title: Installing EBGaramond for pdfLaTeX

text: I made a foolish choice to play around with fonts a few days ago, and haven't escaped since. After getting very kind and useful help here yesterday, I decided to follow the advice given, and change to use EBGaramond from the LaTeX Font Catalogue. This, however, has proved problematic. I tried to follow the instructions given here as best I could - below is the sequence of events, using the following code as a MWE:               \documentclass[a4paper,10pt]{article}     \usepackage[T1]{fontenc}     \usepackage{ebgaramond}          \begin{document}     Testing\ldots{}     \end{document}      First of all, I used `kpsewhich --var-value TEXMFLOCAL` to determine obtain the value of `/usr/local/share/texmf`, to which I moved the unzipped `ebgaramond` folder (I had to use `sudo mv` to do so). I then applied `sudo texhash`, which gave the output:               texhash: Updating /usr/local/share/texmf/ls-R...      texhash: Updating /var/lib/texmf/ls-R-TEXLIVEMAIN...      texhash: Updating /var/lib/texmf/ls-R-TEXLIVEDIST...      texhash: Updating /var/lib/texmf/ls-R-TEXMFMAIN...      texhash: Updating /var/lib/texmf/ls-R...      texhash: Done.      and then `sudo updmap-sys --enable Map=EBGaramond.map`, which produced               updmap: resetting $HOME value (was /home/philip) to root's actual home (/root).     updmap is using the following updmap.cfg files (in precedence order):       /etc/texmf/web2c/updmap.cfg       /usr/share/texmf/web2c/updmap.cfg       /usr/share/texlive/texmf/web2c/updmap.cfg       /usr/share/texlive/texmf-dist/web2c/updmap.cfg     Creating new config file /etc/texmf/web2c/updmap.cfg     dvips output dir: "/var/lib/texmf/fonts/map/dvips/updmap"     pdftex output dir: "/var/lib/texmf/fonts/map/pdftex/updmap"     dvipdfmx output dir: "/var/lib/texmf/fonts/map/dvipdfmx/updmap"     pxdvi output dir: "/var/lib/texmf/fonts/map/pxdvi/updmap"          ERROR:  The following map file(s) couldn't be found:         EBGaramond.map (in /etc/texmf/web2c/updmap.cfg)              Did you run mktexlsr?              You can disable non-existent map entries using the option       --syncwithtrees.      On the basis of that output, I ran `sudo mktexlsr`, followed by `sudo updmap- sys --enable Map=EBGaramond.map`. This, however, produced an error when I ran pdfLaTeX, saying ebgaramond.sty could not be found. I thus then moved `ebgaramond` to `~/texmf/tex/latex/`, and reran `sudo texhash`. Now, however, the compilation fails with the error               ! I can't find file `EBGaramond12-Regular-osf-t1'.      I did try putting in `\usepackage{fontspec}` and `\setmainfont{ebgaramond}`, but that threw up another series of errors, and I'd really rather not go down the XeTeX route. I'll admit, I have been lurching through the problems, but can anyone please give me some tips on this? The phrasing in the README suggests it's a simple process, but I'm still having troubles. Thanks in advance for any advice.


title: Troubles with suftesi and itemize

text: A while ago I was experimenting with `suftesi` and chapters of my thesis, adapting the preamble that had been created using the standard class `book` and it works. I want to try the layout of sufitesi, but I have an strange problem. When I compile and add each chapter, suddenly I've got an error:               ! Undefined control sequence.     \enit@enditemize ->\enit@after                                 \endlist \ifx \enit@series \relax \else \ifnu...     l.13 \end{itemize}      It seems that the problem has to do with the itemize environment, something very strange, because with the class `book` I have not problems. I want to highlight that I read before the documentation of `suftesi` class and from there was I used my preamble options. I have not seen any trouble with itemize. A MWE then should be:               \documentclass[documentstructure=book,pagelayout=standard,tocstyle=ragged,headerstyle=center,captionstyle=standard, parindent=wide,style=sufelements]{suftesi}     \usepackage[utf8]{inputenc}     \usepackage[TS1,T1]{fontenc}     \usepackage[spanish,activeacute,mexico]{babel}     \usepackage{ucs}     \usepackage[osf]{mathpazo}     \usepackage{textcomp}     \usepackage{eurosym}     \usepackage[usenames,dvipsnames,table]{xcolor}     \usepackage{amsmath,amsthm,amstext,amssymb}          \usepackage{multicol,multirow,array,tabularx,ragged2e,booktabs}     \newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}     \usepackage{rotating}     \usepackage{colortbl}     \usepackage[cbgreek]{bpchem}     \usepackage[per-mode=symbol]{siunitx}     \sisetup{     %output-decimal-marker = {,},     detect-weight= true,      range-units = brackets,     list-final-separator = { \translate{and} },     list-pair-separator = { \translate{and} },     range-phrase = { \translate{to (numerical range)} },     }     \usepackage{graphicx,subfigure,etex,tikz,pgfplots}     \usepackage[colorinlistoftodos,spanish,textsize=footnotesize]{todonotes}               \begin{document}     \chapter{Objetivos}          \section{Objetivo general}          \noindent Sintetizar óxidos binarios basados en mezclas de Ir y Ru mediante una síntesis coloidal como electrocatalizadores para la reacción de evolución de oxígeno \todo[color=cyan]{acrónimo} (REO) en un electrolizador tipo \todo[color=cyan]{acrónimo} ESP que superen las propiedades electrocatalíticas de los óxidos simples \BPChem{IrO\_2} y \BPChem{RuO\_2}, es decir, que reduzcan el sobrepotencial requerido para la \todo[color=cyan]{acrónimo} REO mejorando su cinética lenta.           \section{Objetivos específicos}          \begin{itemize}     \item Caracterizar físicamente los materiales sintetizados mediante difracción de rayos X \todo[color=cyan]{acrónimo} (XRD), microscopia de barrido electrónico (SEM), área superficial por la técnica de \todo[color=cyan]{acrónimo} BET para determinar la morfología y tamaño de partícula de los óxidos binarios en estudio.     \item Evaluar la actividad electrocatalítica de los materiales sintetizados a través de su caracterización electroquímica con técnicas como voltamperometría cíclica \todo[color=cyan]{acrónimo} (VC), \todo[color=cyan]{acrónimo} lineal (VL) y cronoamperometría \todo[color=cyan]{acrónimo} (CA).     \item Evaluar los materiales en un electrolizador tipo \todo[color=cyan]{acrónimo} ESP. Realizar la comparación del desempeño de la serie de óxidos binarios con un óxido comercial \BPChem{IrO\_2}.      \end{itemize}     \end{document}      Well the MWE works, but with the whole document (all the chapters) not. I'm using TeXLive 2013 updated. I made a proof in ShareLaTeX and it works but with errors. I don't understand what's wrong. Could someone help me?


title: hyperref for longtable jumps to first page of PDF

text: I have have longtable in my document, but when I click the caption name in the list of tables, or any reference to the table (using \ref{tab:table label}) it takes me to the first page of the document (rather than the 50th). Is there a solution to this                \documentclass{scrreprt}           \usepackage{booktabs}           \usepackage{multirow}           \usepackage[labelfont=bf,justification=raggedright]{caption}            \usepackage{longtable, tabu}           \usepackage[colorlinks]{hyperref}               \hypersetup{colorlinks,citecolor=blue, linkcolor=black}           \usepackage{tocloft}               \begin{document}               \listoftables              \clearpage              \footnotesize%              \begin{center}                \setlength\LTright{-30pt}           % default: \fill                \begin{longtable}[l]{>{\raggedright}p{1.1cm}>{\centering}p{2cm}>{\raggedleft\arraybackslash}p{1.5cm}}               \caption{table caption}\label{tab:table label}\\               \tabuphantomline               \hline               Column 1 & Column 2 & Column 3 \\               \endfirsthead               \multicolumn{3}{c}{{\bfseries \tablename\ \thetable{} -- Continued from previous page}} \\               \hline               Column 1 & Column 2 & Column 3 \\ \hline               \endhead               \multicolumn{3}{r}{{Continued on next page}} \\               \endfoot                    \endlastfoot               1 & 2 & 3 \\               4 & 5 & 6 \\               7 & 8 & 9 \\               \end{longtable}               \end{center}               \normalsize               \end{document}


title: Label angle with tikz

text: I am able to draw a nice right triangle with               \begin{tikzpicture}[thick]       \draw (0,0)  -- (4,0) node[midway,below]{$f$} -- (4,2) node[midway,right]{$\frac{x}{2}$}-- cycle;     \end{tikzpicture}      Now I want to label the left angle of the triangle and I am stuck on how to do this.


title: \item behaviour in footnote, depending on brackets use

text: I've noticed something strange, and someone might be able to explain things to me. When I do the following code, everything goes awry in the footnote (the itemized phrases go outside the page):               \documentclass[10pt,a4paper]{book}     \usepackage[utf8x]{inputenc}     \usepackage{ucs}     \begin{document}     Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla\footnote{Here are the items :\begin{itemize}     \item[Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test]     \item[Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test]     \end{itemize}} test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test     \end{document}      But when I do the following, everything is ok:               \documentclass[10pt,a4paper]{book}     \usepackage[utf8x]{inputenc}     \usepackage{ucs}     \begin{document}     Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla\footnote{Here are the items :\begin{itemize}     \item Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test     \item Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test     \end{itemize}} test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test Blabla test blabla test     \end{document}      Do you have any idea why? I stumbled on the right solution almost per chance and would like to understand my first error.


title: Hyperref + \url: long URL with dashes won't break

text: I've discovered a rather weird behaviour of PdfLaTeX. In this example               \documentclass{article}     \usepackage[breaklinks]{hyperref}     \begin{document}     \url{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/}     \end{document}      PdfLaTeX won't break the URL and create a too long line. However, if I replace \url with \href like this:               \documentclass{article}     \usepackage{hyperref}     \begin{document}     \href{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/}{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/}     \end{document}      I get the line broken, but the font of the link is not right any more of course (normal instead of texttt). Why doesn't URL break the line at dashes and what could I do to get a nicely typeset line-broken link?


title: Aligned \description

text: ### Code               \documentclass[a4paper,twoside,12pt]{book}     \usepackage[utf8]{inputenc}          \begin{document}     \noindent Let us define:     \begin{description}       \item[$C_{DEP}$] (\euro) depreciation of the machine.       \item[$C_{EN}$] (\euro) energy cost.       \item[$CE$] (\euro /year) energy cost per year.       \item[$CMAT_{(W \geq W_L)}$] (\euro\textcentoldstyle) cost of raw material regarding the ``conforming'' packages.       \item[$CMAT_{(W < W_L)}$] (\euro\textcentoldstyle) cost of raw material regarding the ``non conforming'' packages.       \item[$CS$] (\euro\textcentoldstyle) cost of sorting.       \item[$CP$] (\euro\textcentoldstyle) cost of the packaging material.       \item[$c_{pack}$] (\euro /kg) cost of the packaging material per kilogram.       \item[$c_u$] (\euro\textcentoldstyle/g) cost of the raw material per gram.       \item[$\delta$] dummy variable to consider both rework and scrap packages.       \item[$DEP$] (\euro /year) depreciation of the machine per year.       \item[$E(W|W \geq W_L)$] (g/package) expected weight value of the ``conforming'' packages.       \item[$E(W|W < W_L)$] (g/package) expected weight value of the ``non conforming'' packages.       \item[$LAB$] (\euro /h) labor cost per hour.       \item[$n_B$] number of ``conforming'' packages.       \item[$P$] number of packages produced in a specific time interval.       \item[$Q_{pack}$] (kg/package) quantity of the packaging material per package.       \item[$t$] (hours/package) production time.       \item[$W$] (g/package) quantity of product delivered in each package, it can be modeled as a random variable with an unknown distribution.       \item[$W_L$]              (g/package) legal weight of the package. The tolerable negative error in the contents of a prepackage is fixed in accordance with the table below:          \begin{table}[htbp]         \captionsetup{font=small} % Set the caption font size     \begin{center}     \begin{tabular}{cc | cc}          \toprule     \multicolumn{2}{c}{$W_T$ in \si{\gram} or \si{\ml}} & \multicolumn{2}{|c}{Tolerable negative error}\\     \midrule     from    &   to              &   as \% of $W_T$  &     \si{\gram} or \si{\ml}\\     \midrule     5       &   50              &   9               &   -       \\     50      &   100             &   -               &   4.5     \\     100     &   200             &   4.5             &   -       \\     200     &   300             &   -               &   9       \\     300     &   500             &   3               &   -       \\     500     &   1000            &   -               &   15      \\     1000    &   \num{10000}     &   1.5             &   -       \\     \bottomrule          \end{tabular}     \vspace{5pt} % a little space to shift the caption down     \caption{tolerable negative error}     \label{tab:legislation}     \end{center}     \end{table}       \item[$W_T$] (g) Target weight value of a package.       \item[$TI$] (s) time used to take care of the ``non conforming'' packages.     \item[$WH$] (hours/year) working hours of the machine per year.          \end{description}     \end{document}      ### Output ![Output](http://i.stack.imgur.com/Z1LFv.png) ### Question Is there any easy way to align symbols, Units of measurement and descriptions? I'd like to avoid using tables to align. I'd like something like:               SYMBOL    (Units)    Long long long long long long long long long long long long long     SYMBOL_2  (Units)    Long long long long long long long long long long long long long                          Long long long long long long long long long long long long long


title: Newline after \cases in \equation environment

text: I have the following problem: I have an equation environment with three different lines. The first to should be connected with a 2 line bracket. The last line should be below the two. Just like if it were three independet lines of stuff. I use \cases to creat the bracket, but the last line will show up behind the two, not below. Tried multlines and eqnarray already.               \begin{equation}      2 \text{x}      \begin{cases}      {}^\text{1}\text{H} + {}^\text{1}\text{H} \rightarrow {}^\text{2}\text{H} + e^+ + \nu \\     {}^\text{2}\text{H} + {}^\text{1}\text{H} \rightarrow {}^\text{3}\text{He} + \gamma       \end{cases} \\      {}^\text{3}\text{He} + {}^\text{3}\text{He}  \rightarrow \text{2} {}^\text{1}\text{H}     \label{eq:ppkette}     \end{equation}


title: Tikz,PGFplots: drawing in node's cs placed on plot

text: I'm trying to place some arrows which should be placed alongside the graphs. I place nodes on the graph using               node[pos=0.2,above] (point1) {}       Then I want to draw in that coordinate system               \draw [->] (node cs:name=point1,anchor=north) -- (0,1);      but this doesn't work at all. Here's the complete code:               \begin{tikzpicture}     \tikzexternaldisable     \begin{axis}[xlabel=$\lambda$,ylabel=$M_R$     domain=0:50,     width=12cm,     height=8cm,     ytick=\empty     ]     \addplot[smooth,black] table[x=lam,y expr=\thisrow{ct}] {bilder/mr/ct.out} node[pos=0.6]{};     \addplot[smooth,black] table[x=lam,y expr=\thisrow{ct}*2] {bilder/mr/ct.out}      node[pos=0.2,circle,fill=black,scale=0.3] (point1) {}        node[pos=0.6,circle,fill=black,scale=0.3] (point1) {};     \addplot[smooth,black] table[x=lam,y expr=\thisrow{ct}*4] {bilder/mr/ct.out} node[pos=1, above] {$W$} node[pos=1,xshift=12pt,yshift=-10pt] (v1) {} ;     \draw (node cs:name=a1,anchor=north) [->]  (0,0) -- (0,1);          \end{axis}     \end{tikzpicture}      The ct.out looks like this:                   lam ct  cp     0.4 0.012360489 0.004944196     0.8 0.020495909 0.016396727     1   0.027456016 0.027456016     1.2 0.039743915 0.047692698     1.5 0.062400877 0.093601316     1.7 0.08363738  0.142183546     1.9 0.10823897  0.205654043     2   0.11533637  0.23067274     2.1 0.11622777  0.244078317     2.3 0.11317585  0.260304455     2.5 0.10662368  0.2665592     3   0.087667927 0.263003781     3.5 0.069310704 0.242587464     4   0.0525382   0.2101528     5   0.0262106   0.131053     6   0.003988099 0.023928596      Arrows should look like this ![Arrows should look like this](http://i.stack.imgur.com/dirSG.png)


title: Parentheses size

text: How can I change parenthesis size in whole document? I have bunch of 'coc(o)nunt' or 'co(c)onut' words. Standard parenthesis seems too big, footnotesize looks ok. Replacing any `(` with `{\footnotesize(}`, looks rather poorly.


title: How to make hanging lists using memoir?

text: I found the `\hangsecnum` command for having section numbers hanging out into the left margin. Now I want to do the same thing for all lists also, that is for the `enumerate` and `itemize` environments at least and maybe also for `description` if it is possible. I have been searching but not come up with any obvious ways of doing this. Just to be clear here is some ASCII-art showing what I want to do:                  Lorem ipsum dolor sit amet, consectetur adipiscing elit.         Donec accumsan, quam eget mollis eleifend, elit libero         molestie quam, vitae gravida eros lorem eget diam.         Nulla mollis cursus condimentum. Luctus eget vestibulum:           * ante       * ipsum       * primis              On faucibus orci luctus et ultrices posuere cubilia         Curae; Donec consequat elementum dictum. Suspendisse metus        turpis, venenatis at mollis quis, porta sit amet lectus:           1 aliquam       2 erat       3 volutpat             Vestibulum posuere convallis nibh a lacinia.      How can I do it?


title: Cartesian product of two lists as parameters for a command

text: Friends, I used to suffer a lot when had to iterate through elements of a list, but thanks to egreg's suggestion, I've been successfully using the `etoolbox` package for that task, e.g.:               \DeclareListParser*{\dothedance}{;}     \dothedance{\fbox}{item1; item2; item3}      Now, I'm trying to get all the pairs of a cartesian product of two lists (pardon the following Haskell code):               Prelude> [ (x,y) | x <- ['A','B','C'], y <- ['a','b','c','d'] ]     [('A','a'),('A','b'),('A','c'),('A','d'),('B','a'),('B','b'),('B','c'),('B','d'),('C','a'),('C','b'),('C','c'),('C','d')]      Then, for each pair, I'd like to break it into two parameters ( _x_ and _y_ ) and pass them to a command. For example, consider two lists `[Hello, Howdy]` and `[Ann, Mary, Kate]` and the following dummy command:               \newcommand\saysomething[2]{#1~#2}      I'd expect each pair to be the parameters of that command. So the output would be:               Hello Ann     Hello Mary     Hello Kate     Howdy Ann     Howdy Mary     Howdy Kate      I'm pretty sure `etoolbox` could help me on that, but all my attempts of iterating through two lists were unsuccessful. I'm probably missing something obvious, but I need enlightment. Any ideas?


title: How retain (overridden) default values with pgfkeys?

text: I'm creating a package for drawing sequence charts and make use of pgfkeys to keep default values for various parameters that I need. However, sometimes I wish to provide to my macros one or more pgfkeys key-value pairs that override the defaults stored in pgfkeys. The code below demonstrates a problem I'm having; it is stripped down to the bare minimum. There are many more keys in my original.               \documentclass{article}     \usepackage{tikz}     \newcount\x          \pgfkeys{/std/msg/width/.code=\def\msgwidth{#1}}     \pgfkeys{/std/msg/default/.style={         /std/msg/width=0.7,     }}     \pgfkeys{/std/msg/default} % Set the defaults          \newcommand{\msgx}[3][]{         \pgfkeys{/std/msg/.cd,#1} % Use provided optional params (or default)         \draw[->] (\x,#2) -- (\x+\msgwidth,#3);         \advance\x by 1     }          \begin{document}     \begin{tikzpicture}     \msgx{1}{2} \msgx{2}{1}     \msgx[width=0.3]{1}{3}     \msgx{1}{2} \msgx{2}{1}  % Uses width=0.3 (not the default)     \end{tikzpicture}     \end{document}      The problem with the example is that after setting width=0.3, it remains 0.3. I do want to be able to set it to something other than the default using an initialization macro (not shown), but I want the default/initialized values to be retained after the end of \msgx[width=0.3]. My questions is: What pgfkeys mechanism should I use to avoid that my optional params (#1) override the defaults?


title: How to put a symbol inside another in math mode?

text: In math mode, I would like to put a symbol inside another.   Let say I want to put an x inside a V.   I would like x to be in the empty space inside the letter V.   I guess I need to put V in a box, then x in a box too, and strecth/quench/overlap each box. I look at this thread, How to put a symbol inside a circle arrow?.   I tried the following, but it is not nice looking               \documentclass{article}     \usepackage{amssymb}     \begin{document}     \setbox1=\hbox{$V$}     \setbox2=\hbox{$x$}     \makebox[0pt][c]{\usebox1}     \makebox[0pt][r]{\raisebox{2.5pt}{$x$}}     \hspace{0.5\wd1} Here is some more text.     \end{document}      ![latex result](http://i.stack.imgur.com/QyCSP.png)


title: Working with arial or helvetica fonts

text: I want to use arial font, but it doesn't generate any document. I'm using Texpad software. I tried with `helvet` package, but it doesn't work. Here's my code, maybe I'm not right. Can you help me?               \documentclass[10pt, a4paper]{article}          \usepackage{fontspec}     \setmainfont{Arial}     \usepackage{lipsum}     \usepackage[ampersand]{easylist}          \begin{document}          \tableofcontents     \newpage     \section{TITLE}     \section{TITLE}     \subsection{Subtitle}     \subsection{Subtitle}     \section{TITLE}     \lipsum     \subsection{Subtitle}     \subsection{Subtitle}     \subsubsection{Title}     \begin{easylist}     & Title     & Title     && Subtitle     &&& Title     & Title     \end{easylist}     \subsubsection{Title}     \subsection{Subtitle}     \section{TITLE}     \subsection{Subtitle}     \subsubsection{Title}          \end{document}


title: table too wide and doesn't fit within textwidth

text: \begin{table}[htbp]             \centering             \small             \begin{tabular}{|c|c|c|c|c|c|c|c|c|}                 \hline                     Wavelength & Model & Package & Emmitter type & Manufacturer & Power (mW) & Iop (mA) & Ith (mA) & Vop (V)\\                 \hline                     405 & DL-7386-101HG & TO-56 & single & sanyo & 50-70 & 70 & 35 & 4.8\\                 \hline                     450 & PL 450 & TO-38 & single & osram & 50-90 & 120 & 30 & 5.5\\                 \hline                     638 & ML520G54 & TO-56 & single & mitsubishi & 90-100 & 150 & 50 & 2.7\\                 \hline                     655 &  DL-5147-242 & TO-56 & single & sanyo & 30-50 & 80 & 40 & 3.8\\                 \hline             \end{tabular}             \caption{Laser specifications}             \label{tab:Laser_Specs}         \end{table}      The above is my code for creating a table and when compiled it gets beyond textwidth. How can I solve this issue without altering the font size ? ![Output!](http://i.stack.imgur.com/N8j9e.png)


title: Symbol or image behind heading

text: I would like to insert/embed symbols/images behind a heading. Do you know, if that can be done?


title: Vertical space between section header and text is too big

text: \documentclass[12pt,a4paper]{mwrep}     \usepackage{polski}     \usepackage[utf8]{inputenc}     \usepackage{amsfonts}     \usepackage[draft]{graphicx}     \usepackage{amsmath}     \usepackage[nodisplayskipstretch]{setspace} \setstretch{1.5}     % Make all figure use 'ht' position by default:     \makeatletter     \def\fps@figure{ht}     \makeatother          \begin{document}     \section{Lorem ipsum}     \emph{Lorem ipsum} dolor sit amet, consectetur adipiscing elit. Vestibulum in scelerisque velit. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero.     \begin{equation}     Z=     \begin{bmatrix} z_{11} & z_{12} & \cdots & z_{1n} \\             z_{21} & z_{22} & \cdots & z_{2n} \\             \vdots & \vdots & \ddots & \vdots \\             z_{n1} & z_{n2} & \cdots & z_{nn}     \end{bmatrix}     \end{equation}     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum in scelerisque velit. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero.     \begin{gather}     E = mc^2 \\     a^2+b^2=c^2     \end{gather}          \emph{Lorem ipsum} dolor sit amet, consectetur adipiscing elit. Vestibulum in scelerisque velit. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero. Praesent ac mi libero.     \begin{figure}     \centering     \setlength\fboxsep{124pt}     \setlength\fboxrule{1pt}     \fbox{\includegraphics[scale=0]{dummy.jpg}}     \caption{Dummy caption}     \end{figure}     Lorem ipsum dolor sit amet, consectetur adipiscing elit. \textbf{In sed tortor sit amet magna eleifend egestas.}     \begin{equation}     P=     \begin{bmatrix} 0.1 & 0.3 & 0.0 & 0.6 \\                     0.2 & 0.4 & 0.1 & 0.3 \\             0.0 & 0.8 & 0.0 & 0.2 \\             0.2 & 0.0 & 0.2 & 0.6     \end{bmatrix}     \end{equation}     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum in scelerisque velit. Praesent ac mi libero.          \section{Sed eu neque ligula.}     \emph{Sed eu neque ligula.} Mauris gravida risus et eros aliquet viverra. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam vel nisi eu mauris fermentum dictum. Ut erat dui, aliquam nec cursus vel, scelerisque a ipsum. Curabitur ut est est. Aenean quis felis a orci sodales varius nec non est. Sed in augue eget orci elementum interdum vel et velit. Vestibulum sed condimentum lacus.      \end{document}       This is sample layout of my document. Sorry It's so long but I was not able to reproduce the problem on smaller sample. The problem is huge space between section header and text. Why bolded sentence (`In sed tortor sit amet magna eleifend egestas.`) is not on single page? It would look better and vertical space between header and text would be smaller. How can I fix this and this vertical space? Using `usepackage[headsep=0pt]{geometry}` as in How to remove vertical space between header and body of text? didn't help. I need figures to be at `ht`. If there is no way to aviod vertical space, I'd rather want it at the bottom of the page instead of the way it is now.


title: Marking (multiple) intersection points sinus function and constant function

text: The intersection of a sinus and a constant function, has multiple results. So my question is how to mark these points. My code               \documentclass[11pt,a4paper]{article}      \usepackage{geometry}     \geometry{margin=1in}           \usepackage{tikz}     \usepackage{tkz-euclide}     \usetkzobj{all} %% om allerhande objecten te gebruiken zoals gradenboog...     \usetikzlibrary{calc,intersections,through,backgrounds,snakes}     \usepackage{pgfplots}     \pgfplotsset{compat=1.8}          \begin{document}          \begin{center}     \begin{tikzpicture}     \begin{axis}[        %at={(0,-12mm)},         y=10mm,         width=1*\textwidth,         axis lines=center,         xmin=0, xmax=4*pi,         ymin=-2, ymax=2,         enlarge y limits,         enlarge x limits=upper,         samples=50,         xtick={0,1.5708,...,22},         ytick={-2,-1,...,3},         xticklabels={0, $\frac{\pi}{2}$, $\pi$, $\frac{3\pi}{2}$,$2\pi$,$\frac{5\pi}{2}$, $3\pi$, $\frac{7\pi}{2}$, $4\pi$,$\frac{9\pi}{2}$, $5\pi$, $\frac{11\pi}{2}$, $6\pi$,$\frac{13\pi}{2}$, $7\pi$},         tick label style={font=\tiny},         ]         \addplot[smooth, domain=0:4*pi, very thick, red] {sin(deg(x))};         \addplot[smooth, domain=0:4*pi] {0.5};     \end{axis}     \end{tikzpicture}     \end{center}         \end{document}      ![sin\(x\)=0.5](http://i.stack.imgur.com/vckiB.png)


title: exsheets varying of question's point value

text: I'm using exsheets package. I want variations with different point values.               \documentclass[a4paper]{article}     \usepackage[magyar]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{t1enc}     \usepackage{lipsum}     %     \usepackage{titlesec}     \usepackage[load-headings,load-tasks,]{exsheets}     \begin{filecontents}{\jobname-example.inc}         \begin{question}{2}             What is the result of \vary{$2+3$}{$1231+4431$}?         \end{question}     \end{filecontents}     \begin{document}     %     %     \SetVariations{2}     \variant{1}     \section{Group A}     \includequestions{\jobname-example.inc}     \newpage     \variant{2}     \section{Group B}     \includequestions{\jobname-example.inc}     \end{document}      I want two different point value:               \documentclass[a4paper]{article}     \usepackage[magyar]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{t1enc}     \usepackage{lipsum}     %     \usepackage{titlesec}     \usepackage[load-headings,load-tasks,]{exsheets}     \begin{filecontents}{\jobname-example.inc}         \begin{question}{\vary{2}{4}} % <<<==== CHANGE =======             What is the result of \vary{$2+3$}{$1231+4431$}?         \end{question}     \end{filecontents}     \begin{document}     %     %     \SetVariations{2}     \variant{1}     \section{Group A}     \includequestions{\jobname-example.inc}     \newpage     \variant{2}     \section{Group B}     \includequestions{\jobname-example.inc}     \end{document}      But it fails on changed line:               ! You can't use `\long' after \the.      Is there any solutions without create two _full_ question (the differences between questions only the numbers)?


title: Latex TIKZ spring and damper in a row (and a spring in parallel)

text: I dont get into the syntax of drawing a damper and a spring in row (without a mass or anything else between them): all i can do is draw them in parallel: another thing: how do I control the length of the spring? Thank you a lot for you help!               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings}          \begin{document}          \begin{tikzpicture}[every node/.style={draw,outer sep=0pt,thick}]     \tikzstyle{spring}=[thick,decorate,decoration={zigzag,pre length=0.3cm,post length=0.3cm,segment length=6}]     \tikzstyle{damper}=[thick,decoration={markings,         mark connection node=dmp,       mark=at position 0.5 with        {         \node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum width=15pt,minimum height=3pt,draw=none] {};         \draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);         \draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);       }     }, decorate]     \tikzstyle{ground}=[fill,pattern=north east lines,draw=none,minimum width=0.75cm,minimum height=0.3cm]               \begin{scope}[xshift=7cm]          \node (wall) [ground, rotate=-90, minimum width=3cm,yshift=-3cm] {};     \node (walle) [ground, rotate=-90, minimum width=3cm,yshift=3cm] {};               \draw (wall.north east) -- (wall.north west);     \draw (walle.south west) -- (walle.south east);               \draw [spring, width=15pt] (wall.170) -- ($(walle.south west)!(walle.170)!(walle.south east)$);     \draw [damper] (wall.10) -- ($(walle.south west)!(walle.10)!(walle.south east)$);          \node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum width=15pt,minimum height=3pt,draw=none] {};                    \end{scope}          \end{tikzpicture}          \end{document}


