title: Subnodes in a vector in TikzEdt

text: I am trying to display two vectors in two differnt nodes, and then, link some elements using arrows.               \tikzstyle{line} = [draw, -latex']                 \begin{tikzpicture}[node distance = 2cm,auto,remember picture]             % Place nodes                    \node [draw,rounded corners] (node1) {$\matrix[mymatrix, name=M1]{                                                                     1 \\                                                             |[!]|   2\rho\pi \\                                                             |[draw,rounded corners,fill=blue]|   3\\                                                         }$};               \node [draw,rounded corners] (node1) {$\matrix[mymatrix, name=M2]{                                                                     4 \\                                                             |[!]|   2\lambda\pi \\                                                             |[draw,rounded corners,fill=yellow]|   3\\                                                         }$};            \draw [red, >=stealth, <->, shorten <= 3pt, shorten >=3 pt]      (M1-2-1.south east) to[bend left=60] (M2-3-1.north east);              \end{tikzpicture}      In my Tikz Preamble I have the following package declaration               \documentclass{article,fleqn}     \usepackage{tikz,amsmath, amssymb,bm,color,automata,matrix,positioning,fit}     \usepackage[margin=0cm,nohead]{geometry}     \usepackage[active,tightpage]{preview}     \usetikzlibrary{shapes,arrows}     % needed for BB     \usetikzlibrary{calc}     \usetikzlibrary{topaths}     \usetikzlibrary{decorations}     \usetikzlibrary{decorations.pathmorphing}     \usetikzlibrary{calc}     \usetikzlibrary{tikzmark}          \usetikzlibrary{topaths}     \usetikzlibrary{backgrounds}     \usepackage{todonotes}          %To be able to use      \tikzset{         !/.style = {             fill=yellow!30,         },         mymatrix/.style = {             matrix of math nodes,             left delimiter  = (,             right delimiter = ),             nodes={minimum width=6ex},         }     }     \tikzset{every picture/.style=remember picture}          \PreviewEnvironment{tikzpicture}      Probably , i am using more then required, but I do have other files. Tikz is giving me the following error:               Package amsmath Error: Old form '\matrix' should be \begin{\matrix}..de[draw,rounded corners](node1){$\matrix(followed by: [mymatrix, na       I already used that in Latex (Thanks to the help of some stackeschange users), but I can't seem to make it work in Tikz If anyone has a suggestion, then please... Cheers.


title: references with enumitem

text: I'm sorry if this question was asked elsewhere. I searched all over but couldn't find it. I'm writing a document with lots of lists and lots of references. I'd like to refer to an entry of a list without explicitly writing out `\label{}` for each entry. I thought the `enumitem` package would solve this but maybe I'm mistaken. Here's an example:               \begin{theorem} There are four equivalent things     \begin{enumerate}[label=(\roman{*}), ref=(\roman{*})]        \item Thing 1        \item Thing 2        \item Thing 3        \item Thing 4     \end{enumerate}      And then later in the text I refer to this as               Theorem~\ref[(ii)]{thm:4.1}       The text comes out as `Theorem ??(ii)]thm:4.1` Is such a thing possible? Or is this asking too much?


title: Aligning equations

text: This is very similar to a lot of other questions but I haven't found one that EXACTLY replicates the problem I'm having. I have the following:               \begin{align*}       &\text{minimize} &R_k + \sum_jr_{jk}^+ + r_{jk}^- &\\       &\text{subject to} &R_k + r_{jk}^+ \geq \hat{\gamma_{jk}}X_jk, &\forall j ,k\\       & &R_k + r_{jk}^- \geq -\hat{\gamma_{jk}}X_jk, &\forall j,k \\       & &R_k, r_{jk}^+, r_{jk}^- \geq 0 &\forall j,k     \end{align*}      Ultimately I want my output to have the text line up in the "first column", the `R_k` values to line up in the second column, and all the forall statements to line up in the third. Note that none of the lines have all three items ( _i.e._ the last two should have some leading white space). Right now my output has the text and the forall's lining up but the `R_k` terms are scattered. Any help is appreciated


title: Random number without repetition in an \includegraphics

text: I have 58 images in PDF format. At the moment, each of them is in a separate PDF, such as `1.pdf`, `2.pdf` etc. I would like to include those 58 images in a random order without repetition. I found the 'random order without repetitition' part: Generating random numbers without repetitions So very candidly, this is what I did (minimal code):               \documentclass[a4paper,12pt]{article}      \usepackage{tikz}          \begin{document}          %here is the bit from the link above to randomly draw a number from a list of integers without repetition     \def\declarenumlist#1#2#3{%         \expandafter\edef\csname pgfmath@randomlist@#1\endcsname{#3}%         \count@\@ne         \loop         \expandafter\edef         \csname pgfmath@randomlist@#1@\the\count@\endcsname         {\the\count@}         \ifnum\count@<#3\relax         \advance\count@\@ne         \repeat}          %I want 58 numbers because I have 58 images     \declarenumlist{total}{1}{58}          %I try to include my pdf     \includegraphics{\pgfmathrandomitem\z{total}\z.pdf}          \end{document}      Of course, this does not work, the reason being I suppose '\includegraphics should be a file name (after macro expansion), not the set of instructions to compute it', as explained in How to include random images?. I tried to follow the route suggested in this question, by doing a               \newcommand{\myrandomnumber}{\pgfmathrandomitem\z{total}\z}     \includegraphics{\myrandomnumber.pdf}      But this does not work either. Note that, if needed, I can keep my 58 images in the same pdf (they are pdflatex generated) and use a `\includepdf[pages={\pgfmathrandomitem\z{total}\z}]{images.pdf}`, but this does not work either, I think for the same reasons. Does anyone know what's going on (I would like to understand) and then how to fix my problem? Any help would be very much appreciated.


title: Let LaTeX sort notes of a book

text: I want to to create a LaTeX document for taking notes of a book I'm reading. I want the final document to look like this: ============ **Page xy** Here shall be the note xy.. **Page ab** Here shall be the note for page ab.. ============ Furthermore I want the notes to be sorted in a way that the lowest page numbers are at the beginning of the document and the larger page numbers further down. My input in LaTeX should be something like this:               Page 836:      Here shall be the note for page number 836..     Page 144:      Here shall be the note for page number 144..      The result should be: === **Page 144:** Here shall be the note for page number 144.. **Page 836:** Here shall be the note for page number 836.. === I've tried               \usepackage{amsthm}     \newtheorem{note}{Page}      but I don't get a satisfactory result. _Do you know a way to get the desired result?_ I am glad at any help! P.S.: Feel free to edit this question since I'm not a native English Speaker.


title: Customizing Multiline captions

text: I would like to have a caption which is centered and has multiple lines. For example,               \documentclass{article}          \begin{document}     \begin{figure}     \centering     \begin{tabular}{cc}       \rule{5cm}{3cm} & \rule{5cm}{3cm} \\       (a) & (b) \\     \end{tabular}     \caption{\begin{tabular}{ll}       (a) & This is a .... \\       (b) & This is a ...      \end{tabular}}     \end{figure}          \end{document}      When this compiles, there is a centered caption, but the Figure label does not match up with the first line. I have used the caption package and inserted new lines, however when I insert `\\` or `\newline`, I lose the centering. Simply put, I would like to have multi-line captions which are centered on the page (as a whole), the first line matches the Figure label, and ideally will allow me to use a table to construct my caption.


title: Tufte running headers not using full width of page

text: I use Minion Pro and XeLaTeX together with the tufte class. There is an issue with caps in headers (as can be noticed if removing the two line marked `%% headings fixes` below). My fix is to use the `myheadings` option – but I get a strange effect where the running headers only use up the main text block width and not the full width (the main block + sidenotes).               \documentclass[nols]{tufte-handout}     \usepackage{fontspec}     \setmainfont{Minion Pro}          \title{Example of tufte headings problem}     \author{Author}          %% headings fixes     \pagestyle{myheadings}     \markboth{\textsc{example of tufte headings problem}}{\textsc{example of tufte headings problem}}          \begin{document}          \maketitle          \section{First section}          First section body.          \newpage          Second page.          \newpage          Notice how the headings only uses the main text block width and not the full width of the page.          \end{document}      What could be a solution?


title: Spacing only works in xeCJK for Chinese and Japanses but not Korean

text: \documentclass{article}     \usepackage{xeCJK}     \setCJKmainfont{Batang}          \CJKspace     \begin{document}          一二三四五          一 二 三 四 五          あいうえお          あ い う え お          일이삼사오          일 이 삼 사 오          \end{document}      I'm trying to write something with some Chinese, Japanese, and Korean in it. As you may know, among the three, Korean is the one that requires spacing between the words, but not the other two. I have the code written as above, and for Chinese and Japanese, the result is as expected, with spaces, but for Korean, the spaces in the last line are ignored. I've read the other post about putting spaces between Korean words, but it doesn't seem to work for me. So I have no idea what I'm doing wrong.


title: Beamer TOC: changing color and shape for subsection items in TOC

text: The default items for subsection in TOC are balls (no-nummered). I would like to use blue triangles, like the symbol `\blacktriangleright` but blue color. Any idea?


title: Is it possible to refer some text from file1 in file2?

text: I have two files, say file1 and file2 suppose in file1 > ...bla bla bla, I am text in file1..., I want to repeat it in file2... bla > bla bla... I want to repeat some text in file1 (I am text in file1..., I want to repeat it in file2...) in file2. Expecting content in file2: > some text, some text... the following sentences from file1 "I am text in > file1..., I want to repeat it in file2..." has been revised. more text, more > text This is just for avoiding repeated revision of those text in both files. Is it possible to do it automatically? Just seconds before, I found the following code is available for one file, but how improve it to fit on two files conditions?               \documentclass{minimal}          \makeatletter          \newcommand{\customlabel}[2]{%          \protected@write \@auxout {}{\string \newlabel {#1}{{#2}{}}}#2}          \makeatother          \begin{document}          Here is some text. \customlabel{foobar}{asdasd asdfasdf asdfasdf}          Here is some more text \ref{foobar}.          \end{document}


title: xypic: 2cell diagram label position issue

text: This code               \xymatrix{z & y\ltwocell_{f}^{g}{^{\alpha}} & x\ltwocell_{f'}^{g'}{^{\beta}}}     =\xymatrix{z &  & y\lltwocell_{f\cdot f'}^{g\cdot g'}{^{\alpha\circ\beta}}}      produced this diagram ![enter image description here](http://i.stack.imgur.com/Li2VR.png) What I want is to slide the alpha comp beta label to the right for the evident reasons, I'm quit sure there are many ways to do it and that they are all in the manual, but I didn't find the right way.


title: How to color certain commands/environments?

text: My goal is to achieve colorings in the output document, that are similar to the syntax highlighting I use in my editor, so switching between the editing and viewing the document becomes easier on the eyes. I figured I can use the `color` package to define some colors using `\definecolor` and then set the foreground and backgroundcolors using `\color{fg}` and `\pagecolor{bg}`, respectively. What I'd like to do now, is assing certain colors to certain commands and environments. For simple commands like `\emph` I can do               \let\oldemph\emph     \renewcommand\emph[1]{{\color{emph}\oldemph{#1}}}      but I haven't figured out how to change the color of environments like `align*` and others. Any help on how I could achieve this? Maybe theres even a generic way to do this, a package for semantic coloring like this would be cool. **EDIT:** I managed to color environments using               \usepackage{etoolbox}     \AtBeginEnvironment{align*}{\color{equation}}     \AtBeginEnvironment{align}{\color{equation}}     \AtBeginEnvironment{equation*}{\color{equation}}     \AtBeginEnvironment{equation}{\color{equation}}      Inline-math can be colored using `\everymath{\color{inlinemath}}`, but this overrides the colors of the `align*` environment (not of the `equation*` environment though). How to fix this? **EDIT:** If I'm correct, `align*`-environments switch between mathmode and non-mathmode to obtain the correct spacing. So if I use `\everymath` to set a color, it will be set inside `align*` environments, overriding what I did with `\AtBeginEnvironment`. For `equation*` it works, because there is only a single math block and `\AtBeginEnvironment` will put the color setting inside. The only way I can think of to fix this, would be somehow setting a color only for `$...$`, instead of using `\everymath`. Is this possible?


title: Placing coloured rectangles on a plot, using points from the plot - Riemann Sums

text: October 31st Note: Below is the original question, but after some feedback I have progressed somewhat and posted an answer to demonstrate what I've learnt since. My answer presents an encapsulated solution. I'm posting it here because the original question was in the context of being able to create diagrams for demonstrating Riemann sums. These questions here are where I was a week ago and my answer is where I am now. The title remains relevant. A search on placing rectangles on a plot or on Riemann Sums will turn up this page and there are some useful answers here. I'm sorry if people think I've confused the question, but I think this is what happens when you're on a steep learning curve and the page was kind of documenting that. What seem like simple questions now were quite perplexing a week ago. I've edited this and my answer comprehensively in order to simplify matters. October 23rd **Q(1)** If there was a simple way to add the in-between lines to the rectangles in the attempt on the left, I would be finished. The problem with the solution on the right is the stacked environment doesn't like my original graph so I placed it in it's own axis environment and then had trouble with the curve matching the rectangles. I tried the solution on the right mainly to get the colours right, but quickly realised drawing the upper rectangles before the lower ones gave what I wanted with the solution on the left. If drawing those lines is the only way to go then fair enough, but is there a systematic way to get them as part of the plot? **Q(2)** Can I get the values for the heights of the rectangles from my plot equation rather than calculating and typing them all in by hand? **MWE 1 Output** ![MWE 1 Output](http://i.stack.imgur.com/2uaZ1.jpg) **MWE 1 Code**               \documentclass{standalone}          \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{pgfplots}     \usepackage{mathtools}          \pgfplotsset{compat=1.9}          \begin{document}     \begin{tikzpicture}     \begin{axis}[         xtick={0,...,5},ytick={5,10,15,20,25},         y=0.3cm, xmax=5.4,ymax=26.9,ymin=0,xmin=0,         enlargelimits=true,         axis lines=middle,         clip=false         ]     \addplot+[color=red,fill=red!10!white,const plot, mark=none]         coordinates {(0,2) (1,5) (2,10) (3,17) (4,26) (5,26)}\closedcycle;     \addplot+[color=green,fill=green!10!white,const plot, mark=none]         coordinates {(0,1) (1,2) (2,5) (3,10) (4.0,17) (5,17)}\closedcycle;     \addplot[smooth, thick,domain=0:5]{1+x^2};     \end{axis}     \end{tikzpicture}     \begin{tikzpicture}         \begin{axis}[         xtick={0,...,5},ytick={5,10,15,20,25},         y=0.3cm, xmax=5.4,ymax=26.9,ymin=0,         axis lines=middle,         clip=false,             const plot,             stack plots=y,             area style]         \addplot coordinates             {(0,1) (1,2) (2,5) (3,10) (4.0,17) (5,17)}             \closedcycle;         \addplot coordinates             {(0,1) (1,3) (2,5) (3,7) (4,9) (5,9)}             \closedcycle;         \end{axis}         \begin{axis}[             axis lines=none,         y=0.3cm, xmax=5.4,ymax=26.9,ymin=0,             ]             \addplot[smooth,thick,color=black, domain=0:5]{1+x^2};         \end{axis}     \end{tikzpicture}     \end{document}


title: charter and siunitx: either the kerning is bad, or the micro doesn't follow the surrounding text shape. What can I do?

text: I'm using Charter (with the `mathdesign` package) for my main text font. As mathdesign isn't doing a good job at kerning (see "NOP." and "DEF." in MWE), I'm additionally loading the `charter` package as suggested in this question. In addition, I have quite a few units with \micro prefixes in the text. I would like my numbers and units to be in the same shape as the surrounding text. However, when loading the `charter` package in addition to `mathdesign`, the mu changes. What can I do?               \documentclass{scrreprt}     \usepackage[bitstream-charter]{mathdesign}      %\usepackage{charter}     \usepackage[detect-all=true]{siunitx}           \begin{document}     Testing the kerning with two examples: NOP. DEF.          Testing the ``micro'': \SI{1}{\micro\metre}           \textit{in italic text: \SI{1}{\micro\metre}}          \end{document}      Example 1: bad kerning, nice detection of surroundings in siunitx ![Example 1, bad kerning, nice detection of surroundings in siunitx](http://i.stack.imgur.com/WZuiZ.png) Example 2: better kerning, no detection of surroundings in siunitx ![Example 2, better kerning, no detection of surroundings in siunitx](http://i.stack.imgur.com/e0wEm.png)


title: getting an option clash with Babel, [english,greek]

text: I am getting an option clash for babel using: `\usepackage[greek,english]{babel}`. Here is the output:               ! LaTeX Error: Option clash for package babel.      Does anyone know what might be causing this? I've tried Googling and have seen many others use these options together, but I cannot get it to work. Here is my full latex heading:               \documentclass[article,11pt]{Latex/Classes/PhDthesisPSnPDF}     \raggedbottom     \setcitestyle{square}     \usepackage[normalem]{ulem}     \usepackage[greek,english]{babel}     \usepackage{amsmath}     \usepackage{amstext}     \usepackage{wrapfig}     \usepackage{graphicx}     \usepackage{algorithm}     \usepackage{algorithmic}     \makeatletter     \def\NAT@def@citea{\def\@citea{\NAT@separator}}     \makeatother


title: The attachfile2 package doesn't work when using \jobname

text: I'm using MiKTeX 2.9 on a Windows 7 Home Premium 64-bit computer. I have been experimenting with using `attachfile2` to make a link to an embedded LaTeX file. When I compile the following document, named `test.tex`,               \documentclass{article}     \usepackage{xcolor}     \definecolor{myred}{rgb}{0.9,0.2,0.2}     \usepackage{attachfile2}     \attachfilesetup{color = myred}     \begin{document}     \jobname.tex \textattachfile{test.tex}{view source code}     \end{document}      it works as expected, producing the name of the file and a link: ![enter image description here](http://i.stack.imgur.com/FpFFx.png) But when I replace `test.tex` with `\jobname.tex` in the `\textattachfile` command, I get the following error (I am using TeXstudio 2.6.2): ![enter image description here](http://i.stack.imgur.com/MjJjI.png) Even putting `\expandafter` right before `\textattachfile`, which as far as I understand should ensure that `\textattachfile` never even sees the command `\jobname`, doesn't help. What's going on? * * * Further observations (not sure if relevant):   * When I use `attachfile` instead of `attachfile2`, it works fine with the `\jobname` input (of course, the only difference being that I can't use my custom color, which is the reason I wanted to use `attachfile2` in the first place).   * As I mentioned, I'm using TeXstudio. This editor has a convenient feature where it (at least attempts to) detect the commands that are defined by any included packages, and then highlights any commands it doesn't recognize. When I use the `attachfile` package, the commands `\attachfilesetup` and `\textattachfile` are recognized; when I use the `attachfile2` package, they are not recognized. Perhaps my copy of the `attachfile2` package is broken somehow? MiKTeX tells me that I have the `oberdiek` bundle installed, which is apparently where `attachfile2` lives.   * I also tried using the `currfile` package, which provides a macro `\currfilename`. Nothing different happens when I replace `\jobname.tex` with `\currfilename`; it works and doesn't work in the same cases.


title: Polyglossia + right-to-left language + doublespacing with setspace affects footnote spacing

text: I have some Arabic text, so I use polyglossia and `\setotherlanguage{arabic}`. This however causes line spacing within footnotes to change, which looks odd, especially because the distance _between footnotes_ is not changed. The same happens when I use `hebrew`, but not when using `german`. The main text body is spaced appropriately. This can't be intended, can it? MWE (the examples work without actually using any Arabic):               \documentclass{article}     \usepackage[doublespacing]{setspace}          \usepackage{polyglossia}     \setmainlanguage{english}     \setotherlanguage{arabic} %remove, or change to hebrew/german to see the difference          \begin{document}     normal text normal text normal text normal text normal text normal text normal text normal text normal text normal text normal text normal text normal text normal text\footnote{footnote text footnote text footnote text footnote text footnote text footnote text footnote text footnote text footnote text}          normal text normal text normal text normal text normal text normal text normal text normal text normal text normal text normal text normal text normal text normal text\footnote{footnote text footnote text footnote text footnote text footnote text footnote text footnote text  footnote text  footnote text}     \end{document}      Using `arabic`: ![enter image description here](http://i.stack.imgur.com/jwdjZ.png) Using `german`: ![enter image description here](http://i.stack.imgur.com/ehDQ9.png)


title: frame in NewDocumentEnvironment

text: With beamer frames, this does not work.               \newenvironment{itemframe}[1]{       \begin{frame}{#1}         \begin{itemize}     }{         \end{itemize}       \end{frame}     }      Adding `fragile, environment=itemframe` as an optional argument to the frame will solve the issue. But there is also an alternative that avoids making the frame fragile: Exporting everything apart from the frame environments to own commands.               \documentclass{beamer}     \usepackage{xparse}          \newenvironment{itemframe}[1]{     %\NewDocumentEnvironment{itemframe}{m}{       \begin{frame}{#1}         \itemframebegin     }{         \itemframeend       \end{frame}     }     \newcommand\itemframebegin{       \begin{itemize}     }     \newcommand\itemframeend{       \end{itemize}     }          \begin{document}     \begin{itemframe}{Title}       \item A       \item B       \item C     \end{itemframe}     \end{document}      Now when `\newenvironment` is replaced with `\NewDocumentEnvironment` from the `xparse` package, as shown as a comment above, both solutions again fail with               ! File ended while scanning use of \beamer@collect@@body.      Is there a possibility to make a `\NewDocumentEnvironment` including a `frame`? Avoiding the fragile option is preferred.


title: TeXworks freezes when opening from template

text: Today I created a new template in the Basic LateX template folder for TeXWorks. Since then, TeXWorks freezes whenever I try to 'open from template.' The templates themselves still work when I open them by navigating to the template folder using windows explorer, and they still open when I open them from 'open recent' in TeXWorks. Removing the new template I made did not fix the problem. I am using TeXWorks 0.4.3 r.857 (MiKTeX 2.9), running on Windows 7 Family Premium edition version 6.1.7601. I am the administrator, and I am completely helpless :(


title: Add to TexStudio autocompletion

text: I'd love to know how to add the `eqnarray*` environment to autocompletion, I only get the regular `eqnarray`. (I'm using Windows 7)


title: Alphabetic Style of Bibliography - how to insert special letters in the first three letters

text: I have a problem with the alphabetic style of the bibliography. In the preamble I have defined:               \usepackage[backend=bibtex8,     language=american,     maxbibnames=100,     maxcitenames=1,     backref=true,     abbreviate=true,     url=false,     sorting=nyt,     babel=hyphen,     style=alphabetic]{biblatex}      Problem: If the first author name of the bibitem contains a special character in the first three letters, like:               @article{Blonski,     author={P.~{B{\l}o\'{n}ski}},     title={xxx},     year = 2010}      the bibitem in the manuscript is abbreviated as `[Bł10]`. I would like to have `[Bło10]`. Similar Problem for example in case of:               @article{Koenig,     author={{M.~K\"{o}nig},     title={xxx},     year = 2007}      returns `[K¨07]` instead of `[Kön07]`. What do I have to modify?


title: Type of file to select for writing Math Thesis if I use latex from Kile

text: if I write a math. thesis using latex from Kile, then, while opening a new file in Kile, what is the option should I choose: article/book/report? Thank you!


title: Hyperref links in TOC point to wrong location when using titletoc

text: I have modified the formatting of subsections in the toc, so that they appear in one line instead of separate lines. For this i used the titletoc package. Here is a MWE:               \documentclass{scrbook}          \usepackage{titletoc}     \titlecontents*{subsection}%         [3.8em]%         {\small\itshape}%         {\hyperlink{subsection.\thecontentslabel}{\thecontentslabel}\ }%         {}%         {\ \thecontentspage}%         [,\ ]%         [.]%          \usepackage[colorlinks=true,linktoc=all]{hyperref}          \begin{document}          \tableofcontents           \chapter{Chapter}     \section{Section}     \subsection{Subsection}     \subsection{Another Subsection}     \clearpage     \section{Another Section}     \end{document}      This was very easy, but there are two problems:   1. The subsection label is not included in the link. This is already fixed in the MWE with the help of the answer to this question: Common style for global TOC, LOF, LOT and titletoc partial TOCs (with hyperref & caption)   2. The link to the section following the modified subsections points to the wrong location. In the MWE the link of '1.2 Another Section' points to '1.1.1 Subsection'. I have not found a solution to the second problem. I have experimented with `\phantomsection` without any success. I have read here that titletoc has some incompatibilities with hyperref and tried to implement the same behavior with the tocloft package. I managed to get something similar, but not quite right. The tocloft approach seems to be so much more convenient, if the links would work properly. On a sidenote: The document i want to apply this to is rather large and is typeset with the classicthesis style. I would appreciate any tips or solutions to this problem.


title: Show Abstract Title in Latex

text: I'm using a latex template given to me to write up a project I'm writing. However, above the abstract, it does not explicitly show the title "Abstract" which I would like it to do. The document is a two column doc, whereas the abstract is just one column. I think normally it should show abstract title so maybe somewhere in my document it specifies not to? The top part of my code reads:               \documentclass[a4paper,aps,twocolumn,secnumarabic,     balancelastpage,amsmath,amssymb,nofootinbib]{revtex4-1}          \usepackage{lgrind}       \usepackage{chapterbib}       \usepackage[usenames,dvipsnames]{color}     \usepackage{graphics}     \usepackage[pdftex]{graphicx}         \usepackage{longtable}      \usepackage{epsf}            \usepackage{bm}              \usepackage{thumbpdf}     \usepackage[colorlinks=true]{hyperref}     \usepackage{geometry}     \geometry{verbose,a4paper,tmargin=2.9cm,bmargin=2.8cm,lmargin=2.5cm,rmargin=2.5cm,     headheight=13.6pt}     \usepackage[nodisplayskipstretch]{setspace}      \renewcommand*\arraystretch{.6}               \renewcommand{\vec}[1]{\mathbf{#1}}     \renewcommand\thesection{\arabic{section}}     \renewcommand\thesubsection{\thesection.\arabic{subsection}}     \renewcommand\refname{References}          \begin{document}     \title{My Title}     \author         {me}     \date{\today}     \affiliation{University of Somewhere}               \begin{abstract}     My abstract text     \end{abstract}          \end{document}      I have probably included more than necessary, but don't know what might be relevant. I've tried the various other posts about abstracts but can't find anything that is quite the same problem.


title: When does TeX execute the \catcode=`\... assignment?

text: TeX always scans the input and converts it into some tokens, then expands some tokens according to the latest definition of that command ... stomach -> lists -> page but when does TeX execute the catcode assignment? does it execute it as soon as looking at it? for example               1. \catcode`\%=12     2. %     3. \catcode`\%=14     4. \def\foo{\catcode`\%=12%}     5. \bye      this will be wrong since TeX doesn't expand the macros to be defined. the last % in line 4 is only a comment sign, not a percent sign with catcode 12. But, does TeX execute line 1 and line 3 as soon as looking at (does it mean that TeX doesn't convert line 1 and line 3 into tokens?) another example (I try to finish this macro, but failed)               \def\foo{hello, world}     {\catcode`\^=13      \gdef^{\relax\ifmmode\def\next{\catcode`\^=7 ^}\else\let\next\foo\fi\next}}          {\catcode`\^=13      ^$a^2$}     \bye      I think I should get the `hello, world` with `a square` just after it, because the `first ^` should be expanded               ^ ->\relax\ifmmode\def\next{\catcode`\^=7 ^}\else\let\next\foo\fi\next       ->\relax\let\next\foo\next       ->\relax\next       ->\relax h e l l o , w o r l d      so, I should get `hello, world`. `the second ^` in `$ ... $` pairs               $a^2$ ->$a\relax\ifmmode\def\next{\catcode`\^=7 ^}\else\let\next\foo\fi\next2$           ->$a\relax\def\next{\catcode`\^=7 ^}\next2$           ->$a\relax\catcode`\^=7 ^2$           ->$a^2$ % the catcode of ^ is 7 now      so, I think I should get `a square` but this is wrong, I get mistake. I don't know why :-(


title: error in output.bbl

text: I keep getting the error message above when I try to compile a `.pdf` using natbib references. My `.bib` file looks like this;               @article{RefWorks:9,         year={1995},         title={Bertlmann's Socks and the Nature of Reality},         journal={WORLD SCIENTIFIC SERIES IN 20TH CENTURY PHYSICS},         volume={9},         pages={820-841},         note={ID: RN002392987; Article. Dewey: 530. Â© COPYRIGHT THE BRITISH LIBRARY BOARD AND OTHER CONTRIBUTORS. ALL RIGHTS RESERVED.},         language={English},         url={}     }          @misc{RefWorks:29,     author={Dictionary of Physics}       title =    {Online, Dictionary of Physics}       url={}     }          @article{RefWorks:5,         author={K. Audenaert and J. Eisert and E. Jan\'e and M. B. Plenio and S. Virmani and B. De Moor},         year={2001},         month={Nov},         title={Asymptotic Relative Entropy of Entanglement},         journal={Phys.Rev.Lett.},         volume={87},         number={21},         pages={217902},         url={http://link.aps.org/doi/10.1103/PhysRevLett.87.217902}     }      and my `.tex` file begins like this:               \documentclass[a4paper,12pt, fleqn]{article}          \usepackage{graphicx}          \usepackage{natbib}     \usepackage{amsmath}     \usepackage{url}     \begin{document}     \underline{Chapter 1}     \begin{flushleft}     \underline{Contextualization of Quantum Processes}     \end{flushleft}      Any idea what is going wrong? I've had to remove the url in the references file because you can only post 2 links, apparently. Thanks in advance


title: What is a token?

text: Please forgive such a basic question, but I did some Google searching and looked around on this site, and while there are many threads and online resources that _involve_ tokens, I can't seem to find a _direct_ explanation of what a token is, specifically in the context of TeX, LaTeX, etc. Perhaps there is a good explanation of tokens in the TeXbook, but I don't have a copy of it. This Wikipedia page gives me some idea: > A token is a string of characters, categorized according to the rules as a > symbol (e.g., IDENTIFIER, NUMBER, COMMA). but this is a bit too general for me to understand. Taking a guess based on the Wikipedia definition and this TeX.SE thread, is it correct to say that a token is "a thing that has a catcode"? (which, even if true, does not seem entirely satisfactory as an answer: what characterizes the things that are given catcodes?) Some illustrative examples, and non-examples, of tokens in the realm of TeX, LaTeX, etc. would be much appreciated.


title: How to make a simple 2D pressure vessel drawing in tikz?

text: Two things: 1) How do I make the semicircle portion of my shape have the same thickness as the straight lines? 2) How do I fill the overall shape with a filling gray colour? Here is my code so far:               \documentclass[tikz]{standalone}     \begin{document}     \begin{tikzpicture}[scale=0.5]     \draw (10,0.4) arc (90:270:0.4cm);     \draw (10,0.4) -- (12,0.4);     \draw (10,-0.4) -- (12,-0.4);     \draw (12,0.4) arc (90:-90:0.4cm);     \end{tikzpicture}     \end{document}


title: Type phase symbol in ConTeXt, like LaTeX steinmetz package

text: I am trying to create an electrical phase symbol in ConTeXt like that produced by the `\phase{}` command from LaTeX's `steinmetz` package. Here is what the symbol looks like: ![](http://www.robinbye.com/blog/wp-content/ql- cache/quicklatex.com-5554f64e9b8cc98087d665d75c0e2e1a_l3.png) Is there something out there already or do I need to brew my own? If I do, suggestions would be appreciated. I'm relatively new to ConTeXt and MetaPost. Here is the meat from the `steinmetz` package, for reference.               \RequirePackage{pict2e}[2004/07/06]     \newsavebox{\stm@phasebox}     \newlength{\stm@phasedp}     \newlength{\stm@phaseht}     \newlength{\stm@phasetot}     \newlength{\stm@phasewd}     \newcommand\phase[2][1]{%      \sbox\stm@phasebox{$\ifcase#1\relax\displaystyle\or\textstyle\or\scriptstyle\or\scriptscriptstyle\fi#2$}     \stm@phaseht=\ht\stm@phasebox     \stm@phasedp=\dp\stm@phasebox     \stm@phasetot=\stm@phasedp \advance\stm@phasetot .35ex \advance\stm@phasetot\stm@phaseht     \stm@phasewd=\wd\stm@phasebox \advance\stm@phasewd .5\stm@phasetot     \setbox\stm@phasebox=\vbox to\stm@phaseht{       \hbox{\setlength{\unitlength}{1pt}\linethickness{.6pt}%             \edef\ph@x{\strip@pt\stm@phasewd}\edef\ph@y{\strip@pt\stm@phasetot}%             \dimen@ .5\stm@phasetot \edef\ph@dx{\strip@pt\dimen@}%     \begin{picture}(\ph@x,\ph@y)      \put(0,0){\circle*{.4}}      \put(0,0){\line(1,0){\ph@x}}\put(0,0){\line(1,2){\ph@dx}}      \put(\ph@dx,1.5){\raise\stm@phasedp\vbox{\box\stm@phasebox}}     \end{picture}%     }\vss}%     \advance\stm@phasedp .35ex \advance\stm@phasedp .6pt     \dp\z@=\stm@phasedp \box\stm@phasebox}


title: Including range is multi-part numbers

text: How do I produce something like "4 x 5 x (10--15) mm^3" in _siunitx_? Thanks!


title: longtable caption (make it look like table caption as defined by a LaTeX class)

text: I have the following MWE with a table and a longtable, and I just want that the longtable caption looks exactly as the table caption without modifying anything from the table above (just the longtable). I actually have the table caption settings in a .cls file that I am not supposed to change, and they look like the following (the complete .cls file can be found here: http://www.biomedcentral.com/download/tex/bmc_article.zip):               % settings for table caption     \setattribute{floatcaption}    {size}{\footnotesize\bfseries\mathversion{bold}\raggedright}     \setattribute{floatcaptionname}{size}{\bfseries}          \setlength\abovecaptionskip{0\p@}     \setlength\belowcaptionskip{4\p@}          \long\def\@makecaption#1#2{         \vskip\abovecaptionskip         \parbox[t]{\hsize}{\floatcaption@size{\floatcaptionname@size #1}\hskip.5em #2\par}%         \vskip\belowcaptionskip}               \def\@floatboxreset{%             \reset@font             \footnotesize             \sffamily             \@setminipage             \centering     }      So I just want to make the longtable caption look like the table caption as specified in the .cls file, but introducing the required changes in the .tex file only. I do not understand why the .cls file affects only table captions but not longtable captions, but if I write \usepackage{caption} in the preamble, it affects everything... How can I make local changes in certain specific captions (the longtable ones), so that they look exactly as specified in the .cls file?? This is the MWE:               \documentclass[a4paper,12pt]{article}          \usepackage{multirow}     \renewcommand{\arraystretch}{2}     \usepackage{longtable}               \begin{document}          \section*{Tables}     \begin{table}[h!]     \caption{Sample table title. This is where the description of the table should go.}           \begin{tabular}{cccc}             \hline                & B1  &B2   & B3\\ \hline             A3 & ..  & .   & .\\ \hline           \end{tabular}     \end{table}                    \begin{longtable}{|c|c|c|c|}     \caption{Statistically significant Gene Ontology terms from enrichment tests for each gene class. Adjusted p-value < 0.01, N/A indicates no terms at this level of significance.}\\     \hline         \textbf{Class}         & \textbf{Ontology}         & \textbf{Term}         & \textbf{Adj. p-value}\\     \hline     \endfirsthead     \multicolumn{4}{c}%     {\tablename\ \thetable\ -- \textit{Continues from previous page}}\\     \hline         \textbf{Class}         & \textbf{Ontology}         & \textbf{Term}         & \textbf{Adj. p-value}\\     \hline     \endhead     \hline \multicolumn{4}{r}{\textit{Continues on next page}} \\     \endfoot     \hline     \endlastfoot               \multirow{8}{*}{\textbf{1}}             & \multirow{2}{*}{\textbf{\textit{BP}}}             & \textit{{\scriptsize positive regulation of cell migration}}             & 2.20E-03\\     \cline{3-4}             \multicolumn{1}{|c|}{}             & \multicolumn{1}{|c|}{}             & \textit{{\scriptsize cell-cell adhesion}}             & 6.10E-03\\     \cline{2-4}             \multicolumn{1}{|c|}{}             & \multirow{2}{*}{\textbf{\textit{CC}}}             & \textit{{\scriptsize texttexttexttext}}             & 2.20E-03\\     \cline{3-4}             \multicolumn{1}{|c|}{}             & \multicolumn{1}{|c|}{}             & \textit{{\scriptsize texttexttexttext}}             & 2.20E-03\\     \cline{2-4}             \multicolumn{1}{|c|}{}             & \multirow{4}{*}{\textbf{\textit{MF}}}             & \textit{{\scriptsize texttexttexttext}}             & 2.20E-03\\     \cline{3-4}             \multicolumn{1}{|c|}{}             & \multicolumn{1}{|c|}{}             & \textit{{\scriptsize texttexttexttext}}             & 2.20E-03\\     \cline{3-4}             \multicolumn{1}{|c|}{}             & \multicolumn{1}{|c|}{}             & \textit{{\scriptsize texttexttexttext}}             & 2.20E-03\\     \cline{3-4}             \multicolumn{1}{|c|}{}             & \multicolumn{1}{|c|}{}             & \textit{{\scriptsize texttexttexttext}}             & 2.20E-03\\     \hline     \end{longtable}               \end{document}


title: Chapter Thumbs or Tabs in Book Class

text: I'm currently finalizing a book, and would like to add chapter thumbs or tabs to the document. While I've found a fair number of packages which are likely capable of doing so, I can't seem to get the document to successfully compile with the tabs in place. I've uploaded some sample content below in hopes someone has some insight.               \documentclass [11pt] {book}     \usepackage{graphicx,array,paralist,lastpage}     \usepackage[fleqn]{amsmath}     \usepackage[left=1in,top=1in,right=1in]{geometry}          \usepackage{wrapfig}     \usepackage{chappg}     \usepackage{enumerate}                    \usepackage{fancyhdr}     \pagestyle{fancy}     \renewcommand{\chaptermark}[1]{\markboth{#1}{}}     \fancyhead{} % clear all header fields     \fancyhead[RO,LE]{\thepage}     \fancyhead[RE,LO]{\chaptername { }\thechapter: \leftmark}     \fancyfoot{} % clear all footer fields     \renewcommand{\headrulewidth}{0.4pt}          \renewcommand{\thesection}{\Alph{section}.}          \parindent=0in     \usepackage{subfig}                         \begin{document}     \vspace*{0.75in}     \begin{center}     \begin{Large}     \textbf{\huge{DYNAMICS}}\\[16pt]     \end{Large}     \end{center}     \thispagestyle{empty}          \newpage {}\thispagestyle{empty}          \newpage     \textbf{About the Authors:}\\[\baselineskip]         \thispagestyle{empty}     \newpage {}\thispagestyle{empty}          \newpage     \tableofcontents     \thispagestyle{empty}     \newpage\thispagestyle{empty}               \setcounter{chapter}{-1}     \chapter{Fundamentals and Review Materials}     \thispagestyle{fancy}     \newpage     \thispagestyle{fancy}     \mbox{}     \newpage     \section*{Introduction}     To be successful ...               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5     \chapter{Particle Kinematics}     \thispagestyle{fancy}     \newpage     \thispagestyle{fancy}     \mbox{}     \newpage     \section{Planar Kinematics: Cartesian, Path and Polar Coordinates}     \subsection*{Background}     Blah, blah,               \end{document}


title: Error message with hobby package

text: I am trying to use the `hobby`package with this minimal example from the manual:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{hobby}     \begin{document}     \begin{tikzpicture}[scale=.5,use Hobby shortcut]     \draw (0,0) .. (6,4) .. (4,9) .. (1,7) .. (3,5) .. cycle;     \end{tikzpicture}     \end{document}      On compiling with `pdflatex` I get this error message:               ! Undefined control sequence.     \hobby_genpath: ...y }\prg_stepwise_function:nnnN                                                        {0}{1}{\l_hobby_npoints_in...     l.7 .... (6,4) .. (4,9) .. (1,7) .. (3,5) .. cycle                                                       ;      I am using TeXLive 2012 and the `hobby.code.tex` that came with it. What can I do to get it working? P.S. Googling came up with a message on the Italian TeX Group forum but I could not cotton on to what was being said.


title: Using Hashtag in macro

text: I had a problem putting the column headers in bold (in a table of course) using pgfplotstable. You can see the problem here I found a way to work arround that. It isn't generic as I wanted it to be, but at least I know there is a way to do it. The only thing I had to do was to add options to the table when creating it, just like this:               \pgfplotstabletypeset     [columns/col1/.style{column name=\textbf{col1}},     columns/col2/.style{column name=\textbf{col2}},     columns/col3/.style{column name=\textbf{col3}},     columns/col4/.style{column name=\textbf{col4}},     columns/col5/.style{column name=\textbf{col5}}     ]{     col1 & col2 & col3 & col4 & col5 \\     1st & at me & agam & at us & againn \\     2st & at you & agat & at you & agaibh \\     3st & at him & aige & at them & acu \\     & at her & aici & & \\     }      As you can see it's not the best way to do things, especially when you're new to latex and trying to introduce people to latex, people who've never used latex before. That's the reason why I wanted to create a macro for all those options so that the others should simply add \mymacro(column1name, column2name, ...) to the side of the \pgfplotstabletypeset to make everything easier. I tried this:               \newcommand\mymacro[3]{    % 3 is just an example, I did \mymacroone .. two ..                    %etc in order to be able to apply the same concept in different situations     columns/#1/.style{column name=\textbf{#1}},     columns/#2/.style{column name=\textbf{#2}},     columns/#3/.style{column name=\textbf{#3}}     }      But this jut generates an error and ( **can't use # in horizontal mode** ) doesn't compile. Does anyone know of a better way to do this, or how I can correct the expression to make iot compilable? I tried using {#}, #, {#}, ##, but haven't been able to do it right.


title: How to best typeset this long matrix multiplication?

text: I have a quite large matrix multiplication:               \begin{align*}     \mathrm{Var}(\alpha)&\approx \begin{pmatrix}\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*}) &\frac{\pi\exp(-\delta^{*}+\zeta^{*})}{\sqrt{1+\pi^{2}}}&-\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*})\end{pmatrix}       \begin{pmatrix} \mathrm{Var}(\zeta^{*}) &\mathrm{Cov}(\zeta^{*},\pi) & \mathrm{Cov}(\zeta^{*},\delta^{*}) \\\mathrm{Cov}(\pi,\zeta^{*}) & \mathrm{Var}(\pi) & \mathrm{Cov}(\pi, \delta^{*}) \\\mathrm{Cov}(\delta^{*},\zeta^{*}) & \mathrm{Cov}(\delta^{*},\pi) & \mathrm{Var}(\delta^{*}) \end{pmatrix}     \begin{pmatrix}\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*}) \\\frac{\pi\exp(-\delta^{*}+\zeta^{*})}{\sqrt{1+\pi^{2}}}\\-\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*})\end{pmatrix}             \end{align*}      Since this does not fit a single line I am wondering how I could typeset this in the best way? So that the logic of the matrix multiplication is still visible?


title: poster with left and right logos

text: I want to insert 2 logos, one on the LHS and the other on the RHS of this poster: http://www.latextemplates.com/template/baposter-portrait-poster How can I do that?


title: tikzpictures inside pgfplots' axis

text: When having a `tikzpicture` inside `pgfplots`'s `axis` environment strange effects can be observed which I guess stem from the fact that the corresponding coordinate systems are interfering with each other:               \begin{tikzpicture}      \begin{axis}[        xlabel={A \tikz\draw[->](0,0)--++(1em,0); B},     ]      \addplot {x*x};      \end{axis}     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/W8yXV.png) My first idea was to add `pgfplots`' option `disabledatascaling` which however seems to make things worse:               \begin{tikzpicture}      \begin{axis}[        disabledatascaling,        xlabel={A \tikz\draw[->](0,0)--++(1em,0); B},     ]      \addplot {x*x};      \end{axis}     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/lqSlx.png) What actually does seem to work is adding explicit values for `xmin`, `xmax`, `ymin` and `ymax`:               \begin{tikzpicture}      \begin{axis}[        xlabel={A \tikz\draw[->](0,0)--++(1em,0); B},        xmin = -6, xmax = 6,        ymin =  0, ymax = 25,     ]      \addplot {x*x};      \end{axis}     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/Zr3nm.png) However, this still isn't ideal since it forces me to a) set those values explicitly and b) looses the margin between plot and axes. So my question is: is there a better way to deal with situations like this? Of course this isn't a real world example but the inner `tikzpicture` may actually be drawn by another command (and not look like an arrow at all). Complete code:               \documentclass{article}     \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}      \begin{axis}[        xlabel={A \tikz\draw[->](0,0)--++(1em,0); B},     ]      \addplot {x*x};      \end{axis}     \end{tikzpicture}          \bigskip          \begin{tikzpicture}      \begin{axis}[        disabledatascaling,        xlabel={A \tikz\draw[->](0,0)--++(1em,0); B},     ]      \addplot {x*x};      \end{axis}     \end{tikzpicture}          \bigskip          \begin{tikzpicture}      \begin{axis}[        xlabel={A \tikz\draw[->](0,0)--++(1em,0); B},        xmin = -6, xmax = 6,        ymin =  0, ymax = 25,     ]      \addplot {x*x};      \end{axis}     \end{tikzpicture}          \end{document}


title: Commutative diagrams package

text: I want to put one of those great category theoretic diagrams into one of my papers. What sort of packages can I use without breaking my TeX work so far.


title: Can I use microtype (or something else) to 'amend' a ligature's spacing?

text: Say I have the following source:               \documentclass{article}     \usepackage{xparse}     \ExplSyntaxOn     \NewDocumentCommand \Dash { } {       \leavevmode       \unskip       \nobreak       \hspace{\halfspace}       \textemdash       \hspace{\halfspace}     }     \NewDocumentCommand \halfspace { } {       .5\fontdimen2\font plus .5\fontdimen3\font minus .5\fontdimen4\font     }     \ExplSyntaxOff               \begin{document}     The quick brown fox jumped---%       and I mean \emph{bounded}---%       over that lazy dog.          The quick brown fox jumped \Dash       and I mean \emph{bounded} \Dash       over that lazy dog.     \end{document}      How can I get the effect of using `\Dash` (not necessarily just using that control sequence, just appropriately altering the spacing) by only using the syntax in the first sample? * * * ### Edit As the answer below points out, what I'm looking for isn't exactly kerning. I don't quite know what else to call it, so I'm justing going with 'spacing'. My apologies.


title: How to draw Bar & Pie Chart

text: I'm want to include two graphs mentioned below in a document. ![Bar Chart](http://i.stack.imgur.com/pEASz.png) ![Pie Chart](http://i.stack.imgur.com/0B0e4.png) I'm able to draw pie charts using pgf-pie. Is there any package which is capable of generating BAR & PIE Chart both? [Also which is included in default LATEX installation] ?


title: Custom separator for CSV import via csvsimple

text: I have successfully used csvsimple to import .csv files. But I would like to have commas as number separators, so I modified the .csv file to use semicolons as separators and as csvsimple manual says, I defined it with `separator=semicolon` like this               \begin{tabular}{c|c c|c}%       & \bfseries A & \bfseries B & \\\hline       \csvreader[head to column names, late after line=\\, separator=semicolon]%       {csv/test.csv}{}%       {\bfseries\cat & \A & \B & \acc\%}%     \end{tabular}      but I keep getting error `! Package pgfkeys Error: I do not know the key '/csv/separator' and I am going to ignore it.`


title: First column of multicols introduces an unwanted vertical space when first element is displaymath

text: Code:               \documentclass{article}     \usepackage{multicol}          \begin{document}     \begin{multicols}{3}       \[ \rho^1 = \left(\begin{array}{ccccc}1&2&3&4&5\\2&4&5&1&3\end{array}\right) \]       \[ \rho^2 = \left(\begin{array}{ccccc}1&2&3&4&5\\4&1&3&2&5\end{array}\right) \]       \[ \rho^3 = \left(\begin{array}{ccccc}1&2&3&4&5\\1&2&5&4&3\end{array}\right) \]       \[ \rho^4 = \left(\begin{array}{ccccc}1&2&3&4&5\\2&4&3&1&5\end{array}\right) \]       \[ \rho^5 = \left(\begin{array}{ccccc}1&2&3&4&5\\4&1&5&2&3\end{array}\right) \]       \[ \rho^6 = \left(\begin{array}{ccccc}1&2&3&4&5\\1&2&3&4&5\end{array}\right) \]     \end{multicols}     \end{document}      Output: ![output](http://i.stack.imgur.com/bMiJQ.png) Can I remove the vertical space in the first column?


title: 3 dimension plots with larger z axis and all the values show up on ticks

text: I am trying to build a 3 dimension graph using the following code.               \documentclass{article}          \usepackage{pgfplots}          \begin{document}          \begin{figure} [H]     \centering     \pgfplotsset{compat=newest}     \begin{tikzpicture} [scale=0.8]     \begin{axis}[     view = {5}{8},     grid=both,     legend cell align=left,     xticklabels = {10,20,30,40,50,60,70,80,90,100,110},     yticklabels ={0.03,0.05,0.07,0.09,0.11,0.13,0.23,0.33,0.43,0.53},     zticklabels = {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1},     xtick={1,2,3,4,5,6,7,8,9,10,11},     ytick={1,2,3,4,5,6,7,8,9,10},     tick label style={font=\tiny},     legend pos=north east,     legend columns = 4,     y tick label style={rotate=90},     ylabel=distinctness,     xlabel=Dimension,     zlabel=silhouette coefficient,     y label style={rotate=57},     ]     \addplot3  coordinates{(1,1,0.27)(1,2,0.27)(1,3,0.27)(1,4,0.27)(1,5,0.32)(1,6,0.38)   (1,7,0.66)(1,8,0.80)(1,9,0.80)(1,10,0.85)};     \addplot3  coordinates{(2,1,0.23)(2,2,0.30)(2,3,0.33)(2,4,0.40)(2,5,0.46)(2,6,0.43)(2,7,0.62)(2,8,0.80)(2,9,0.85)(2,10,0.87)};     \addplot3  coordinates{(3,1,0.83)(3,2,0.85)(3,3,0.86)(3,4,0.86)(3,5,0.86)(3,6,0.57)(3,7,0.74)(3,8,0.78)(3,9,0.86)(3,10,0.87)};     \addplot3  coordinates{(4,1,0.86)(4,2,0.88)(4,3,0.90)(4,4,0.56)(4,5,0.56)(4,6,0.52)(4,7,0.64)(4,8,0.78)(4,9,0.84)(4,10,0.87)};     \addplot3  coordinates{(5,1,0.92)(5,2,0.92)(5,3,0.52)(5,4,0.57)(5,5,0.59)(5,6,0.58)(5,7,0.63)(5,8,0.81)(5,9,0.82)(5,10,0.85)};     \addplot3  coordinates{(6,1,0.86)(6,2,0.90)(6,3,0.91)(6,4,0.85)(6,5,0.86)(6,6,0.87)(6,7,0.88)(6,8,0.80)(6,9,0.82)(6,10,0.86)};     \addplot3  coordinates{(7,1,0.83)(7,2,0.87)(7,3,0.88)(7,4,0.88)(7,5,0.86)(7,6,0.86)(7,7,0.83)(7,8,0.79)(7,9,0.84)(7,10,0.86)};     \addplot3  coordinates{(8,1,0.66)(8,2,0.76)(8,3,0.76)(8,4,0.76)(8,5,0.79)(8,6,0.80)(8,7,0.68)(8,8,0.81)(8,9,0.84)(8,10,0.85)};     \addplot3  coordinates{(9,1,0.79)(9,2,0.84)(9,3,0.56)(9,4,0.59)(9,5,0.63)(9,6,0.65)(9,7,0.73)(9,8,0.80)(9,9,0.84)(9,10,0.85)};     \addplot3  coordinates{(10,1,0.36)(10,2,0.52)(10,3,0.52)(10,4,0.59)(10,5,0.63)(10,6,0.64)(10,7,0.73)(10,8,0.80)(10,9,0.84)(10,10,0.86)};     \addplot3  coordinates{(11,1,0.36)(11,2,0.52)(11,3,0.52)(11,4,0.59)(11,5,0.63)(11,6,0.64)(11,7,0.73)(11,8,0.80)(11,9,0.84)(11,10,0.86)};     \end{axis}     \end{tikzpicture}     \end{figure}     \end{document}      ![enter image description here](http://i.stack.imgur.com/NQjrw.png) There are some issues with it, may be many, you can suggest what other changes can I make so that the plot is more illustrative. Issues that I know of but don't know how to solve:   1. How can I increase the length of y-axis so that all the ticks and labels are clearly readable like the labels of x-axis   2. How can I show all the ticks for z-axis, I wrote `zticklabels = {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}` in my code, but the plot does not show all the values. What is going wrong here?   3. What is the meaning of view attribute? I know changing the values changes the orientation of plot along the z-axis. But what I don't understand is how it works, means, I don't know what value of views will bring what kind of effect? I will appreciate any suggestion that you can provide. Thanks.


title: LyX <File> <New from Template> all require special modules, why?

text: My question is: Where are the LyX templates that don't require installation of extra packages, classes or modules? There isn't one for a novel under _New from Template_. Months ago I tried LyX without reading the manuals. I hoped could dive in and learn by experimenting. Instinctively I clicked on _File_ , and _New From Template_ thinking I could find something suitable to use for a Novel, based on subject matter. I found templates titled "apa", "APA6", "JASA", "ectaart" and others that didn't suggest a design purpose. Perhaps one of those would work, but I didn't want to open each one to try to piece together to see each one's goal intent. But, after much head scratching I did anyway. Every single user template required some sort of extra package, module or class, but thankfully the dialog box let me know that this wasn't an error, just a warning that I couldn't produce output. I believe I was about to start using a template for a journal entry to the American Geophysical Union, without output. Yet, I could still use the LyX template for composition. Thankfully I discovered that in the manual first. That was before I discovered that first the user needs to set their Class, then load the template they'd like to use. That's available when you drill down through Documents --> Settings and there select _Class_ from the menu, and then can pick Memoir, Koma etc., for a Book, or whatever type of document you'd like to compose. And so now I'm back to just looking for a Novel Template that's requires just the standard classes, modules and packages that LyX has. I suppose since I can select Memoir under Document --> Settings that it should be able to render PDF output.


title: Conditional execution based on style existence (listings)

text: Is there a way in LaTeX (or e-TeX) to check if a style is defined using the `listings` package (inside a `\lstnewenvironment` definition)? I mean something like this:               \lstdefinestyle{tmpdefaultstyle}{}     \lstdefinestyle{tmpstyle}{}     \lstnewenvironment{tmpenv}{       \ifcsname **********\endcsname         \lstset{style=tmpstyle}       \else         \lstset{style=tmpdefaultstyle}       \fi     }{}      `**********` \- I don't know what to write here.


title: lstinline loses braces when used as an argument to another command

text: I'm using the `listings` package, for the Java language (which, as all C-like languages, uses braces as a block delimiter). I intend to use `\lstinline{...}` as the second argument to a command for typesetting Hoare triples. While `\lstinline|while (...) { ... } |` typesets the braces correctly, they are removed if `\lstinline|...|` is passed as argument to any macro. E.g.:               \documentclass{article}     \usepackage{listings}     \lstset{language=Java}          \newcommand{\hoare}[3]{\{ $#1$ \} #2 \{ $#3$ \} }     \newcommand{\true}{\mathbf{true}}     \newcommand{\false}{\mathbf{false}}          \begin{document}     \hoare{\true}{\lstinline|while(true) { }|}{\false}     \end{document}      How do I get my braces back?


title: How to get rid of reference in beamer presentation menu

text: The following code causes the text `References` in the top left hand side of the slide. I've tried lots and lots of things but I don't seem to be able to get rid of the text. (Redefining `\bibname` doesn't work, and using the option `title={}` for the `\printbibliography` command also doesn't work.) (Oddly enough, when I use the same code for the `block` with the `beamer- poster` package, using the option `name={\hbox to 1mm{}}` _does_ get rid of the text. Other names don't....)               \documentclass{beamer}     \usetheme{Berlin}          \usepackage{biblatex}     \addbibresource{tiny}     \begin{document}     \begin{frame}        Some citation~\cite{Knuth:1990}.        \begin{block}{Bibliography}           \printbibliography[name={}]        \end{block}     \end{frame}     \end{document}      The following is the BibTeX file, which should be called `tiny.bib`.               @Book{Knuth:1990,         author    = {Knuth, Donald E.},         title     = {The {\TeX}book},         keywords  = {latex},         year      = {1990},         isbn      = {0-201-13447-0},         publisher = {Addison--Wesley},     }


title: How to use leftmark in LaTeX in memoir class

text: I am using document class `memoir`. I want too use `\leftmark` to display section headings as headers. Can you give a small sample program how to use `\leftmark` in LaTeX in `memoir`. I read the manual but did not understand it. Following is the program               \documentclass[a4paper]{memoir}     \addtopsmarks{headings}{}{       \createmark{section}{both}{shownumber}{}{. \ }     }     \pagestyle{headings}          \begin{document}               \section*{Introduction}           same moment it is produced. When you flip a switch, the electric power is there. Behind the scenes, state electricity board employees are hard at work operating and maintaining the comwhich I have learnt at GNDTP 1 in this report. Additional help has been taken from internet which has           \end{document}


title: How to inverse top and bottom ?

text: I would like to get 100 "above" the radius, if I consider that the radius comes from the center towards the circle. A little example :               \documentclass[landscape]{scrartcl}     \usepackage{tikz}     \begin{document}          \begin{tikzpicture}         \foreach \a in {0,20,...,340}{%         \draw (0,0)--(\a:4cm) node [pos=.75,above,sloped] {$\a$};         }     \end{tikzpicture}           \end{document}      ![enter image description here](http://i.stack.imgur.com/p6uAd.png) Another example :                   \documentclass[landscape]{scrartcl}         \usepackage{tikz}         \begin{document}          \begin{tikzpicture}[color=blue]            \node (A) at (2,-4){A};           \node (O) at (0,0){O};           \node (B) at (-2,-4){B};            \draw[color=red] (O)  to node[sloped,above]{label}                                   node[sloped,above,blue,rotate=180]{label} (A) ;          \draw[color=red] (O)  to node[sloped,above]{label}(B) ;        %\draw[color=red] (B)  to node[sloped,above]{label}(O) ;            \end{tikzpicture}             \end{document}      ![enter image description here](http://i.stack.imgur.com/pu75a.png) In this example, I always thought that if I reverse the nodes then I reverse the top and bottom but I was wrong. A solution is to use a rotation but...it's not automatic. The only idea I had, is to use the rotation after testing the angle formed by the two points and the horizontal axe.


title: latex gives me the error: Ouch---my internal constants have been clobbered

text: As the title states, compiling with latex produces the error, right away:               Ouch---my internal constants have been clobbered!---case 14      I have no idea what this means... I use TexLive 2012. I updated my texmf.cnf and ran fmtutil-sys and texhash. I guess texhash may have messed it up? Any ideas? As requested a minimal working example:               \documentclass{article}     \begin{document}         Any tex file.     \end{document}


title: Style of tableofcontents

text: I want to change style of table of contents which is given by \tableofcontents, (say I do not want that much space between lines and some I want the subsections to be listed in one line). How can I do that? (So far I can only edit toc-file by hands, which is not a good solution.)


title: Why does hyperref/hpdftex.def v6.81u cause an error for me?

text: Background information: I'm using TeXlive 2010 (on ArchLinux x86_64, though installed through TUG/CTAN, not from the Arch repos). I update my system with tlmgr daily. All was well until today, perhaps having something to do with the most recent updates, and v6.81u of the hyperref package in particular (and the file hpdftex.def). Now, even this simple document:                 \documentclass{article}       \usepackage{hyperref}       \begin{document}       Hello world.       \end{document}      throws the following error:                 (/usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/hpdftex.def       File: hpdftex.def 2010/11/22 v6.81u Hyperref driver for pdfTeX       /usr/local/texlive/2010/texmf-dist/tex/latex/hyperref/hpdftex.def:35: Undefined        control sequence.       \pdf@ifdraftmode ->\ifnum \pdf@draftmode                                                 =\ltx@one \expandafter \ltx@firstof...       l.35 \pdf@ifdraftmode                            {%       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.      Has anyone else had this problem? Is it a package version incompatibility? Here's what I get if I add \listfiles to the beginning of the code.                 *File List*        article.cls    2007/10/19 v1.4h Standard LaTeX document class         size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)       hyperref.sty    2010/11/22 v6.81u Hypertext links for LaTeX        ltxcmds.sty    2010/04/26 v1.7 LaTeX kernel commands for general use (HO)          ifpdf.sty    2010/01/28 v2.1 Provides the ifpdf switch (HO)       pdftexcmds.sty    2010/04/01 v0.9 Utility functions of pdfTeX for LuaTeX (HO)       infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)       ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)         keyval.sty    1999/03/16 v1.13 key=value parser (DPC)       kvsetkeys.sty    2010/03/01 v1.9 Key value parser (HO)       etexcmds.sty    2010/01/28 v1.3 Prefix for e-TeX command names (HO)       pdfescape.sty    2010/03/01 v1.9 Provides hex, PDF name and string conversions        (HO)         ifvtex.sty    2010/03/01 v1.5 Switches for detecting VTeX and its modes (HO)        ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional        hycolor.sty    2009/12/12 v1.6 Color options of hyperref/bookmark (HO)       xcolor-patch.sty    2009/12/12 xcolor patch       letltxmacro.sty    2008/06/24 v1.3 Let assignment for LaTeX macros (HO)       kvoptions.sty    2010/02/22 v3.7 Keyval support for LaTeX options (HO)         pd1enc.def    2010/11/22 v6.81u Hyperref: PDFDocEncoding definition (HO)        intcalc.sty    2007/09/27 v1.1 Expandable integer calculations (HO)       hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive            url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.         bitset.sty    2007/09/28 v1.0 Data type bit set (HO)       bigintcalc.sty    2007/11/11 v1.1 Expandable big integer calculations (HO)       atbegshi.sty    2010/03/25 v1.12 At begin shipout hook (HO)        hpdftex.def    2010/11/22 v6.81u Hyperref driver for pdfTeX       atveryend.sty    2010/03/24 v1.5 Hooks at very end of document (HO)       rerunfilecheck.sty    2010/03/16 v1.6 Rerun checks for auxiliary files (HO)       uniquecounter.sty    2009/12/18 v1.1 Provides unlimited unique counter (HO)        nameref.sty    2010/04/30 v2.40 Cross-referencing by name of section       refcount.sty    2008/08/11 v3.1 Data extraction from references (HO)       gettitlestring.sty    2009/12/18 v1.3 Cleanup title references (HO)        scratch.out        scratch.out        ***********      I'd be happy to upload the full log if anyone thinks it will help.


title: Reverse page numbering

text: How can one make LaTeX print the pages numbering in reverse order, in the sense that if the document in question has N pages then the first page is numbered N, then N-1, ...?


title: Vertical line superimposed over a letter

text: Looking for a way to put a vertical line over another character. Similar to the \cancel feature, but with a vertical, rather than a slanted line. For example on a capital S the vertical line would turn it into something akin to a US dollar symbol: $. (verticallity in this text box seems dependent upon font choice) i.e. superimpose a | over a C


title: What's the deal with Tex Live and expl3.sty?

text: I've installed Tex Live 2010 on a mac, and when trying to use xelatex, I get the error: !Latex Error: File `expl3.sty' not found What is this package, and how can I get it installed on tex live? There are no updates available, according to the Tex Live utility. Update: I've found the 'tlmgr' utility, and done: sudo tlmgr install expl3 So far, so good. Unfortunately, I am now told I need xparse.sty. xparse.sty is not available through tlmgr ("package xparse not present in package repository"). Needless to say, I am not using xparse directly, nor am I directly using calc.sty, which is the file that was mentioned just before this error. Further update: xparse is obtained by installing 'xpackages'.


title: Strange behavior y label in PGFplots

text: I've noted a strange behavior of PGFplots y label with the following code:               \documentclass{report}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[     compat = 1.3,     no markers,     grid   = major,     ylabel = $P_2$,     xlabel = h,     xmin   = 0,     xmax   = 60000,     % TRY HERE     % case 1           ymin   = 0,     % case 2     %ymin   = 0.00000001,     ]     \addplot[line width=1.5pt,red] table[x index=0,y index=1]{       1.0000000e+003  2.7793697e-004       5.5000000e+004  6.3359750e-007     };     \end{axis}     \end{tikzpicture}          \end{document}      Compile with case 1 not commented and with case 2 commented and after viceversa to see the difference. ![the two results](http://i.stack.imgur.com/S0dBb.png) Can somebody tell me why? Is it a bug?


title: possibilities of the picture environment

text: from what I could find on the net, the picture environment does not offer the triangle shape. It is possible to get something similar with lines but not when you want the triangle to be fill up with a solid color. Do you confirm? Maybe the bezier curves could be an option.               \setlength{\unitlength}{2pt}     \begin{picture}(50,200)     \linethickness{1pt}     \bezier{20}(0,0)(10,30)(50,30)     \put(0,0){\circle*{1}}     \put(50,30){\line(-1,0){40}}     \put(50,31){\makebox(0,0)[b]{C}}     \end{picture}


title: How to multiply compile according to selected tags?

text: I would like to do the following, by I am not sure how. Say I have a LaTeX file with series of annotations, each with zero or more "tags" (say, about their contents or the project they are related to) and the day it was written down. I would like to be able to compile the same file in two ways:   * in its entirety, with the annotations in chronological order, with the dates in some evidence, as a kind of log;   * including only the annotations pertaining to one or more given tags (with or without the dates), as a survey of, say, the project those tags refer to. Would you think it can be done in a not too complicated way?


title: siunitx number too big when trying to round with scientific-notation = fixed

text: I'm trying to to round numbers in latex in a way, such that 1.23456e-10 rounded to two places becomes zero and not 1.23e-10. One solution with siunitx is               \num[round-mode=places,scientific-notation = fixed,fixed-exponent = 0 ,round-precision = 2]{1.23456e-6}      But if the digits get too many (>10) it fails, with the the error message               ! Number too big.      As explained in siunitx number too big when trying to round the command               \num[round-mode=figures,round-precision=2]{1.0123456789012e-6}      had the same problems, which are fixed now. But, if I add scientific-notation = fixed, then the error reappears. Does anybody know a fix for that problem?


title: Header and page numbers with pdfpages

text: I have a chapter of attachments which contains pdf files in this format, using the awesome pdfpages package:               \chapter{Title}     Lots of multipage pdfs following     \includepdf[pages=-,frame,scale=0.9]{abc.pdf}     \includepdf[pages=-,frame,scale=0.9]{def.pdf}     ...      This works, but apparently clears out the header and page numbers of the parent document. What setting do I have to change to get back the header and page numbers?


title: Produce nice TIKZ picture (Tree)

text: so far i have the following code which gives me a ugly TIKZ picture (twe level tree). Is there a comfortable way to get a nice spacing for second level nodes? Thank you very much in advance!               \documentclass[a4paper,12pt,titlepage]{scrreprt}      % \documentclass[a4paper,11pt, twoside]{scrartcl}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english, ngerman]{babel}     \usepackage{graphicx}     % \usepackage[pdftex]{graphicx}     % \usepackage{epstopdf}     \usepackage{latexsym}     \usepackage{amsmath,amssymb, amsthm}     \usepackage{tikz}     \usetikzlibrary{external}     %\tikzexternalize % activate!     \usepackage{lscape}     \usepackage{fullpage}     \usetikzlibrary{positioning,shadows,arrows,trees,shapes,fit}          \begin{document}     \pagestyle{empty}     \begin{landscape}     \begin{figure}[h]     \begin{center}     \begin{tikzpicture}     [level distance=2.5cm,     level 1/.style={sibling distance=5cm},     level 2/.style={sibling distance=2cm}, auto,transform shape ]     \tikzstyle{every node}=[rectangle,draw]     \node(Root) {Gesamtdaten}         child { node (Root-0){$RR=0$} }         child {             node (Root-1){$RR\neq 0$}             child { node(Root-1-1) {$0<RR\leq 0.25$} }             child { node (Root-1-2){$0.25<RR\leq 0.65$} }             child { node (Root-1-3){$0.65 < RR \leq 1$} }             child { node(Root-1-4) {$1 < RR \leq 1.2$} }             child { node (Root-1-5){$1.2 < RR \leq 1.35$} }             child { node (Root-1-6){$1.35 < RR \leq 1.5$} }             child { node (Root-1-7){$1.5 < RR \leq 1.7$} }             child { node (Root-1-8){$1.7 < RR \leq 1.95$} }             child { node (Root-1-9){$1.95 < RR \leq 2.4$} }             child { node (Root-1-10){$2.4 < RR \leq 3$} }             }     ;     \begin{scope}[every node/.style={right}]      \path (Root-0    -| Root-1)  ++(2cm,0) node[color=red] {SVM 1};      \path (Root-1-1  -| Root-1-10) ++(2cm,0) node [color=red] {SVM 2};      \end{scope}     \end{tikzpicture}          \end{center}     \end{figure}     \end{landscape}          \end{document}      ![enter image description here](http://i.stack.imgur.com/UAHxX.png)


title: ending statements in algorithm2e environment

text: I am using the package `algorithm2e`. Is there a way to end with period instead of semicolon, or end with simply newline? I don't like the semicolons on the sentences. If I just try putting a period it will put both sentences together which I don't want to do.               Compute the modulated input across this connection\;     Add the modulated input to the accumulated input\;      Any help appreciated.


title: Arrow with text above

text: I am drawing an arrow using the following command:   `$ \xleftarrow{\mbox{\tiny{BCast}}} $`. I have tested the command in two different environments:   1. TeXShop (MacOS, uses TeX Live) outputs an arrow with the problem stated in the second item.   2. TeXmaker (Windows, uses MiKTeX) in a bidirectional environment (for writing Farsi) outputs the correct arrow with "Bcast" above it but the arrow seems to have splitted areas that are connected using dots.   ![alt text](http://i.stack.imgur.com/ytq1a.png) Am I doing it wrong?   **Edit:** this is the "preview" rendering of the file under zoom of 1000x.   ![alt text](http://i.stack.imgur.com/9Z1DH.png)


title: How can I obtain brackets with proper size on multiple lines using the {multline} environment?

text: My code is of the form               \begin{multline}     \left[ \frac{foo}{bar} \\ foo \right]     \end{multline}      This code gives an error for missing \right. etc. To remedy this, I used this code               \begin{multline}     \left[ \frac{foo}{bar} \right. \\\left. foo \right]     \end{multline}      However, in this code, the right ] bracket is small and is not the same size as the left [. Please let me know if a solution to this exists.


title: array package breaks references in a tabular environment

text: This is a follow-up question to my last question: Defining a new LaTeX environment for numbered two-column proofs Basically, I'm trying to define the following environment:               \newcounter{proofc}     \DeclareRobustCommand\stepproofc{\refstepcounter{proofc}(\arabic{proofc})}     \newenvironment{twoproof}{%       \setcounter{proofc}{0}       \begin{tabular}{@{\stepproofc \hspace{4pt}}>{$}c<{$}|>{$}l<{$}}     }{       \end{tabular}     }      and I used `\refstepcounter` specifically so that I could refer to some entries inside other entries, like this:               \begin{twoproof}     \label{step1} Prop A & Justification \\     \label{step2} Prop B & Justification \\     Prop C & Because \ref{step1} and \ref{step2}     \end{twoproof}      Sadly, if you include the `array` package, this doesn't come out the way I'd hoped, because the `\ref` macros don't turn into the right number. I'm like 99% sure that this is because the `\label` macro is catching the wrong number (if you put a theorem environment before a twoproof environment, the `\ref` macros transform into the number of the theorem). If I don't include the `array` package, this works the way it should. But then I can't use the `>{$}` and `<{$}` column modifiers to put my columns into math mode (I've tried using @-espressions instead and that gives an error). So how do I   1. get `label` to work inside tabular, even with the `array` package included (preferable), or   2. Typeset my columns in math mode without using `>{$}` and `<{$}`, which come from the array package. Any help will be greatly appreciated! **Edit** : Unfortunately, if you try to wrap the whole environment in `\begin{displaymath}` and `\end{displaymath}`, and change `tabular` to `array` (and get rid of the column modifiers), you get this error:               ! Package amsmath Error: Multiple \label's: label 'step1' will be lost.          See the amsmath package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.30     \label                    {step2} Prop B & Justification \\     ?      So it seems like `displaymath` doesn't play nicely with labels either. **Edit 2** : As requested, here is a complete example illustrating the problem:               \documentclass[oneside]{article}     \usepackage{amsmath,amsthm}                                                                           \usepackage{array}                                                                                \newcounter{proofc}                                                                           \DeclareRobustCommand\stepproofc{\refstepcounter{proofc}(\arabic{proofc})}                    \newenvironment{twoproof}{%                                                                     \setcounter{proofc}{0}                                                                        \begin{tabular}{@{\stepproofc \hspace{4pt}}>{$}c<{$}|>{$}l<{$}}                             }{                                                                                \end{tabular}                                                                               }                                                                                \theoremstyle{definition}                                                                     \newtheorem{thm}{Theorem}[section]                                                                 \begin{document}                                                                                \begin{thm} This theorem exists to highlight the problem. \\                                  If you remove it or take the proof out of the theorem, the ref numbers simply disappear in the proof below          \begin{center}                                                                                \begin{twoproof}                                                                              \label{step1} E \vdash \alpha &  \pi_1 \\                                                     \label{step2} E \vdash \beta & \pi_2 \\     E \vdash \gamma & \ref{step1} \mbox{ and } \ref{step2}                                        \end{twoproof}     \end{center}          \end{thm}                                                                                \end{document}      Note that if you replace lines 7-12 with:               \newenvironment{twoproof}{%                                                                     \setcounter{proofc}{0}       \begin{displaymath}                                                          \begin{array}{@{\mbox{\stepproofc \hspace{4pt}}}c|l}                             }{                                                                                \end{array}       \end{displaymath}                                                                              }      You get the error described above. Thanks again for your help!


title: Drawing neat UML class diagrams with tikz

text: I want to draw (UML) class diagrams with tikz (and I'm aware there is a special tikz package for that). I want to imitate the style that yuml.me uses, since personally I find it very appealing and at the same time still serious. Here is an example what I would like to achieve: ![](http://i.stack.imgur.com/N2Mdc.png) Note in particular that there is a slight shadow/glow outside and inside the border and the subtle color gradient used for the fill color. Here is a zoomed view to make clear what I mean: ![](http://i.stack.imgur.com/k0f0i.png) I tried to take the color values from an yuml diagram and transfer them to tikz, but the closest I got is the following: ![](http://i.stack.imgur.com/o2LFZ.png)               \tikzstyle{class}=[         rectangle,         draw=black,         text centered,         anchor=north,         text=black,         text width=3cm,         shading=axis,         bottom color={rgb:red,222;green,222;blue,222},top color=white,shading angle=45]          \begin{tikzpicture}[node distance=2cm]         \node (Item) [class, rectangle split, rectangle split parts=2]         {             \textbf{Car}             \nodepart{second}foobar\newline baz         };           \end{tikzpicture}      which is still pretty ugly and not anywhere near the style I want to achieve. Any help from the tikz-experts would be appriciated!


title: What notation is used to show that a variable is a matrix?

text: When a variable is a vector, it is common to put an arrow above the variable, shown bellow               \vec{x}      When a variable is a matrix, sometimes a capital letter is used to distinguish it from the ordinary vectors and scalars. But what should I do if I cant use a capital letter? I have a variable Omega that sometimes is a vector and sometimes is a matrix. It always is capital Omega to show it represents a solid angle. I need to distinguish the vector Omega from the matrix Omega. How could I do this?


title: Create two sets of caption labels

text: I would like to create two sets of caption labels in latex, but research online has not yielded any satisfactory solution. I was wondering if anyone can provide help. More specifically, I have many images to insert into a paper that need to be sorted. Some will be labeled normally (i.e. Figure 1, Figure 2, etc.). However, there is another set I would like to name sequentially in a different format (i.e. Plate 1, Plate 2, etc.). I am using `\includegraphics` in the `float` environment for inserting images. However, I am open to any adjustments.


title: TikZ: vertical rule between columns with differently sized cells

text: I would like to draw a rule separating two columns. Unfortunately, it won't work properly if the cells have different widths. Are there any known workarounds? My code:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{matrix}      \begin{document}     \begin{tikzpicture}     \matrix (m) [matrix of nodes]{     a & b & c \\     d & long row & e \\     f & g & h \\     };     \draw (m-1-2.north east -| m-3-2.south east) -| (m-3-2.south east);     \end{tikzpicture}     \end{document}      Result (notice the rule intersecting the long cell): ![enter image description here](http://i.stack.imgur.com/OMPBC.jpg)


title: glossaries - \setglossarystyle is an undefined control sequence

text: I'm having an issue where I'm fully able to create a glossary with the glossaries package, but I'm unable to change the style - the command \setglossarystyle isn't recognised. This example works:               \documentclass{article}     \usepackage[acronym, nopostdot, nonumberlist]{glossaries}     \newacronym{acr}{acr}{Acronym}     \makeglossaries     \begin{document}          \acrshort{acr}     \printglossary[type=\acronymtype]          \end{document}      But this one fails, with an error complaining that \setglossarystyle is an undefined control sequence:               \documentclass{article}     \usepackage[acronym, nopostdot, nonumberlist]{glossaries}     \newacronym{acr}{acr}{Acronym}     \makeglossaries     \begin{document}          \acrshort{acr}     \setglossarystyle{long}     \printglossary[type=\acronymtype]          \end{document}      Am I missing a package or something somewhere?


title: Strange Knitr behavior with APA6 class manuscript

text: I tried everything that I know to solve this problem. I normally write my homework on share latex, but for this I downloaded and installed MacTex, Sweave and Knitr on my Mac. After trying out every tutorial and combination I could find I could not find the source of my problem. When I use Knitr or Sweave, it sometimes gives the error:               Typesetting problem in main.tex: Underfull \vbox (badness 10000)     has occurred while \output is active []      The result is that certain section headings have around 4 to 5 newlines of white space extra. When I remove the use of \Sexpr and in other cases knitr code chunks, then the problem disappears. This only happens with the manuscript version of the class. Furthermore, it only occurs when `echo = FALSE` with a chunk. It does not give the error when I type half a page extra. But typing extra stuff is not how I want to resolve this problem. How would I go about solving this, where would I need to look? I've looked for 3 hours myself, but I am a beginner in LaTeX. **Edit** : I noticed there is also an apa6e class. The problem does not get produced there. It does report all kinds of hbox errors, but I do not see them in the layout. **Edit2** : when I use the option `a4paper` then there are less underflows (`letter` is the default). At the moment I do not see any visual `\vbox` underflows. It might be a possible solution. But I am not sure yet, because this problem occurs 'dynamically'. Here is a minimal reproducible example (if you do this at sharelatex.com be sure to rename the *.tex file to *.Rtex or *.Rnw on your local TeX editor with Knitr installed via R). If you remove the last "bla" the problem does not occur. It has something to do with the output of Knitr and its `\sexpr`, the section heading "methode" and having a full page under one section.               \documentclass[man]{apa6}     \usepackage[natbibapa]{apacite}     \usepackage[dutch]{babel}     \usepackage[utf8]{inputenc}          \title{Statistiek 2 Verslag: agressie en haar gevolgen}     \shorttitle{agressie en haar gevolgen}          \author{Melvin}          \abstract{Dit is een abstract van mijn statistiek 2 verslag.}          \newcommand{\SES}{sociaal economische status}          \begin{document}          \maketitle %error gets not reproduced without make title          <<test, echo = FALSE, warning = FALSE, results = "hide">>=     options(scipen = 1, digits = 2)     aantal = 100     rf_meisjes = 55     rf_jongens = 55     ses_laag = 5     ses_midden = 2     ses_hoog = 2     @          \section{Inleiding}          Agressie heeft een mogelijke negatieve invloed op de persoon en de maatschappij. Zo suggereert onderzoek dat agressie op jonge leeftijd een positief verband heeft met politiecontact (ref) Een ander resultaat is dat oncontroleerbare niet geplande agressie een positief verband heeft met sociale verwerping (ref). De voorgaande onderzoeken impliceren dat agressie een voorspeller is van een eenzamere en meer criminele maatschappij. Daarom is onderzoek in dit onderwerp van maatschappelijk belang.          De literatuur gebruikt verschillende definities van agressie. Zonder een eenduidige definitie is het onmogelijk om heldere interpreteerbare resultaten te verwachten. In dit verslag wordt geprobeerd een eenduidige algemene definitie te hanteren. Agressie wordt in dit verslag gedefinieerd als: het (bewust of onbewust) gebruiken van sociaal-relationele wapens tegen een ander persoon. Deze definitie is ge\"inspireerd door (ref).          Bij de eerste hypothese werd er verwacht dat de mate van agressie een positief verband heeft met leeftijd bij een lage \SES, maar niet bij een gemiddelde \SES\ en een hoge \SES. Zie figuur .. op pagina .. voor een hypothetische grafische weergave.      Bij de tweede hypothese werd er verwacht dat de mate van verwerping van leeftijdsgenoten en de snelheid van boos worden op zevenjarige leeftijd een positieve verband hebben op agressie met zevenjarige leeftijd. Bij de derde hypothese werd er verwacht dat de mate van agressie op zevenjarige leeftijd en een lage \SES\ een positieve verband hebben met politie contact blablablabla. %remove the last "bla" and the error does not occur          \section{Methode}           \subsection{Participanten}     Er waren \Sexpr{aantal} participanten (waarvan \Sexpr{rf_meisjes}\% meisjes en \Sexpr{rf_jongens}\% jongens). Van deze groep hadden \Sexpr{ses_laag}\% kinderen een lage \SES, \Sexpr{ses_midden}\% kinderen een gemiddelde \SES en \Sexpr{ses_hoog}\% kinderen een hoge \SES. De participanten waren geworven via verschillende peuterspeelzalen in Noord-Holland.          \bibliographystyle{apacite}     \bibliography{referenties}     \end{document}


title: datatool group by?

text: I try to display the results of a survey where students of 2 different classes could choose their favorite subject. In the result table I find Surname, Name, ClassID, Subject. The data in the file `ff14.txt` I'm using looks like this:               ClassID; Schueler_Name; Schueler_Vorname; Subject     5a; Stiner; Markus; Big Band     3c; Meier; Stefan; Latein     5b; Muggli; Elena; Instrument     3b; Strang; Flurin; Band     3b; Nomer; Ulrike; Big Band      Now I'd like to order the results by class and then display all the students in this class with their chosen favorite subject. I've done something similar before using `nlatexdb`, where I used a nested construction. However, when I try to apply the same code to `datatool` I get a very different result. In the PDF the class is not grouped but displayed 27 times (as many as there are students in the class). So the resulting PDF consists of 27 tables each containing 27 students. But what I would like to have is 2 tables (there are 2 classes) with all the student in the corresponding class. My MWE:               \documentclass[12pt]{article}          \usepackage{babel, fixltx2e}     \usepackage{xltxtra}     \usepackage{xunicode}     \usepackage{float}     \usepackage{datatool}          \DTLsetseparator{;}      \DTLloaddb{anmeldungen}{ff14.txt}          \begin{document}          \DTLforeach{anmeldungen}{\class=ClassID}{          \subsection*{Klasse \class}               \begin{tabular}{ll} \hline     \textbf{Name} & \textbf{Vorname}      \DTLforeach{anmeldungen}{\fn=Schueler_Vorname, \ln=Schueler_Name}{\DTLiffirstrow{\\ \hline}{\\  }     \ln & \fn   }  \\ \hline \hline     \end{tabular}               \begin{flushright}     \DTLsavelastrowcount{\n}     \n\ Anmeldungen.     \end{flushright}          }


title: tiling a pattern for beamer background

text: Is there a solution to have a given pattern (lets say as a `.png`file) **tiled** on the background (`background` or `background canvas`) for `beamer- presentations`?   I only find links to the `wallpaper` package, what seems to bring up many problems.


title: Formating bibliography with natbib

text: \documentclass[12pt,a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage[portuguese]{babel}     \usepackage{natbib}          \begin{document}     Hello, world! (\Citealt[32]{Doe2999})          \bibliographystyle{chicago}     \bibliography{mybib}{}          \end{document}      (Sorry, I don't know how to emulate mybib file.) In the bibliography it shows: > Doe, J. (2999). _title_. City: Publisher Whereas, 16th edition of Chicago Manual of Style says it shoud be: > Doe, John. 2999. _title_. City: Publisher Is it possible to update natlib chicago definitions?


title: How to Graph Floor/Ceiling Functions in LaTeX (PGFPlots)

text: I am trying to make a graph of some floor/ceiling functions for examplep the floor of 3x+2 like this: http://www.wolframalpha.com/input/?i=graph+of+floor%283x%2B2%29# _=_. However, I searched through the PFGPlots manual and did not find a mention of that. Does anyone know how to do this in LaTeX or PGFplots?


title: Graphs in commutative diagrams in TikZ

text: I want to draw a diamond shape commutative diagram using tikz. Instead of just letters I want to have simple graphs (just edges and vertices) in the diagram. I tried some stuff but the diagram still looks superugly. Is there any way to make this look smoother?               \documentclass[a4paper,12pt]{article}     \usepackage{tikz}     \usepackage{tikz-cd}     \usetikzlibrary{matrix,arrows}               \begin{document}                 \begin{center}              \begin{tikzcd}               &                \begin{tikzpicture}%B             [every node/.style={circle,fill=black,inner sep=3pt}]               \node (a) at (0,0) {};               \node (b) at (0,-1)  {};               \node[olive] (d) at (1,0)  {};               \node[olive] (f) at (0,1)  {};                    \foreach \from/\to in {a/b,a/d,a/f}                 \draw (\from) -- (\to);             \end{tikzpicture}              \arrow{dr} &\\                    \begin{tikzpicture}%A             [every node/.style={circle,fill=black, inner sep=3pt}]               \node (a) at (0,0.5) {};               \node (b) at (0,-0.5)  {};                    \foreach \from/\to in {a/b}                 \draw (\from) -- (\to);             \end{tikzpicture}             \arrow{ur} \arrow{dr} & &             \begin{tikzpicture}%Amalgam             [every node/.style={circle,fill=black, inner sep=3pt}]               \node (a) at (1,1) {};               \node (b) at (1,0)  {};               \node[orange] (c) at (0.125,0.5) {};               \node[olive] (d) at (2,1)  {};               \node[orange] (e) at (1.7,1.7) {};               \node[olive] (f) at (1,2)  {};                    \foreach \from/\to in {a/b, a/c,a/d,a/e,a/f,c/b}                 \draw (\from) -- (\to);             \end{tikzpicture}\\              &              \begin{tikzpicture}%C             [every node/.style={circle,fill=black, inner sep=3pt}]               \node (a) at (1,1) {};               \node (b) at (1,0)  {};               \node[orange] (c) at (0.125,0.5) {};               \node[orange] (e) at (1.7,1.7) {};                    \foreach \from/\to in {a/b,a/c,a/e,c/b}                 \draw (\from) -- (\to);             \end{tikzpicture}             \arrow{ur}             &\\              \end{tikzcd}             \end{center}         \end{document}      ![enter image description here](http://i.stack.imgur.com/rk4Li.png)


title: smallroyalvopaper defaults in memoir

text: Does anyone know how to find the default values used by memoir when it sets the margins for its built-in paper sizes? I'm particularly interested in finding the defaults for smallroyalvopaper.


title: Modifying natbib \citep

text: I need to use a "modified Harvard" citation style for one of my papers, in which the citation should look like               (Jones, 1990:99)      where the author is Jones, the year is 1990 and the page is 99. The closest I could get to that is via the natbib command:               \citep[99]{jones} yields: (Jones, 1990, 99)      But this isn't quite what I'm looking for. I would appreciate any ideas/suggestions. Thanks! [EDIT] Example:               \documentclass[11pt]{article}     \usepackage{natbib}           \title{Hello}     \date{}     \begin{document}          \maketitle           Hello. \citep[99]{jones}           \bibliographystyle{agsm}      \bibliography{mybib}             \end{document}


title: What documentclass/template should I use for non sectioned essays?

text: I have looked for different templates but most of them are concerned with papers, theses, books etc. But I am wondering if there is a specific one for simple essays, because (as an example) using the minimal document-class is discouraged.


title: Mis-aligned free translations in gb4e

text: When there is an example with a number more than three digits, the free translation line is too far to the left in `gb4e` examples.               \documentclass{article}     \usepackage{gb4e,cgloss4e}     \begin{document}              \begin{exe}             \exi{(10.159)} \gll    b\'u \`a k\H{o} k\`am t\`aha k\'{\i}    \\                 cl2 {\sc ds} (b)hold (a)break (a)scatter cl7      \\         \glt    ``They broke it off.'' (Missong)         \z     \end{document}      ![enter image description here](http://i.stack.imgur.com/wL01k.png) Has anyone dealt with this problem before?


title: LaTeX Django template custom language for listings

text: I'm using `Listings` package to insert python and javascript code into my thesis. This package has a lot of languages but not Django Template. Someone has yet defined that custom language, or there's another method to include it, as pretty as would be with `listings`?


title: Remove beamer markup

text: I have a `main.book.tex` and a `main.beamer.tex` which then `\input` the same source files. In those source files, I have a lot of `\mode<>` designations and generally, a lot of beamer markup -`\overlayarea`'s, `\only<>`'s, etc. My problem is that I also want to output to HTML. Now, `tex4ht` is generally awesome, generally plays nice with `beamer` and `beamerarticle`, and I've spend a lot of time customizing it to get it to do what I want. But, I'd like to try other conversion tools (e.g. pandoc) that can't handle `beamer` markup. Are there any good tools I could run my files through to remove the beamer markup? I've started writing a script to do this, but I thought maybe tex.sx already knows of such tools or has better ideas.