title: Listing removing horizontal lines and autocrop to the size of code fragment

text: I am trying to include the code in my presentation. There are two things that I need to fix:   * there are horizontal lines appearing between the code lines   * I do not want to use the entire page, need to autocrop to the size of the code Gray horizontal lines between code lines: ![enter image description here](http://i.stack.imgur.com/Tekph.png) MWE:               \documentclass[10pt]{article}     \usepackage[usenames,dvipsnames]{xcolor} %used for font color     \usepackage[utf8]{inputenc} %useful to type directly diacritic characters     \usepackage{listings}     \begin{document}     \definecolor{lbcolor}{rgb}{0.1,0.1,0.1}      \lstset{          basicstyle=\ttfamily\color{White},          language=Java,          tabsize=1,          xleftmargin=20pt,          keywordstyle=\color{Red}\bf,          showstringspaces=false,          morekeywords={public, class},          backgroundcolor=\color{Black}      }          \begin{lstlisting}          public class MyObject{              public MyObject(){             System.out.println("MyObject");         }     }     \end{lstlisting}          \end{document}


title: Decrease top margin of some chapters

text: I'm finishing my thesis in LaTeX, using class "book". I use a 1.5 line stretch with `\renewcommand{\baselinestretch}{1.5}`. Everything is ok, but I'd like the Abstract chapter (`\chapter*{Abstract}`) to fit in one page. There are 4 or 5 extra lines and I've almost achieved it by decreasing the marging between title and text (`\vspace*{-1.1cm}` just after the title) and the line stretch of the abstract (decreasing `\renewcommand{\baselinestretch}{XX}` and reseting it to 1.5 at the end of the abstract). The problem is that I cannot avoid all lines to go to the next page without making the abstract page a bit weird (too small margin between title and text, too small stretch line...) and I think the easiest way to achieve that is to decrease the margin before the title. Any idea? Thank you! MWE:               \documentclass{book}     % Some dummy text     \usepackage{lipsum}     % Defult line stretch of all document     \renewcommand{\baselinestretch}{1.5}          % Starting document     \begin{document}          % The chapter I'd like to fit in one page     \renewcommand{\baselinestretch}{0.5} % Reduce line stretch     % \vspace*{-1.1cm} % doesn't work properly     \chapter*{Abstract}     \vspace*{-1.1cm} % Reduce space between title and text     \lipsum[2-4] % Dummy text     \lipsum[13]     \renewcommand{\baselinestretch}{1.5} % Restore line stretch          % A normal chapter whose behaviour I don't want to change     \chapter{Introduction}     \lipsum[6-20] % Dummy text          \end{document}      Peaso


title: Biblatex citation: two articles same author, year - years printed in full?

text: I am citing two articles by the same author in the same year, referenced by the keys `auth00a` and `auth00b`. With the `authoryear-comp` style, I can use `textcite{auth00a,auth00b}` but this gives me "Author (2000a,b)" in the result. I would much rather have "Author (2000a, 2000b)"; that is, the years in full. Is there an easy way to do this? Thanks!


title: Gaussian elimination

text: I want to demonstrate examples of Gaussian elimination/the Gauss-Jordan method as shown below. There are some things that I like about what I have right now.   * Each column is the same width from array to array.    * The notation for row operations is consistent with the textbook that I am using.    * There is a clear break between steps.    * I don't have to do a huge amount of manual tuning.  However, there are also a few things that I would like to change.   * Having to use \\[3pt] instead of just \\ to make sure that the spacing is consistent, and fractions on adjacent lines do not crash into one another.    * In a long example (like the one below), the sequence of steps cannot break across a page, which causes the array to run off the bottom of the page unless I manually insert a break (which may mess up the consistent column widths).    * The hackish way in which the horizontal lines between matrices are obtained.    * I usually prefer to use brackets around my matrices.    * The right border is implemented in a very hackish way.  Any advice on how to implement these changes while maintaining the aspects that I like would be greatly appreciated. I am aware of the `gauss` package, but I'm not sure if I can use it to get things in the "like" list.               \documentclass{article}          \begin{document}          \[         \begin{array}{rr@{}|rrrrrrr|l}             & & 2 & 1 & 1 & 3 & 0 & 4 & 1             & \frac{1}{2} R_{1}             \\[3pt]             & & 4 & 2 & 4 & 4 & 1 & 5 & 5             \\[3pt]             & & 2 & 1 & 3 & 1 & 0 & 4 & 3             \\[3pt]             & & 6 & 3 & 4 & 8 & 1 & 9 & 5             \\[3pt]             & & 0 & 0 & 3 & -3 & 0 & 0 & 3             \\[3pt]             & & 8 & 4 & 2 & 14 & 1 & 13 & 3             \\ \\[-1em] \hline \\[-1em]             %%%%%%%%%%%%%%%%%%%%%%%%%             & & 1 & \frac{1}{2} & \frac{1}{2} & \frac{3}{2} & 0 & 2 & \frac{1}{2}             \\[3pt]             & & 4 & 2 & 4 & 4 & 1 & 5 & 5             & R_{2} - 4 R_{1}             \\[3pt]             & & 2 & 1 & 3 & 1 & 0 & 4 & 3             & R_{3} - 2 R_{1}             \\[3pt]             & & 6 & 3 & 4 & 8 & 1 & 9 & 5             & R_{4} - 6 R_{1}             \\[3pt]             & & 0 & 0 & 3 & -3 & 0 & 0 & 3             \\[3pt]             & & 8 & 4 & 2 & 14 & 1 & 13 & 3             & R_{6} - 8 R_{1}             \\ \\[-1em] \hline \\[-1em]             %%%%%%%%%%%%%%%%%%%%%%%%%             & & 1 & \frac{1}{2} & \frac{1}{2} & \frac{3}{2} & 0 & 2 & \frac{1}{2}             \\[3pt]             & & 0 & 0 & 2 & -2 & 1 & -3 & 3             & \frac{1}{2} R_{2}             \\[3pt]             & & 0 & 0 & 2 & -2 & 0 & 0 & 2             \\[3pt]             & & 0 & 0 & 1 & -1 & 1 & -3 & 2             \\[3pt]             & & 0 & 0 & 3 & -3 & 0 & 0 & 3             \\[3pt]             & & 0 & 0 & -2 & 2 & 1 & -3 & -1             \\ \\[-1em] \hline \\[-1em]             %%%%%%%%%%%%%%%%%%%%%%%%%             & & 1 & \frac{1}{2} & \frac{1}{2} & \frac{3}{2} & 0 & 2 & \frac{1}{2}             & R_{1} - \frac{1}{2} R_{2}             \\[3pt]             & & 0 & 0 & 1 & -1 & \frac{1}{2} & -\frac{3}{2} & \frac{3}{2}             \\[3pt]             & & 0 & 0 & 2 & -2 & 0 & 0 & 2             & R_{3} - 2 R_{2}             \\[3pt]             & & 0 & 0 & 1 & -1 & 1 & -3 & 2             & R_{4} - R_{2}             \\[3pt]             & & 0 & 0 & 3 & -3 & 0 & 0 & 3             & R_{5} - 3 R_{2}             \\[3pt]             & & 0 & 0 & -2 & 2 & 1 & -3 & -1             & R_{6} + 2 R_{2}             \\ \\[-1em] \hline \\[-1em]             %%%%%%%%%%%%%%%%%%%%%%%%%             & & 1 & \frac{1}{2} & 0 & 2 & -\frac{1}{4} & \frac{11}{4} & -\frac{1}{4}             \\[3pt]             & & 0 & 0 & 1 & -1 & \frac{1}{2} & -\frac{3}{2} & \frac{3}{2}             \\[3pt]             & & 0 & 0 & 0 & 0 & -1 & 3 & -1             & -R_{3}             \\[3pt]             & & 0 & 0 & 0 & 0 & \frac{1}{2} & -\frac{3}{2} & \frac{1}{2}             \\[3pt]             & & 0 & 0 & 0 & 0 & -\frac{3}{2} & \frac{9}{2} & -\frac{3}{2}             \\[3pt]             & & 0 & 0 & 0 & 0 & 2 & -6 & 2             \\ \\[-1em] \hline \\[-1em]             %%%%%%%%%%%%%%%%%%%%%%%%%             & & 1 & \frac{1}{2} & 0 & 2 & -\frac{1}{4} & \frac{11}{4} & -\frac{1}{4}             & R_{1} + \frac{1}{4} R_{3}             \\[3pt]             & & 0 & 0 & 1 & -1 & \frac{1}{2} & -\frac{3}{2} & \frac{3}{2}             & R_{2} - \frac{1}{2} R_{3}             \\[3pt]             & & 0 & 0 & 0 & 0 & 1 & -3 & 1             \\[3pt]             & & 0 & 0 & 0 & 0 & \frac{1}{2} & -\frac{3}{2} & \frac{1}{2}             & R_{4} - \frac{1}{2} R_{3}             \\[3pt]             & & 0 & 0 & 0 & 0 & -\frac{3}{2} & \frac{9}{2} & -\frac{3}{2}             & R_{5} + \frac{3}{2} R_{3}             \\[3pt]             & & 0 & 0 & 0 & 0 & 2 & -6 & 2             & R_{6} - 2 R_{3}             \\ \\[-1em] \hline \\[-1em]             %%%%%%%%%%%%%%%%%%%%%%%%%             & & 1 & \frac{1}{2} & 0 & 2 & 0 & 2 & 0             \\[3pt]             & & 0 & 0 & 1 & -1 & 0 & 0 & 1             \\[3pt]             & & 0 & 0 & 0 & 0 & 1 & -3 & 1             \\[3pt]             & & 0 & 0 & 0 & 0 & 0 & 0 & 0             \\[3pt]             & & 0 & 0 & 0 & 0 & 0 & 0 & 0             \\[3pt]             & & 0 & 0 & 0 & 0 & 0 & 0 & 0         \end{array}     \]          \end{document}


title: Disabling enumeration for a document

text: I'd like to disable enumeration for my document. I'm using `amsmath` and `breqn`. I tried using `\mathtoolsset{showonlyrefs=true}`, but it doesn't work.               \documentclass[a4paper,landscape]{article}     \usepackage{amsmath}     \usepackage{breqn}     \usepackage{mathtools}     \mathtoolsset{showonlyrefs=true}     \begin{document}     \begin{dmath}     Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P{(O \mid \lambda )} \sum_s \sum_m \sum_t             \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} \right| + \left(    \mathbf{o}_t - \hat{\mu}_m^{(s)} \right) ^T C_m^{(s)-1} \left(\mathbf{o}_t -   \hat{\mu}_m^{(s)}\right) \right)      \end{dmath}      \begin{dmath}     Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P{(O \mid \lambda )} \sum_s \sum_m \sum_t             \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} \right| + \left(    \mathbf{o}_t - \hat{\mu}_m^{(s)} \right) ^T C_m^{(s)-1} \left(\mathbf{o}_t -   \hat{\mu}_m^{(s)}\right) \right)      \end{dmath}      \end{document}      I could use `dmath*`, but this is inconvenient, since I'm writing a formula sheet.


title: longtabu: put running total of some columns under the header on each page

text: so, I have a longtabu table spanning several pages. The table has a header, that needs to be repeated on each page. Some of the columns are numerical amounts, and I would like to put a row presenting a running total at the top of each page, just below the header. So, I started off of what I found here: How to print subtotals in each page of a long table? and modified the code a little to be able to sum floating point numbers (the modification is in one of the answers to that question). Now, I figured out how to move the running total to the header, instead of the footer, of the page. Still, as I said, I need also the original header to show up at each page, before the running total. However, when I typeset the MWE that you can find below here, I see two problems in the generated PDF:   * The running total row is badly aligned   * after the end of the table, I get an additional page with just the header and the (badly aligned) running total, which is undesireable. I understand (I think!) the cause of the second problem, but cannot find a solution (it is probably beyond my understanding of longtabu's innards). As for the first problem, I can't figure it out. So, without further ado, here's the MWE:               \documentclass{article}          \usepackage{longtable}          \usepackage[textheight=9\baselineskip]{geometry}     \newcount\zzz     \def\foo{}     \def\zz#1{#1%     \global\advance\zzz#1\relax     \marks1 {\the\zzz}%     }     \marks1{0}          \newlength\yyy     \setlength{\yyy}{0pt}     \def\yy#1{#1     \global\addtolength{\yyy}{#1pt}\relax     \marks2 {\the\yyy}     }     \marks2{0}          \makeatletter         \def\LT@output{                 \global\advance\c@LT@chunks\@M                 \LT@bchunk                 \edef\tmp{\topmarks1 }                      \copy\LT@head\\                     running total: & \ifx\tmp\@empty\else \botmarks1 \fi& \ifx\tmp\@empty\else \strip@pt\dimexpr\botmarks2 \fi                 \LT@echunk                 \setbox\LT@head\box\z@                 \setbox\LT@foot\box\z@                 \LT@get@widths                 \global\advance\c@LT@chunks-\@M                     \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}%                     \@makecol                     \@outputpage                     \global\vsize\@colroom                 \copy\LT@head\nobreak             }            \makeatother          \begin{document}          \begin{longtable}{l|l|l}     Var&Val1&Val2 \endhead     xxxxxxxx&yyyyyyy&yyyyyy\\     xxxxzzzzzzzzzzzzzxx&yyyyyyy&yyyyyy\endfoot% not typeset but needs to be bigger than the foot that is used.     &&\endlastfoot     a & \zz{1} & \yy{0}\\     b & \zz{2} & \yy{0}\\     c & \zz{5} & \yy{0}\\     d & \zz{7} & \yy{0}\\     e & \zz{1} & \yy{0}\\     f & \zz{9} & \yy{0}\\     g & \zz{2} & \yy{0}\\     h & \zz{3} & \yy{0}\\     i & \zz{1} & \yy{1}\\     j & \zz{6} & \yy{6}\\     k & \zz{8} & \yy{8}\\     l & \zz{3} & \yy{3.2}\\     m & \zz{2} & \yy{2.67}\\     n & \zz{1} & \yy{1.1}\\     o & \zz{4} & \yy{4}\\     p & \zz{8} & \yy{8.05}\\     q & \zz{3} & \yy{3}     \end{longtable}          \end{document}      And here's a screenshot of the result: ![result](http://i.stack.imgur.com/dWANn.png) Thanks in advance for any help that might come. Regards!


title: Error with \framebox inside $$

text: I'm new to LaTeX, and I'm having an issue with using `\framebox` inside an equation (denoted with `$$` signs at the beginning and the end). The text that I'm trying to box is the following:               1.5 \times 10^{- 5} \; Pa      However, once I put a `\framebox` around it, like so:               \framebox{1.5 \times 10^{- 5} \; Pa}      I get the following error: > ./assignment1.tex:85: Missing $ inserted. ...where 85 points to the line where I put in the `\framebox`. Any ideas why this is happening?


title: What is the easiest way to mix document classes in the same PDF?

text: I would like a letter at the start of my report, but it would be a different document class. Could I use the same .tex file, with `\begin{document}\end{document}\begin{document}\end{document}`?


title: Cannot set local Tex path on ubuntu with "vanilla" TeX Live

text: Using manual installation of TeX Live on Ubuntu (i.e. not via repos) I cannot seem to get LaTeX to look through my local tex directory path. I've set TEXMFHOME using `sudo tlmgr conf texmf TEXMFHOME "~/.texlive2014"` and running `kpsewhich -var-value=TEXMFHOME` gives: "/home/angel/.texlive2014/". I also ran `texhash ~/.texlive2014/` and it produced a correct `ls-R` file. Under `~/.texlive2014/` I have several directories with BIB and STY files. Still, local packages and styles are not found when I try to compile documents. Needless to say, linking the required style files to the directory where the LaTeX doc is works. What am I missing here?


title: Two separate yet connected bibliographies in one document in LaTeX

text: I'm writing a thesis in LaTeX, and what I need is bibliography split into two separate parts: general citations and own citations (i.e. those positions I'm author/coauthor of). Those parts should have consistent numbering, so if general citations end with number 83, my first own position should start with 84. Also, I need to cite them freely all over the text as if they were in one bibliography. To sum up, I need something like this: General Citations:   * (1). Author1, Author2, "Paper 1", Journal 1   * (2). Author3, Author4, "Paper 2", Journal 2   * ...   * (N). Author2N-1, Author2N, "Paper N", Journal N [New page] Own citations:   * (N+1). Me, coauthor1, coauthor2, "My Paper1", JournalN+1   * (N+2). Me, coauthor3, coauthor4, "My Paper2", JournalN+2   * ... This is functionally, from citing point of view, one bibliography, but split visually to look like two separate ones. It would also be very cool, if numbering could be in cite order, but with numbers 1 to N reserved for general citations and N+1 up for own citations. Any ideas on how to approach this problem? If this is of any relevance, my bibliography is currently in a BibTeX "bib" file.


title: nomencl with units, nomgroups and longtable

text: I use nomencl with nomgroups and nomunit. The only way I achieved to properly align it is given in the picture. It was produced using the methods of the documentation. ![enter image description here](http://i.stack.imgur.com/gIv4G.png) The file.ist is standard, while tex-file looks like this:               \documentclass{scrartcl}     \usepackage{ifthen}     \usepackage[refpage,intoc]{nomencl}     \renewcommand{\nomname}{Abkürzungsverzeichnis}     \makenomenclature     %Pagenumber in nomenclature     \renewcommand{\pagedeclaration}[1]{{\hfill #1}}     \renewcommand{\nompostamble}{}%     \newcommand{\nomunit}[1]{%      \renewcommand{\nomentryend}{[\parbox{.08\textwidth}{\centering $#1$}]}}          \newlength{\nomentrywidth}     \setlength{\nomentrywidth}{.76\textwidth}     \renewcommand{\nomgroup}[1]     {%         \ifthenelse{\equal{#1}{X}}         {\vspace{2em}\item[]\hspace*{-\leftmargin}%         \hfill \textbf{Abkürzungen} \hfill \hbox{}}         {%             \ifthenelse{\equal{#1}{A}}             {\vspace{2em}\item[]\hspace*{-\leftmargin}%             \hfill \textbf{Physikalische Größen} \hfill \hbox{}}             {%                 \ifthenelse{\equal{#1}{R}}                 {\vspace{2em}\item[]\hspace*{-\leftmargin}%                 \hfill \textbf{Regelungstechnik} \hfill \hbox{}}                 {%                 \ifthenelse{\equal{#1}{XX}}                 {\vspace{2em}\item[]\hspace*{-\leftmargin}%                 \hfill \textbf{Schriftauszeichnungen} \hfill \hbox{}}                 }             }         }     }     \begin{document}          \markright{Abkürzungsverzeichnis}     \printnomenclature[1.5cm]     \nomenclature[A]{$Re$}{Reynoldszahl\nomunit{-}}%     \nomenclature[R]{$\rho_L$}{Dichte der Luft\nomunit{\frac{kg}{m^3}}}%     \nomenclature[X]{$\eta_L$}{Dynamische Viskosität der Luft\nomunit{\frac{kg}{m \cdot s}}}%     \nomenclature[X]{$\eta_L$}{asdf\nomunit{\frac{kg}{m \cdot s}}}%     \end{document}     %% EOF      Unfortunately the page number is before the unit. (Note the `[refpage,intoc]`, which may be removed.) Can someone give a complete solution either the normal way or with a longtable and explain how I can manipulate the column ordering.


title: How can we correctly implement a list of two (calculated) variables?

text: I want to use `foreach` to loop through two variables at the same time, in Tikz. I'd like to go through the variable `\y` from 0 to 7. At the same time, I'd like to go through `\yy` from 0 to 14, by increments of 2. I'd like to know how to do this without writing out the entire list. For example, the following code works:                \foreach \y / \yy in {0/0, 1/2, 2/4, 3/6, 4/8, 5/10, 6/12, 7/14}        \node at (0,\y) {\y -- \yy};      But I can't seem to get this code to work:                \foreach \y / \yy in {0/0, 1/2, ..., 7/14}        \node at (0,\y) {\y -- \yy};      I'm planning on using **LOTS** of loops like this, so I'm really trying to figure out how to get a double loop with the dots to work. Any suggestions?


title: How to manage long title with progressbar

text: I'm using `progressbar`. I need some help to manage my "too long title". The usual commands `\title [short title] {long title}` doesn't work. I'm looking for any way to use a short title in the footnotes or to completely erase it from the footnotes. I will appreciate the help.


title: Place coordinates halfway (or 75%, etc) up the plot

text: I am using this macro               \newcommand{\ymax}[0]{\pgfkeysvalueof{/pgfplots/ymax}}      to do stuff like the following:               \draw[dashed] (axis cs:4, \ymin) -- (axis cs:4, \ymax);      and this works fine. However, if I want to do something like `\ymax / 2` or `0.5 * \ymax`, this doesn't work. I get the error, "Could not parse input ' 0.5 * 1.09763666e6' as a floating point number, sorry." Do I need to use something like `\pgfmathparse`? What is the correct way to do arithmetic on this value? When I change the expression to               \draw[dashed] (axis cs:4, \ymin) -- (axis cs:4, \pgfmathparse{0.5*\ymax});      then my TeX Live freezes and I have to `^C` out. # MWE               \documentclass{article}          \usepackage{pgfplots}     \pgfplotsset{compat=1.8}          \begin{document}          \begin{tikzpicture}     \begin{axis}[enlargelimits=false]          \newcommand{\getpgfkey}[1]{\pgfkeysvalueof{/pgfplots/#1}}     \newcommand{\ymax}[0]{\getpgfkey{ymax}}     \newcommand{\ymin}[0]{\getpgfkey{ymin}}          \addplot [smooth, domain=0:6] (x, x); % to generate an axis cs          % this works fine     \draw[dashed] (axis cs:2, \ymin) -- (axis cs:2, \ymax);          % none of these work     %\draw[dashed] (axis cs:4, \ymin) -- (axis cs:4, \ymax / 2);     %\draw[dashed] (axis cs:4, \ymin) -- (axis cs:4, (\ymax / 2));     %\draw[dashed] (axis cs:4, \ymin) -- (axis cs:4, ({\ymax / 2}));     %\draw[dashed] (axis cs:4, \ymin) -- (axis cs:4, {(\ymax / 2)});     %\draw[dashed] (axis cs:4, \ymin) -- (axis cs:4, (0.5*\ymax));     %\draw[dashed] (axis cs:4, \ymin) -- (axis cs:4, (0.5*{\ymax}));     %\draw[dashed] (axis cs:4, \ymin) -- (axis cs:4, {0.5*(\ymax});          \end{axis}     \end{tikzpicture}          \end{document}      The error I get is:               ! Package PGF Math Error: Could not parse input ' {0.5*6.0e0}' as a floating po     int number, sorry. The unreadable part was near '*6.0e0'..          See the PGF Math package documentation for explanation.     Type  H <return>  for immediate help.


title: \graphicspath{<filepath>} Yielding Strange Errors

text: I am trying to use `\graphicspath` properly, and am having some issues. I am using MikTex 2.9 64-bit on a Lenovo X230. Here is my code:               \documentclass[12pt,letterpaper]{article}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \author{Jeffrey Wubbenhorst}     \title{math Sandbox}     \begin{document}     \begin{figure}[ht!]     \begin{center}     \includegraphics[scale=0.75]{Disposables/idiot.jpg}     \graphicspath{{C:/Users/chire001/Documents/Jeffrey Files/School/Software/LaTeX/Disposables/idiot.jpg/}}        \caption{A simple caption}     \end{center}     \label{overflow}     \end{figure}     \end{document}      One of the most crytpic errors I am getting is below:               ! Package pdftex.def Error: File `Disposables/idiot.jpg' not found.      Another error:               ! Package pdftex.def Error: File `Disposables/idiot.jpg' not found.See the pdftex.def package documentation for explanation.Type H <return> for immediate help.... ...raphics[scale=0.75]{Disposables/idiot.jpg}      I hope this is not a duplicate- at the risk of writing an excelssively long post, here is another piece of code that didn't work. I had some conflicting documentation on the usage of `\graphicspath`, and wanted to try and sort everything out.               \documentclass[12pt,letterpaper]{article}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \author{Jeffrey Wubbenhorst}     \title{math Sandbox}     \begin{document}     \begin{equation}     \delta+y \\     Cowbell     \end{equation}     \begin{figure}[ht!]     \begin{center}     \includegraphics[scale=0.75]{Disposables/idiot.jpg}          \graphicspath{{C:/}{Users/}{chire001/}{Documents/}{Jeffrey Files/School/}{Software/}{LaTeX/}{Disposables/}{idiot.jpg/}}     \caption{A simple caption}     \end{center}     \label{overflow}     \end{figure}     \end{document}      This yielded `! Package pdftex.def Error: File`Disposables/idiot.jpg' not found.See the pdftex.def package documentation for explanation.Type H for immediate help.... ...raphics[scale=0.75]{Disposables/idiot.jpg}' My apologies for my ignorance. Best regards, ~Q0rk


title: Problems with footer and header and pagenumbering

text: My problem is, that all my footers and headers are gone now :( and the pagenumber. Here the code:               \documentclass{article}     \pagestyle{empty}% for cropping     \usepackage{microtype}     \begin{document}     \begingroup         \noindent         \bfseries         \begin{tabular}{|p{\dimexpr0.5\textwidth-2\tabcolsep}p{\dimexpr0.5\textwidth-2\tabcolsep}|}             \hline             Received:            & Approved:  \cr                                  & Date:      \cr                                  & Signature: \cr             (for the instructor) &            \cr             \hline         \end{tabular}     \endgroup     \bigskip     \begingroup         \centering         \obeylines         \scshape         \lsstyle         \large Modern Box         \LARGE Aflering 3         \Large John Boxer         \large Institute for Boxes         \large Box University         \large 26/04/2014     \endgroup     \end{document}      I have also usepackages for headers and fooders in my preamble. The fooder and header worked before, but now they are gone. It's good they are gone on the first page. And that the pagenumbering is gone on the front page and on the tableofcontents page is really nice. But now I would prefer pagenumbering (so the pagenumbering starts on maybe page 3 width "page 3 of number"). And please just in the "page ... of ... style". Are my ideas possible? Are their anyone who can help me?


title: Apply columns to sections without explicitly bracketing each section

text: # Background Creating a document that can have zero-, two-, or three-column layouts, depending on user preferences. I would like to keep the content clean of `\columnsets` by redefining only the sections (both section and chapter pages have independent styles). For example, this produces the desired outcome, but requires duplicating the `\startcolumnset` for each `\startsection`, which I'd like to avoid:               \definecolumnset[StyleColumns][n=2,       %rule=on,     ]          \startsection[title={Section1},reference=sec:section1,]       \startcolumnset[StyleColumns]         \placefigure[left]{}{%         \externalfigure[7b104cc5c6.jpg][width=\textwidth]}              This is a sentence that is really, really, really and very long.       \stopcolumnset     \stopsection          \startsection[title={Section2},reference=sec:section2,]       \startcolumnset[StyleColumns]         \placefigure[left]{}{%         \externalfigure[7b104cc5c6.jpg][width=\textwidth]}              This is a sentence that is really, really, really and very long.       \stopcolumnset     \stopsection      (The vertical rules don't work for me yet, but that's a separate issue.) # Problem There are potentially hundreds of sections in the book that gets automatically generated. I would like to define whether or not multiple columns are used outside of the main content in a single location within the document (i.e., before the first `\startbodymatter`). Forgiving my accent, I would like to do something such as:               % <CODE BLOCK>     \let\OldSection\section     \define\section{%       \startsection         \startcolumnset[StyleColumns]           \OldSection         \stopcolumnset       \stopsection     % </CODE BLOCK>          \startsection[title={Section1},reference=sec:section1,]       \placefigure[left]{}{%       \externalfigure[7b104cc5c6.jpg][width=\textwidth]}       This is a sentence that is really, really, really and very long.     \stopsection          \startsection[title={Section2},reference=sec:section2,]       \placefigure[left]{}{%       \externalfigure[7b104cc5c6.jpg][width=\textwidth]}       This is a sentence that is really, really, really and very long.     \stopsection      That way when the document is generated, if the `<CODE BLOCK>` is not included then the document won't use multiple columns. # Alternative Approach I considered using conditional modes, but that would lead to either messy or duplicated content. # Question How do you create a document using ConTeXt such that the `\startsection`...`\stopsection` code blocks can be made columnar without actually embedding `\startcolumnset[X]`...`\stopcolumnset` within each section's code block? # Related   * http://wiki.contextgarden.net/Columns   * http://www.pragma-ade.com/general/manuals/columns.pdf


title: Incorrect reference

text: When I type `\ref{name}` giving the link is on the wrong page. How do I fix this?               \documentclass[a4paper]{book}     \usepackage[utf8]{inputenc}     \usepackage{hyperref}     \usepackage{theorem}          \newtheorem{teo}{Teorema}[chapter]     \begin{document}     \begin{teo}\label{tvi}     text     \end{teo}     ... %insert various \newpage     \ref{tvi}     \end{document}      Returns incorrect page.


Here's TeX's line-breaking approach (as I understand it) in a nutshell:   1. If `\pretolerance` is positive, try to break a paragraph into lines without inserting discretionary hyphens and without exceeding a badness of `\pretolerance`.   2. If method 1 fails, allow hyphenation and try not to exceed a badness of `\tolerance`.   3. If method 2 fails and `\emergencystretch` is positive, try again with the amount of "tolerable" white space per text line increased by `\emergencystretch`. On p. 96 of the _TeXbook_ , Knuth reports experiments showing that _"the first pass [without hyphenation] succeeds more than 90% of the time"_ for "fairly wide" lines, but fails quickly for "very narrow" ones. He also states that the first pass is done _"[i]n order to save time"_. My interpretation of this is as follows:   * For cases where line-breaking without hyphenation fails, one would in fact save time by _omitting_ the first pass (i.e., setting `\pretolerance=-1`).   * It is also possible (though maybe not very likely for languages with a small average word length) that the first pass will succeed, but that allowing hyphenation would have resulted in a solution with smaller badness.   * As Knuth nevertheless chose a default value of `100` for `\pretolerance`, he must have regarded the net time savings from "trying without hyphenation" as worthwile, _given the average processing power of the time when he adopted these settings_. I don't know if the default settings for TeX's line-breaking algorithm changed over time. But isn't it possible that formerly substantial net time savings are irrelevant today? So: Is it still worthwhile to let TeX try line-breaking without hyphenation? Or is it preferable by now to adopt `\pretolerance=-1` as default setting?


title: Highlight smallest number in table

text: I would like to highlight the smallest number in each row. How would I go about doing this. In the following for example, would like to highlight 3 and 3.               \documentclass{article}     \usepackage{datatool}          \begin{filecontents*}{test2.csv}         Fruits, Adam, steve         apples, 17, 3         oranges, 3, 18      \end{filecontents*}          \DTLloaddb{mydata2}{test2.csv}          \begin{document}          \begin{tabular}{ll}     \bfseries Adam & \bfseries Steve & \bfseries Fruits%     \DTLforeach{mydata2}{\Adam=Adam,\Steve=Steve, \Fruits=Fruits}%     {%     \\\Fruits & \Adam & \Steve     }%     \end{tabular}          \end{document}


title: Reducing the title spacing

text: I use LyX. When I use the "Title" environment under article(hebrew), it uses very big spacings between it and the rest of the document. How do I control the spacing and make it use a compact title so my resume will all fit in one page?


title: Section headers in margins

text: I'm working on my resume in LyX and I would like my section headers to look like this. What should I write in the preamble to achieve this?


title: How to use the chronology.sty package?

text: Can anyone explain how to use chronology.sty or provide a link to some live (useful) documentation? In more detail: I am creating an outline and timetable schedule for my academic thesis. I started with How to create a timeline with LaTeX? and I have found that chronology.sty by Levi Wiseman produces something very close to my desired output but the documentation that should be found at http://tug.org/texlive/Contents/live/texmf- dist/doc/latex/chronology/chronology.pdf is no longer live. I have examined the chronology.sty file to the best of my ability and deduce that argument #1 = stepsize, #2 = yearstart, #3 = yearstop, #4 = unit and #5 = timelinewidth. However I can't seem to get my timeline to behave as desired. I would like my timeline period to be 18 months Mid-2013 to End-2014, with large dividers every month and small dividers every week. My "events" will require the \decimaldate precision. I am aware that the package may have some bugs see link http://tex.stackexchange.com/questions/109382/chronology-adds- arbitrary-gaps. I will email this request to Levi Wiseman.


title: How to make a section header span the whole page in a twocolumn document

text: I am writing a book in twocolumn format. Section headers appear in their respective column, and for most of the book, that is fine for me. But for a specific chapter of the book, I would prefer the section header to span _both_ columns. Only the section header, not the subsection headers, and only in that specific chapter of the book. Is there a way to achieve this?


title: How to avoid header and footer on first page?

text: > **Possible Duplicate:**   >  Suppress Fancy header and footer on first page only. I'm using header and footer but I want to avoid on very first page since it is title page. How can i implement it?


title: Removing Footer from First Page

text: I'm using the following commands to produce a header and footer on all of the pages of my homework assignment:               \usepackage{fancyhdr}     \pagestyle{fancy}     \lhead{Math 185 Spring 2014}     \chead{Problem Set 3}     \rhead{Jacob Kent}     \renewcommand{\headrulewidth}{0.25pt}     \renewcommand{\footrulewidth}{0.25pt}      How would I remove the header/footer from just the first page of my document? I want it to be on all of the other pages, just not the first one.


title: Padding left, top, right and bottom in LaTeX

text: I want to include the **Padding left, top, right and bottom**. How can we do in LaTeX?


title: movie15 package and playing time information in a pdf-embeded video

text: I am working with the beamer class and using the movie15 package to embed videos into a pdf document. I notice that when I includde mp4-format videos the embedded player does not include run time information (i.e., a counter/timer like you typically would have on a DVD player which shows you where you are within a given video with respect to time). When I embed a wmv-format video file, this player does include time information in the space above the player controls and below the video images. I could just reformat my mp4 clips into wmv, but I prefer the look of the player as it appears in the mp4 format. Is there a way of getting the mp4-format player to include a timer which shows the passage of time while the video is running? I don't really care whether the time information were to appear outside the video images as part of the player or, on the other hand, superimposed upon the actual video frames. I consulted Alexander Grahn's movie15 documentation to no avail. Here are the specifics of my tex document (MiKTeX 2.8, TeXnicCenter):               \documentclass{beamer}     \usepackage[american]{babel}     \usepackage[latin1]{inputenc}     \usepackage{hyperref}     \usepackage{booktabs}     \usepackage{wrapfig}     \usepackage{hanging}     \usepackage{ragged2e}     \usepackage{color}     \usepackage{movie15}          \usetheme{Berkeley}     \title[\textit{Teaching ...}]{Ballrooms and Buses ...}     \author[...]{...}     \institute{...}     \date{July 8, 2011}          \DeclareGraphicsRule{.tif}{png}{.jpg}{.bmp}          \usepackage{url}     \usepackage[]{breakurl}     \urlstyle{same}          \begin{document}          %lots of sections and frames, among these:          \section{Mink-Wearing ...}          \begin{frame}{...}          \begin{figure}[ht]     \includemovie[toolbar,autoclose,poster,text={\includegraphics[width=9.1cm, height=4.8cm]{HMspeech.png}}]{9.1cm}{4.8cm}{HMspeech.mp4}          \caption{... Acceptance Speech}          \end{figure}          \end{frame}          %more sections and frames leading up to:          \section[Dance]{Dance: ...}          \begin{frame}{... and Dance}          \begin{figure}[ht]     \includemovie[toolbar,autoclose,poster]{5.04cm}{4.32cm}{rumba.wmv}          \vspace{20pt}          \caption{... Rumba (2003)}          \end{figure}          \end{frame}          %more sections and frames          \end{document}      Should anyone have taken time to read my question: Thank you!


title: tex4ht: hyperlink page numbers in the index

text: This question was already answered by Radhakrishnan in an older post   How do I preserve hyperreferences in the index when converting text from LaTex to HTML, but I'm not able to get his solution to work. The .idx and .ind files are successfully generated. However, executing the following command in the dos console `tex '\def\filename{{test}{idx}{4dx}{ind}} \input idxmake.4ht'` gives me the error message > This is TeX, Version 3.1415926 (MiKTeX 2.9 64-bit)   >  ! I can't find file `''.   >   >  \def   >  <*> '\def   >  \filename{{test}{idx}{4dx}{ind}} \input idxmake.4ht'   >  Please type another input file name:   > Did I forget something? Any pointers to the cause of the problem would be appreciated.


title: How to define a command that could generate similar environments just as \newtheorem does?

text: It's well known that the LaTeX built-in command `\newtheorem` could generate a series of the theorem environments that are similar: they share the same theme of layout style but differ in their name and counter style etc. I defined a colored text box, which is used to output a fancy style of class note, using Ti*k*Z recently. Although the specific style satisfied me myself, it also brought me some kind of inconvenience. Since I want to put definition, lemma, and conclusion, for example, into different but similar styles, I have to define such environments one by one, by using over ten lines of code. MWE is here:               \documentclass{book}     \usepackage{tikz}     \usepackage{xcolor}     \usepackage{environ}     \usepackage{amsmath,mathrsfs,amsfonts}          \usetikzlibrary{shapes,decorations}     \definecolor{bule}{RGB}{18,29,57}     \definecolor{bablue}{RGB}{248,248,248}     \definecolor{main}{RGB}{127,191,51}     \definecolor{seco}{RGB}{0,145,215}     \definecolor{thid}{RGB}{180,27,131}          %define the style of tikz newthemsty     \tikzstyle{newthemsty}                =[draw=seco, fill=blue!10,very thick,rectangle,                rounded corners, inner sep=10pt, inner ysep=20pt]     \tikzstyle{newthemstytitle}               =[fill=seco, text=blue!10]          %%define the "newthem" environment     \newcounter{Newthem}[chapter]     \renewcommand{\theNewthem}{\thechapter.\arabic{Newthem}}     \NewEnviron{newthem}[1][{}]{%     \noindent\centering     \begin{tikzpicture}     \node[newthemsty] (box){          \begin{minipage}{0.93\columnwidth}             \sffamily\BODY          \end{minipage}};     \node[newthemstytitle,right=10pt] at (box.north west){          \bfseries\textsf{Theorem \stepcounter{Newthem}\theNewthem\; #1}};     \node[newthemstytitle, rounded corners] at (box.east) {$\clubsuit$};     \end{tikzpicture}     }[\par\vspace{.5\baselineskip}]          \begin{document}          \begin{newthem}         test     \end{newthem}          \end{document}      And its output: > ![enter image description here](http://i.stack.imgur.com/zHk1v.png) If I want a command that could define such an environment and I'm able to modify the color (of background and the edge), the font shape(italic or upright) and series(bold or not), the name in the label (say 'theorem' here) and the counter (within or without another counter), what should I do? Any clues or hints would be appreciated.


title: Is there an Autocorrect feature in TeXStudio 2.6.2?

text: I was wondering if there's an **Autocorrect** feature in TexStudio 2.6.2 that works like in MS Word so that if I have to type a certain word many times, the editor writes it for me as soon as I press spacebar after I finish typing the shortcut for that particular word. (Eg. phl --> photolithography) I've already searched StackExchange for similar questions and read Qrrbrbirlbel's comment  here. I've tried my hand at the Macros but it's not working properly, maybe some bug that needs TeXStudio to re-start for it take action or maybe I simply don't know how to make it work. Can someone help me, please?


title: How to use a large number of arbitrary rgb colors in a TikZ image?

text: I have a document with some TikZ images in it, which are automatically generated from a program I have written. All images are fairly similar, and each of them contains of a large number of squares with different, arbitrary rgb colors. My question is: **What is the best way of coloring all this large number of squares?** The method I have used so far consists of defining the color `fillcolor` by using the macro `\definecolor`, before drawing each square, and of using that color to fill the square. That means that each time I'm drawing a new square, I'm defining `fillcolor` again. However, I'm not so sure that is the way to do it. pdflatex seems to require very much memory when compiling the document, and, for some strange reason, runs out of memory if I include more than 5 of the images (even if I increase the amount of memory tenfold when going from 5 to 6 images). Is there any chance that it stores all the colors I have defined, and that I need to make pdflatex "forget" about `fillcolor` before calling `\definecolor` again? **Update:** Below is an example of one of the TikZ images I want in my document (it's a vizualization of the phase fraction field in a two-phase fluid simulation using the finite volume method and the volume of fluid method, and yes, I know, the fluid interface isn't exactly crisp): ![TikZ image containing 1990 squares in different colors](http://i.stack.imgur.com/Kuq4o.png) This particular image consists of 1990 filled squares and 4 unfilled squares. First, for each square, `fillcolor` is defined with `\definecolor`, and the square is filled with that color:               \definecolor{fillcolor}{rgb}{1.000000,0.241735,0.000000}     \fill[fillcolor] (0.203125,0.578125) rectangle (0.218750,0.593750);      Then the sides of each square is drawn, for example               \draw (0.203125,0.578125) rectangle (0.218750,0.593750);


title: How to emphasize with in a listing an identifier containing a digit?

text: I have this LaTeX code that I want to typeset using listings:               \documentclass[paper=a4,fontsize=12pt,version=last]{scrlttr2}      I want to emphasize "scrlttr2" with a different format. How can it be done with listings?


title: BibTex: Easy way to drop article titles from references?

text: I would like to generate a bibliography for a grant application with a minimal structure. Ideally, something like `science.bst` i.e. omitting the article title. > A. N. Clarkson, B. S. Huang, S. E. Macisaac, I. Mody, S. T. Carmichael, > _Nature_ **468** , 305 (2010). However, I would prefer to have the authors and year structured like `apalike.bst`. > Clarkson, A. N., Huang, B. S., Macisaac, S. E., Mody, I., and Carmichael, S. > T. (2010).Reducing excessive GABA-mediated tonic inhibition promotes > functional recovery after stroke. _Nature_ , 468:305–9. Is there a way to easily force `apalike.bst` to drop article titles or have `science.bst` reverse the author/initials and move the year?


title: Parenthetical Errors

text: \documentclass{article}          \begin{document}          8.) Now calculate the logarithm of the $n$th term in the sequence, i.e. log($a_{n}$). \indent Use the series representation of the logarithm     \\     \\ \indent \indent log(1 + $x$) = - $   \sum\limits_{k=1}^{\infty}$ $ \frac {(-1)^{k}}{k} x^{k} $,      \\     \\ \indent \indent to simplify the answer. What do you conclude?     \\      \\ \indent \indent log((1 + $\frac{1}{n})^{n}}$)      \\      \\ \indent \indent \indent \indent  = n $\cdot$ log(1 + $\frac{1}{n}$)      \\     \\ \indent \indent \indent \indent = n $\cdot$ ( - $ \sum\limits_{k=1}^{\infty}$ $ \frac{(-1)^{k}}{k} (\frac{1}{n})^{k}$)      \\     \\ \indent \indent \indent \indent = -n $\cdot$ ($ \sum\limits_{k=1}^{\infty}$ $  \frac{(-1)^{k}}{k} (\frac{1}{n}^{k}})$     \\     \\ \indent \indent \indent \indent = -n [ $\{$$ \frac{(-1)^{1}}{1} \cdot \frac{1}{n^{1}}$$\}$$_{n=1} $ + {$ \frac{(-1)^{2}}{2} \cdot \frac{1}{n^{2}}$\}_{n=1} + \{$\frac{(-1)^{3}}{3}$ $\cdot$ $\frac {1}{n^{3}}$\}$_{n=1}$ + \indent \indent \indent \indent ...]     \\     \\ \indent \indent \indent \indent = -n $ \cdot$ [\{- $\frac{1}{n}$\}_{n=1} + \{ $\frac{1}{2n^{2}}$\} _{n=1} + \{$\frac{(-1)} {3n^{3}}$\}_{n=1} + ... \: ]     \\      \\ \indent \indent \indent \indent = - n $\sum\limits_{k=1}^{\infty} \frac{(-1)^{k}}{k} \frac{1}{n}^{k}$     \\     \\ \indent \indent \indent \indent = -$\sum\limits_{k=1}^{\infty} \frac{(-1)^{k}}{k} \frac{1}{n}^{k-1}$      \\     \\ \indent \indent \indent \indent = -[\{$\frac{(-1)}{1} \cdot \frac{1}{1}$\}_{n=1} + \{ $\frac{(-1)^{2}} {2}$ $\cdot$ $\frac{1}{n}$\}_{n=1} + \{ $\frac{(-1}^{3}}{3} \cdot \frac{1}{n^{2}}$ \}_{n=1} + ... ]     \\     \\ \indent \indent \indent \indent -[\{-1\}_{n=1} + \{ $\frac{1}{2n}$ $\}$_{n=1} + \{ $\frac{-1}{3n^2}}$ \}_{n=1} + ... ]


title: Re-use code like figures and paragraphs in other documents

text: I was wondering if there is a way in which I can reuse the code, for example one figure, that is written in one file into another file. I want to use something similar to `xr` package that allows you to reuse the labels references from one file into another. But I want to use it in the figures code or in entire paragraphs. To illustrate what I need to do lets assume I have a file A.tex in which I already define a figure. And I have another file B.tex. And now I want to use the same definition of the figure in B. However, I want to "link" to the figure code in A; because if I do some change in A, I don't have to copy and paste everything in B again. Also, I want to do this with paragraphs. It is kind of quoting the previous file. Is it possible using LaTeX? What do you suggest me to do? **Edit:** I need to do this "copy & paste" to include text and figures from the main document, into a second one. This references should have the same number of figures, and same bibliography reference, etc. That's why I say that I need something similar to `xr` package. I tried using `\include` and `\input` to see if it was readable. However, I run into another problem. The number of figures and references are not maintained in the second document. The `\include` creates new numbers for each document. But I need to maintain the same as the original document. Is there a way to do this "copy & paste" automatically?


title: Difference between control space and non-breaking space

text: In my answer to How can I get following layout? I've used non-breaking spaces `~` (ties) to align monospaced text. Actually I rather meant control spaces `\ `, but they're less convenient to type (and read), and line breaks were not of interest anyway. Some experiments concerning line breaking are documented in the code below. **Question** : Besides their line-breaking behaviour, is there any difference between `\ ` and `~`? In particular, do (or may) they _by nature_ have a different width?               \documentclass{article}     \usepackage{lipsum}     \usepackage{parskip}          \begin{document}          \lipsum[75]          %non-breaking space     lorem lorem lorem lorem lorem lorem lorem lorem lorem      lorem lorem lo~lo~lo~lo~lo~lo~lo~lo~ip~ip~ip~sum sum sum sum sum sum sum sum sum          lorem lorem lorem lorem lorem lorem lorem lorem lorem      lorem lorem lo~lo~lo~lo~lo~ %input line break doesn't affect non-breaking space     lo~lo~lo~ip~ip~ip~sum sum sum sum sum sum sum sum sum          lorem lorem lorem lorem lorem lorem lorem lorem lorem      lorem lorem lo~lo~lo~lo~lo  %breaks at input line break     lo~lo~lo~ip~ip~ip~sum sum sum sum sum sum sum sum sum          %breaks at protected space     lorem lorem lorem lorem lorem lorem lorem lorem lorem      lorem lorem lo~lo~lo~lo~lo\ lo~lo~lo~ip~ip~ip~sum sum sum sum sum sum sum sum sum          \end{document}      ![enter image description here](http://i.stack.imgur.com/x7fiT.png)


title: Package hyperref Error: Wrong driver option `pdftex' when using mk4ht

text: I am trying to convert TeX, made using `moderncv`, to `.doc` format. I am trying to use the following 2 commands               pdflatex filename.tex     mk4ht oolatex filename.tex      But I'm getting the following error               ! Package hyperref Error: Wrong driver option `pdftex',     (hyperref)                because pdfTeX in PDF mode is not detected.          See the hyperref package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.3905 \ProcessKeyvalOptions{Hyp}      How can I fix the problem? If it is not possible is there any alternate way to convert TeX to `.doc`?


title: Parentheses changing size depending on what's in them?

text: Very simple problem, but very confusing. When I type               \left( \frac{\partial f}{\partial x }  \right)^2      I get smaller parentheses but when I type the **same thing** but with y instead of x, i.e.               \left( \frac{\partial f}{\partial y }  \right)^2      I get larger ones... what's up with that? Is it a known problem or do I have to supply more information? **UPDATE (after reading some comments)** : This difference isn't present if the expression is written by itself, but only if it's in the denominator, i.e. when I write               \frac{...something...} { \left( \frac{\partial f}{\partial x }  \right)^2 + \left( \frac{\partial f}{\partial y}  \right)^2}      I get parentheses of different size!


title: Alternating row color two at a time in tables

text: How can I achieve alternating row colors in tables for two rows at a time? So two rows should have the same color, then two other rows, and so on. In the following example               Bla1 & reference1 \\     & Description1 \\       should have one color and               Bla2 & reference2 \\     & Description2 \\      should have another. Then start alternating again. How can this be achieved?               \documentclass[a4paper]{scrartcl}     \usepackage[english]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[table]{xcolor}          \begin{document}          \section{Section}        \begin{tabular}{lp{10cm}}         \hline         \textbf{Col 1} & \textbf{Col 2} \\ \hline         Bla1 & reference1 \\         & Description1 \\          Bla2 & reference2 \\         & Description2 \\ \hline     \end{tabular}     \end{document}      Gonzalo Medina's solution works fine, however if one uses the `glossaries` package the acronyms table will have row colors as well. How could I prevent the acronyms table to have this behavior?


title: Drawing linked trees

text: I got great help earlier defining a tree using `forest` (thanks again to cfr!). I would like to be able to break down a tree into subtrees and draw links between them... either in the same forest or separated forests. Pictures will be more understable... **FROM :** ![initial](http://www.weboplanet.com/tests/calculerAire2disques.pdf.png) **TO something like :** ![something like that](http://www.weboplanet.com/tests/calculerAire2disques.pdf_wish.png) I tried using "phantom" node as root, but subtrees keep on the same line : ![something like that](http://www.weboplanet.com/tests/calculerAire2disques_wish_resultat.pdf.png) **Source code :**               \documentclass{standalone}     \usepackage[latin1]{inputenc}     \usepackage{forest}     \usetikzlibrary{shapes.geometric}     \begin{document}     \pgfkeys{/forest,       decision/.append style={diamond, fill=blue!20, text width=5em, inner sep=.5pt, rounded corners},       io/.append style={trapezium, trapezium left angle=70,trapezium right angle=-70, minimum height=5mm},       sequence/.append style={fill=red!20, rounded corners},       nop/.append style={fill=red!5},       rotor/.append style={inner sep=3pt,outer sep=0,fill opacity=0.3,minimum width=2cm,circle},       racine/.append style={minimum width=1cm, fill=white!80,circle,             tikz={                 \draw [circle,draw,line width=0.5pt] ;                 \draw [->,line width=1pt] () ++(160:4mm) arc (-200:40:4mm);}             }         }          \begin{forest}for tree={       child anchor=north,       parent anchor=south,       thick,       draw,      align=center,       font=\sffamily\large,      }     [,phantom     [{Principal\\\hline \mbox{}\\[-1em]reel r1, r2, aire2, PI\\reel aire1, aire\\}          [seq, racine             [initialisation, name=initSrc,sequence             ]              [Traitement, name=trtSrc,sequence             ]              [Resultat, name=resSrc,sequence             ]         ]     ]         [initialisation, name=initDest,sequence             [{ECRIRE "rayon du disque extérieur ?"}, io]             [{r1$\leftarrow$ LIRE()}, io]             [{ECRIRE "rayon du disque interieur ?"}, io]             [{r2$\leftarrow$ LIRE()}, io]         ]          [Traitement, name=trtDest,sequence             [{aire1$\leftarrow$ PI*r1*r1} ]             [{aire2$\leftarrow$ PI*r2*r2} ]             [{aire$\leftarrow$ r1-r2} ]         ]          [Resultat, name=resDest,sequence             [{ECRIRE "l'aire vaut ",aire}, io]         ]     ]     \draw[->] (initSrc) to[out=north east,in=south] (initDest);     \draw[->] (trtSrc) to[out=north east,in=south] (trtDest);     \draw[->] (resSrc) to[out=north east,in=south] (resDest);     \end{forest}     \end{document}      Many thanks for your help !


title: Cramping up overset and underset

text: When typesetting inline equations, I used to force display style to get limits below, because I deemed the inline style with sub/superscript limits to be absolutely appalling, which I still do, and because I was totally unaware of the `\limits` command. Right now, I still do that because it enlarges symbols like `\sum`, making them look better. However, it has been pointed out to me that this distorts line spacing, and I've come to agree the effect is almost as bad-looking as the inline style. An example I'm dealing with right now is the following, with a `\bigoplus`: ![enter image description here](http://i.stack.imgur.com/7d5XI.png) So my idea has been to use `\underset`, reduce the size of the limits by `\scriptscriptstyle` and then raise it, so as to cramp it up with the `\oplus` as much as I can without getting too much "side effect" from the cramping. With the code:               Va bene. Per quanto riguarda il viceversa, è chiaro\vsp{-8.5pt} che se     $M\simeq\!\!\!\raisebox{3pt}{$\underset{\raisebox{6pt}{\scb{0.9}[0.9]{$\ssst t\text{ volte}$}}}{\raisebox{-2pt}{$\bigoplus$}}$}\!\!_RR=(_RR)^t$,     poi scriveremo anche $R^t$, la somma diretta di $t$ copie di $_RR$ è libera sulla base     $\br{e_i:i\leq t}$, perché? Ad esempio      where `\scb` is `\scalebox`, `\vsp` is `\vspace`, `\ssst` is `\scriptscriptstyle` and `\br{…}` is `\left\lbrace…\right\rbrace`, I get the following: ![enter image description here](http://i.stack.imgur.com/VCMcp.png) I'm sure you'll agree it's already much better, but I want to make it even better. Trouble is:   1. Raising the limit actually lowers the line below;   2. Trying to lower the plus and then raise the whole increases the space between the "Va bene" line and what is above. The code above does that, only because I tried that, and raising the whole by 3pt and lowering the `\bigoplus` by 2 gets the `\bigoplus` a little higher which I like, and removing the raising of the limit would require fixing the `\vspace`, so I'm giving the code typesetting exactly to the picture. So naturally the question is: why do the things in points 1) and 2) happen and how can I get the limit actually closer to the `\bigoplus`? PS I'm fully aware that having an ascender below the limit messes the whole thing up, but that's something I'll get to later.


title: How to adjust space between columns in longtable environment?

text: In the regular tabular environment, we can use `\setlength{\tabcolsep}` to specify the size of the space between the columns, but this doesn't work in `longtable`. Is there a similar command?               \documentclass[12pt]{article}         \usepackage{longtable}                \begin{document}     \begin{longtable}{rl}     \setlength{\tabcolsep}{2pt}     2: $x^3$&= $6x^2-4x-16$ \\     4: $x^5$ &= $6x^4-8x^3+8x^2-16x-64$ \\     6: $x^9$ &= $6x^8-4x^7-24x^6+48x^5-32x^4-64x^3-384x^2+256x+1024 $ \\     8: $x^{15}$ &=$6x^{14}-4x^{13}-16x^{12}-32x^{11}+192x^{10}-128x^{9}-512x^8+512x^7$\\     &$\hspace{.25cm}-3072x^6+2048x^5+8192x^4+4096x^3-24576x^2+16384x+65536$     \end{longtable}          \end{document}


title: Deactivating Anti-Aliasing when typesetting QR-Code

text: Using the following LaTeX-Code:               \documentclass[a4paper]{article}          \usepackage[pdf]{pstricks}     \usepackage{pst-barcode}          \begin{document}       \begin{pspicture}(0.7in,0.7in)         \psbarcode{01234567890}{eclevel=L}{qrcode}       \end{pspicture}     \end{document}      and pdflatex with "shell-escape" option               pdflatex -shell-escape QRCode.tex      a PDF containing the QR-Code is created. However, the QR-Code is anti-aliased. How can I turn off anti-aliasing? I am using MacTeX (TeX-Live 2010) on Mac OS X 10.6


title: tilde in a url in the address portion of a letter

text: I am trying to include my website address in the address block of a letter. My webaddress has a tilde character, and my usual solution, `$\sim$`, to the tilde formatting problem is not working. The relevant code is               \documentclass[english]{letter}     ...     \address{ Street \\ City, ST 00000 \\ \url{http://my.web.address/~blah} }     ...      This gives a bad-looking top-aligned tilde. If I replace `~` with `$\sim$`, then "http://my.web.address/$\sim$blah" appears in the output PDF. Using `\texttildelow` gives a compilation error. **Edit:** This is not a duplicate. Solutions for the referenced questions do not work inside `\address{}`.


title: Definition of PSTricks constant and improvement of code for drawing of Pantheon

text: Consider the following. **Code**               % pdflatex -shell-escape test.tex          \documentclass{article}          \usepackage{       auto-pst-pdf,       pst-eucl,       pstricks-add     }     \usepackage{siunitx}          \begin{document}          \begin{figure}     \def\radius{21.65}      % radius     \def\vinkelA{12}        % angle     \def\faktor{0.33333333} % Scaling     \newlength\maksimum \maksimum=2\faktor\radius\psunit % This doesn't work!      \centering      \psset{        unit=0.8cm,        linecolor=red      }       \begin{pspicture}(\maksimum,\maksimum)        \pnode(0,0){A}        \pnode(!0 \faktor\space \radius\space mul){B}        \pnode(!2 \faktor\space \radius\space mul mul \faktor\space \radius\space mul){C}        \pnode(!2 \faktor\space \radius\space mul mul 0){D}        \pnode(!\faktor\space \radius\space mul \faktor\space \radius\space mul){E}        \psline(C)(D)(A)(B)        \psarc(E){!\faktor\space \radius\space mul}{0}{!90 \vinkelA\space sub}        \psarc(E){!\faktor\space \radius\space mul}{!90 \vinkelA\space add}{180}        \psline[linestyle=dashed](B)(C)        \psarc[linestyle=dashed](E){!\faktor\space \radius\space mul}{180}{360}       \psset{         linecolor=blue,         linewidth=1.5pt       }        \psRelLine[angle=!270 \vinkelA\space add](E)(B){1}{P1}        \psRelLine[angle=!90 \vinkelA\space sub](E)(C){1}{P2}        \pcline(E)(P1)        \pcline(E)(P2)        \pcline[offset=12pt,linestyle=none](P1)(P2)        \aput*{:U}{Oculus}        \pcline(P1)(P2)        \pnode(!\faktor\space \radius\space mul 1 \vinkelA\space cos add \faktor\space \radius\space mul mul){H}        \pcline(E)(H)       \psset{         linecolor=black,         linewidth=0.5pt,         MarkAngleRadius=3.7,         LabelSep=4       }        \psRelLine[linestyle=dotted,angle=45]{<->}(E)(C){1}{V}        \ncline[linestyle=none]{E}{V}        \naput[nrot=:U]{\small{\SI{\radius}{\m}}}        \pstMarkAngle{H}{E}{P1}{\scriptsize{\SI{\vinkelA}{\degree}}}        \pstMarkAngle{P2}{E}{H}{\scriptsize{\SI{\vinkelA}{\degree}}}        \pstRightAngle{P1}{H}{E}        \pstRightAngle{P2}{H}{E}       \end{pspicture}     \end{figure}          \end{document}      **Output** None, since the code cannot compile. **Question** I don't get how to use the `\psunit`; I tried using the same method as in this post by @Herbert but it doesn't work. When that is said, I would also like to simplify the code, but the main problem is the use of `\psunit` in order to get rid of some of the `\space`s.


title: Indent and spacing in tables (or: How to do it better?)

text: I'm using the `tabular` environment in order to properly display my address in the text. But as the following example shows, the first column of the table doesn't align with the main body text. Also note that the spacing between the main body text and the table is not double (if I add `\\\` at the end of the line before the table, the spacing will be more than double). What should I do to align the text of the first column with the main body text, and how do I make sure that the spacing between the rows is the same as between the table and the text above it?               \documentclass{article}     \usepackage{setspace}         \doublespacing          \begin{document}          \noindent{Here is some text illustrating how the text looks outside a table.}          {\noindent\begin{tabular}{l l}     Address: & My department\\     {} & My university\\     {} & My street\\     {} & My city     \end{tabular}}     \end{document}      ![enter image description here](http://i.stack.imgur.com/cwxfy.png) I have a suspicion that there might be a much better way to accomplish what I intend here than to use the `tabular` environment. I'm therefore also open to suggestions that don't address the question of how to remove the indentation and how to fix the spacing issue.


title: \foreach with indexed names of curves

text: I am constructing several curves, which are all constructed differently, but they have path name=lambda1, ..., lambda4. Later, I intersect each of them with one path. Attached is a working minimal example.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{intersections}     \begin{document}     \begin{tikzpicture}     \path[name path=t1] (6,0) -- (6,7);      \draw[name path=lambda1] (0,4) -- (7,3.5);      \draw[name path=lambda2](0,2.5) sin (7,4.5);      \draw[name path=lambda3] (3,0) parabola (7,5);      \draw[name path=lambda4] (2,0) .. controls (3,4) .. (7,7);     \fill [red, name intersections={of=lambda1 and t1}] (intersection-1) circle (2pt) node    [below] {$\lambda_1$};     \fill [red, name intersections={of=lambda2 and t1}] (intersection-1) circle (2pt) node[below] {$\lambda_2$};      \fill [red, name intersections={of=lambda3 and t1}] (intersection-1) circle (2pt) node[below] {$\lambda_3$};      \fill [red, name intersections={of=lambda4 and t1}] (intersection-1) circle (2pt) node[below] {$\lambda_4$};     \end{tikzpicture}     \end{document}      The last 4 lines beg for a \foreach, but I can't make it work entirely. To me, it seems that               \foreach \n in {1,...,4} {     \fill [red, name intersections={of=lambda\n and t1}]      (intersection-1) circle (2pt) node[below] {$\lambda_\n$};}       should be the right solution, but it is not. However,               \foreach \n in {1,...,4} {     \fill[red, name intersections={of=t1 and lambda\n}]      (intersection-1) circle (2pt) node[below] {$\lambda_\n$};}      works fine. What am I missing here?


title: why does my document fail with sideways from rotating package?

text: I want to test landscape tables, and started with the sideways environment. However the code does not compile, I get the error:               (./content/landscapetable.tex     ! LaTeX Error: Something's wrong--perhaps a missing \item.     See the LaTeX manual or LaTeX Companion for explanation.     Type H <return> for immediate help.     ...     l.6 \begin{center}      Here is a minimal example:               \documentclass{scrartcl}      \usepackage[utf8]{inputenc}     \usepackage{tabularx}     \usepackage{caption}     \usepackage{rotating}     \begin{document}     \begin{sideways}     \begin{center}       \centering      %  \captionsetup{type=table}     %  \caption{Sehr breite Tabelle.}     \begin{tabularx}{0.8\textheight}{XXX}     \hline     head & head & head \\     \hline     text which is considereably longer than      the width of the column &      text which is considereably longer than      the width of the column &      text which is considereably longer than      the width of the column \\     \hline     \end{tabularx}       \end{center}     \end{sideways}     \end{document}      Remove the sideways environment, and it compiles. EDIT: when the center env is removed, and centering is left and the caption is introduced again another error with the caption occurs.               \begin{sideways}       \centering       \captionsetup{type=table}       \caption{Sehr breite Tabelle.}     \begin{tabularx}{1.0\textheight}{*{6}{X}}     \hline     head & head & head & head & head & head \\     ...     \end{tabularx}       \end{sideways}      The error is then               ! Missing \endgroup inserted.     <inserted text>     \endgroup     l.5 \caption{Sehr breite Tabelle.}      With sidewaystable it works, but that is not what I want.


title: pgfplots multiple plots in one file

text: In pgfplots is it possible to have several plots in one datafile? The goal is to add about 20 plots, which has different number of points and not the same x-value, to the same axis. (app. 350 points) * * * One posible solution is to have the plots in separate column, and then use loads of 'nan' because of the different x values:                   x  p1   p2  P3  ...         1  3    nan nan ...         2  nan  5   nan ...         6  4    8   nan ...         8  7    nan nan ...         ...      I do not like this solution:o( * * * The gnuplot solution is nice: the different plots are separated in the datafile by two newlines, and they are selected by 'index'. Does something similar exist in pgfplots? or any other solution?


title: Handout is not the same as last displayed state of a frame

text: > **Possible Duplicate:**   >  How to exclude certain slides from handout OK. Here is the MWE that explains it all. When compiled as beamer (onscreen) option, the itemized items appear on every click. Are red colored and bold as they appear. But go back to normal view as soon as the slideshow advances. The final view of the slide is all lines except the 'permanently bold' line are normal. But when compiled as a handout, the entire itemized list appears red colored and bold. Is there a way in which handout view = last view of the frame on-screen can be achieved?               % this is for onscreen      \documentclass[xcolor=dvipsnames,english,professionalfonts,smaller]{beamer}     % \documentclass[xcolor=dvipsnames,english,professionalfonts,smaller,handout]{beamer}                                                                                \usetheme{Madrid}     \usecolortheme[named=Black]{structure}          \begin{document}          \begin{frame}[<+->]{Leave the competition behind}          \pause          Some Text that remains normal all through.          \pause              \begin{itemize}              \item \alert <.>{\textbf <.> {Want this bold and alert when just displayed}}         \item \alert <.>{\textbf <.> {But remains bold and alert in handout, too}}         \item \alert <.>{\textbf <.> {The question is, how to avoid this}}              \end{itemize}              \uncover <+-> {Some other text that too remains normal all through}              \uncover <+-> {\Large{\textbf{Want this bold permanently}}}              \uncover <+-> {See, earlier text remains bold}          \end{frame}          \end{document}


title: Can emphasize produce an index item?

text: I would like to have a command which empasizes a term (like a definition in a mathematical text) and produces an item for the index (I use makeindex). Ideally the macro should not be too invasive, such that the index can be turned off it this might be desired. Can you provide me a solution for this task?


title: Package xparse \SplitList last token

text: I need to create a macro to render lists with a variable number of arguments (1+), e.g. `\mylist{1,2,3}` should expand to `$\tilde{1}$--$\tilde{2}$--$\tilde{3}$`. I'm trying to use `xparse` and `\SplitList`, but I didn't find a way to tell when I'm processing the last token (where I don't need the separator `\--`).               \NewDocumentCommand\mylist{>{\SplitList{,}}m}     {       \ProcessList{#1}{\myitem}     }     \newcommand\myitem[1]{$\tilde{#1}$--}      This would expand `\mylist{1}` to `$\tilde{1}$--` instead of the desired `$\tilde{1}$`.


title: Create a macro that appends some code an existing command, with arguments

text: As I am working on improving my answer to Different approach to literate programming for LaTeX, I have created a macro that automatically processes two arguments and formats indexes accordingly. The arguments are strings (not control sequences), with `#1` being the type of macro and `#2` being the name of the macro. Here is a sample of the macro I am using. It relies on `etoolbox` and `xstring`.               \newcommand{\set@macro@type}[2]{         \StrSubstitute{#2}{@}{"@}[\entryname]         % Default definitions         \def\macro@type{#1}         \def\macro@format{#2}         \def\macro@index{#2@\string\texttt{#2}}         % Specific type definitions         \ifstrequal{#1}{m}             {\def\macro@type{}              \def\macro@format{\textbackslash#2}              \def\macro@index{%                 \entryname @\string\texttt{{\string\textbackslash}\entryname}}}{}         \ifstrequal{#1}{l}             {\def\macro@type{length}              \def\macro@format{%                 \entryname @\string\texttt{{\string\textbackslash}\entryname}}}{}         \ifstrequal{#1}{e}             {\def\macro@type{environment}              \def\macro@format{\textbackslash#2\par\textbackslash end#2}              \def\macro@index{%                 \entryname @\string\texttt{{\string\textbackslash}\entryname}}}{}}      However, I would like to make it so that the user can add new types of macros with an interface such as:               \addmacro{<name>}{<type>}{<format>}{<index>}      which should append the following code to my existing macro:               \ifstrequal{#1}{<name>}         {\def\macro@type{<type>}          \def\macro@format{<format>}          \def\macro@index{<index>}}      Ideally, the `\addmacro` command could be starred, too, as I have an additional switch to toggle depending on the user's wishes. So, my question is: how can I implement a macro that appends some code at the end of the main macro, and that can be used repeatedly. I would prefer to keep using `etoolbox` if possible (I have seen `\apptocmd` in the documentation but can't get it to work). The main difficulty which I am encountering is with the arguments `#1` and `#2` of `\set@macro@style`, which the user must be able refer to in some way. How could this be implemented? An explanation would be very welcome too.


title: Disable microtype for a portion of a document

text: ## Update: 2013-04-18 After upgrading to `microtype` 2.5 today this specific test cases indeed runs much faster (from approximately 3:00 minutes down to 8 seconds). However, I do have another cases where the compile time has not quite improved as much: only went down from 2:05 hr to 1:30 hr. ## Question: I would like to disable the features of the `microtype` package for a portion of the document. I attempted to use `\microtypesetup{activate=false}` but that seems to have no effect. Additional options I tried included:               \microtypesetup{expansion=false}     \microtypesetup{protrusion=false}     \microtypesetup{kerning=false}     \microtypesetup{tracking=false}      and did not seem to fix the compile time issue. ## Background: This problem seems related to Why does the use of microtype and xfrac lead to a high compile time? as my compile time for this small document is very large if **all** three of the `\def` defined at the top are uncommented: ie.,   * The `microtype` package is used, _and_   * `\sfrac` from the `xfrac` pacakge is used, _and_   * My "extended" version of the `\bracr` macro is used Otherwise this document compiles just fine. With `%\def\UseMicrotype{}` commented, and the other two `\def` uncommented, this produces: ![enter image description here](http://i.stack.imgur.com/8Mwsp.png) The last sentence is only to show why I need the "extended" version of the `\bracr` macro. ## Notes:   * I am using `microtype` from CTAN (2.4), and will update to 2.5 once it is released (which apparently does not have this long compile time issue with `\sfrac`). In the mean time, if there is a way to disable `microtype` that would be helpful. ## Code:               %%% Problems ONLY if ALL three of these are uncommented     %\def\UseMicrotype{}%    Enable use of microtype.     \def\UseExtendedBrac{}% Enable use of "extended" version of \brac macro     \def\UseSFrac{}%        Enable use of \sfrac          \documentclass{article}     \usepackage{showframe}%     \usepackage{amsmath}%     \usepackage{xfrac}%     Provides sfrac               \ifdefined\UseMicrotype         \usepackage{microtype}%       \fi               \ifdefined\UseExtendedBrac%          \makeatletter         \newcommand{\@Brac}[3]{% #1,#3 = left/right bracket type             \ensuremath{%                 \left#1\vphantom{#2}\right.% left bracket                 #2% content                 \left.\vphantom{#2}\right#3% right bracket             }%         }%         \newcommand{\bracr}[1]{\@Brac{(}{#1}{)}}%         \newcommand{\bracs}[1]{\@Brac{[}{#1}{]}}%         \makeatother     \else% Works if these are used         \newcommand{\bracr}[1]{\left(#1\right)}         \newcommand{\bracs}[1]{\left[#1\right]}     \fi          \ifdefined\UseSFrac     \else% No problem if we don't use \sfrac         \renewcommand*{\sfrac}[2]{\frac{#1}{#2}}%     \fi          \begin{document}     \ifdefined\UseMicrotype         \microtypesetup{activate=false}     \fi     %     \begin{align*}         f(x,y)         &= \bracr{\frac{x^{ \sfrac{3}{2}}}                         y^{-\sfrac{1}{2}}}^{\!\!\!-2} \\         &= \bracr{              \bracs{                 \frac{x^{ \sfrac{3}{2}}}                      {y^{-\sfrac{1}{2}}}}^2}^{\!\!\!-1}     \end{align*}     %     % Reason for using the "extended" brac as it yields line wrapping.     As we can see in the following, the \verb|\bracr| wraps around lines:      $\bracr{x^{-1} + x^{-2} + x^{-3} +x^{-4} + x^{-5} + \cdots }$     \end{document}


title: Left Justifying the Date with Scrlttr2

text: I would like to left justify the date in the KOMA-Script scrlttr2 class so that it aligns with the left margin of the body. I have no other data in the refline. This question helped me to get my present workaround, which is as follows: Shrink the width of the refline field:               \@setplength{refwidth}{2.5cm}      Manually position the refline field:               \@setplength{refhpos}{2.27cm}      While this can produce the output I want, when the width of the date changes, such as at the start of the month (think July->August), I have to manually edit the variables to get the proper alignment. Is there a more elegant way within KOMA-Script to left justify the date? If there is not a built-in method: Is there a way to automate the calculation of the widths or lengths when I compile so that justification remains constant regardless of the length of date?


title: \midrule dashed and colored in booktabs -- two kinds of midrules in one booktab

text: Is it possible to make two `\midrule`s in one booktab? The first one should be colored, the second one colored and dashed, as it is shown in the picture. Before each entry is a horizontal space - how to include such space in my table? ![output as it should be](http://i.stack.imgur.com/aSd5B.jpg)               \documentclass{beamer}                    \mode<presentation>     {   \usetheme{Madrid}         \setbeamercovered{transparent}     }          \usepackage{booktabs}          \usepackage{amsmath}     \usepackage{amsfonts}     \newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}          \usepackage[utf8x]{inputenc}     \usepackage[MeX]{polski}          \usepackage{tabularx}     \usepackage{color}     \usepackage{graphicx}          \usepackage[utopia]{mathdesign}          \usecolortheme{crane}          \renewcommand\figurename{Rys.}     \def\captionlabeldelim{.}          \renewcommand\tablename{Tab.}     \def\captionlabeldelim{.}     \usepackage[small,bf,singlelinecheck=off]{caption}          \title[Midrule]     {\textbf{midrule}\\ colored and dashed}     \subtitle{}     \author[]{No name}     \institute[Misiu]     {    }     \date[19.10.12]     {\\ Warszawa, 22. października 2012r.}          \subject{Wynagrodzenia}     \AtBeginSection[]     { \begin{frame}<beamer>        \frametitle{Plan prezentacji}        \tableofcontents[currentsection]       \end{frame}     }          \begin{document}     \begin{frame}     \begin{center}     \begin{table}     \begin{tabular}{@{}m{\dimexpr.45\textwidth}ccc@{}}     \toprule     procesy & Min & Max  &Dalkia\\     \midrule     Junior         & 1 700 & 2 800 & 3 200\\     \midrule     Senior         &  & ? &\\     \midrule      Specjalist     &  & ? &\\     \midrule     Team Leader    &  & ? &\\     \bottomrule     \end{tabular}     \caption{1. Wynagrodzenia: Procesy HR}     \label{tabela1}     \end{table}     \end{center}     \end{frame}     \end{document}


title: How to create newlines?

text: I am new to Latex and found out how to use it a bit. Newlines are created by `\\\` I get the following error: `\\\ can only appear in a matrix or array` How do you create newlines between matrix or arrays? Thanks EDIT: Here's the code. This is for an online forum that processes LaTeX.               a =      \left[     \begin {array}{ccc}     1& 2&3\\     \noalign{\medskip}     4&5&6     \end {array}     \right]          b = a .+ 1           b =      \left[     \begin {array}{ccc}     2&3&4\\     \noalign{\medskip}     5&6&7     \end {array}     \right]      By the way, what is the proper etiquette to post the code? Do I need code tags? Or LaTeX tags? Thanks.


title: How to fill a shape bounded by edge[bend right]?

text: I've got               \node (A) at (0,2) {$A$};     \node (B) at (0,0) {$B$}       edge [<-] (A)       edge [<-, bend right=90] (A);       How do I fill this D shape? I've got to use `\filldraw`, obviously, but I can't figure out how to do the bending.


title: scrreprt .cls is missing

text: I get the following error on TeXShop when trying to compile:               ./thesis.tex:2: LaTeX Error: Missing \begin{document}.          ! LaTeX Error: File `scrreprt .cls' not found.      My .tex file looks the following:               \documentclass{scrreprt }     \title{Abstract}     \begin{document}     \maketitle          \end{document}      I updated all packages with TeX Live Utility. And when I select the koma- script package in the program, the scrreprt is available. But still get that error!


title: How to set the Texshop comment font to italics?

text: Does anyone know how to set a special font for comments in TexShop? I would like to have it in italic with gray colour. I used to use LaTex on Ubuntu and I just turned to Mac, I'm therefore not familiar with TexShop fonts.


title: Enumerate environments within theorems

text: How to create an environment for enumerating that allows one to identify the enumeration with the theorem environment? Example: * * * **Definition 1.1** Let X be a set. An algebra over X is a collection C of subsets of X satisfying **D 1.1.1** If A is an element of C, then X\A is an element of C; **D 1.1.2** If A and B are both elements of C, then the union A U B is an element of C. * * * **Proposition 1.1** Let C be an algebra over a set X; then the following senteces are true **P 1.1.1** The empty set is an element of C; **P 1.1.2** The set X is an element of C; **P 1.1.3** Every finite union of elements of C is an element of C; **P 1.1.4** Every finite intersection of elements of C is an element of C. * * * It would be quite useful if I could labeled then, to a further reference.


title: Drawing vector field using PSTricks

text: Are there any PSTricks packages for drawing vector fields? I have had a look at http://tug.org/PSTricks/main.cgi?file=examples#vector but I don't fully understand the syntax in the example(s). Also I have had a look at page 23 on ftp://ftp.chinatex.org/TeXDoc/TeXDraw/pstricks/pstricksexample/seminarSS08.pdf but here the code is missing. `:(` Specifically, I would like to draw the vector field > `{1, x}` in the range from -5 to 5 on both axes. Here is the vector field drawn using Mathematica: ![vectorfield](http://i.stack.imgur.com/BVo8J.jpg) **Update** I have figured out how to do it (more or less):               \documentclass{article}          \usepackage{       pst-plot,       pst-ode     }          \psset{       unit=5,       algebraic,       algebraicOutputFormat     }          \begin{document}          \begin{figure}[htbp]      \centering       \begin{pspicture}(-1.1,-1.1)(1.1,1.1)        \psaxes[          dx=0.2,          Dx=1,          dy=0.2,          Dy=1        ]{->}(0,0)(-1.1,-1.1)(1.1,1.1)         \psVectorfield[           arrows=->,           linecolor=black!60         ](-1,-1)(1,1){x}         \pstODEsolve{y0_a}{t | x[0]}{-1}{1}{100}{-0.1}{t}         \pstODEsolve{y0_b}{t | x[0]}{-1}{1}{100}{0.1}{t}         \pstODEsolve{y0_c}{t | x[0]}{-1}{1}{100}{0.3}{t}         \pstODEsolve{y0_d}{t | x[0]}{-1}{1}{100}{0.5}{t}         \pstODEsolve{y0_e}{t | x[0]}{-1}{1}{100}{0.7}{t}         \pstODEsolve{y0_f}{t | x[0]}{-1}{1}{100}{0.9}{t}        \psset{          arrows=-,          linewidth=1.5pt        }         \listplot[linecolor=gray  ]{y0_a}         \listplot[linecolor=red   ]{y0_b}         \listplot[linecolor=green ]{y0_c}         \listplot[linecolor=blue  ]{y0_d}         \listplot[linecolor=purple]{y0_e}         \listplot[linecolor=yellow]{y0_f}       \end{pspicture}      \caption{Vektorfeltet~$\mathbf{F}(x,y) = (1,x)$ med nogle str{\o}mningskurver.}     \end{figure}          \end{document}      ![output2](http://i.stack.imgur.com/jPhTw.jpg) The problem is that the picture is really only drawn from -1 to 1 on both axes (but I have changed the axes labels). This means that the vector arrows and the curves are too 'flat' compared to if they were drawn from -5 to 5 on both axes. I tried to change the code to               \documentclass{article}          \usepackage{       pst-plot,       pst-ode     }          \psset{       unit=1,       algebraic,       algebraicOutputFormat     }          \begin{document}          \begin{figure}[htbp]      \centering       \begin{pspicture}(-5.7,-5.7)(5.7,5.7)        \psaxes[          dx=1,          Dx=1,          dy=1,          Dy=1        ]{->}(0,0)(-5.5,-5.5)(5.5,5.5)         \psVectorfield[           arrows=->,           linecolor=black!60         ](-5,-5)(5,5){x}         \pstODEsolve{y0_a}{t | x[0]}{-5}{5}{100}{-0.5}{t}         \pstODEsolve{y0_b}{t | x[0]}{-5}{5}{100}{0.5}{t}         \pstODEsolve{y0_c}{t | x[0]}{-5}{5}{100}{1.5}{t}         \pstODEsolve{y0_d}{t | x[0]}{-5}{5}{100}{2.5}{t}         \pstODEsolve{y0_e}{t | x[0]}{-5}{5}{100}{3.5}{t}         \pstODEsolve{y0_f}{t | x[0]}{-5}{5}{100}{4.5}{t}        \psset{          arrows=-,          linewidth=1.5pt        }         \listplot[linecolor=gray  ]{y0_a}         \listplot[linecolor=red   ]{y0_b}         \listplot[linecolor=green ]{y0_c}         \listplot[linecolor=blue  ]{y0_d}         \listplot[linecolor=purple]{y0_e}         \listplot[linecolor=yellow]{y0_f}       \end{pspicture}      \caption{Vektorfeltet~$\mathbf{F}(x,y) = (1,x)$ med nogle str{\o}mningskurver.}     \end{figure}          \end{document}      but then I get the error               Runaway definition?     ->/ArrowA { moveto } def /ArrowB { BeginArrow 1.  1.  scale  false 0.\ETC.     ! TeX capacity exceeded, sorry [main memory size=5000000].     \pst@code ....setopacityalpha  Arrow  EndArrow  }                                                        def       l.28     ](-5,-5)(5,5){x}      How do I fix this? **Update 2** Here is what I ended up with:               \documentclass{article}          \usepackage{pst-plot}     \usepackage{pst-ode}          \begin{document}          \begin{figure}[htbp]     \centering      \psset{        algebraic,        algebraicOutputFormat      }       \begin{pspicture}(-5.47,-5.47)(5.85,5.9)               \psaxes[           linecolor=lightgray         ]{->}(0,0)(-5.5,-5.5)(5.5,5.5)[$x$,0][$y$,90]         \psVectorfield[           Ox=10,           Dx=1,           Dy=1,           linecolor=blue         ](-5,-5)(5,5){x}         \pstODEsolve{y0_a}{t | x[0]}{-2.1}{2.1}{100}{5.205}{t}         \pstODEsolve{y0_b}{t | x[0]}{-2.533}{2.533}{100}{5.208}{t}         \pstODEsolve{y0_c}{t | x[0]}{-2.9}{2.9}{100}{5.205}{t}         \pstODEsolve{y0_d}{t | x[0]}{-3.226}{3.226}{100}{5.2025}{t}         \pstODEsolve{y0_e}{t | x[0]}{-3.523}{3.523}{100}{5.2055}{t}         \pstODEsolve{y0_f}{t | x[0]}{-3.797}{3.797}{100}{5.208}{t}         \pstODEsolve{y0_g}{t | x[0]}{-4.051}{4.051}{100}{5.205}{t}        \psset{          linewidth=1.5pt        }         \listplot[linecolor=red!20]{y0_a}         \listplot[linecolor=red!30]{y0_b}         \listplot[linecolor=red!40]{y0_c}         \listplot[linecolor=red!50]{y0_d}         \listplot[linecolor=red!60]{y0_e}         \listplot[linecolor=red!70]{y0_f}         \listplot[linecolor=red!80]{y0_g}     %    \listplot[linecolor=purple]{y0_a}     %    \listplot[linecolor=green ]{y0_b}     %    \listplot[linecolor=red   ]{y0_c}     %    \listplot[linecolor=blue  ]{y0_d}     %    \listplot[linecolor=orange]{y0_e}     %    \listplot[linecolor=gray  ]{y0_f}     %    \listplot[linecolor=yellow]{y0_g}       \end{pspicture}     \end{figure}          \end{document}      ![output2](http://i.stack.imgur.com/Unfbc.jpg) **Update 3** When I use the procedure mentioned by AlexG in the comment to the answer by Marienplatz, I still get an error when compiling from `ps` to `pdf`, i.e. when invoking `ps2pdf`, (but the PDF file looks okay):               \documentclass{article}          \usepackage{pst-plot}     \usepackage{pst-ode}          \begin{document}          \begin{figure}[htbp]     \centering      \psset{        algebraic,        algebraicOutputFormat      }       \begin{pspicture}(-5.47,-5.47)(5.85,5.9)               \psVectorfield[           Ox=10,           Dx=1,           Dy=1,           linecolor=blue         ](-5,-5)(5,5){x}         \pstODEsolve{y0_a}{t | x[0]}{-2.1}{2.1}{100}{5.205}{t}         \pstODEsolve{y0_b}{t | x[0]}{-2.533}{2.533}{100}{5.208}{t}         \pstODEsolve{y0_c}{t | x[0]}{-2.9}{2.9}{100}{5.205}{t}         \pstODEsolve{y0_d}{t | x[0]}{-3.226}{3.226}{100}{5.2025}{t}         \pstODEsolve{y0_e}{t | x[0]}{-3.523}{3.523}{100}{5.2055}{t}         \pstODEsolve{y0_f}{t | x[0]}{-3.797}{3.797}{100}{5.208}{t}         \pstODEsolve{y0_g}{t | x[0]}{-4.051}{4.051}{100}{5.205}{t}         \psaxes[           linecolor=lightgray         ]{->}(0,0)(-5.5,-5.5)(5.5,5.5)[$x$,0][$y$,90]        \psset{          linewidth=1.5pt        }         \listplot[linecolor=red!20]{y0_a}         \listplot[linecolor=red!30]{y0_b}         \listplot[linecolor=red!40]{y0_c}         \listplot[linecolor=red!50]{y0_d}         \listplot[linecolor=red!60]{y0_e}         \listplot[linecolor=red!70]{y0_f}         \listplot[linecolor=red!80]{y0_g}     %    \listplot[linecolor=purple]{y0_a}     %    \listplot[linecolor=green ]{y0_b}     %    \listplot[linecolor=red   ]{y0_c}     %    \listplot[linecolor=blue  ]{y0_d}     %    \listplot[linecolor=orange]{y0_e}     %    \listplot[linecolor=gray  ]{y0_f}     %    \listplot[linecolor=yellow]{y0_g}       \end{pspicture}     \end{figure}          \end{document}      The error is as follows:               pstODEsolve RKF45 method; '-' failed step, '+' successful step, 'o' output step :      oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo     pstODEsolve RKF45 method; '-' failed step, '+' successful step, 'o' output step :      oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo     pstODEsolve RKF45 method; '-' failed step, '+' successful step, 'o' output step :      oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo     pstODEsolve RKF45 method; '-' failed step, '+' successful step, 'o' output step :      oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo     pstODEsolve RKF45 method; '-' failed step, '+' successful step, 'o' output step :      oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo     pstODEsolve RKF45 method; '-' failed step, '+' successful step, 'o' output step :      oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo     pstODEsolve RKF45 method; '-' failed step, '+' successful step, 'o' output step :      ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooError: /invalidrestore in --restore--     Operand stack:        (1)   1786   1388   5.0   (2)   1786   1152   5.0   (3)   1786   916   5.0   (4)   1786   679   5.0   (5)   1721   2093   5.0   (1)   1721   2329   5.0   (2)   1721   2566   5.0   (3)   1721   2802   5.0   (4)   1721   3038   5.0   (5)   2117   1962   5.0   (5)   1902   1834   5.0   (x)   1902   1834   5.0   (y)   1902   1834   5.0   --nostringval--   --nostringval--     Execution stack:        %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1884   1   3   %oparray_pop   1883   1   3   %oparray_pop   1867   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   1807   53   4   %oparray_pop   --nostringval--   1791   53   4   %oparray_pop   --nostringval--     Dictionary stack:        --dict:1171/1684(ro)(G)--   --dict:8/20(G)--   --dict:117/200(L)--   --dict:187/300(L)--     Current allocation mode is local     Last OS error: Numerical result out of range     Current file position is 259609     GPL Ghostscript 9.10: Unrecoverable error, exit code 1


title: Write inside divided circle

text: At this address Label Points in a circle in tikz you can see the code to divide a circle into x cells. How to write a phrase into each cell of the divided circle?


title: 'longtable' caption without incrementing 'table'?

text: For reasons both complex and confusing, I would like to caption a `longtable` **without** incrementing the `table` counter in the process. I want to have two consecutive `longtable` environments to be captioned with identical table numbers; i.e. one `longtable` captioned "Table x.y: Data Set (Part A)" and one captioned "Table x.y: Data Set (Part B)", with x.y being identical for both tables. Apparently however, even `\caption*{}` command bumps `table`. I am a bit at a loss here. **Note:** _I know_ that the `xtab` package would enable me to have _one_ long table with switches of headers and captions mid-table. However I got a (different) problem with that package, akin to this question but sadly not solved by egreg's answer there; so this question should be considered `longtable`-only as `xtab`, `supertabular` etc. don't float my boat right now. :-(


title: Compile sequence: citing in the glossary

text: I'm trying to add a reference to a source in my bibtex bibliography in one of my glossary entries. However, it remains a questionmark! When I compile two times in a row, it works fine, though. My compile sequence is the following:               pdflatex myFile.tex     makeglossaries myFile     bibtex myFile     pdflatex myFile.tex     pdflatex myFile.tex      What am I doing wrong here? Why is it only recognising the reference on the second run? What should I add to my make file?


title: Partition in page into thirds vertically

text: I'd like to partition the page into thirds vertically. That means, the first part starts at the upper left corner of the text body (as usual), the second part starts at (0,-1/3*\textheight) [as seen from the upper left corner of the text body] and the third starts at (0,-2/3*\textheight). I tried `\begin{minipage}[t][0.33\textheight][t]{\textwidth}…\end{minipage}`, but it almost always breaks the layout in some way. The minipages need to contain wrapped images. At the moment, I work with `wrapfig`. Are there other ways to achieve the desired layout?


title: Opinion on aesthetics of this symbol

text: I am trying to decide on a symbol for a particular mathematical quantity, it has three different types of indices and I'm running out of places to put sub- scripts/super-scripts. I have a few ideas, but would like input on what looks best (or any additional ideas you may have). Since you are all typesetting experts, and anyone who uses TeX likely has some affinity for aesthetics, I figured this was a good place to ask. Here are my ideas so far: ![SomeIdeas](http://i.stack.imgur.com/S7j4M.png) For context, the symbol is used in equations similar to this: ![](http://i.stack.imgur.com/Izs91.png)


title: Marginpar does not appear in ledmac numbered text

text: For some reason my marginal notes don't appear. Is it because of line numbering?               % XeLaTeX can use any Mac OS X font. See the setromanfont command below.     % Input to XeLaTeX is full Unicode, so Unicode characters can be typed directly into the source.          % The next lines tell TeXShop to typeset with xelatex, and to open and save the source with Unicode encoding.          %!TEX TS-program = xelatex     %!TEX encoding = UTF-8 Unicode     \documentclass[11pt,oneside]{book}     \usepackage{ledmac}     \usepackage{fancyhdr}     \usepackage{adforn}     \pagestyle{myheadings}     \usepackage{hanging}     \textheight = 180.5 mm     \textwidth = 108.5 mm     \pagenumbering{arabic}     \makeatletter     % And in the paragraphed footnotes, I'd like no colon too:     \def\parafootfmt#1#2#3{%       \normal@pars       \parindent=0pt \parfillskip=0pt plus 1fil       {\bf\printlines#1|}%       {\select@lemmafont#1|#2}~%       #3\penalty-10 }     \makeatother     \let\Afootfmt\parafootfmt          %\newcommand{\rhet}[2]{\edtext{#1}{\Afootnote{#2}}}     \newcommand{\rhet}[2]{\edtext{}{\Afootnote{#1~]\ \ #2}}}     \newcommand{\oed}[2]{\edtext{ #1}{\Bfootnote{] #2}}}     \footparagraph{A}     \footparagraph{B}                                                                      %%%%%%%%%%%%%%%%     \raggedbottom               \newcommand*{\LeftWidth}{3.0cm}%     \newcommand*{\RightWidth}{\dimexpr\linewidth-\LeftWidth-2em\relax}%     \newcommand{\AlignedBrace}[2]{%         \medskip\par\noindent%         \parbox{\LeftWidth}{\raggedleft\textbf{#1}\strut~}%         $\left\{~\parbox{\RightWidth}{\strut\textit{#2}\strut}\right.$%     }%               %\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.     %\geometry{a4paper}                   % ... or a4paper or a5paper or ...      %\geometry{landscape}                % Activate for for rotated page geometry     %\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent     \usepackage{graphicx}          \usepackage{amssymb}     \usepackage{amsmath}     %\renewcommand %These two commands are for double-spacing     %\baselinestretch{2}          % Will Robertson's fontspec.sty can be used to simplify font choices.     % To experiment, open /Applications/Font Book to examine the fonts provided on Mac OS X,     % and change "Hoefler Text" to any of these choices.          \usepackage{fontspec,xltxtra,xunicode}     \defaultfontfeatures{Mapping=tex-text}     \setromanfont[Mapping=tex-text]{Brill}     \setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}     \setmonofont[Scale=MatchLowercase]{Andale Mono}     \frenchspacing               \begin{document}          \beginnumbering     \pstart                    NAture hath indued euery man, with     a certain eloquence, and also subtilitée \marginpar{Rhetorike     and Logike     giuen of nature.} to reason and discusse,      \pend     \endnumbering     \end{document}


title: Expansion of commands in errmessage

text: When I run               \documentclass{article}     \def\pet{dog}     \errmessage{My \pet\ is {sick}}     \begin{document}     My \pet\ is {sick}.     \end{document}      the error message is: > My dog\ is {sick}. but the PDF output reads: > My dog is sick. What's going on here? Why is `\pet` expanded, but `\␣` isn't? Why are those braces printed in the error message? Shouldn't I have to write `\\{` and `\\}` to get braces?


title: Problem with the \mathbf command

text: In this MWE, I want to obtain bold letter for the letter "H" (compare the two "H") :               \documentclass[10 pt]{beamer}     \usetheme{default}     \usepackage{lmodern} % load a font with all the characters     \usepackage{fontspec}     \usepackage{cmbright}     \SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n}     \usepackage{amsmath}%loads amsmath that should go before unicode-math     \usefonttheme{professionalfonts}     \defaultfontfeatures{Mapping=tex-text}  % This seems to be important for mapping glyphs properly          \begin{document}     \begin{frame}     \[     \mbox{First bold H : }\|x\|_{\mathbf{H}},\; \mbox{Second bold H : }\mathbf{H}      \]     \end{frame}     \end{document}      but I don't know how doing it. THe "H" produced by this MWE is tiny but no bold effect. If I use > \SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n} I obtain bold tiny "H" but the font used still not the same.


title: Workaround for citation inside pdfcomment?

text: Is there a simple workaround for using citations inside a pdfcomment? Here it is a MWE:               \documentclass{article}     \usepackage{pdfcomment}          \begin{document}          Works \cite{Smith1959}.          Works \pdfmarkupcomment{here}{comment1}          Doesn't work \pdfmarkupcomment{here \cite{Smith1959}}{comment2}.          \begin{thebibliography}{100}     \bibitem{Smith1959}J. Smith, J. Chem. Phys. {\bf 3}, 764 (1935).     \end{thebibliography}     \end{document}      The error message is:               ! Argument of \@citex has an extra }.