title: Text misplacement with certains combinations of \mathring and \overline

text: If I try to compile the following document               \documentclass{article}          \usepackage{mathtools}          \DeclareMathOperator{\Op}{Op}          \begin{document}          \[ 1 + \mathring \Op(4) = 2 \]     \[ \overline{ 1 + \mathring \Op(4) } = 2 \]     \[ \mathring{\overline{ 1 + \mathring \Op(4) }} = 2 \]          \end{document}      the first two equations are displayed correctly, just as I want them. In the last one the text "Op" is misplaced on the right, superimposed on the "(4)". The `\mathring` symbol is correctly placed, but it has white below it, because the text has been moved. The rest of the formula appears to be formatted just like as the "Op" text was in the right place. My first impression is that it is a bug of the macro set, but I'm not very confident with such intricacies, so I ask here if this is a mistake of mine or not (proper workarounds are also appreciated!). In case it helps (I'm using a more or less up-to-date Debian sid):               $ pdflatex --version     pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)     kpathsea version 6.1.1     Copyright 2013 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).     There is NO warranty.  Redistribution of this software is     covered by the terms of both the pdfTeX copyright and     the Lesser GNU General Public License.     For more information about these matters, see the file     named COPYING and the pdfTeX source.     Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).     Compiled with libpng 1.2.49; using libpng 1.2.49     Compiled with zlib 1.2.8; using zlib 1.2.8     Compiled with poppler version 0.18.4      Thanks.


title: 2 axes scaling problem

text: I have two problems : the arrow on x axis. The left y axis does't match all the hight as the right does. I want on the left axe ymin=0 ymax=25 and the ticks lines in front of the tick lines of the right's one. I tried with ymin, ymax, and max space between ticks, but nothing good. ![enter image description here](http://i.stack.imgur.com/rOTlV.png)                   \begin{tikzpicture}          % let both axes use the same layers     \pgfplotsset{set layers}          \begin{axis}[%         scale only axis=true,         ybar, bar width=10pt,          ymin=0,ymax=100,         enlargelimits=0.05,         %axis x line=box,         axis y line=right,         symbolic x coords=%             {Janvier,Février,Mars,Avril,Mai,Juin,Juillet,             Août,Septembre,Octobre,Novembre,Décembre},         xtick=data,         x tick label style={rotate=60,anchor=east},         legend style={at={(0.1,0.85)}, anchor=south west,legend columns=-1},         %nodes near coords,         %nodes near coords align={vertical},     ]               \addplot[style={draw=yellow!80!black,fill=yellow!40!white}] coordinates {%         (Janvier,85)         (Février,75)         (Mars,60)         (Avril,59)         (Mai,62)         (Juin,42)         (Juillet,48)         (Août,41)         (Septembre,69)         (Octobre,80)         (Novembre,81)         (Décembre,91)         } ;          \legend{Précipitations} ;     \end{axis}               %\end{tikzpicture}          %\begin{tikzpicture}     \begin{axis}[         scale only axis = true,         ymin=0,         max space between ticks=28,         axis y line=left,         enlargelimits=0.05,         axis x line=none,         symbolic x coords=%             {Janvier,Février,Mars,Avril,Mai,Juin,Juillet,             Août,Septembre,Octobre,Novembre,Décembre},         legend style={at={(0.1,.93)}, anchor=south west,legend columns=-1},         ]          \addplot[red,mark=*] coordinates {%         (Janvier,9)         (Février,10)         (Mars,13)         (Avril,15)         (Mai,18)         (Juin,22)         (Juillet,24.5)         (Août,25)         (Septembre,22.5)         (Octobre,18)         (Novembre,13)         (Décembre,10.5)          } ;          \addplot[blue,mark=*] coordinates {%         (Janvier,3)         (Février,3.5)         (Mars,4.5)         (Avril,6.5)         (Mai,9.5)         (Juin,12)         (Juillet,14)         (Août,14)         (Septembre,12)         (Octobre,9)         (Novembre,6)         (Décembre,4)             } ;          \legend{Max,Min} ;          \end{axis}     \end{tikzpicture}


title: glossaries acronyms description in brackets

text: I use the package `\usepackage[acronym,toc]{glossaries}` In the text I write my acronyms usually via `\gls{Acr}`, `\acrshort{Acr}` or `\acrlong{Acr}` This displays my acronyms like: > Acronymdescription (Acr) > > Acr > > Acronymdescription Now my question: How can I get the description in brackets? > Acr (Acronymdescription) I used in a makeshift manner `\acrshort{Acr} (\acrlong{Acr})` Is there a better solution? Minimal example:               \documentclass{scrreprt}          \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{textcomp} % special chars     \usepackage{lmodern} % better fonts     \usepackage{relsize} % font size relative     \usepackage{xcolor}           \definecolor{navy}{RGB}{0,0,128}          \usepackage[         bookmarks,         bookmarksopen=true,         bookmarksnumbered,         colorlinks=true,         linkcolor=navy, % link colors         anchorcolor=black,% anchor link color         citecolor=navy, % referral to bibliography items in the text         filecolor=navy, % links to local files         menucolor=black, % Acrobat-menuecolor         urlcolor=navy,          backref,         plainpages=false, % needed for correct creation of bookmarks         pdfpagelabels=true, % needed for correct creation of bookmarks         hypertexnames=true, % needed for correct creation of bookmarks         linktocpage % page number linked to text in toc     ]{hyperref}          \usepackage[acronym]{glossaries}     \makeglossaries          \newacronym{DIN}{DIN}{Deutsches Institut für Normung}          \begin{document}          Often I need the standard form: \gls{DIN}.          But sometimes I need it like this: \acrshort{DIN} (\acrlong{DIN}).          Better would be an single command that includes the bracket in the link.          \newpage     \printglossary          \end{document}


title: Graphics importation and master image into Beamer

text: A conference accepted a presentation idea I submitted. They provided a PowerPoint template, but I want to use LaTeX and beamer The presentation will include pdf graphics. They want to know:   1. Can you accept • .png • .jpg • .bmp   1. Does the LaTex program have the capabilities to have a master page? If so, we want to put the background image in.   2. Can you match our aspect ratio of 16:9? And I do not know the answers to any of these.


title: Color fraction bar

text: What would be the easiest way to create a fraction whose bar can be coloured as desired? I know one can use the `\genfrac{left-delim}{right- delim}{thickness}{mathstyle}{numerator}{denominator}` command but I can't seem to get. The following is a MWE (not so much if you can see):               \documentclass[letterpaper]{article}     \usepackage{amsmath,amssymb}     \usepackage{xcolor}          \begin{document}     $\genfrac{}{}{0.4pt}{}{a}{b}$     \end{document}      ## UPDATE Applying Herbert's solution below yields something weird. See below: ![enter image description here](http://i.stack.imgur.com/y6pCL.png)               \documentclass[letterpaper]{article}     \usepackage{amsmath,amssymb}     \usepackage{xcolor}          \def\Frac#1#2{ #1 \color{red}\above 0.4pt \normalcolor #2}          \begin{document}          $ \Frac{n+1}{n-1} $$\displaystyle \Frac{n+1}{n-1} $          \end{document}      Note the denominator of the second is of the same size as the first fraction.


title: Using variables to draw a tikz diagram

text: I am defind my own command to plat a diagram with tikz. Instead of constant values I rather want to pass numbers to my command which determine the height of the bars in my diagram. **Problem:** I am using a wrong syntax, so Tex cannot parse my arguments to set the bar height. I tried a, #a, {#a} and #{a} but nothing workd so far. **Question:** What is my mistake and how can I solve it?               \newcommand{\clocksTen}[a][b][c][d]{     \begin{tikzpicture}     %  \centering     \begin{axis}[     ybar,     enlargelimits=0.15,     legend style={at={(0.5,-0.15)},     anchor=north,legend columns=-1},     %width=0.4\textwidth,     ylabel={CPU clocks},     symbolic x coords={one, two, three, four},     xtick=data,     nodes near coords,     nodes near coords align={vertical},     ]     \addplot coordinates {     (one, a) %doesnt work     };     \addplot coordinates {     (two, #a) %doesnt work     };     \addplot coordinates {     (three, {#a}) %doesnt work     };     \addplot coordinates {     (four, #{a}) %doesnt work     };     \legend{one, two, three, four}     \end{axis}     \end{tikzpicture}     }


title: How to split a node content/right align in tikz tree?

text: This is my code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{arrows}     \usetikzlibrary{trees}               \tikzstyle{bag} = [text width=8em, text centered]          \begin{document}     \begin{tikzpicture}[-,>=stealth',level/.style={sibling distance = 2.5cm/#1,       level distance = 1cm}]      \node [bag] {$||$}         child{node[bag] {$\&\&$}           child{node[bag] {$enabled$}}           child{node[bag] {$\&\&$}               child{node[bag] {$tcas\_eq$}}               child{node[bag] {$intent\_not\_known$}}            }         }         child{node[bag] {$!$}           child{node[bag] {$tcas\_eq$}}         }     ;      \end{tikzpicture}     \end{document}      This is the output: ![enter image description here](http://i.stack.imgur.com/FHcoK.png) How to make last two nodes' content separate? I want something like this: ![enter image description here](http://i.stack.imgur.com/RXE2v.png)


title: libertine-newtxmath some symbols

text: I'm using `libertine` with `newtxmath`. Actually it is very good but some symbols don't seem good to me as in the figure. ![enter image description here](http://i.stack.imgur.com/XaAPv.png) Can I use different font from these symbols like given below without changing the other ones? (these are from `mathpazo`.) ![enter image description here](http://i.stack.imgur.com/4jb04.png)               \documentclass{article}     \usepackage[english]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[lining]{libertine}     \usepackage[libertine,cmintegrals]{newtxmath}     \usepackage{ucs}     \usepackage{amsfonts,amsmath,amssymb}     \usepackage{graphicx}     %------------TIKZ-PGF----------------     \usepackage{tikz,pgf,pgfplots}     \pgfplotsset{compat=1.10}     \usepgfplotslibrary{fillbetween}     \usetikzlibrary{shapes.multipart}     \usetikzlibrary{patterns}     %---------------------------------          \begin{document}          \[     f\left(  \mathbf{x}|\theta\right)  =\underset{h\left(  \mathbf{x}\right)     }{\underbrace{1}}\cdot\underset{g_{1}\left(  T\left(  \mathbf{X}_{1}\right)     |\mu\right)  }{\underbrace{\left(  2\pi\sigma^{2}\right)  ^{-n/2}\exp\left[     -\frac{n\left(  \overline{x}-\mu\right)  ^{2}}{2\sigma^{2}}\right]  }%     }\underset{g_{2}\left(  T\left(  \mathbf{X}_{2}\right)  |\sigma\right)     }{\underbrace{\exp\left[  \frac{-1}{2\sigma^{2}}\sum\left(  x_{i}-\overline     {x}\right)  ^{2}\right]  }}%     \]     \[\sqrt{\exp\left[  \frac{-1}{2\sigma^{2}}\sum\left(  x_{i}-\overline     {x}\right)  ^{2}\right]}\]          $\forall\exists= \pm+-$     \end{document}


title: parbox vertical alignment

text: The following code uses parboxes and hrules to vertically align two rectangles of different heights. The hrule seem a bit hackish to me. Is there a more elegant solution?               \documentclass{article}     \begin{document}     \begin{minipage}[t]{4in}        \parbox[t]{2cm}{\hrule height 0pt width 0pt \rule{1cm}{1cm}}      \parbox[t]{2cm}{\hrule height 0pt width 0pt \rule{1cm}{3cm}}     \end{minipage}     \end{document}        My apologies. I tried to simplify the problem and only obfuscated it. The real problem is vertical alignment of two figures, each created in separate Tikz environments. I would like the y's to be at the same height, but I'd like to accomplish this outside of tikz.               \documentclass{article}      \usepackage{tikz}      \begin{document}           \begin{tikzpicture}      \draw (0,0)--(0,1) node[above]{$y$};       \end{tikzpicture}           \begin{tikzpicture}     \draw (0,0)--(0,3) node[above]{$y$};     \end{tikzpicture}          \end{document}


title: Extract year from parameter containing date

text: > **Possible Duplicate:**   >  How do I split a date? Does anyone know how to extract year from date in parameter of own macro? Namely,               \themacro#1{...}      where `#1` contain either date already in format `yyyy` or in format `dd.mm.yyyy`, which `\themacro` would convert to plain `yyyy`... I hope I made myself clear, well, simply speaking, I just need to extract the year from date (if extraction is necessary).


title: How to use qpdf via latexmk?

text: In the manual of latexmk I read that > [latexmk] can also, if needed, call an external program to do other > postprocessing on the generated files. How can I call qpdf with latexmk? I want to do `qpdf --linearize` on the file that latexmk is operating on. Preferably latexmk will call qpdf only when it is called with a specific flag such as `-l`.


title: xparse recursion and/or special numeric specifications

text: I need to parse a "commands" where each command is is a string of letters and numbers: `a34b56c32alpha` Does `xparse` have any way to deal with the numbers? I would like to specify it with something like `{ 'a' n 'b' n 'c' n m }` where `n` would be a number. Basically this is to save having to use unnecessary delimiters (it's already more complex and I can't use `,`). I'm new to `xparse` and didn't see anything in the docs about being able to parse numbers.               \documentclass[11pt]{book} % use larger type; default would be 10pt     %\documentclass[11pt,a4paper,oneside]{report}          \usepackage{pgffor}     \usepackage{xparse}     \begin{document}          \DeclareDocumentCommand{\Dotparse}{o m}     {     #1     }          % Passes each value in the array to an xparse command.     \def\Dots#1     {         \foreach \n in {#1}{             \Dotparse{\n}     }}          \Dots{[3]f4s3,f12s5,s2f14,[5]e,f,g,1,2,3,4,5,6,7}               \end{document}      This code does not parse the optional commands The above should display `3, , , 5, , , , ....` but I get No Value for all. not sure what is going on. In any case, what I want the output to be is for               \Dots{[3]f4s3,f12s5,s2f14,[5]e,f,g,1,2,3,4,5,6,7}      to parse into               [3](f + 4), s + 3, f + 12, s + 5, ...      where the the `+` does not mean addition BUT simply is a separator. So `#1 = 3, #2 = f, #3 = s, #4 = 4` (note, don't get confused by the array, it is irrelevant. I iterate over it and THEN pass the element to the xparser which is all I am concerned about now... e.g., I want to parse `[3]f4s3` into it's it's tokens where `f4s3` is actually 4 tokens. `f43s35` would still be 4 since for my purposes) for example, which such a parser I could write `x353.43y32.435z345.3cgreen` to represent a 3d point with color. Obviously it looks more confusing than using commands or = signs but it is very compact which is what I'm after.


title: Underscore should not force mathmode in macro

text: When trying to color words in arabic (transliteration), LaTeX wants me to be in mathmode (`Missing $ inserted.`), as there is an underscore in the transliteration. This is of course completely wrong as it is not math rather than `arabxetex`’s convention for some arabic letters. The problem only occurs if I try to color it using a macro, the version using the `\color` command directly works without any problems. However, to me the two are seemingly identical, yet to LaTeX they obviously are not. If I force the following code (ignoring all errors), I get this output: ![Forced Code](http://i.stack.imgur.com/gnwIg.png) The first line is “Try No. 1” and the second one “Try No. 2” and how it should actually look. I suspect the problem might lie in my macro but I fail to see where the error is.               % !TEX TS-program = xelatex     % !TEX encoding = UTF-8 Unicode          \documentclass{scrartcl}          \usepackage{xcolor}          \usepackage{fontspec,xltxtra,xunicode}     \setromanfont[Mapping=tex-text]{Linux Libertine O}     \setsansfont[Mapping=tex-text]{Linux Biolinum O}     \newfontfamily\arabicfont[Script=Arabic,Scale=1.5]{Scheherazade}          \usepackage{arabxetex}     \SetTranslitConvention{dmg}          \newcommand*{\place}[1]{{\color{cyan} #1}}          \begin{document}          \place{\textarab[trans]{\UC ya_trib}}% Try No. 1     {\color{cyan} \textarab[trans]{\UC ya_trib}}% Try No. 2          \end{document}


title: Underline and center headings

text: For a paper I have to make my LaTeX document guideline conforming. Many of you will already guess now that this means dirty work by violating virtually all possible typography standards. My biggest problem is concerning _section_ headings. They have to be:   * Capitalized   * Underlined   * Centered   * Have roman numerals   * **The bibliography should not be appended a section number.** I tried to achieve this using the `sectsty` package and since that did not work out gave the `titlesec` package a shot, both with and without the `ulem` package.   However, no combination worked. The problem occurs in any way when you give the option `underlined`. Here is a minimal example with the `sectsty` package:               \documentclass{scrartcl}          \usepackage{ucs}     \usepackage[utf8x]{inputenc}          %% ADJUSTMENTS FOR IAC     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %% Get stupid underlining for headings right     \usepackage[]{ulem}          %% Change heading style     \usepackage{sectsty}         \sectionfont{\MakeUppercase\rmfamily\center\underline}          \begin{document}         \section{Test Section}     \end{document}      How can I make those headings conform to the rules? Would it probably even be the easiest way to manually write the headings, without a command at all?


title: Is Tex/LaTex appropriate for my situation

text: Is TeX a good idea for my current situation? I'm currently maintaining documentation for a piece of software, so I came up with my own .doc template with the official company header/footer. Since software changes sometimes (shocking!) documentation needs to be updated frequently. As a developer I'm maintaining my documentation on source control and sometimes it would be interesting to be able to rapidly see what changes between two versions of the same document. I know TeX is maintained as clear text so it would make this comparison very easy. I'm also hoping to spend more time writing and less time fighting with my text editor. Some points to consider:   * I would like to keep the document look as close as possible to the current one (somewhat image heavy if I compare it to most document that I know were created with TeX)   * I am not the only developer and some probably never heard of TeX   * I'm starting from scratch and don't have a lot of hours to spend on document formatting (is that realistic?)


title: No page break after index with idxlayout

text: In the `idxlayout` manual I read that the `memoir` class with `twocolumn` options forces a page break after the index. Is there any way around this behavior? I would like the following to remain on one page, not three.               \documentclass[oneside,twocolumn]{memoir}          \usepackage[columns=1]{idxlayout}     \makeindex     \title{Title}          \begin{document}         \maketitle         \printindex         \index{Hi}{Hello}     \end{document}


title: How to make the legend box transparent in pgfplots?

text: The legend box is covering parts of the graph (even though I removed the borders). How do I make the legend box transparent? ![enter image description here](http://i.stack.imgur.com/3NhJD.png)


title: How to obtain a text surrounded with begin and end commands

text: I want to obtain a text surrounded with begin and end commands, as the following.               \begincommand     Here any text is written.     \endcommand          \surroundedtext % this command is replaced with "Here any text is written."      Of course, the object is accomplished if I define \begincommand so that it takes an argument.               \def\begincommand#1{...}     \begincommand{Here any text is written.}      But, I don't want to use braces. Please let me know if you have the solution.


title: TexLive 2011, MacTeX and file permissions

text: I've recently had occasion to upgrade three Mac machines to texlive 2011 using the package at MacTex. All the machines had different vintages of Tex already installed on them, though all had been installed from packages on the MacTex site - one had texlive 2010, one had an even older version of MacTex. It seems that all three have different permissions problems which lead to problems trying to run latex documents using locally installed fonts -- in all cases, Latex cannot find the font although `sudo updmap --listmaps` shows that the map files are there and known about. The locally installed fonts are in the user's own Library under a texmf tree. Previously I would just run `sudo updmap --enable Map ...` and this would all work. Now it doesn't -- `updmap` does add the map file, but Latex still cannot find the fonts. Curiously, all three installations have different file permissions on the texlive directly in the user's Library folder - one has read-write access, one has read access and another does not permit access at all!!! Is texlive inheriting something from somewhere strange? Any thoughts would be greatly appreciated.


title: \newcommand gives errors in math mode (with or without arguments)

text: I'm trying to define a custom command for use in math mode, defined as               \newcommand{\deriv2}[2]{\ensuremath{\frac{\partial^2 {#1}}{\partial {#2}^2}}}      Other non-math mode \newcommands work in my document, but as soon as I put one into math mode I get the error messages: > ! LaTeX Error: Missing \begin{document} > > ! You can't use `macro parameter character #' in math mode. I have also tried defining my `\newcommand` without `\ensuremath`, and in all combinations of calling it within the `equation` environment, `$$`, and `\\[ \\]`. I've also tested it without the arguments `#1` and `#2`, but any `\newcommand` I make seems to fail in math mode. Now, I _know_ one can roll their own commands to save tedium in math mode, and even pass arguments to them.


title: Smaller frame with listings

text: I am using `listings` to put java code in my `beamer` slides. Sometimes, I want to frame the code but I do not want the frame to occupy the whole width of the page. I want the frame to occupy only the width of my code and no more. Is there a way to do that?


title: How to add a jitter to a scatter plot with pgfplots

text: I have the following scatter plot:               \begin{tikzpicture}       \begin{axis}[         enlarge x limits=0.02,         xmin=0,       ]         \addplot+[only marks,mark size=1pt] table[x=rmsd,y=seq_score_min] {\featuretable};       \end{axis}     \end{tikzpicture}      ![http://i.stack.imgur.com/fG8tJ.png](http://i.stack.imgur.com/uesvq.png) I would like to add a jitter to the marks, i.e. some noise so that one can get a better feeling about the number of marks can would otherwise be placed above each other. In this particular case this is needed for the rightmost values.


title: tex4ht: limit toc

text: When I run the following file through `htlatex main html,4`, the first (main) page has a table of contents that is too deeply nested. I only need part,chapter and section in my toc. The section page should have the subsection in it. **How to get rid of the subsection in the first page?**               \documentclass{book}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{blindtext}     \begin{document}     \part {First part}     \chapter{A chapter}     \blindtext     \section{A section}     \blindtext     \subsection{A subsection}     \blindtext     \section{A section}     \blindtext     \subsection{A subsection}     \end{document}


title: reading multi columns table with out x column

text: I have a table (10000 rows and 14 cols) in a ascii file, which contain only the y - components. In my case the x's values are 1 till 10000. Is it possible to tell Tikz to plot from a table only with the y-component? I am aware of `x expr=\coordindex`, but then i need to import each column separately using addplot (in my case 14 times) and i need to define the color of each column separately. Is there an elegant solution to read the table, use the position of the y value as x position and different color for each column?


title: Biblatex author name missing (dashed=false and style=authoryear)

text: I'm encountering some odd behaviour in biblatex. The author name for multiple- entry citations in the bibliography is being supressed, but the style is defined (=authoryear, as per answer: define bib style) and I have the dashed option turned off (=false, as per answer: make dashed=false). Here is my MWE:               \documentclass[twoside,12pt]{book}     \usepackage[ pdftex,             pdfauthor={Michael J Lotinga},             pdftitle={The Title},             pdfsubject={The Subject},             pdfkeywords={Some Keywords},             pdfproducer={LaTeX with hyperref},             pdfcreator={pdflatex}             plainpages = false,              pdfpagelabels,              pdfpagelayout = OneColumn, % display single page, advancing flips the page - Sasa Tomic             bookmarks,             bookmarksopen = true,             bookmarksnumbered = true,             breaklinks = true,             linktocpage,             colorlinks = true,             linkcolor = cyan,             urlcolor  = blue,             citecolor = magenta,             anchorcolor = green,             hyperindex = true,             hyperfigures]{hyperref}      \usepackage[sorting=nyt,                 style=authoryear,                            hyperref=true,                 backref=true,                 maxbibnames=99,                 maxcitenames=1,                 uniquelist=false,                 uniquename = false,                 dashed=false,                 backend=biber]                 {biblatex}          %Redefine citation commands for linking     \DeclareNameAlias{sortname}{last-first}     \DeclareCiteCommand{\cite}       {\usebibmacro{prenote}}       {\usebibmacro{citeindex}%        \printtext[bibhyperref]{\usebibmacro{cite}}}       {\multicitedelim}       {\usebibmacro{postnote}}          \DeclareCiteCommand*{\cite}       {\usebibmacro{prenote}}       {\usebibmacro{citeindex}%        \printtext[bibhyperref]{\usebibmacro{citeyear}}}       {\multicitedelim}       {\usebibmacro{postnote}}          \DeclareCiteCommand{\parencite}[\mkbibparens]       {\usebibmacro{prenote}}       {\usebibmacro{citeindex}%         \printtext[bibhyperref]{\usebibmacro{cite}}}       {\multicitedelim}       {\usebibmacro{postnote}}          \DeclareCiteCommand*{\parencite}[\mkbibparens]       {\usebibmacro{prenote}}       {\usebibmacro{citeindex}%         \printtext[bibhyperref]{\usebibmacro{citeyear}}}       {\multicitedelim}       {\usebibmacro{postnote}}          \DeclareCiteCommand{\footcite}[\mkbibfootnote]       {\usebibmacro{prenote}}       {\usebibmacro{citeindex}%       \printtext[bibhyperref]{ \usebibmacro{cite}}}       {\multicitedelim}       {\usebibmacro{postnote}}          \DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]       {\usebibmacro{prenote}}       {\usebibmacro{citeindex}%        \printtext[bibhyperref]{\usebibmacro{cite}}}       {\multicitedelim}       {\usebibmacro{postnote}}          \DeclareCiteCommand{\textcite}       {\boolfalse{cbx:parens}}       {\usebibmacro{citeindex}%        \printtext[bibhyperref]{\usebibmacro{textcite}}}       {\ifbool{cbx:parens}          {\bibcloseparen\global\boolfalse{cbx:parens}}          {}%        \multicitedelim}       {\usebibmacro{textcite:postnote}}          \makeatother     \addbibresource{references.bib}     \DefineBibliographyStrings{english}{%       bibliography = {References},% replace "references" with "bibliography"  for `book`/`report`     }               \begin{document}          \textcite{Taylor2004a}     \textcite{Taylor2004b}          \printbibliography          \end{document}      Here is my associated .bib file               @proceedings{Taylor2004a,     author = {Thornely-Taylor, R.M.},     title = {The prediction of vibration, groundborne and structure-radiated noise from railways using finite difference     methods},     year = {2004},     maintitle = {Proceedings of the 8th International Workshop on Railway Noise},     eventtitle = {IWRN8},     eventdate = {2004-09-08/2004-09-11},     location = {Buxton, UK},     url = {http://www.ruperttaylor.com/RMTT_IWRN8_6.pdf},     }          @inproceedings{Taylor2004b,     author = {Thornely-Taylor, R.M.},     title = {The prediction of vibration, groundborne and structure-radiated noise from railways using finite difference     methods  --  Part 1  --  theory},     maintitle = {Proceedings of the Institute of Acoustics},     year = {2004},     volume = {26},     part = {2},     pages = {69--79},     url = {http://www.ruperttaylor.com/RTT_IOA_SC2004.pdf},     }      And here is the bibliography output I am getting: ![Example bibliography output](http://i.stack.imgur.com/wPS1L.jpg) I'm hoping for an output that lists the author for every single reference, irrespective of whether it is the same as the preceding (or in this case, succeeding) entry! Can anyone make a suggestion as to what might be getting screwed up? I have other references that are behaving similarly, with less similar article titles. Any help is appreciated.


title: How to prevent page numbers from appearing on glossaries?

text: I am using the `glossaries` package to make a glossary. However I don't want the page numbers where the entry is referenced to be shown after the description in the glossary. How can I do that? Actually I use in preamble:               \usepackage[acronym]{glossaries}     \makeglossaries      and inside the document:               \printglossary[type=main,style=long]      I don't want the page numbers to be displayed because there are entries that are added in preamble with the command `\glsadd{entry}` and it will appear as present on page 1. And sometimes the page numbers list won't be complete, that is, there will be parts of the text which will contain one term and it won't reference directly the glossary. How to prevent the page number to appear on glossary?


title: How to make a custom reference list without automatic counter

text: In my document I have a list of requirements (currently these are just text created through a custom command). One special thing is that these requirements are manually numbered (and not ordered by number). This is very important because that way we can assure requirements stay uniquely identifiable across documents and versions. How can I make a list of requirements? And how can I refer (clickable in PDF) to my requirements from the text? I have found several examples of this (for instance using ntheorem), but they all do the numbering automatically. This could work for example as follows (the requirements are spread across the document):               \requirement{7}{Important requirement}     ...     \requirement{8}{Secondary requirement}     ...     \requirement{3}{Moved requirement, this must be followed if \refRequirement{7} is not follow}          \listOfRequirements      This would produce the requirements in order of set in the document, with a clickable link to requirement 7, and alist of requirements (sorted by number) in a separate chapter, these indicate the page the requirement is on, as well as a link to them.


title: Creating table without problem of exceeding page

text: I would like to create a table like this, but the first row is too long and exceeded the width of page. How can I create and fix this problem in latex? ![enter image description here](http://i.stack.imgur.com/kEdVE.jpg)


title: epsilon and varepsilon rendering in pslatex

text: I have a very simple article, with one line:               $\epsilon \gtrsim \varepsilon$      If I use `pdflatex` to compile, `\epsilon` and `\varepsilon` are rendered in a different way, which is the correct behaviour. However, I have to use `pslatex`, which renders both `\epsilon` and `\varepsilon` in the same way. Why is this so? Can you reproduce this behaviour, or perhaps I am missing a package? Edit. My working example.               \documentclass{article}          \begin{document}            $\varepsilon \gtrsim \epsilon$          \end{document}      Also, to clarify: I do not need both renderings in my document. I need only `\epsilon`. However `\epsilon` is rendered as `\varepsilon` by `pslatex`


title: Why does the hyperref package changes encoding of font commands?

text: If you compile the following document with hyperref using `XeLaTeX` you will see that the encoding of the text commands is changed by the`hyperref` package to "PU" encoding. Why is this necessary?               \documentclass{article}     \usepackage{fontspec}     \setmainfont{Linux Libertine O}     \usepackage{hyperref}          \begin{document}     \ttfamily     \meaning\textasciitilde\\     \meaning\textcelsius\\     \meaning\"\\     \meaning\NG\\     \meaning\k\\          \end{document}      Are there any "gotchas" to watch?


title: Plotting one x- vs multiple y- using custom color map

text: I am trying to plot data that comes in the form of one x-axis vs multiple y-axis on the same plot. I would like the color of each line to spread itself out through my desired color map (spectrum coloring). An example of the data I want plot can be found here: http://pastebin.com/R8nC0zq4 If I copy this data set into MATLAB, I can set up my plot to show an example of how I want it to ultimately look in pgfplots. Consider the pastebin code copied into `MATLAB`, residing in a variable named `data`:               cmp = jet(10);     hLine = plot(data(:,1),data(:,2:end)); %plot x vs all the y columns (10)     for line = 1:10     set(hLine(line),'Color',cmp(line,:));     end     set(hLine,'LineWidth',1.5);      The plot (which is just to illustrate what I want) looks as follows: ![example plot](http://i.stack.imgur.com/k4prm.png) Without using `matlab2tikz`, how can I use the data provided in the pastebin link to directly recreate this same plot in pgfplots? Ideally the method should be able to automatically take any number of y-data and set the color of each line appropriately. Thanks


title: @misc bibtex entry is not citing correctly

text: I'm using an @misc bibtex entry to cite a government website in my thesis. The Bibliography compiles fine, but within the text the citation is included twice. for example text text (cite, cite). Any ideas would be appreciated.               \documentclass{report}     \usepackage{natbib}      bibtex entry:               @misc{kinaSUR,         author = {{Ministry for Primary Industries}},         title = {{Kina sea urchin regions in NZ}},         howpublished = {\url{http://fs.fish.govt.nz/Page.aspx?pk=7\&sc=SUR}},         note = {Online; accessed 29 January 2014}       The double brackets for author ensure it typesets correctly, otherwise it tries to make it a first and last name and comes out a jumbled mess. It might be the problem but its the only way I could get the author to typeset correctly. Suggestions appreciated. Thanks               \documentclass{report}     \usepackage{natbib}      \begin{document}     \bibliographystyle{otago}      \bibliography{thesis}     \citep{kinaSUR}     \end{document}      bibtex entry is above


title: Implementing a syntax: Smooth curves with specified points and tangents

text: Note: the following question is similar to the final version of this question, but none of the answers to that question appear to answer my question. Often, I find it desirable to specify a curve by specifying that it passes through certain points with certain tangents. For instance, I might want to specify that a curve starts at `(0,0)` with at ten-degree angle and passes through `(1,1)` at a 70 degree incline, `(2,2)` at a 0-degree incline, and `(3,0)` at a -50 degree incline (in that order). The following code accomplishes this:               \documentclass[tikz]{standalone}     \begin{document}     \begin{tikzpicture}         \draw (0,0) to[out=10,in=70-180] (1,1)%             to[out=70,in=0-180] (2,2)%             to[out=0,in=-50-180] (3,0);     \end{tikzpicture}     \end{document}      ![Imgur](http://i.imgur.com/wlDbK.png?1) However, I find this awkward, for several reasons, one of which is most significant: if I want to fiddle with the tangent at a point, I have to change two numbers rather than just one. What I'd like to be able to write is something more like the following:               \begin{tikzpicture}         \draw (0,0) to[start angle=10,next angle=70] (1,1)%             to[next angle=0] (2,2)%             to[next angle=-50] (3,0);     \end{tikzpicture}      This syntax avoids redundancies and is more intuitive, at least to me. Unfortunately, my attempts to implement it using `\pgfkeys` type commands have so far been unsuccessful. How would one go about implementing something like the above? (Bonus points, figuratively speaking, for avoiding the use of low-level TeX commands.)


title: Tikz text not adjusting itself for the arrow

text: I have the code below which produces the image (unfortunately the code doesnt work since the image files are not available here). The text "Done" is for some reason getting placed well below the arrow. How can I fix that ?               \begin{flushleft}     \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto, node distance=8.5cm ,semithick]           \node [draw=none, initial, initial text=\textbf{Initial Query},initial where=above](part1){\includegraphics[width=7.5cm,height=6cm,keepaspectratio=true]{byhalfpart1.jpg}};              \node [draw=none](part2)[right of=part1] {\includegraphics[width=7.5cm,height=6cm,keepaspectratio=true]{byhalfpart2.jpg}     };          \path (part1) edge[]   node{} (part2);         \coordinate[below of=part2] (d1);          \path (part2) edge[shorten >=5cm]  node{Done} (d1);          %    \draw [shorten >=5cm] (part2) to[] node[auto] {\textbf{Done}} (d1);     \end{tikzpicture}\\     \end{flushleft}      ![enter image description here](http://i.stack.imgur.com/s50Ay.png)


title: Undefined control sequence Error with moderncv+Hebrew

text: I would like to use `modernv` to create a right-to-left CV document in Hebrew. I have downloaded and installed `culmus-latex`, and Hebrew+English LaTex documents compile without a problem. I took `template.tex`, the moderncv boilerplate file, and added the Hebrew packages:               \usepackage[T1]{fontenc}     \usepackage[latin9,cp1255]{inputenc}          \usepackage{babel}     \usepackage{culmus}      And changed the `documentclass` from:               \documentclass[11pt,a4paper,sans]{moderncv}      To:               \documentclass[11pt,a4paper,sans,english,hebrew]{moderncv}      I got the following error:               ...     (/usr/share/texmf-texlive/tex/generic/babel/babel.def))     (/usr/share/texmf-texlive/tex/generic/babel/rlbabel.def     ! Undefined control sequence.     <argument> \thesection           l.174 }          ?      ! Emergency stop.     <argument> \thesection           l.174 }          !  ==> Fatal error occurred, no output PDF file produced!     Transcript written on template.log.      More info:   * I'm working on Linux Mint with standard `texlive` packages.   * The original moderncv file and the Hebrew file compile well (separately).   * All documents are encoded in `Windows-1255`.   * I've uploaded the full tex files, log files and error message to gist:github.  **Addendum:** When the `inputenc` end `babel` lines are commented out:               %\usepackage[latin9,cp1255]{inputenc}     %\usepackage{babel}      The document compiles, with erroneous Hebrew encoding: ![enter image description here](http://i.stack.imgur.com/fjKCH.png) To conclude, > Uh, so, uh, anything you can do to, uh, to help, would be... very... > helpful...


title: inclusion arrow in TikZ

text: How can I give shape to some arrow in tikz, to draw the inclusion arrow? I read a similar question How to typeset inclusion arrow? with given answer, but the answer didn't really used tikz and I really need tikz in order to produce nice biggish diagrams. For instance, in this diagram (taken from here ), I want, say, A to be included in A' :               \matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]     { 0 & A  & B  & C  & 0 \\       0 & A' & B' & C' & 0 \\ };      { [start chain] \chainin (m-1-1);     \chainin (m-1-2);     { [start branch=A] \chainin (m-2-2)         [join={node[right,labeled] {\eta_1}}];}     \chainin (m-1-3) [join={node[above,labeled] {\varphi}}];     { [start branch=B] \chainin (m-2-3)         [join={node[right,labeled] {\eta_2}}];}     \chainin (m-1-4) [join={node[above,labeled] {\psi}}];     { [start branch=C] \chainin (m-2-4)         [join={node[right,labeled] {\eta_3}}];}     \chainin (m-1-5); }      { [start chain] \chainin (m-2-1);     \chainin (m-2-2);     \chainin (m-2-3) [join={node[above,labeled] {\varphi'}}];     \chainin (m-2-4) [join={node[above,labeled] {\psi'}}];     \chainin (m-2-5); }


title: How to change the way theorems are displayed with LyX?

text: The theorems are currently all displayed in bold, but I would like to display them in small-caps. My question is much like this one. However, I am using LyX with an AMS style document class, and was not able to implement any of the suggestions in the aforementioned thread, namely because I could not figure out how to use them in a LyX preamble. * * * Thanks Herbert. I am not entirely sure what you want me to show. Do you want to see the Lyx-generated preamble itself? Or were you looking for something more specific? I suspect that the below is more than you were looking for. Thanks for any help.               % Preview source code          %% LyX 1.6.8 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[11pt,oneside,english]{amsart}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage[letterpaper]{geometry}     \geometry{verbose,tmargin=1.23in,bmargin=1.23in,lmargin=1in,rmargin=1in}     \usepackage{babel}          \usepackage{float}     \usepackage{amsthm}     \usepackage{graphicx}     \usepackage{setspace}     \usepackage{amssymb}     \usepackage[authoryear]{natbib}     \onehalfspacing     \usepackage[unicode=true, pdfusetitle,      bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,      breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]      {hyperref}          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.     \numberwithin{equation}{section}       \theoremstyle{plain}       \newtheorem{assumption}{Assumption}       \theoremstyle{plain}       \newtheorem{prop}{Proposition}[section]       \theoremstyle{definition}       \newtheorem{defn}{Definition}[section]       \theoremstyle{plain}       \newtheorem{lem}{Lemma}[section]       \theoremstyle{plain}       \newtheorem{thm}{Theorem}[section]       \theoremstyle{plain}       \newtheorem*{algorithm*}{Algorithm}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \makeatletter \renewenvironment{proof}[1][\proofname] {\par\pushQED{\qed}\normalfont\topsep6\p@\@plus6\p@\relax\trivlist\item[\hskip\labelsep\bfseries#1\@addpunct{.}]\ignorespaces}{\popQED\endtrivlist\@endpefalse} \makeatother          \makeatother          \begin{document}


title: Grid Z-order in PGFPlots

text: How can I go about putting a grid _in front_ of a bar chart in PGFPlots, preferably as automagically as possible? Ed Tufte demonstrates a rather appealing way of drawing bar charts in The Visual Display of Quantitative Information that consists of removing horizontal grid lines from the bars (example centre), and it occurs to me that this can be replicated by drawing white horizontal lines over the chart, or perhaps through some other route. Any ideas?


title: `hyperref` weirdness with simple custom package

text: Trying to retroactively get `hyperref` working for my thesis. Fun. Encountered the following weirdness... I have the following (hard earned) minimal-ish working example:               \documentclass{article}          \usepackage{blindtext}     % LINE 0 BELOW     % \usepackage{mypackage}     \usepackage{hyperref}          % LINE 1 BELOW     \newtheorem{definition}{Definition}[section]           \begin{document}          \section{Section One}     See Definition~\ref{def:one}.          \begin{definition}\label{def:one}     \blindtext     \end{definition}          \Blindtext          \section{Section Two}     When using external \texttt{mypackage}, Definition~\ref{def:two} \texttt{hyperref}'s to Definition~\ref{def:one}---otherwise it's fine.          \begin{definition}\label{def:two}     \blindtext     \end{definition}          \end{document}      Which works fine after a couple of builds. However, if I put the `newtheorem` command (`LINE 1`) into a new custom `mypackage.sty` as follows:               \ProvidesPackage{mypackage}          \newtheorem{definition}{Definition}[section]      ...stick it in the same directory as the main file, and toggle the comments on `LINE 0 & 1` in the main file, after a couple of builds I get a warning: > pdfTex warning (ext4): destination with the same identifier > (name{definition.1}) has already been used, duplicate ignored Also, in the resulting PDF, the label for the second `Definition` links to the first one. Now, I have my fix (move the `newtheorem` declaration into my main .tex file)... ...but I've been held hostage by `hyperref` for so long this time, I've developed Stockholm syndrome. (Looking back at my history with this package, it was only a matter of time.) Can someone give me some closure and explain _why_ `hyperref` cares where I put my `newthereom` declaration? Otherwise, can someone point me in the direction of a `hyperref` victim support group?


title: BA (Baskerville) Math Font from micropress available?

text: For several years now, I've been trying to get my hands on the BA Math Font from micropress. But I can't find anyone who has it, or who is willing to sell it to me (including the original authors). And the online ordering form at the referenced website doesn't do anything -- I've tried it. As far as I can tell, this font has disappeared from the face of the planet! :) Does anyone know where I can buy this font? Anyone have any information that might help me to track this down?


title: Createspace template for a pocket book

text: I have been used `createspace` (GitHub) package but that is not giving me the desired results. I have attempted to use the `geometry` package with the following code:               \usepackage[paperwidth=5.325in, paperheight=8.125in,bindingoffset=.75in]{geometry}      But I don't think this is inline with createspace guidelines. Therefore, my question is, I have done this correctly? And if not, how can I fix it? EDIT: The createspace guidelines require that the inside margin of the document is .75 and the outside margin is 0.5. I am using the trim size `5.25 x 8`. **UPDATE:** I uploaded the file with the code the that @Jubobs provided and I still get the following message: > Insufficient gutter, books from 151 - 400 pages require at least .75" for > the gutter (inside margin) and at least .25" for the outside, top and bottom > margins. When I used the in-built function, the words were not too much out of the margins but now they are out of the margins by a lot.


title: Why are checkboxes always checked, regardless of default or configuration?

text: Weird situation in a form:               \documentclass[]{article}     \usepackage{hyperref}     \begin{document}          \title{Test of checkbox}     \author{Me}     \date{\today}     \maketitle          \begin{Form}     \CheckBox[name=Test]{This} \\     \CheckBox[name=Test,checked=false]{Or This}     \end{Form}     \end{document}      If you believe the manual, checked=false is the default behaviour. I am seeing both boxes above as being checked. Platform: MacTeX 2014 on Mac OSX Mavericks 10.9.2.


title: Is there a substitute for Blue Sky's TeXtures?

text: Is there a substitute for Blue Sky's TeXtures program? That is, some other TeX editor that typesets TeX code in real time?


title: How to display videos

text: I'm trying to include a video into my presentation using this code:               \documentclass[xcolor={dvipsnames}]{beamer}     \usetheme{CambridgeUS}     \usepackage{multimedia}          \begin{frame}     \frametitle{Test title}     \framesubtitle{Test subtitle}     \movie[showcontrols,width=\linewidth]{}{c.avi}     \end{frame}          \end{document}      But this wouldn't display the video, how do I to deal with this please? Thanks a lot!


title: How to get small numbers (For example q0)

text: I'm still new to Latex, and I can't seem how to write f.ex. q0 where the 0 is small. Hard to explain/search google when I don't know what you call this in english. Hope someone can help :)


title: pgfplots linear regression for the wrong column

text: The following MWE correctly plots the `Y` column when it is plotted directly (black points). However, a linear regression specified for the `Y` column actually fits to the `Z` column if the `Y` column is the last one (black dashed line). If `Y` is the second column, the regression is for the correct column (blue dashed line). How can I have the linear regression be for the `Y` column even though it is the last column?               \documentclass[tikz]{standalone}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \pgfplotsset{compat=1.10}          \begin{document}     \begin{tikzpicture}     \begin{axis}[ytick={1,...,6}]     \pgfplotstableread{%     X Z Y     1 3 0     2 4 1     3 5 2     4 6 3     }\test     \addplot[only marks, mark=*] table[x=X, y=Y] {\test};     % Here be dragons     \addplot[no markers,dashed,x=X,y={create col/linear regression={y=Y}}] table {\test};     % Here is normal     \addplot[no markers,dashed,x=X,y={create col/linear regression={y=Y}},blue]     table{%     X Y Z     1 0 3     2 1 4     3 2 5     4 3 6     };     \end{axis}     \end{tikzpicture}     \end{document}      ![incorrect linear regression](http://i.stack.imgur.com/8eWce.png)


title: Horizontal placement of graphic in left and right margins

text: I want to place small graphics in the outer margins of my 2-sided document. I've been using, e.g.,               \marginpar[{\hfill     \includegraphics[scale=.3]{figures/ivy-univ.png}\hspace{8 pt}     }]{     \includegraphics[scale=.3]{figures/ivy-univ.png}     }      It works fine on the right-hand page margins, but the graphic overlaps the text on the left-hand pages. I've been playing with the `\hfill`, `\hspace` and with using `\marginnote`, but can't get it right. `\marginnote` got the position right, but didn't recognize left vs right page properly. Any help is appreciated.


title: Using tikz to create fancy chapters

text: I am trying to use **Stefan Kottwitz** 's chapter style found on TeXample.net I am using the code as is but I can't seem to be able to compile it successfully. The code is               \documentclass[svgnames]{book}          \usepackage{tikz}     \usepackage{kpfonts}     \usepackage[explicit]{titlesec}     \newcommand*\chapterlabel{}          \titleformat{\chapter}       {\gdef\chapterlabel{}        \normalfont\sffamily\Huge\bfseries\scshape}       {\gdef\chapterlabel{\thechapter\ }}{0pt}            {\begin{tikzpicture}[remember picture,overlay]         \node[yshift=-3cm] at (current page.north west)           {\begin{tikzpicture}[remember picture, overlay]             \draw[fill=LightSkyBlue] (0,0) rectangle               (\paperwidth,3cm);             \node[anchor=east,xshift=.9\paperwidth,rectangle,                   rounded corners=20pt,inner sep=11pt,                   fill=MidnightBlue]                   {\color{white}\chapterlabel#1};            \end{tikzpicture}                };        \end{tikzpicture}       }     \titlespacing*{\chapter}{0pt}{50pt}{-60pt}          \begin{document}     %\tableofcontents     \chapter{Introduction}     Text     % \chapter{Main}     %      % \section{Section}     % Text     % \begin{thebibliography}{99}     % \bibitem{Test} test reference     %      % \end{thebibliography}     \end{document}      What I get is an error that > There is no `\begin{document}` Here is my log file. Any idea on why there is such a problem?


title: Omitting date when exporting from org-mode

text: How can I omit the date from being displayed when exporting to LaTeX from emacs org-mode? This (within the .org file) works to omit the date when exporting to ascii:               #+OPTIONS: timestamp nil      But it doesn't take effect when exporting to LaTeX. Nor does this work:               #+ATTR_LATEX: :date nil


title: How to show a long chapter name in the footer with two lines?

text: A short time ago, I asked this question to resize the width of a chapter section. But there is another problem with the footer. If the chapter name is too long, the chapter name in the footer ends in the middle. Is there any possibility to make the height optimal for two lines? ![Chapter name](http://i.stack.imgur.com/qYWqO.png) ![Footer](http://i.stack.imgur.com/RlTD5.png) I tried to make a working sample, but it's not optimal...               \documentclass{scrbook}     \usepackage{xcolor}     \usepackage{titlesec}     \usepackage{lmodern}% just for the example     \usepackage{lipsum}% just for the example     \usepackage{hyperref}     \usepackage{fancyhdr}      \usepackage{tgheros}          \colorlet{ctcolorchapterline}{cyan}     \colorlet{ctcolorchapternum}{cyan}          \newcommand\mychapformat[1]{%       \parbox[b]{\dimexpr\textwidth-3em\relax}{\raggedright#1}}     \titleformat{\chapter}[display]%       {\usekomafont{chapter}}%       {\vspace{-8em}\raggedleft{%         {\color{ctcolorchapterline}%             \rule[-5pt]{2pt}{5cm}}\quad%         {\color{ctcolorchapternum}             \fontsize{60}{60}\selectfont\thechapter}%         }%       }%       {-2.1em}%       {\mychapformat}%       [\phantomsection]          % **************************************************     % Header and Footer     % **************************************************     \pagestyle{fancy}     \renewcommand{\chaptermark}[1]{%         \markboth{%             \footnotesize%             {\color{ctcolorchapterline}\textbf{\chaptername\ \thechapter}}%             \quad%             {\color{ctcolorchapterline}#1}%         }{}%     }     \renewcommand{\sectionmark}[1]{%         \markright{%             \footnotesize%             {\color{ctcolorchapterline}\textbf{\thesection}}%             \quad%             {\color{ctcolorchapterline}#1}%         }%     }     %     \fancypagestyle{plain}{%         \fancyhf{}         \fancyfootoffset[OR]{1.85cm}         \fancyfoot[OR]{%             {\ }\usekomafont{chapter}%             {\color{ctcolorchapterline}\rule[-90pt]{1.25pt}{100pt}}%             \hspace*{10pt}\begin{minipage}[b]{1.5cm}%                 \color{ctcolorchapterline}\normalsize\textbf{\thepage}%             \end{minipage}%         }         \fancyfootoffset[EL]{1.85cm}         \fancyfoot[EL]{%             \usekomafont{chapter}%             \begin{minipage}[b]{1.5cm}%                 \raggedleft\color{ctcolorchapterline}\normalsize\textbf{\thepage}%             \end{minipage}%             \hspace*{10pt}{\color{ctcolorchapterline}\rule[-90pt]{1.25pt}{100pt}}%         }         \renewcommand{\headrulewidth}{0pt}         \renewcommand{\footrulewidth}{0pt}     }     %     \fancypagestyle{maincontentstyle}{%         \pagestyle{plain}         \fancyhf{}         \fancyfootoffset[OR]{1.85cm}         \fancyfoot[OR]{%             {\ }\usekomafont{chapter}\footnotesize%             \rightmark%             \hspace*{0.75cm}{\color{ctcolorchapterline}\rule[-90pt]{1.25pt}{100pt}}%             \hspace*{10pt}\begin{minipage}[b]{1.5cm}%                 \color{ctcolorfooterpage}\normalsize\textbf{\thepage}%             \end{minipage}%         }         \fancyfootoffset[EL]{1.85cm}         \fancyfoot[EL]{%             \usekomafont{chapter}\footnotesize%             \begin{minipage}[b]{1.5cm}%                 \raggedleft\color{ctcolorchapterline}\normalsize\textbf{\thepage}%             \end{minipage}%             \footnotesize%             \hspace*{10pt}{\color{ctcolorchapterline}\rule[-90pt]{1.25pt}{100pt}}%             \hspace*{0.75cm}\leftmark%         }     }          \begin{document}          \chapter{A test chapter with a long title that will span two lines}     \lipsum[1-6]          \end{document}


title: Displaying the horizontal and vertical lines of a table after coloring rows

text: How can I re-show each line in the following table after coloring the row?                \documentclass[english,a4paper,12pt]{report}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage[latin9]{inputenc}     \usepackage{graphicx}     \usepackage{xcolor,colortbl}     \usepackage[showframe=false]{geometry}     \usepackage{changepage}     \usepackage{hhline}          \usepackage[font=normalsize,labelfont=bf,justification=centering]{caption}     \begin{document}          \begin{table}[htb]     \begin{adjustwidth}{-1cm}{}     \resizebox{0.6\textwidth}{!}{     \begin{minipage}{\linewidth}     \def\arraystretch{1.5}%          \begin{tabular}{ | c | c | c | c | c |  c |  c |  c | c |  c |  c |  }     \cline{2-11}     \multicolumn{1}{c|}{} & \textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} &     \textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} &     \textbf{Telestrada} & \textbf{Telestrada} & \textbf{Telestrada} \\          \hline       \textbf{LOC} & 5 & 5 & 6 & 5 & - & 5 & 6 & 5 & 6 & 5  \\     \hline     \rowcolor{gray!40}  \textbf{VS} & 8 & 5 & 9 & 8 & 9 & 8 & 9 & 8 & 9 & 8 \\     \hline          \end{tabular}     \end{minipage}      }     \end{adjustwidth}     %% put caption outside here     \caption{\label{fig:text}text experiment experiment experiment experiment experiment experiment experiment}     \end{table}     \end{document}      ![enter image description here](http://i.stack.imgur.com/KlYxU.png)


title: How to fix vertical text frame size (including footnotes)?

text: I'm using LyX to typeset a document, and get a predictable page size when no footnotes are around. However, when I use footnotes, those are added as **extra** at the bottom of the page, changing the overall size of the 'text frame' of the document. In my case, it's critical to keep the maximum frame consistent so that e-readers such as KDX would show them uniformly without text shrinking. So my question - is there any way to tell LaTeX/LyX to do this? Just to give an analogy, in InDesign you define a text frame and that's where _everything_ goes - text _and_ footnotes.


title: Brace diagram in TikZ

text: I apologize if this has already been covered in some other posts, but I couldn't find it anywhere and I'm not even sure if "brace diagram" is the correct name in English. I have found some examples of probability trees, and some others that are close (like this: Draw Curly Braces in TikZ), but while playing with them I couldn't get the correct output (The part of the first "text here" when out of boundaries into the brace). What I'm trying to do is something like this with `TikZ`: ![enter image description here](http://i.stack.imgur.com/aurLX.png) I know there are some ways to do this with mathmode, but I'm really interested in learning a little more about `TikZ` and how it works for diagrams like this.


title: Randomly reduce the number of pages

text: My colleagues and I wrote a book that has m pages. Our editor wants n << m pages. For fun, I'd like to submit him two versions of our book.   1. One version that randomly suppress (m - n) pages from the final output (I'd like to do it on-the-fly, that is discard a page once it has been shiped out).   2. One version that randomly suppress a fraction of characters so that the document has approximatively n pages. I thought that the `chickenize` package could help but, for once, it does not provide such useful functions. Do you have any idea?


title: Merge separate footnotes into text

text: A text (written by someone else) has numbered footnote insertion points:               Text text1) text text text2) text text text.3) Text ...       The actual footnote-texts are in a second file:               1) text of note one     2) text of note two     3) text of note three     ...      Manually putting each note where it belongs would be a nuisance; using endnotes instead of footnotes is unfortunately not an option. Using `\footnotemark[num]` and `\footnotetext[num]` gives me the right numbering but not the right distribution over the pages. I was wondering whether I could define one numbered macro per note (e.g. `\newcommand{\sepfootnote1}{\footnote{text of note one}}` and calling each macro at the appropriate point in the text but as macro names may not contain numbers this wouldn't be possible with a simple RegEx. Is there another way to make LaTeX do the tedious work?


title: Simple directed graph with some dashed edges

text: My code here does what I would like, except some node outlines are dashed where they should be solid. I realise I am probably putting the dashed in the wrong place, but I just tried my way to this.               \tikzstyle{every node}=[circle, draw, fill=black!50, inner sep=0pt, minimum width=4pt]     \begin{tikzpicture}[thick,scale=0.8,->,shorten >=2pt]         \draw (0,0) node {} -- (1,1) node {};         \draw (1,1) node {} -- (2,1) node {};         \draw (2,1) node {} -- (3,2) node {};         \draw (3,2) node {} -- (4,1) node {};              \draw (0,2) node {} -- (1,1) [dashed] node {};         \draw (1,2) node {} -- (2,1) [dashed] node {};         \draw (2,1) node {} -- (3,2) node {};         \draw (3,2) node {} -- (4,1) node {};              \draw (2,1) node {} -- (3,0) [dashed] node {};         \draw (2,1) node {} -- (2,0) [dashed] node {};         \draw (3,0) node {} -- (4,0) [dashed] node {};         \draw (3,0) node {} -- (4,-1) [dashed] node {};         \draw (1,1) node {} -- (1,0) [dashed] node {};     \end{tikzpicture}


title: Difference between setting parindent and hangindent

text: Is there a difference between setting   * `\parindent` to 1em and to setting   * `\parindent` to 0em, `\hangindent` to 1em, and `\hangafter` to -1 that shows in practical use? The nodes created by TeX are different, but does that show in typesetting at one point? One difference that I see is that the hang* settings are paragraph-local, but I don't care about that because I create every paragraph using LuaTeX's `tex.linebreak()` This question is specific about LuaTeX, but I guess the answer applies to all engines. Sample code:               \documentclass{article}     \begin{document}     \linewidth 300pt          \newcommand\text{A wonderful serenity has taken possession of my entire soul, like     these sweet mornings of spring which I enjoy with my whole heart. I am     alone, and feel the charm of existence in this spot, which was created     for the bliss of souls like mine. I am so happy, my dear friend, so     absorbed in the exquisite sense of mere tranquil existence, that I     neglect my talents.}          \text          \hangindent=\parindent     \parindent 0pt     \hangafter=-1     \text          \end{document}


title: How to make my bibliography an appendix?

text: I'm trying to do this:               \documentclass{article}     \usepackage{natbib}     \begin{document}     % ...     \phantomsection     \addcontentsline{toc}{section}{References}     \appendix     \bibliographystyle{apalike}     \bibliography{mybib}     \end{document}      I want my bibliography be titled as `"A. References"`, as all other appendixes. But it's still titled as `"References"`. What to do?