title: Stacked bar-plot: display total value

text: Is there a way to make `pgfplots` display only the total value of a stacked bar-plot? With `nodes near coords`, all segment-values are shown: ![enter image description here](http://i.stack.imgur.com/gqqqw.png) I'm only interested in the sum of the stacks, though. Basically, the last brown-ish value printed in black would be perfect. Here's the MWE which generates the picture above:               \documentclass{article}     \usepackage{pgfplots}          \pgfplotsset{testbar/.style={         xbar stacked,         width=.8\textwidth,         axis y line*= none, axis x line*= bottom,         xmajorgrids = true,         xmin=0,xmax=70,         ytick = data, yticklabels = {C1,C2},         tick align = outside, xtick pos = left,         bar width=6mm, y=8mm,         enlarge y limits={abs=0.625},% 0.5 + 0.5*(y - bar width)/y [TeX.sx #47995]         nodes near coords,         nodes near coords align={horizontal},     }}          \begin{document}          \begin{tikzpicture}         \begin{axis}[testbar]              \addplot coordinates{(2.68,1) (2.94,0)};             \addplot coordinates{(26.63,1) (31.67,0)};             \addplot coordinates{(6.2,1) (9.91,0)};         \end{axis}     \end{tikzpicture}          \end{document}


title: How to change section headings to have Q1 Q2

text: Can somebody help with changing the headings for my section? Instead of having 1 2 3, I would like to have Q1 Q2 Q3 (and keep the automatic numbering). Thanks


title: How can I increase arrow-head size in tkz-graph?

text: How can I increase the size of the head of the arrows in a `tkz-graph` graph? This question is similar to Is it possible to change size of arrowhead in TikZ/PGF?, but requires an adaptation of the solution to `tkz-graph` specifically.


title: memoir, adjmulticol, three column index

text: For my book i use memoir document class with asymmetric page layout (spinner margin is half of outer margin). For index i change text width with **adjmulticol** to have a place for index in three column formatted by **idxlayout**. This almost work fine ... except that all items are on one page! When the page is full, i.e. page is not going to break on as expected (see example below) and as is done when in adjmulticol is other (non index) text. What cause this behavior? Is there some better approach to achieve desired result? **Edit** : In my original question I unfortunately strip out three lines:               \usepackage{calc}      immediately after document class and               \setlength{\marginwidth}{\marginparsep+\marginparwidth}     \setlength{\headwidth}{\textwidth+\marginwidth}      before \usepackage{adjmulticol}, which shows, why I actually nested a **adjmulticol** and **idxlayout**. The length \marginwidth I use for calculation of \headwidth and other items in my real case (like chapter title layout, new environments which are extended into outer margin). I hope that my questions is more clear. Wider text width i need for placing longer indices in index that they are not broken unnecessary into two lines.                       \documentclass[twoside,openright]{memoir}             \usepackage{calc}% added in eddit         \setstocksize{297mm}{210mm}                                 % A4             \settrimmedsize{\stockheight}{\stockwidth}{*}           % A4         \newlength{\marginwidth}             \settypeblocksize{247mm}{120mm}{*}             \setulmargins{25mm}{*}{1}           % upper, lower margin, ratio             \setlrmarginsandblock{30mm}{60mm}{*}% spinner, outer margin, ratio         \checkandfixthelayout             \setlength{\marginparwidth}{45mm}             \setlength{\marginparsep}{5mm}         \setlength{\marginwidth}{\marginparsep+\marginparwidth}% added in edit         \setlength{\headwidth}{\textwidth+\marginwidth}% added in edit         %---------------------------------------------------------------%     \usepackage{adjmulticol}         \usepackage[columns=3]{idxlayout}         \makeindex              \begin{document}             \mainmatter         \chapter{Test of indexing}             \index{Alpha}         alpha(a)    \index{Alpha!alpha}             alpha(a)    \index{Alpha!alpha!a}   alpha(b)    \index{Alpha!alpha!b}             alpha(c)    \index{Alpha!alpha!c}   alpha(d)    \index{Alpha!alpha!d}         beta(a)     \index{Alpha!beta}                     \index{Alpha!beta!a}             beta(b)     \index{Alpha!beta!b}    beta(c)     \index{Alpha!beta!c}              \section{Beta, Delta, Epsilon, Eta}             \index{Beta}         alpha(a)    \index{Beta!alpha}             alpha(a)    \index{Beta!alpha!a}    alpha(b)    \index{Beta!alpha!b}             alpha(c)    \index{Beta!alpha!c}    alpha(d)    \index{Beta!alpha!d}         beta(a)     \index{Beta!beta}                     \index{Beta!beta!a}             beta(b)     \index{Beta!beta!b}     beta(c)     \index{Beta!beta!c}                  \index{Delta}         alpha(a)    \index{Delta!alpha}             alpha(a)    \index{Delta!alpha!a}   alpha(b)    \index{Delta!alpha!b}             alpha(c)    \index{Delta!alpha!c}   alpha(d)    \index{Delta!alpha!d}         beta(a)     \index{Delta!beta}                     \index{Delta!beta!a}             beta(b)     \index{Delta!beta!b}    beta(c)     \index{Delta!beta!c}                  \index{Epsilon}         alpha(a)    \index{Epsilon!alpha}             alpha(a)    \index{Epsilon!alpha!a} alpha(b)    \index{Epsilon!alpha!b}             alpha(c)    \index{Epsilon!alpha!c} alpha(d)    \index{Epsilon!alpha!d}         beta(a)     \index{Epsilon!beta}                     \index{Epsilon!beta!a}             beta(b)     \index{Epsilon!beta!b}  beta(c)     \index{Epsilon!beta!c}                  \index{Eta}         alpha(a)    \index{Eta!alpha}             alpha(a)    \index{Eta!alpha!a}     alpha(b)    \index{Eta!alpha!b}             alpha(c)    \index{Eta!alpha!c}     alpha(d)    \index{Eta!alpha!d}         beta(a)     \index{Eta!beta}                     \index{Eta!beta!a}             beta(b)     \index{Eta!beta!b}      beta(c)     \index{Eta!beta!c}              \section{Gamma, Kappa, Lambda, Omega}             \index{Gama}         alpha(a)    \index{Gamma!alpha}             alpha(a)    \index{Gamma!alpha!a}   alpha(b)    \index{Gamma!alpha!b}             alpha(c)    \index{Gamma!alpha!c}   alpha(d)    \index{Gamma!alpha!d}         beta(a)     \index{Gamma!beta}                     \index{Gamma!beta!a}             beta(b)     \index{Gamma!beta!b}    beta(c)     \index{Gamma!beta!c}                  \index{Kappa}         alpha(a)    \index{Kappa!alpha}             alpha(a)    \index{Kappa!alpha!a}   alpha(b)    \index{Kappa!alpha!b}             alpha(c)    \index{Kappa!alpha!c}   alpha(d)    \index{Kappa!alpha!d}         beta(a)     \index{Kappa!beta}                     \index{Kappa!beta!a}             beta(b)     \index{Kappa!beta!b}    beta(c)     \index{Kappa!beta!c}                  \index{Lambda}         alpha(a)    \index{Lambda!alpha}             alpha(a)    \index{Lambda!alpha!a}  alpha(b)    \index{Lambda!alpha!b}             alpha(c)    \index{Lambda!alpha!c}  alpha(d)    \index{Lambda!alpha!d}         beta(a)     \index{Lambda!beta}                     \index{Lambda!beta!a}             beta(b)     \index{Lambda!beta!b}   beta(c)     \index{Lambda!beta!c}                  \index{Omega}         alpha(a)    \index{Omega!alpha}             alpha(a)    \index{Omega!alpha!a}   alpha(b)    \index{Omega!alpha!b}             alpha(c)    \index{Omega!alpha!c}   alpha(d)    \index{Omega!alpha!d}         beta(a)     \index{Omega!beta}                     \index{Omega!beta!a}             beta(b)     \index{Omega!beta!b}    beta(c)     \index{Omega!beta!c}              \section{Pi, Phi, Psi, Rho}             \index{Pi}         alpha(a)    \index{Pi!alpha}             alpha(a)    \index{Pi!alpha!a}      alpha(b)    \index{Pi!alpha!b}             alpha(c)    \index{Pi!alpha!c}      alpha(d)    \index{Pi!alpha!d}         beta(a)     \index{Pi!beta}                     \index{Pi!beta!a}             beta(b)     \index{Pi!beta!b}       beta(c)     \index{Pi!beta!c}                  \index{Phi}         alpha(a)    \index{Phi!alpha}             alpha(a)    \index{Phi!alpha!a}     alpha(b)    \index{Phi!alpha!b}             alpha(c)    \index{Phi!alpha!c}     alpha(d)    \index{Phi!alpha!d}         beta(a)     \index{Phi!beta}                     \index{Phi!beta!a}             beta(b)     \index{Phi!beta!b}      beta(c)     \index{Phi!beta!c}                  \index{Psi}         alpha(a)    \index{Psi!alpha}             alpha(a)    \index{Psi!alpha!a}     alpha(b)    \index{Psi!alpha!b}             alpha(c)    \index{Psi!alpha!c}     alpha(d)    \index{Psi!alpha!d}         beta(a)     \index{Psi!beta}                     \index{Psi!beta!a}             beta(b)     \index{Psi!beta!b}      beta(c)     \index{Psi!beta!c}                  \index{Rho}         alpha(a)    \index{Rho!alpha}             alpha(a)    \index{Rho!alpha!a}     alpha(b)    \index{Rho!alpha!b}             alpha(c)    \index{Rho!alpha!c}     alpha(d)    \index{Rho!alpha!d}         beta(a)     \index{Rho!beta}                     \index{Rho!beta!a}             beta(b)     \index{Rho!beta!b}      beta(c)     \index{Rho!beta!c}              \section{Sigma, Theta, Xi}             \index{Sigma}         alpha(a)    \index{Sigma!alpha}             alpha(a)    \index{Sigma!alpha!a}   alpha(b)    \index{Sigma!alpha!b}             alpha(c)    \index{Sigma!alpha!c}   alpha(d)    \index{Sigma!alpha!d}         beta(a)     \index{Sigma!beta}                     \index{Sigma!beta!a}             beta(b)     \index{Sigma!beta!b}    beta(c)     \index{Sigma!beta!c}              \index{Theta}         alpha(a)    \index{Theta!alpha}             alpha(a)    \index{Theta!alpha!a}   alpha(b)    \index{Theta!alpha!b}             alpha(c)    \index{Theta!alpha!c}   alpha(d)    \index{Theta!alpha!d}         beta(a)     \index{Theta!beta}                     \index{Theta!beta!a}             beta(b)     \index{Theta!beta!b}    beta(c)     \index{Theta!beta!c}              \index{Xi}         alpha(a)    \index{Xi!alpha}             alpha(a)    \index{Xi!alpha!a}      alpha(b)    \index{Xi!alpha!b}             alpha(c)    \index{Xi!alpha!c}      alpha(d)    \index{Xi!alpha!d}         beta(a)     \index{Xi!beta}                     \index{Xi!beta!a}             beta(b)     \index{Xi!beta!b}       beta(c)     \index{Xi!beta!c}                   \backmatter         \begin{adjmulticols}{1}{0mm}{-\marginwidth}\Large             \printindex         \end{adjmulticols}         \end{document}


title: Text alignment in beamer

text: I make a presentation using LaTeX. But I have a slide with picture and text and I want a text to be aligned to the right. How to do this?               \documentclass{beamer}     \begin{document}     \begin{frame}          \begin{block}{Подпрограма Solver}     \end{block}          \begin{itemize}     \item Изпълнява се n -- пъти; \\      \item $\overline{F}(\varphi) = -\varphi \, '' + \sin \varphi - \gamma$; \\       \item $\varepsilon$ -- стоп--критерий. \\     \end{itemize}          \tikzstyle{my loop}=[->,to path={     .. controls +(300:1) and +(560:1) .. (\tikztotarget) \tikztonodes}]               \begin{tikzpicture}          \path (0, 0) node(a) [ellipse, draw] {$\varphi_0$};     \path (0, -1) node(b) [rectangle, draw] {$\varphi^n = \varphi^{n-1} + \tau_n \cdot     w^n$};     \path (0, -3) node(c) [diamond, draw] {$\| \overline{F}(\varphi^n) \| < \varepsilon$};     \path (6, -3) node(d) [rectangle, draw] {Продължаваме (получили сме решение)};          \draw[->] (a) to (b);     \draw[->] (b) to (c);     \draw[->] (c) to node[above] {да} (d);     \draw[->] (c) to (0, -5) node[right] {не} to (-2.5, -5) to (-2.5, 0) to (a);          \end{tikzpicture}     \end{frame}     \end{document}


title: How are the default Execution Modes set up in WinEdt?

text: I'm using portable MiKTeX and when I set up the _Execution Modes_ pointing to it, it works just fine. However, every time I change the computer the defaults are reverted to the `C:\` drive and I have to set the _Execution Modes_ over again (say by loading `TeXConfig.edt` from the flash drive). Also, the `default.prj` isn't coming up automatically and I have to specially load it. How are these defaults set once and for all in WinEdt?


title: How do I typeset ‘long’ waveforms with tikz-timing?

text: I'm typesetting with the `book` class (so, one column), and I need to typeset various waveforms with `tikz-timing`. When I was using it for two-column documents, I never had a problem, but now I've come across this (simplified from a larger document):               \tikzset{timing/.style={x=1ex, y=2ex, line cap=round, line join=round, line width=1.3pt}}       \begin{tikztimingtable}       RAWCLK & 28{CL CH} \\     \end{tikztimingtable}      Trying to compile this with the XeLaTeX from TeX Live 2012 (Debian release from 2011-06-11, marked `2012.20120611-3`) breaks:               ! Package tikz Error: Giving up on this path. Did you forget a semicolon?.          See the tikz package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.125   RAWCLK & 28{CL CH} \\      I experimented and found that this works if and only if:   * I shorten the trace to `7{CL CH}` (anything over 7 repetitions fails)   * I comment out or remove the entire `\tikzset{}` command. So it looks like it's either very short waveforms or unstyled waveforms. Obviously, I'd rather have long, styled ones. I can't figure out if I've just come across a limitation I can work around some other way, or I'm just doing something monumentally stupid, or I've come across a bug (in which case I'll happily delete the question and take it up with the TikZ and/or TikZ-Timing authors).


title: Is there a way to position a footnote in LyX without using TeX code "manually"?

text: I'm using the tufte-latex document class with LyX and would like to adjust the positions of some "footnotes" in my document by specifying an offset. I understand that I can do this manually by replacing the footnote that appears in LyX (which generates `\footnote{...}` in the source) with the code               \sidenote[][<offset>]{...}      but am wondering whether there is a way to do this through the LyX UI so that I don't have ERT cluttering up the document (yes, I know; but that's what LyX is for). Many environments and commands in LyX provide simple ways to add options in this way (e.g. `enumitem` lets you add options with `Insert > Short Title`) but I don't see how to do it for footnotes.


title: Biblatex Style or Package for Council of Science Editors Citation Format

text: I have seen that in between texlive 2011 and 2012, there were a lot of new styles developed. But I still have to see a style intended for the Council of Science Editors Citation Style. I'm definitely useless with **hardcore** tex codes but I definitely tried to read and understand the biblatex manual and the source files for the biblatex style files but I could not start to comprehend where to start so I would be very thankful if someone out there tries to develop a CSE style, specifically the **_Name-Year Citation Sequence_**? Also, does someone out there have an easy work-around without having to develop a CSE style? ## Update: December 24, 2012 What I am trying to achieve can be seen in the following external sites:   * http://writing.wisc.edu/Handbook/DocCBE_NameYear_Intext.html   * http://library.austincc.edu/help/CSE/CSE-ny.php   * http://www.libraries.psu.edu/psul/lls/students/cse_citation.html


title: LaTeX command with optional arguments

text: While writing lecture notes from statistical physics I found out, that I am often writing very similar long LaTeX sequences like `\frac{\partial }{\partial <foo>}` `\frac{\partial <bar>}{\partial <foo>}` and `\left( \frac{\partial <bar>}{\partial <foo>} \right)_{<baz>}` I wanted ease my life by using forms `\dddfrac{<foo>}` `\dddfrac{<foo>}{<bar>}`, and `\dddfrac{<foo>}{<bar>}{<baz>}` all with the same name, so they are easy to remember. One friend of mine (who's help is unavailable now) helped me with the following TeX hackery:               %requires \usepackage{gmverb}     \fooatletter{%       \def\dddfrac#1{%         \relaxen\dddfrac@i         \relaxen\dddfrac@ii         \relaxen\dddfrac@iii         \def\dddfrac@i{#1}%         \@ifnextchar\bgroup\dddfrac@getii\dddfrac@typeset}%       %        \def\dddfrac@getii#1{%         \def\dddfrac@ii{#1}%         \@ifnextchar\bgroup\dddfrac@getiii\dddfrac@typeset}%       %       \def\dddfrac@getiii#1{%         \def\dddfrac@iii{#1}%         \dddfrac@typeset}%       %       \def\dddfrac@typeset{%         \@ifundefined{dddfrac@iii}{%           \@ifundefined{dddfrac@ii}{% 1 argument only             \frac{\partial }{\partial \dddfrac@i}           }{% 2 arguments             \frac{\partial \dddfrac@i}{\partial \dddfrac@ii}%             }}{% 3 arguments             \left( \frac{\partial \dddfrac@i}{\partial \dddfrac@ii} \right)_{\dddfrac@iii}%           }}     }      I have experience in LaTeX, but cannot write in pure TeX (but I understand what the code does more-or-less). Now although this works as it is, the code is ridiculously long to write if I want to have, say, 20 such commands. Is there any standard way of slipstreaming implementation of such behaviour, for a person who _don't_ know how to program in pure TeX? Maybe someone already wrote package for this case, similar to e.g. the `suffix` package? Second question: LaTeX has a tradition of introducing starred versions for commands with some extra functionality instead of sufixing name with e.g. "Ex" (like Microsoft did). Is it possible to go along this tradition with the \dddfrac command and define \dddfrac* with another set of definitions for different number of arguments? Matbe the `suffix` will help? After all, this package allows for definitions of starred versions of commands or for a version of command with 1 argument and without. But the documenation is rather short and requires knowledge of TeX, which I humbly hope to be able to live without.


title: xtemplate proposes 'objects,' but are they really objects? How can they be extended to become 'true' objects?

text: In chat, @cgnieder just pointed me to `xtemplate` after poking around my own startup `ltx3obj`. In section 3, the documentation states (at the time of writing): > An _object type_ (sometimes just "object") is an abstract idea of a document > element that takes a fixed number of arguments corresponding to the > information from the document author that it is representing. A sectioning > object, for example, might take three inputs: > >> "title", "short title", and "label". But isn't this just a data structure at that point? Wiktionary defines an object as an instance of a class, and it defines a class as > A set of objects having the same behavior (but typically differing in > state), or a template defining such a set. Thus, objects have state _and_ behavior, which I clearly put forward in `ltx3obj`. I find it difficult to believe that `xtemplate` does not have a means of specifying behavior for a class (or object). Unfortunately, I can't find any explicit support other than _templates_ , which actually do the work of defining what an object _is_ rather than just saying _it is_. Moreover, templates do not (in a way that is immediately obvious) support methods. So in conclusion, I have three _very_ closely related questions:   * Is there a way `xtemplate` can be extended to include this?   * Does `xtemplate` already include this functionality, and is just non-obvious about it from the outside looking in?   * If not, are there any plans to officially include this functionality?


title: Is there an SBL citation style?

text: Does anyone know if there exists a `.bst` file for the Society of Biblical Literature citation format? Or a `biblatex` style?


title: A fancy box for non-verb text, but like that of Fancyvrb

text: How can I create, without a verbatim environment, these nice boxes that the `Fancyvrb` package produces: ![Image from Fancyvrb](http://i.stack.imgur.com/hRA1M.png) The sibling package `Fancybox` (by the same author) doesn't allow for the caption being placed onto the box's sides.


title: problem on the parentheses direction in equations

text: I recently installed a MacTex version and I faced a problem with the direction of parentheses both in the enumeration and the text reference using `\eqref`. I use XeLaTeX to compile the `tex` files. Since in my tex file I have right- to-left content, I have to use the bidi package. Example: Precision is computed as in equation )3.3(. ![enter image description here](http://i.stack.imgur.com/GyPLa.png) Here is the code:               \documentclass[oneside, a4paper]{report}          \usepackage{amsmath}          \usepackage{fontspec}\newfontfamily\Farsifont[Script=Arabic]{XB Niloofar}     \usepackage{fontspec}\newfontfamily\Parsifont[Script=Arabic]{XB Kayhan}     \usepackage{bidi}     \newcommand{\ARL}[1]{\RL{\Farsifont #1}}     \newcommand{\PRL}[1]{\RL{\Parsifont #1}}          \begin{document}          Precision is computed as in equation \eqref{eq:precision}.          \begin{equation}     \label{eq:precision}     P = \frac{Number~of~Correct~Constituents}{Total~Number~of~Constituents~in~Parser~Output}     \end{equation}          \end{document}      How can the parentheses be reordered in the correct format?


title: Repeating enumerated list items and their original number

text: Sometimes enumerated lists are used to list example sentences which are referred to from the text by their numbers in the list. But as such references are made from far away pages it might be irritating to the reader to have to turn back all those pages to get to the referred sentence. To avoid this one may want to repeat some list items along with their original number. An rough example of how this would look is the following:                1. Example 1      2. Example 2          Some text with references to 1. and 2.           3. Example 3.          Some text across several pages.           1. Example 1          Some text with references to 1.      The problem in achieving this is to get the repeated list item with its original number _without_ interrupting the sequence of numbers for list items occurring before and after the place where the repeated list item is placed. Here is an example of a failure to achieve this:               \documentclass{article}          \usepackage{enumitem}          \newcommand\extwo{Example 2}          \begin{document}         \begin{enumerate}     \item Example 1     \item \extwo     \end{enumerate}     Text     \begin{enumerate}[resume]     \item Example 3     \end{enumerate}     Text     \begin{enumerate}[start=2]     \item \extwo% Example 2 repeated with its original number, i.e. "1."     \end{enumerate}     Text     \begin{enumerate}[resume]     \item Example 4% Is listed as "3." when I want it be listed as "4."     \end{enumerate}     \end{document}      There are mainly two problems with this example:   1. Example 4 is supposed to resume the list number sequence after Example 3 but it is not.   2. It is fragile. If the order of Example 1 and Example 2 were to be changed then the third list has to have its argument changed to `[start=1]`. Can this example be fixed to achieve what I want or is there some more appropriate way to achieve it?


title: Why are listings placed in <pre>'s by htlatex?

text:
Here is a MWE:               \documentclass{book}     \usepackage{listings}     \begin{document}          \begin{lstlisting}     var x = 10;          // Some code     if(x == 10) return null;     \end{lstlisting}          \end{document}      When this is processed by `htlatex` like this: `htlatex MyFile.tex` it gives me this HTML for the listing:

var x = 10;

// Some code
if(x == 10) return null;

      As you can see it's put in a div corresponding to the environment but then it adds a `<pre>`, can I configure `htlatex` to **not** add that? I tried adding a `cfg` with this:               \Preamble{html}     \begin{document}         \ConfigureEnv{listings}{\HCode{
}}{\HCode{
}}{}{}         \ConfigureEnv{lstlisting}{\HCode{
}}{\HCode{
}}{}{}     \EndPreamble      But it didn't help.


title: Overwrite TikZ auto placement of weights in graph

text: So I have the following graph:               \documentclass{article}     \usepackage{amsmath}     \usepackage{tikz}     \usepackage[english]{babel}     \begin{document}          \tikzstyle{vertex}=[draw=black!25,shape=circle,fill=black!25, edge=black!25,minimum size=20pt,inner sep=0pt]     \tikzstyle{edge} = [draw,thick,-]     \tikzstyle{arrow} =[draw,thick,->]     \tikzstyle{weight} = [font=\scriptsize]          \begin{tikzpicture}[scale=2,auto,swap]     \foreach \pos /\name in {{(0,0)}/1,{(1,1)}/3,{(0,2)}/2,{(2,2)}/4,{(2,1)}/5}        \node[vertex](\name) at \pos{$\name$};     \foreach \source /\dest /\weight in {1/3/1,1/5/2,2/1/5,3/2/2,3/5/3,4/2/8,5/2/7,5/4/5}         \path[arrow] (\source) -- node[weight] {$\weight$} (\dest);     \foreach \source /\dest /\weight in {1/3/1} place \weight above of=\path[arrow];     \end{tikzpicture}     \end{document}      which results in the following graph: ![enter image description here](http://i.stack.imgur.com/0cwV9.png) As you can see, the auto-placement of the weights isn't ideal. The weight of the arrow from 1 to 3 and the weight of the arrow from 3 to 2 would be placed better above and below their arrows, respectively. Is there any way to "overwrite" the auto-placement, without having to manually define all weight positions? Ie: can I tell a specific weight to be placed in an other position? Thanks!


title: Table does not fit

text: I have put this into LaTeX to get a table in another page:               \afterpage{     \begin{landscape}     \begin{table}[h!]     \begin{center}     \begin{tabular}{| c ||l | l |l | l | l |l | l |l|l |l |l |l | l|l |}     \hline     Interval & \begin{sideways} Unison & Minor 2nd & Major 2nd & Minor 3rd & Major 3rd & Perfect 4th & Diminished 5th & Augmented 4th & Perfect 5th & Minor 6th and Major 6th & Minor 7th & Major 7th & Octave \end{sideways} \\     \hline     Ratios & $\frac{1}{1}$ &  $\frac{256}{243}$ &  $\frac{9}{8}$ &  $\frac{32}{27}$ &  $\frac{81}{64}$ &  $\frac{4}{3}$ &  $\frac{1024}{729}$ &  $\frac{729}{512}$ &  $\frac{3}{2}$ &  $\frac{128}{81}$ &  $\frac{27}{16}$ &  $\frac{16}{9}$ &  $\frac{243}{128}$ &  $\frac{2}{1}$ \\     \hline     Note & C & D\$flat$ & D & E\$flat$ & E & F & G\$flat$ & F$\sharp$& G & A\$flat$ & A & B\$flat$ & B & C \\     \hline     \end{tabular}     \caption{The Pythagorean Chromatic Scale$}     \end{center}     \end{table}          \end{landscape}     }      But I keep getting error messages. Is it because it is too big?!


title: How to draw legend lines in caption/text without including original plot's TikZ picture?

text: I would like to reference some plot lines in text/captions. It is possible by defining a label for the plot in the corresponding `axis` environment. However, I'm using externalization and only want to distribute the PDF files (not the `tikzpicture` files), but still want to reference plot lines in the text. How to separately add labels for the plot line without having to include the whole `tikzpicture`? As a workaround, I include dummy plots and label them, but it results in appearing a dot in the document. Any way to make this `tikzpicture` hidden and taking zero space would also be useful.               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \begin{document}     This is how I reference to \ref{hwplot1} and \ref{hwplot2}. But the following 'tikzpicture' results in ploting a dot               %%% This is neccessary for drawing plot lines in the text     \begin{tikzpicture}         \begin{axis}[hide axis]             \addplot [             color=red,             solid,             line width=0.9pt,             forget plot             ]             (0,0);\label{hwplot1}             \addplot [             color=black,             dashed,             line width=1.2pt,             forget plot             ]             (0,0);\label{hwplot2}         \end{axis}     \end{tikzpicture}%     \end{document}


title: Applying commands within custom list environment

text: I am trying to redefine an `enumerate` environment that would look something like this in use:               \begint{customItemize}     \item $-6x^{2}-2x=-2x(3x+1)$     \item $-5x+15=-5(x-3)$     \end{customItemize}      And be equivalent to something like this               \begin{enumerate}     \item \fbox{$-6x^{2}-2x=-2x(3x+1)$}     \item \fbox{$-5x+15=-5(x-3)$}     \end{enumerate}      In addition to `\fbox`, I might like to be able to use other (custom) commands. It is important that this happens within the environment, so that the               \item Some stuff     \item Some more stuff       part of the code is easily copy/pasted to other list environments. Can this be done? I've tried something like this, but it's not working and I think it is because I don't know how to deal with parameters of `\item`.               \newenvironment{customItemize}{%                     \let\olditem\item%                      \renewcommand\item[2]{ \olditem\fbox{##2} }%                     \begin{enumerate}}{\end{enumerate}%     }      Math mode is breaking somehow within `fbox`... but I'm kinda clueless as to how to proceed. Again, I think it is something that I don't understand about the "arguments" for `\item`


title: Table with small circles on each intersection/corner

text: I'm a LyX user and have a small question - How do I incorporate to my a document a table consists only of the numbers {0,1}, with borders between the cells, and with small colored circles on the intersections/corners that indicates if the number of 1's touching the intersection/corner is odd or even. Thanks!


title: Listings: use greek letters

text: Is it possible (and if yes, of course, and how) to use Greek letters within `lstlisting` (of the `listings` package)? `\epsilon`, for instance, puts of course exactly that and not a Greek epsilon. I have read in the documentation that it is possible to write e.g. Greek comments, but that is not what I want to do. I'm using `lstlisting` to write EBNF and would like to use an `\epsilon` for "empty".


title: Exclude section number from the ToC link

text: Is there a way I can make hyperref exclude section/chapter/etc numbering from the link in toc/lof/lot? I want it becase I highlight the link, and number is not really a part of the section/chapter/etc name. I searched the manual -- but could not find an option. Perhaps the only way is to redefine some hyperref external command. **Edit** :               \documentclass{book}          \usepackage{fontspec} % enagles loading of OpenType fonts     \usepackage{polyglossia} % support for languages          % fonts:     \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes     \setmainfont{Arial}     \setsansfont{Arial}     \setmonofont{DejaVu Sans Mono}          \usepackage[usenames,dvipsnames]{xcolor}     \usepackage[allcolors=blue,colorlinks]{hyperref}          \begin{document}          \tableofcontents     \chapter{foo}          Foo!          \chapter{bar}          Bar!          \chapter{baz}          Baz!          \end{document}      (supposed to be compiled with XeLaTeX).


title: How to automatically embed cited PDF reports to a document?

text: I have built a `.bib` file with some entries providing a `file` attribute. **I want this file to be automatically attached to the document (at the end, where the references are).** I'm already using `biblatex` to provide a direct http link to some references _via_ the `doi=true` flag (references that I can't legally include as PDFs). I'd like this:               As stated in my previous report, \cite{report1} ...      to be translated into that:               As stated in my previous report, [1] ...          [...]          References     [1] My interesting report, 2012 (click here)      Does anyone know about a package able to do that? I've asked google and CTAN without much success... **EDIT:** Here we are, an example of `.bib` file, let's call it `refs.bib`:               @Article{SomethingIDidntRead,     author = {Some Authors},     title = {The Early Typography of Printed Welsh (sounds great)},     journal = {The Library},     volume = {3},     pages = {217--231},     year = {1981},     doi = {10.1093/library/s6-III.3.217},     }     @unpublished{navigator,     author = {Some Authors},     title = {Navigator},     year = {2010},     url = {http://mirrors.ctan.org/macros/generic/navigator/navigator-doc.pdf},     file = {navigator-doc.pdf}     }      And the `main.tex` file:               \documentclass[         fontsize=12pt,     ]{scrartcl}     \usepackage{luatextra}     \usepackage{hyperref}     \usepackage[         hyperref=true,         backend=biber,         style=numeric-comp,         doi=true,         url=true,         block=none,     ]{biblatex}     \addbibresource{refs.bib}          \begin{document}          This seems to be an interesting article\cite{SomethingIDidntRead}.     But I just took it at random for its \textsc{doi}.          This file is also interesting\cite{navigator} and I'd like it to be embedded.          \printbibliography     \end{document}      What I want is to know if there is a package that takes the file name I provide in the `.bib` file to automatically and embed it to get `file:click here` just as I get `doi:XXXXXXX`. If no package provides that, we'll see what can be done. Thanks for your attention.


title: Can I mass-link in JabRef?

text: I renamed (the majority of) my PDF files to match their Bib(la)tex-keys. Yet when I have multiple entries marked and hit Alt + F, no linking is done. It only works on an per-entry-basis and of course I'm bound to get it done all files eventually. But it is quite tiresome and costs a lot of time. Am I overlooking some option or feature here or is that not possible? Or how does any of you JabRef-users do it? (Note for the sake of formality: JabRef is a popular tool to maintain a LaTeX bibliography. Since I'm sure the user base of JabRef is significantly large on this site I think it is warranted to ask this question here. It is worth a try, especially after it received no reply yet on its official site. I hope you'll agree.)


title: How to prevent indent on \listofalgorithms?

text: How can I prevent the `\listofalgorithms` from being indented? I tried everything I could find on the internet, but the index of my algorithms refused to be aligned along with the title. Here is a MWE:               \documentclass{article}     \usepackage{nomencl}     \usepackage{mathtools}     \usepackage{algorithm}     \usepackage{algpseudocode}     \numberwithin{algorithm}{section}     \begin{document}         \renewcommand{\nomname}{List of Algorithms}         \listofalgorithms         \newpage         \section{Introduction}\noindent         Text\\         \begin{algorithm}[H]             \caption{Caption}             \label{algo:caption}             \begin{algorithmic}[1]                 \State hello world             \end{algorithmic}         \end{algorithm}     \end{document}      Any help is appreciated. Thanks!


title: MinionPro Font-bugs: Copy numbers in pdf with lf option does not work and small caps are not scaled correctly

text: I have experienced the following problem with the MinionPro font with pdflatex and would like to ask if someone has an idea how to solve them: If I use minionpro package with the "lf" options in order not to use old-style numbers, I cannot copy numbers from the Pdf, all I get is a sequence of "" characters. Using `\textsc{ss}s` one can clearly see in the output that the size of small caps is slightly bigger compared to the the lowercase character. I would be very thankful if someone could help me to solve this issues, as I really like Minionpro and do not like to switch the font.


title: Auto-fit table column widths based on content

text: Is there any solution in LaTeX tables that implements similar functionality to MSWord's AutoFit? ![enter image description here](http://i.stack.imgur.com/PBJ6k.png)


title: Why do people write italic “d”s in integrals?

text: In some German books, I see what I consider proper:               \int \mathrm d x      In other books, I just see this:               \int d x      Since everybody writes `$\sin(x)$` instead of just `$sin(x)$`, I wonder why people write all operators upright, just not the “d”. Is it just that it is more typing (which is a lame excuse) or is there some really sound reason for that? Please just don't say that it is “personal style”, since `$sin(x)$` would clearly considered wrong.


title: Left-alignment like Fleqn-option only for specific equations

text: I want to left-align some equations. (Note: I want to align the equations themselves, not code inside of the equations.) I have the following example code:               \documentclass{scrartcl}     \usepackage{amsmath}     \begin{document}          \begin{equation}     \text{I want to left-align this equation}     \end{equation}          \begin{equation}     \text{and this one,}     \end{equation}          \begin{equation}     \text{but not this one and others.}     \end{equation}          \end{document}      How can I achieve this? The equations don't neccessarily have to be left- adjusted to the left text border, the more important goal is to align them to each other.


title: pdflatex with special characters

text: I'm very new to LaTeX and run into some problems. I'm using Texmaker for windows with pdflatex btw. When I use special characters and arrows etc. I would like to write it like this.               \wedge      But I have to write it like this               $\wedge$      Why is this ? Now I would like to write [ and ] in my document. But neither of these examples work.               [     \[     $\[$      How can I write [ and ] in my document? EDIT: Here are some parts from my document.               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{color}     \usepackage{colortbl}     \usepackage{graphicx}     ...     \begin{document}     \begin{tabular}{ll}      [  &  this is a square bracket \\     \end{tabular}     \end{document}      Maybe the problem is the table ? When I just write [ I get following error:               ! Paragraph ended before \@argarraycr was complete.      * * * EDIT 2: Here is a test document. This one I can not compile.               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{color}     \usepackage{colortbl}     \usepackage{graphicx}               \begin{document}     \begin{tabular}{ll}     \{ / \}  &  test \\     [\{ / ]\}  &  test \\     \end{tabular}     \end{document}


title: Can TexText in Inkscape only load certain packages? - Or, how to recreate a page from a thread-bound Chinese book?

text: I've finally managed to install Inkscape 0.48 on my Mac OS X Mountain Lion. My TeX distribution is TeX Live. I've installed TexText 0.4.4. and I can use the extension to write simple LaTeX text (I tried using \emph{}, worked fine). The command for writing Manchu text using this package is `{\bth manju gisun}` where `manju gisun` is the Manchu text to be typeset (entered in transcription). However, I can't use it with the package `manju` which I downloaded and installed from http://www.ctan.org/tex-archive/language/manju I add the following preamble to TexText:               \usepackage{fontspec}     \usepackage{manju}      With this preamble (and `\documentclass{article}`) I am able to successfully type Manchu when I compile with XeLaTeX in my editor. But in Tex Tex it doesn't work, and I get the following error message:               ! Undefined control sequence.     l.7         {\bth                   manju gisun}     ?      ! Emergency stop.     l.7         {\bth                   manju gisun}     !  ==> Fatal error occurred, no output PDF file produced!      Does this mean that the `manju` package is incompatible with TexText? UPDATE I have also tried this with the "montex" `mls` package, which has replaced `manju`. However, the result remains the same: error. UPDATE Here is a minimal example with `mls`, which works when I compile it with XeLaTeX in my editor:               \documentclass{article}     \usepackage{mls}     \begin{document}     \bithe{manju gisun} % \bithe{} is the command for entering Manchu text in mls.     \end{document}      In Tex Text in Inkscape, I omit `\documentclass{article}`, `\begin{document}`, and `\end{document}`, leaving only `\usepackage{mls}` in the preamble and `\bithe{manju gisun}` in the main body. This gives the above error. UPDATE Just to clarify what I'm ultimately seeking to do, by any means possible: I'm trying to reconstruct this page: ![Da Qing quanshu](http://i.stack.imgur.com/mcSeL.png) Other people seem to use Adobe Indesign for this purpose, a program I don't have access to, as in this example: ![enter image description here](http://i.stack.imgur.com/k5pAf.jpg)


title: A guide to understanding expandability: when to write protected functions and when not to

text: I'm having difficulty understanding (and _appreciating_ ) the concept of _expandability_. I'm very murky about understanding **when** and **how** expandability impacts me in writing code for my documents. I've read Why isn't everything expandable?. The answer was interesting and useful, but it didn't get at the heart of what I'm curious about. I've also perused a number of the answers to other questions involving expandability: of particular interest was this post. In respondence to a recent question of mine, it was explained that document commands are _protected_ and hence not _expandable_. Understanding this allowed me to write what I wanted and to get the effect I expected. And in a comment to another question of mine, it was explained how one should use `\cs_new_protected:Npn` "when the function does unexpandable jobs such as setting token lists or sequences." For years, I've been writing code like               \newcommand{\currentanswer}{}     \newcommand{\setcurrentanswer}[1]{\renewcommand{\currentanswer}{#1}}      knowing that after calling `\setcurrentanswer`, any call to `\currentanswer` will result in the desired output. Am I relying upon (un)expandability here? I'm not really sure; I only know that it does what I want. Then there are times I know I can throw in a `\protect` to get the result I want: but, I really don't understand the **why** of it; I just know it gets the job done. Recently, I've been trying to learn some LaTeX3: the more I play with it, the more I like it. LaTeX---which I always thought was pretty powerful---is suddenly much more powerful and transparent in the manner that macros and functions can be defined. But now, I also seem to be running up against this issue of expandability, whereas before I could blithely go about my business ignorant of some of the subtlies of what I was doing. While I am asking multiple questions here, I suspect that they really have much the same answer: hence I'm not splitting them across multiple posts.   1. Could someone take the time to explain some of the nuances of expandability, or, if not, point me to a good reference?    2. How do I know when I'm working with a _protected_ function/macro?   3. Is _protected_ and _unexpandable_ the same thing?   4. Could someone explain the preference for _protected_ functions in LaTeX3?   5. And finally, apart from the answers to the above questions, why would it be preferrable to protect functions which perform unexpandable tasks: such as setting tokens and sequences? (I am _very interested_ in understanding this last question.)


title: Force column break within tabbing environment

text: Basically following the instructions here, I'm trying to enfore a column break in my text. My text is, however, embedded within a `tabbing` environment, and following the said instructions results in the following error:               ! Missing } inserted.     <inserted text>                      }     l.20 {\vfill                 }     ?       Here's a minimally (not) working example:               \documentclass[12pt]{article}     \usepackage{multicol}          \begin{document}     \begin{center}     \large{\textbf{My title.}}     \end{center}     \begin{multicols}{2}     \begin{tabbing}     Here \= is \= a sentence\\     Here \> is \> a word\\     Here \> is \> a sentence\\     Here \> is \> a word\\     Here \> is \> a sentence\\     Here \> is \> a word\\     Here \> is \> a sentence\\     Here \> is \> a word\\     Here \> is \> a sentence\\     Here \> is \> a word\\     \vfill     \columnbreak     Here \> is \> a sentence\\     Here \> is \> a word\\     \end{tabbing}     \end{multicols}     \end{document}


title: Overfull hbox warning when including graphics

text: I'm getting the error:               Overfull \hbox (14.34999pt too wide) in paragraph at lines 374--375     [][] |      when including graphics files. The files are in EPS format. Below is an example:               \begin{figure}      \includegraphics{mov.eps}      \caption{Recall vs. Diversity}      \label{fig:movdiv}     \end{figure}      When I look at the PDF output the figures are a little bit out of the margin. However, while generating the EPS graphics files I don't give any size options. So I don't understand why I'm getting this error. Doesn't LaTeX adjust the size of the EPS files?


title: epstopdf warning: "Shell escape feature is not enabled."

text: I'm having a bit of trouble trying to include .eps files in a LaTeX document compiled with pdfLaTeX. I've been told that I should use the `epstopdf` package to convert .eps files to .pdf on the fly. This is my LaTeX code:               \documentclass[12pt]{article}     \usepackage[pdftex]{graphicx}     \usepackage{epstopdf}     \begin{document}     \includegraphics{thing.eps}     \end{document}      But when I try to compile it with `pdflatex test.tex` I get this error:               Package epstopdf Warning: Shell escape feature is not enabled.          (/usr/share/texmf-texlive/tex/latex/latexconfig/epstopdf-sys.cfg))) (./test.aux ) (/usr/share/texmf/tex/context/base/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] )          ! Package pdftex.def Error: File `thing-eps-converted-to.pdf' not found.          See the pdftex.def package documentation for explanation. Type  H   for immediate help.  ...                                                             l.7 \includegraphics{thing.eps}                                     ? I'm not sure what to do, I've also tried putting `\epstopdfsetup` and `\epstopdfsetup{}` after `\usepackage{espstopdf}` but that doesn't help.


title: TikZ: compiler error for coordinate calculating, calc library

text: \documentclass{standalone}          \usepackage{tikz,pgf}          \usetikzlibrary{decorations.markings,%         snakes,fit,scopes,arrows,calc,shapes.misc,positioning,%         shapes.arrows,chains,matrix,positioning,decorations.pathmorphing,shapes,backgrounds,decorations.text}          \begin{document}          \tikzset{         fuzzy/.style = {decorate, decoration = {random steps, segment length = 0.5mm, amplitude = 0.15pt}},         ns/.style = {rectangle,minimum size = 6mm,rounded corners = 3mm,very thick,draw,font = \ttfamily,fuzzy}     }          \newcommand{\OL}[1]{{$\overline{x}_{#1}$}}     \newcommand{\NL}[1]{{${x}_{#1}$}}          \begin{tikzpicture} [             >=latex, thick,              ns/.style = {rectangle, draw, fill = white, fuzzy, rounded corners = 3mm},             decision/.style = {rectangle, draw, fill = gray, fuzzy, rounded corners = 3mm},         ]         \ttfamily         \begin{scope}             \coordinate node[decision] (nx12) at (0,0) {\OL{12}};             \coordinate node[decision] (x5) at ($(nx12)+(1,1)$) {\NL{5}};             \coordinate node[decision] (nx8) at ($(nx12)+(1,-1)$) {\OL{8}};                  \coordinate node[ns] (x2) at ($(x5)+(2,1)$) {\NL{2}};             \coordinate node[ns] (nx7) at ($(nx12)+(2,-.5)$) {\OL{7}};             \coordinate node[ns] (x4) at ($(x5)+(4,1)$) {\NL{4}};             %\coordinate node[ns] (nx13) at ($(x4)+(1,1)$) {\OL{13}};             %\coordinate node[ns] (x13) at ($(x4)+(1,-1)$) {\NL{13}};         \end{scope}          \end{tikzpicture}          \end{document}      If one comments the `x4` everything goes smoothly, but now it is "<...>must have a (possibly empty) label<...>"


title: In which order execute htlatex and bibtex?

text: I would like to learn the correct order of calling _htlatex_ and _bibtex_. So far I tried the following order:               htlatex main     bibtex main     htlatex main     htlatex main      and (I use pdflatex to generate pdfs from TikZ pictures):               pdflatex     pdflatex     bibtex main     pdflatex     htlatex main      But neither of them works. Could anybody write me what is the correct order?


title: Naming LaTeX files: best practice?

text: What's the best practice for naming LaTeX files? I know R, Matlab, and Java all differ in their use of `.`, `_`, `-`, camel case, capitalization, etc. What do people generally use for naming LaTeX files? Is this easily portable across systems? I remember having a HUGE problem interpreting a Matlab program of mine. Turned out that I had named the file in a way that Matlab couldn't handle. To avoid such issues in the future, I'd just like to start naming my LaTeX files using best practices.


title: Biblatex: submitting to a journal

text: Suppose that I moved from BibTeX to `biblatex`. With BibTeX I just copied the content of `.bbl` file into final version of my paper before submitting it to a journal. What should I do at same stage having `.bbl` file produced by `biblatex`? It is of quite different format.


title: LaTeX templates bundled with MikTeX or elsewhere?

text: Q: Where can I find generic LaTeX document templates (e.g., for the `article`, `book`, etc., classes)? Are there any bundled in MikTeX? Elsewhere? I've found a number of posts answering this question for more specific classes (e.g., Thesis) but not much for the general classes. The Beamer class comes packaged with a number of template and example `.tex` files which I use extensively. Unfortunately, I can't find any equivalent to this for more general classes.


title: LaTeX equivalent to R's ProjectTemplate package?

text: The post LaTeX project file system structure has helped me a lot in organizing my LaTeX projects. This got me the thinkin': the R package ProjectTemplate allows the user to build an R project directory structure with template files according to best practices. Q: Is there anything out there equivalent to this for LaTex? Quick searches of the web have returned nothing. If there really isn't any equivalent out there, I suppose it wouldn't be terribly difficult to build my own default structure to copy from.


title: Inconsistent horizontal width of mdframed with only display math content

text: **Update 2012-03-09:** With an version of `mdframed` updated today, this is now fixed in the package and no longer requires the workaround provided below. * * * In Excess vertical space in mdframed ending with display math environment, I had wrapped the contents on `mdframed` within a `minipage` and had intended to file this as a separate question, as I believe that the `minipage` wrapper should not be necessary. Without this wrapper, if the content contains **only** display math, the width is not the full `\linewidth`. Here is a snippet of the output showing the inconsistent output for the case of display math in red. Note that the output is fine if the frame has a title, but without the frame the width is not consistent: ![enter image description here](http://i.stack.imgur.com/8HZRt.png) ## Questions:   * Is there a `mdframed` setting to adjust this? If not, is there any better way to get the desired behavior other than using a `minipage`?   * Is this a bug with `mdframed`, or a feature? ## Note:   * The code below is adapted from mdframed: Put a line below the frame title and give it a shaded background.   * Uncommenting the `\begin{minipage}` and `\end{minipage}` produces what I believe is the correct result (to be consistent with the first two cases). ## Code:               \documentclass{article}     \usepackage{showframe}     \usepackage{amsmath}          \usepackage[framemethod=TikZ]{mdframed}     \newenvironment{Frame}[1][]{%         \begin{mdframed}[%             frametitle={#1},             skipabove=\baselineskip plus 2pt minus 1pt,             skipbelow=\baselineskip plus 2pt minus 1pt,             linewidth=0.5pt,             frametitlerule=true,             frametitlebackgroundcolor=gray!30         ]%         %\begin{minipage}{\linewidth}%  this should not be necessary??     }{%         %\end{minipage}%         \end{mdframed}     }          \begin{document}\noindent     Text     \begin{Frame}[with Title]         Text     \end{Frame}     Text     \begin{Frame}% no Title         Text     \end{Frame}     Text     \begin{Frame}[Einstein]         \begin{align*}             e & = mc^2         \end{align*}     \end{Frame}     Text     \begin{Frame}\color{red}% no Title         \begin{align*}             e & = mc^2         \end{align*}     \end{Frame}     Text     \begin{Frame}\color{red}% no Title         \begin{align*}             e  &= mc^2\\             F  &= ma         \end{align*}     \end{Frame}     Text     \begin{Frame}\color{red}% no Title         \[             e  = mc^2         \]     \end{Frame}     \end{document}


title: SLatex and line numbering?

text: I'm using SLaTeX to typeset some Racket source code. I would like to have line numbers along the left edge, so that I can refer to them in my document. However, I haven't yet discovered the option for turning line numbers on. I suspect I should just switch over to the **listings** package and be done with it, but before I do, I wanted to check with the other LaTeX experts here.


title: Software Requirements Specification with LaTeX

text: Are there anybody who uses LaTeX to produce quality Software Requirements Specification documents? If yes, do you have any template which you can share?


title: Overfull warning when using longtable

text: I am getting overfull warning (`Overfull \hbox (17.10379pt too wide) in alignment`) when using `longtable` enviroment (See MWE below) The warnings are on `\begin{longtable}` and `\end* lines`. The pdf filellooks fine, but I would like to get rid of the warning message. Any suggestions on how to get rid of those warning by formatting the table?               \documentclass{article}          \usepackage{longtable}     \usepackage{lipsum}          \begin{document}     \begin{longtable}{*2{p{0.49\textwidth}}}             Title & Column 2 \\             \hline         \endfirsthead             Title & Column 2 \\             \hline         \endhead             \multicolumn{2}{r}{Continued}\\         \endfoot             \hline         \endlastfoot              \lipsum[1] & \lipsum[2]\\     \end{longtable}     \end{document}


title: Problem with \rowcolor and monochrome option

text: I have a document that I wish to distribute both in color and monochrome. It contains tables and makes use of colored rows. Problem is, when I use the monochrome option for the `xcolor` package the colored rows show up as completely black and thus cannot be read. What I would like is for the text to be readable even when the `monochrome` option is active. Here is a minimal example :               \documentclass{article}          \usepackage[monochrome]{xcolor}     \usepackage{colortbl}          \begin{document}     \begin{tabular}{cc}     This & that\\     \rowcolor{yellow} This & that     \end{tabular}          \end{document}      (If I remove the `monochrome` option all is well).


title: Is it possible to declare a footnote in a way that it will attach to the first occurrence of a given word or phrase?

text: **Is it possible to declare a footnote in a way that it will attach to the _first_ occurrence of a given word or phrase?** Doing this in a fully automated way might not be possible (see link below), but if (for example) one uses footnote labels with a macro `\uniquefn[text]{id}` (marking phrases that should be considered identical), this should be possible. With such a macro, one would be able to write things like this:               \documentclass{article}          \begin{document}          This is a sentence\uniquefn{an-identifier}.     Let's write\uniquefn[Every footnote identifier must have specified text       (inside an optional argument) exactly once for all invocations of this       macro with that identifier; if this is violated, there should be an       error.]{another-identifier}       two more sentences\uniquefn[If an optional argument is given, the text       within that optional argument is what is to be displayed]{an-identifier}.     This is the penultimate sentence\uniquefn{an-identifier}.     And one final sentence\uniquefn{an-identifier}       concludes\uniquefn[One more footnote.]{yet-another-identifier} this document.          \end{document}      Other equivalent ways of achieving the same effect would work too. Related and potentially useful:   * Highlight First Occurrence of a Particular Word   * Reference different places to the same footnote


title: Overriding hyperref in TikZ/pgfplots

text: Is it possible to override the `hyperref` instruction of showing the references in a specific colour but only within the context of `TikZ` and `pgfplots`? The problem is that I am using `legend to ref` and `\ref` in a `tikzpicture` environment and the text of the legend becomes blue because of the `hyperref` global setting. I don't know how to force legend's text colour or even if that would work, but the solution I am looking for should be something that can be set globally in the preamble if possible. # MWE:               \documentclass{article}          \usepackage{tikz,pgfplots}     \usepgfplotslibrary{groupplots}     \usepackage[colorlinks,linkcolor={blue}]{hyperref}          \begin{document}       \begin{figure}[]         \centering         \begin{tikzpicture}           % \hypersetup{hidelinks} % jfbu's solution: Uncomment to get black text.           \begin{groupplot}[             group style={               group size=2 by 1,},]             \nextgroupplot[scale only axis,width=0.35\textwidth,height=0.35\textwidth,legend to name=grouplegend,]             \addplot               coordinates {(1,1) (2,2) (3,3)};             \addlegendentry{Legend 1}             \nextgroupplot[scale only axis,width=0.35\textwidth,height=0.35\textwidth]             \addplot               coordinates {(1,1) (2,2) (3,3)};           \end{groupplot}           \node (legend) at ($(group c1r1.south)!0.5!(group c2r1.south)$)             [below, yshift=-3\pgfkeysvalueof{/pgfplots/every axis title shift}]             {\ref{grouplegend}};         \end{tikzpicture}%         \caption{The caption.}       \end{figure}     \end{document}      ![enter image description here](http://i.stack.imgur.com/weXGa.png) jfbu's solution of placing `\hypersetup{hidelinks}` in the `tikzpicture` environment works by maintaining the links (I'm not interested in that) but showing the text in black. I'm looking for a way to achieve this globally though.


title: enumitem nextline style: nested item shouldn't start on description label's line

text: I use `enumitem` description style `nextline` to emulate a sort of TOC entry with the following code:               \documentclass{article}     \usepackage{enumitem}          \newenvironment{DLdescription}[1][*]{%       \newcommand{\DLitem}[2][]{%         \item[##1\hfill\emph{##2}]       }       \begin{description}[style=nextline,leftmargin=#1]%     }{\end{description}}          \begin{document}            \begin{DLdescription}       \DLitem[dleft1]{dright1}         blah blah         \begin{itemize}         \item nested item correctly starts on its own line         \end{itemize}           \DLitem[dleft2]{dright2}         % nothing before itemize         \begin{itemize}         \item nested item shouldn't start on description label's line!         \end{itemize}       \end{DLdescription}          \end{document}      The trouble comes on the _second_ description item which starts straight away with an `itemize`: the nested item appears on the same line :-( ![output of code sample](http://i.stack.imgur.com/ycInr.png) A workaround found elsewhere suggests to append a `\hfill` to the relevant label, in my case that would patch command `DLitem` with               \item[##1\hfill\emph{##2}]\hfill      which, gives a non satisfactory results, as too much vertical space is added between the description label's line and the first nested item: ![output of patched code](http://i.stack.imgur.com/Me2wm.png) How to obtain the result in the second image without any extra vertical space?


title: Custom TikZ node with svg path not clipped

text: I would like to make a custom node shape with a small picture (on north east) using the `svg` directive of TikZ, because the picture comes from a svg path. As you can see with this simple code, the picture is clipped and I don't want to add text (aaaa) to make the attached node larger. It would be great if you can show me how to operate a scale and a shift on this small picture. All my tests failed!               \documentclass{article}     \usepackage{tikz}     \begin{document}     \usetikzlibrary{svg.path}     \tikzset{        t1/.style={rectangle,fill=blue!20},       t2/.style={path picture={ \draw[fill=red,draw=blue] svg "M0,0L10,10L20,0L10,-10Z";} }      }     \begin{tikzpicture}     \node[t1](A) at (1,1){A}; \draw(A.north east) node[t2]{aaaa};     \node[t1](B) at (2,1){B}; \draw(B.north east) node[t2]{};     \end{tikzpicture}     \end{document}


title: Figure in text body

text: I would like to put a picture in text body as shown in the following picture from MS Word. ![Image in test](http://i.stack.imgur.com/hGZbI.png) I tried some things but not working. What I want is more or less the `\LaTex` command but for my image! Is there any way to do this in latex?


title: Tikz -- Rotating a line around an intersection

text: I've been trying to rotate a line around an intersection. The problem (I think) is that the intersection is in a previous scope (I need that to have the correct clipping), and the new scope doesn't know what (intersection-1) is. I've been trying the following:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{intersections}     \begin{document}     \begin{tikzpicture}             \clip (0,0) circle (5);         \begin{scope}             \clip [name path=clipA] (0,0) -- (-30:25) -- (-150:25) -- cycle;             \fill[name path=SpeciesA, blue, line cap = round] (-0.2,0) -- (-0.2,-4) -- (0.2,-4) --  node[sloped, below] {Species A} (0.2,0) -- cycle;             \tikz\name intersections={of=clipA and SpeciesA}         \end{scope}         \begin{scope}             \clip [(0,0) -- (-30:25) -- (90:25) -- cycle;             \fill[blue!60!red, line cap = round, rotate around={150:(intersection-1)}]              (-0.2,0) -- node[rotate= 150, sloped, below] {Species C} (-0.2,-3) -- (0.2, -3) -- (0.2, 0) -- cycle;          \end{scope}         \begin{scope}             \clip (0,0) -- (-150:25) -- (90:25) -- cycle;             \fill[blue!60!green, line cap = round, rotate=210] (-0.2,0) -- (-0.2,-3) -- (0.2, -3) --  node[rotate= 210, sloped, below] {Species B} (0.2, 0) -- cycle ;          \end{scope}     \end{tikzpicture}     \end{document}      As I say, LaTeX doesn't seem to know what (intersection-1) is, once we get there. Any advice? Thanks


title: Vertically misaligned margin note

text: I'm trying to use a `\marginnote` along with a specified `\parskip`. However, I'm having an alignment issue. With the code in the group with the `\parskip` the margin note is misaligned with the text on the line, while if I manually put in the gap, then everything works. Here is a screen shot of a PDF: ![](http://i.stack.imgur.com/pRl5M.png) Here is a MWE:               \documentclass[10pt, letterpaper]{article}      \usepackage{geometry}      \geometry{letterpaper, hmargin=1.5in, vmargin=1in, marginparsep=7pt, marginparwidth=.6in}     \usepackage{marginnote}     \newcommand{\years}[1]{\marginnote{\footnotesize #1}}     \renewcommand*{\raggedleftmarginnote}{}     \setlength{\marginparsep}{7pt}     \setlength\parindent{0pt}     \reversemarginpar     \begin{document}     this doesn't work:\\          \begingroup     \setlength{\parskip}{0.3cm}     \years{2008}blah blah blah\\*     line 2\\*     line 3          \years{2008}blah blah blah\\*     line 2\\*     line 3     \endgroup\\\\     this does:\\          \years{2008}blah blah blah\\*     line 2\\*     line 3\\[0.3cm]     \years{2008}blah blah blah\\*     line 2\\*     line 3     \end{document}


title: Tikz picture contains overlaps of objects and arrows

text: I'm new at using the TikZ package to make commutative diagrams. I'm trying to draw a triangle with an arrow between each pair of objects. Here's the code I'm using now:               \documentclass{article}     \usepackage{amsmath,amssymb,tikz}     \newcommand{\QQ}{\mathbb{Q}}     \begin{document}     \begin{tikzpicture}       \node (Q) {$\QQ$};       \node (tQ) [below of=Q] {$\QQ\otimes\QQ$};       \node (cQ) [right of=tQ] {$\QQ\times\QQ$};       \draw[->] (Q) to node {$i$} (cQ);       \draw[->] (tQ) to node [swap] {$m$} (Q);       \draw[<-] (cQ) to node [swap] {$\iota$} (tQ);     \end{tikzpicture}     \end{document}      (`\QQ` is a command I've defined to produce `\mathbb{Q}`, since it saves me typing.) The diagram compiles fine, but the objects and arrows overlap quite badly on the bottom line: the right- and left-most `\mathbb{Q}` in the nodes on the bottom line touch, and the arrow is superimposed over them. How can I fix this so that the diagram can be more readable?


title: Is it possible to use some sort of internationalization in LaTeX?

text: For example, I have one manuscript that will create a PDF file in German and one in English. My idea is that it should be used like i18n in Java, so I have a key for a text block or a sentence and a language file for each language. For example:               \documentclass[a4paper,12pt]{scrartcl}     \usepackage[utf8]{inputenc}          \begin{document}          \i18n{hello.world.text}          \end{document}      This would create two documents, one containing the text _Hallo Welt_ and one containing _Hello World_. Everything that I've found on this topic is to use multiple languages in the same document, but that's not what I'm looking for.


title: Is there any documentation of \Umathcode, \Umathcodenum, etc.?

text: Trying to use the package `unicode-math` I have been looking for some documentation of `\Umathcode`, `\Umathcodenum`, etc. The usually place, the package documentation (http://ctan.org/pkg/unicode-math), does not contain such. Unfortunately, I am not (yet) able to read LaTeX3 source code. For example, by trial and error it seems that `\Umathcode`C="x"yy"zzzz` is the right syntax of `\Umathcode`. Of course, that is different from `\mathcode`C="xyzz` (at least in the number of bits...). So how is the syntax of `\Umathcode`, `\Umathcodenum`, `\Umathchar`, `\Umathchardef`, ...?


title: Pgfplots: how do I fill an area over a curve?

text: I'm working with pgfplots, and I have a curve on a graph which is basically a rect. I would like to color the part on top of it, not the part under it. I have this code:               \addplot[fill=\sixthplotcolor, fill opacity=0.5, thick, mark=none, color=\sixthplotcolor]     coordinates {         (1, 40)         (10, 400)         (100, 4000)         (150, 6000)         (200, 8000)         (250, 10000)         (300, 12000)         (350, 14000)         (500, 20000)         (750, 30000)         (1000, 40000)     } \closedcycle;      Which colors under the curve, but not over. Can anyone help me? Sorry for the dumb question, I'm new to pgfplots.


title: Script to import .bib and output HTML based on a style

text: I'm able to use various tools (such as pyP2B.py) to generate a BibTex database. I've also successfully created a AMA styled RTF of the database using JabRef and the APAish extension, although this has to be done manually - and the output is RTF, not HTML or PDF. What I'm ultimately working toward is automating this process for use in a web application. I'd like to pass the bib file and style as arguments, and receive a stylized PDF or HTML as an output string. * * * _postnote - if my question is not suited for TEX, please go easy. I had an unexpectedly negative response to a similar question posted on StackOverflow yesterday which was more open ended than this. If needed let me know, and I'll delete - please do not punish with downrates._


title: How to implement a floating text box?

text: I'm trying to write an environment that creates a new float type for text boxes. These are used for example in some books to provide interesting tidbits that aren't really part of the main line of argument. I'm using memoir features for this (the `\newlistof`/`\newfloat` stuff obviously but also `vminipage`) but any solution that can do without is of course just as welcome. So this is what I got so far               \documentclass{memoir}     \usepackage{xcolor}          \makeatletter     \newcounter{boxcounter}     \setcounter{boxcounter}{0}     \newcommand{\elaboxname}{Box}     \newcommand{\listelaboxname}{List of Boxes}     \newlistof{listofboxes}{box}{\listelaboxname}     \newfloat{elabox}{box}{\elaboxname}     \newfixedcaption{\felaboxcaption}{box}     \newlistentry{elabox}{box}{0}     \definecolor{BoxColor}{rgb}{0.91, 0.91, 0.91}     \newenvironment{digression}[2][tp]%         {\begin{elabox}[#1]{}\begin{lrbox}{\@tempboxa}\begin{vminipage}{\linewidth}%          \refstepcounter{boxcounter}\textbf{\elaboxname~\arabic{boxcounter}: #2}\par\aftergroup\@afterindentfalse           \aftergroup\@afterheading}%         {\end{vminipage}\end{lrbox}\colorbox{BoxColor}{\usebox{\@tempboxa}}\end{elabox}}     \makeatother          \usepackage{lipsum}     \begin{document}     \lipsum[2-7]          \begin{digression}{By the Way}\label{box:BTW}     \lipsum[8-9]     \end{digression}          \lipsum[10] Also see Box~\ref{box:BTW}.          \lipsum[11-12]     \end{document}      which looks like this: ![result](http://i.stack.imgur.com/Np6TR.png) Not completely awful but not good either. The box is too wide and the text inside the box has no margin. Use `microtype` and the hyphens will almost touch the border. To solve this sounds simple enough but somehow I'm stuck. I tried to put another minipage around the existing one like so: `{\end{vminipage}\end{lrbox}\colorbox{BoxColor}{\centering\begin{vminipage}{\linewidth}\usebox{\@tempboxa}\end{vminipage}}\end{elabox}}` and make the inner one smaller. This completely messes things up and I have no idea why. ![colorbox suddenly much too small](http://i.stack.imgur.com/8B43E.png) I tried saving the old `\linewidth` into a new length but that didn't change anything. Bonus points (literally) if someone can come up with a way to create a box environment that can span more than one page if need be.


title: How to create a matrix with 20 columns in latex

text: The code below works, but when I add 10 more columns, it does not. So, how can I add ten more columns to the matrix below?               \documentclass{article}     \usepackage{amsmath}     \begin{document}          \begin{equation}     \begin{bmatrix}      1 & 0 & 0 & 0  & 0 & 1 & 0 & 0 & 1 & 0      \end{bmatrix}     \end{equation}          \end{document}


title: Error in matrix form?

text: I am writing this matrix in my report:                 \begin{align}       \mathbf{x}=       \begin{pmatrix}       1 & 1 & 1 & 1 & 0 & 1 & 1 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\       1 & 1 & 1 & 0 & 1 & 1 & 0 & 1 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0\\       1 & 1 & 0 & 1 & 1 & 0 & 1 & 1 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0\\       1 & 0 & 1 & 1 & 1 & 0 & 1 & 0 & 1 & 1 & 1 & 0 & 0 & 0 & 1 & 0       \end{pmatrix}^\mathrm{T},       \end{align}      I found errors `pdfLatex> ! Extra alignment tab has been changed to \cr`


title: Line numbering in ConTeXt outside of verbatim

text: Basically, I would like a way to number the lines in a block of text, without resorting to verbatim mode. I have tried               \definetyping[code][numbering=line,style=\tf]     \startcode[step=5]       Thus, I came to the conclusion that       the designer of a new system must not       only be the implementer and first       large-scale user; the designer should       also write the first user manual.     \stopcode      but this preserves the whitespace; I would like ConTeXt to lay out the paragraph normally and then number the lines. The numbering does not need to be in the margin, but I would like to be able to skip every _n_ numbers and use columns. The solution with `definetyping` is quite close; I simply would like to avoid having to manually adjust line breaks and possibly have hyphenation. I found Show the number of lines in margin for LaTeX, but that doesn't apply here, unless there is a ConTeXt equivalent (the wiki does not mention one and Google turns up nothing).


title: Global footnote counter in Koma-script book class

text: > **Possible Duplicate:**   >  Continuous footnote numbering How can I achieve that footnotes have a global numbering scheme, and not a per chapter numbering? I am using the `book class` from the `koma-script`. I am also using the `footmisc` package.


title: Side effect of Czech package?

text: Since I need to show a character in `Czech`, I use the following:               \usepackage[czech]{babel}      This makes everthing looks good including the Czech character, except for the following line showing unexpected result in the generated .pdf:               \usepackage[toc,page]{appendix}     (skip)     \begin{appendices}      becomes like below instead of printing "APPENDICES":               P RÍLOHA A      Any solution idea is appreciated.


title: Vertical spacing issue on box

text: I'm trying to get the `resheading` box to be shorter in vertical space. Right now it appears that I have about 2 cm vertical space on the top and bottom of the text. How can I fix this? Everything I think to be relevant:               \documentclass[letterpaper,10pt]{article}     \setlength{\voffset}{0.1in}     \setlength{\paperwidth}{8.5in}     \setlength{\paperheight}{11in}     \setlength{\headheight}{0in}     \setlength{\headsep}{0in}     \setlength{\textheight}{10.5in}     \setlength{\topmargin}{-0.5in}     \setlength{\textwidth}{7in}     \setlength{\topskip}{0in}     \setlength{\oddsidemargin}{-0.25in}     \setlength{\evensidemargin}{-0.25in}     \usepackage[svgnames]{xcolor}     \usepackage{framed}     \definecolor{shadecolor}{gray}{0.85}  % Background color of title bars          \newcommand{\resheading}[1]{       \parbox{\textwidth}{         \begin{shaded}             \textbf{\sffamily{\mbox{~}{\large #1} \vphantom{p\^{E}}}}         \end{shaded}       }     }


title: test if a listings or glossaries style is valid

text: I want to test in my template if a call of               \lstinputlisting[style=mystyle,...      or               \printglossary[style=mystyle,...      is valid or will fail because of an unkown style. However I could no find out in the sty files how these styles are saved and checked.


title: How do I open the internal viewer in a custom Quick Build command with TeXStudio or TeXMaker?

text: I'm using TeXStudio 2.2 (A fork of TeXMaker, formerly known as TeXMakerX) and I'm trying to make a Quickbuild option that adds in Bibtex. I've written the command line as               pdflatex -interaction=nonstopmode %.tex|bibtex %.aux|pdflatex -interaction=nonstopmode %.tex|pdflatex -interaction=nonstopmode %.tex| pdflatex -interaction=nonstopmode %.tex |  Which I think should work, but I deleted the end of the line, as I figured there was a command I needed to add there for the internal viewer. However, according to How do I open a pdf file in the TexMaker internal PDF viewer using a user-defined quick build sequence? I need to put in the original command to run my PDF viewer, then leave the 'internal viewer' box checked. However, I have no idea what that original command was now. I've tried               "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" "?am.pdf" Which is what is listed under 'Pdf viewer' but that opens the file in Adobe, even with the 'Internal Viewer' option checked. Most of the pages I've found via google tell you to quite using the command line and use the wizard to make it for you, but that option is greyed out in my version. So could someone tell me what the default PDF Viewer command is on Windows (7 if it matters) with Adobe Reader X (10.1.1) installed in either TeXStudio or TeXmaker?


title: Writing in the first column first when using multicol package

text: I'm using the multicol package to enable writing with 3 columns or more, however I realise that the default behaviour is to balance out the content of the page with the columns. But this is not what I want, since what I want is to fill out the first column first, then the second, and so on. Does anyone know how to enable this in multicol package? Or does anyone know any other packages that can enable this?


title: Make multicols use whole column in latex

text: I am trying to make a multicolumn layout. However, the content which I have is small. So it doesn't fill the whole page. Multicol somehow splits the content so the amount of content in the two columns are even. I don't want that. I want the content to be in the first column as much as it can accumulate rather than breaking it even into two columns


title: Multicol cheatsheet format

text: I currently have the following template for a cheatsheet:               \documentclass[10pt]{article}          \usepackage{amsmath,subfigure,color,verbatim}     \pagestyle{empty}          \usepackage{multicol}     \usepackage{savetrees}          % Begin the actual document content here.     \begin{document}     \begin{tiny}     \begin{multicols}{3}          \section*{Section I}     This is section I. This is section I. This is section I. This is section I. This is section I. This is section I. This is section I. This is section I. This is section I. This is section I. This is section I. This is section I. This is section I. This is section I. This is section I. This is section I. This is section I.     \begin{align}         x^2 + y^2 = 2     \end{align}               \end{multicols}     \end{tiny}     \end{document}      which results in the following: ![image](http://i.imgur.com/56GVxHg.png) The content spreads itself out over the three columns, but I want it to fill up one column before going to the next. How can I do that?


title: Multicols: use all vertical space before moving to a new column

text: > **Possible Duplicate:**   >  How do I force TeX to completely use the 1st column? I am using a three-columns template to create cheat sheets:               \begin{multicols}{3}     ...     \end{multicols}      When there is not much text, the result is divided equally between the three columns: ![enter image description here](http://i.stack.imgur.com/dBWII.png) I would prefer having the entire text on the left column, exploiting the entire page height, e.g.: ![enter image description here](http://i.stack.imgur.com/njSLl.png) How do exploit the full page height for the first column with `multicols`?


title: Springer template problem

text: I have installed the Springer template for monograph svmono, following this article, using the command line interface in linux. But something strange happens. If I use `latex`, everything compiles fine, but the `dvi` output is like a "zipped" text, namely a sequence of meaningless characters. If I use `pdflatex` to compile it (disregarding some minor errors) the output is almost perfect. What could be causing this? How can I fix this problem?


title: How to set the width of columns in tex?

text: \documentclass{article}      \usepackage{multicol}     \begin{document}     \begin{multicols}{2}              lots of text goes here.          \end{multicols}     \end{document}      If I add lots of text, I get two columns, but there is a lot of space left on both sides, i.e. the columns are too narrow. I am trying to make a one page CV. How can I increase the width of the columns?


title: How to make horizontal lines thicker?

text: I am customizing the section module following the tutorial here http://blog.scribtex.com/how-to-write-a-latex-class-file-and-design-yo How do I make the                 [\titlerule]                 % Inserts a horizontal line after the heading      thicker?


title: How can set \rule after \section if \section is renew?

text: How can I set `\rule` after `\section` if `\section` is renewed? This doesn't work:                   \let\oldsection\section         \renewcommand{\section}{%             \newpage%             \oldsection%                 \rule{\textwidth}{4pt}%         }      This works, but the line is before title:                   \let\oldsection\section         \renewcommand{\section}{%             \newpage%             \rule{\textwidth}{4pt}%                 \oldsection%         }


title: How to make 2 tables appear one next to another?

text: I have a document with three tables. These three tables currently are too long for the page, so I would like to make 2 tables appear next to each other and then make the third table appear below them. This way, all tables would fit into the same page. This is my MWE:               \documentclass[a4paper,10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{microtype}     \usepackage[margin=2.54cm]{geometry}     \usepackage{graphicx,booktabs,tabularx}     \usepackage[table]{xcolor}     \usepackage{array}          %define some nice colors     \definecolor{middleware_green}{RGB}{82, 119, 17}     \definecolor{middleware_white}{RGB}{255, 255, 255}     \definecolor{middleware_light_gray}{RGB}{239, 239, 239}     \definecolor{middleware_dark_gray}{RGB}{153, 153, 153}          \renewcommand{\tabularxcolumn}[1]{>{\small}m{#1}}     \newcolumntype{L}{>{\leavevmode\ignorespaces\raggedleft\arraybackslash\sffamily}X}%     \newcolumntype{C}{>{\leavevmode\ignorespaces\centering\arraybackslash\sffamily}X}%     \rowcolors{2}{middleware_white}{middleware_light_gray}          \begin{document}          \begin{table}[htbp]          \begin{tabularx}{0.45\textwidth}{|L|L|L|L|}     \hline\rowcolor{middleware_green}     \multicolumn{ 4}{|c|}{\textcolor{white}{\textbf{1 Source, 1 Session, 1 Client, Exp0}}} \\ \hline     \rowcolor{middleware_dark_gray}     \multicolumn{1}{|C}{\footnotesize\textcolor{white}{\textbf{Mes\-sa\-ges per mi\-nu\-te per sour\-ce}}} &      \multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{Mid\-dle\-ware Exec. Ti\-me (s)}}} &      \multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{De\-lay (s)}}} &      \multicolumn{1}{|C|}{\footnotesize\textcolor{white}{\textbf{Ave\-ra\-ge De\-lay (s)}}} \\ \hline      & 60 & 0 &  \\ \cline{ 2- 3}     60 & 60 & 0 & 0.00 \\ \cline{ 2- 3}      & 60 & 0 &  \\ \hline      & 60 & 0 &  \\ \cline{ 2- 3}     120 & 60 & 0 & 0.00 \\ \cline{ 2- 3}      & 60 & 0 &  \\ \hline      & 60 & 0 &  \\ \cline{ 2- 3}     240 & 60 & 0 & 0.00 \\ \cline{ 2- 3}      & 60 & 0 & \\ \hline      & 69 & 9 &  \\ \cline{ 2- 3}     480 & 69 & 9 & 16.67 \\ \cline{ 2- 3}      & 92 & 32 &  \\ \hline      & 159 & 99 &  \\ \cline{ 2- 3}     1000 & 173 & 113 & 109.67 \\ \cline{ 2- 3}      & 177 & 117 &  \\ \hline      & 391 & 331 &  \\ \cline{ 2- 3}     2000 & 383 & 323 & 311.00 \\ \cline{ 2- 3}      & 339 & 279 &  \\ \hline      & 561 & 501 & \\ \cline{ 2- 3}     4000 & 631 & 501 & 512.33 \\ \cline{ 2- 3}      & 595 & 535 &  \\ \hline     \end{tabularx}               \begin{tabularx}{0.45\textwidth}{|L|L|L|L|}     \hline\rowcolor{middleware_green}     \multicolumn{ 4}{|c|}{\textcolor{white}{\textbf{1 Source, 1 Session, 1 Client, Exp0}}} \\ \hline     \rowcolor{middleware_dark_gray}     \multicolumn{1}{|C}{\footnotesize\textcolor{white}{\textbf{Mes\-sa\-ges per mi\-nu\-te per sour\-ce}}} &      \multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{Mid\-dle\-ware Exec. Ti\-me (s)}}} &      \multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{De\-lay (s)}}} &      \multicolumn{1}{|C|}{\footnotesize\textcolor{white}{\textbf{Ave\-ra\-ge De\-lay (s)}}} \\ \hline      & 60 & 0 &  \\ \cline{ 2- 3}     60 & 60 & 0 & 0.00 \\ \cline{ 2- 3}      & 60 & 0 &  \\ \hline      & 60 & 0 &  \\ \cline{ 2- 3}     120 & 60 & 0 & 0.00 \\ \cline{ 2- 3}      & 60 & 0 &  \\ \hline      & 60 & 0 &  \\ \cline{ 2- 3}     240 & 60 & 0 & 0.00 \\ \cline{ 2- 3}      & 60 & 0 & \\ \hline      & 69 & 9 &  \\ \cline{ 2- 3}     480 & 69 & 9 & 16.67 \\ \cline{ 2- 3}      & 92 & 32 &  \\ \hline      & 159 & 99 &  \\ \cline{ 2- 3}     1000 & 173 & 113 & 109.67 \\ \cline{ 2- 3}      & 177 & 117 &  \\ \hline      & 391 & 331 &  \\ \cline{ 2- 3}     2000 & 383 & 323 & 311.00 \\ \cline{ 2- 3}      & 339 & 279 &  \\ \hline      & 561 & 501 & \\ \cline{ 2- 3}     4000 & 631 & 501 & 512.33 \\ \cline{ 2- 3}      & 595 & 535 &  \\ \hline     \end{tabularx}          \begin{tabularx}{0.45\textwidth}{|L|L|L|L|}     \hline\rowcolor{middleware_green}     \multicolumn{ 4}{|c|}{\textcolor{white}{\textbf{1 Source, 1 Session, 1 Client, Exp0}}} \\ \hline     \rowcolor{middleware_dark_gray}     \multicolumn{1}{|C}{\footnotesize\textcolor{white}{\textbf{Mes\-sa\-ges per mi\-nu\-te per sour\-ce}}} &      \multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{Mid\-dle\-ware Exec. Ti\-me (s)}}} &      \multicolumn{1}{|C}{\footnotesize\centering\textcolor{white}{\textbf{De\-lay (s)}}} &      \multicolumn{1}{|C|}{\footnotesize\textcolor{white}{\textbf{Ave\-ra\-ge De\-lay (s)}}} \\ \hline      & 60 & 0 &  \\ \cline{ 2- 3}     60 & 60 & 0 & 0.00 \\ \cline{ 2- 3}      & 60 & 0 &  \\ \hline      & 60 & 0 &  \\ \cline{ 2- 3}     120 & 60 & 0 & 0.00 \\ \cline{ 2- 3}      & 60 & 0 &  \\ \hline      & 60 & 0 &  \\ \cline{ 2- 3}     240 & 60 & 0 & 0.00 \\ \cline{ 2- 3}      & 60 & 0 & \\ \hline      & 69 & 9 &  \\ \cline{ 2- 3}     480 & 69 & 9 & 16.67 \\ \cline{ 2- 3}      & 92 & 32 &  \\ \hline      & 159 & 99 &  \\ \cline{ 2- 3}     1000 & 173 & 113 & 109.67 \\ \cline{ 2- 3}      & 177 & 117 &  \\ \hline      & 391 & 331 &  \\ \cline{ 2- 3}     2000 & 383 & 323 & 311.00 \\ \cline{ 2- 3}      & 339 & 279 &  \\ \hline      & 561 & 501 & \\ \cline{ 2- 3}     4000 & 631 & 501 & 512.33 \\ \cline{ 2- 3}      & 595 & 535 &  \\ \hline     \end{tabularx}          \label{tables_test}     \caption{three tables!}     \end{table}               \end{document}      How can I achieve this? How can I make those three tables fit inside one page?


title: LyX -- copy images into build directory for LaTeX include tags

text: The default `beamer-ornate` template includes an option to put an institution logo at the bottom of every slide,               \pgfdeclareimage[height=0.5cm]{institution-logo}{logofile.png}     \logo{\pgfuseimage{institution-logo}}      Unfortuantely, LyX doesn't know to copy `logofile.png` into the build directory (namely, `/tmp/lyx_tmpdir.T___/lyx_tmpbufN/`), and so the build command fails. How do I make it work correctly?


title: Hyphenating a number in the BibTeX pages field

text: Some journals, such as Phys. Rev. B., use unusual page numbering conventions, such as 081401-1–081401-4. (Depending on the way this gets rendered by your computer, you may not be able to discern that the center dash is an en-dash and the others are hyphens, however it's clear to see the difference in my compiled document) This poses a problem as BibTeX appears to turn all of my hyphens into en- dashes. Wrapping the pages field in double curly braces doesn't seem to do anything. How can I get BibTeX to respect this convention? I am using the IEEE transactions bibstyle (ieeetr)


title: Problem with arabxetex transliteration

text: I have a problem with Arabic transliteration in arabxetex. When I run the code below I get the transliteration as shown in the attached image. The transliteration is just the italicized version of the input text.               \documentclass{minimal}     \usepackage{arabxetex}                   \newfontfamily\arabicfont[Script=Arabic, Scale=1.5]{Scheherazade}          \begin{document}          \begin{arab}[trans]     ^gu.hA wa-.hamIruhu al-`a^saraTu     i^starY ^gu.hA `a^saraTa .hamIriN.     \end{arab}          \begin{arab}[voc]     ^gu.hA wa-.hamIruhu al-`a^saraTu     i^starY ^gu.hA `a^saraTa .hamIriN.     \end{arab}          \end{document}      ![enter image description here](http://i.stack.imgur.com/4pSHN.png)


title: Error message when running custom .bst file in bibtex

text: I have created a custom `.bst` file with the makebst program. Whenever I run BibTeX on it I first get the following error:               z is an unknown function --- line 169 of file eup.bst      Then for all entries in the bib file i get (where Aldrich1995 is the first example):               "Aldrich JH" is a string literal, not a function, for entry Aldrich1995     while executing --- line 1431 of file eup.bst     You cant pop an empty literal stack for Aldrich1995       I am a beginner with `.bst` files so I have no idea what is going on here. P.S: a link to the file: http://www.easy-share.com/1916347685/eup.bst


title: Measure 'real' height of lines/rows (as multiples of \baselineskip)

text: I am trying to measure the height of a few lines while the lines are set. I thought the 'real' height of a line is the baselineskip, e.g. 14.5pt for a 12p document. However, when I set the text in `vbox` to measure its height I get 10.7pt for one line and 25pt for two lines. But should it not be 14.5pt and 29pt, respectively? The MWE below clarifies what I mean. How do I measure the height of a row as multiples of the height of `baselineskip`? What I want to achieve is a clear measure of the amount of the number of lines in a box. I thought a clever strategy was to measure the total height and divide over the baselineskip.               \documentclass[12pt]{scrartcl}          \usepackage{lipsum,lmodern,xspace}          \newcommand{\boxheight}[1]{%      \newdimen\height      \setbox0=\vbox{#1}      \height=\ht0 \advance\height by \dp0      #1     }          \begin{document}          \boxheight{\noindent A box with one line is \the\height\xspace high}          \vspace{3ex}          \boxheight{\noindent A box with \\ two lines is \the\height\xspace high}          \vspace{3ex}          \noindent The `real' height of one line is \the\baselineskip.          \end{document}      ![enter image description here](http://i.stack.imgur.com/JxQhg.png)


title: Using \multispan in plain tex to give a caption to an array

text: I am trying to modify some code that WeBWorK uses to generate pdf hard copies of students' online math assignments. My aim is to improve WeBWorK's accessibility. My task at the moment is to endow tables with captions. Currently, tables are produced like the first one in the mwe below. I've tried a lot of things to insert a caption well, and the second table demonstrates the best I have been able to produce. ![enter image description here](http://i.stack.imgur.com/gQRWA.png) The problem is what I see in the third table, where the only thing different is that there is a caption that is longer than the sum of the subsequent column widths. In this case, what I have does not center the caption. Also, it would be better to keep the columns just as separated as they are in the first two tables. I'd need to stick with plain tex. Is there a one-size fits all solution to my problem?               \batchmode     \documentclass{amsart}               \begin{document}               \par\medskip\centerline{\kern 1pt\vbox{\halign{#\hfil&&\kern 1em #\hfil\cr     \hfil \(x\)&\hfil \(y\)\cr     \hfil \mbox{\parbox[t]{4ex}{\hrulefill}}&\hfil \mbox{\parbox[t]{4ex}{\hrulefill}}\cr     \hfil \mbox{\parbox[t]{4ex}{\hrulefill}}&\hfil \mbox{\parbox[t]{4ex}{\hrulefill}}\cr}}\kern 0pt}\medskip          %----------------------------          \par\medskip\centerline{\kern 1pt\vbox{\halign{#\hfil&&\kern 1em #\hfil\cr     \omit\hfil\multispan2{caption}\hfil\cr     \hfil \(x\)&\hfil \(y\)\cr     \hfil \mbox{\parbox[t]{4ex}{\hrulefill}}&\hfil \mbox{\parbox[t]{4ex}{\hrulefill}}\cr     \hfil \mbox{\parbox[t]{4ex}{\hrulefill}}&\hfil \mbox{\parbox[t]{4ex}{\hrulefill}}\cr}}\kern 0pt}\medskip          %----------------------------          \par\medskip\centerline{\kern 1pt\vbox{\halign{#\hfil&&\kern 1em #\hfil\cr     \omit\hfil\multispan2{caption that is very long}\hfil\cr     \hfil \(x\)&\hfil \(y\)\cr     \hfil \mbox{\parbox[t]{4ex}{\hrulefill}}&\hfil \mbox{\parbox[t]{4ex}{\hrulefill}}\cr     \hfil \mbox{\parbox[t]{4ex}{\hrulefill}}&\hfil \mbox{\parbox[t]{4ex}{\hrulefill}}\cr}}\kern 0pt}\medskip               \end{document}


title: How to remove labels but preserve hanging indenting in the memoir class

text: I am writing my humanities PhD in the `memoir` class. I need to have hanging indents for the bibliography, but no numbers or bullets. I have added               \makeatletter     \renewcommand\@biblabel[1]{}     \makeatother      to the preamble, which removes the numbering, but I can't get the hanging indents to come back. Any suggestions?


title: Missing number, treated as zero in tabularx

text: I'm using a program to generate LaTeX code utilize the tabular package. It creates an error that reads               ! Missing number, treated as zero.     <to be read again>                         ##     l.17 \begin{tabularx} {#}                               {@{} l Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y@{}} \\     ?      The code I'm using is as follows:               \documentclass[11pt, oneside]{article}      \usepackage{booktabs}     \usepackage{tabularx}          \title{Brief Article}     \author{The Author}          \begin{document}     \maketitle     %\section{}     %\subsection{}     \begin{center}     \footnotesize     \newcolumntype{Y}{>{\raggedleft\arraybackslash}X}          \begin{tabularx} {#} {@{} l Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y@{}} \\     \toprule      & \multicolumn{2}{c}{\textbf{surveyseason}} \\     \cmidrule(l{.75em}){2-3}      &\textbf{1}&\textbf{} \\     &Col \%&Col \% \\     \midrule     \textbf{sex}&& \\     female&45.3&47.2 \\     male&54.5&56.8 \\     \midrule     \textbf{grade}&& \\     9th&29&23 \\     10th&26&25 \\     11th&12.8&2.5 \\     12th&2.8&21.3 \\     \midrule     \textbf{ethbest}&& \\     american indian or alaska native&3.9&3.9 \\     native hawaiian or pacific islander&1.6&1.6 \\     asian american&9.8&9.8 \\     white or caucasian&60.4&60.4 \\     other&8.8&8.8 \\     \midrule     \textbf{highsch}&& \\     san dieguito&17.6&17.6 \\     torrey pines&33.5&33.5 \\     lacosta canyon&29.0&29.0 \\     canyon crest&19.8&19.8 \\     \bottomrule     \addlinespace[.75ex]     \end{tabularx}     \par     \scriptsize{\emph{Source: }test.dta}     \normalsize     \end{center}               \end{document}


title: Creating ethane using \chemfig

text: I was tinkering with chemfig package. I created the macros               \documentclass{article}     \newcommand{\lmethyl}{C(-[2]H)(-[4]H)(-[6]H)}     \newcommand{\rmethyl}{C(-[2]H)(-[6]H)-H}     \newcommand{\tmethyl}{C(-[2]H)(-[4]H)-H}     \newcommand{\bmethyl}{C(-[4]H)(-[6]H)-H}     \usepackage{chemfig}     \begin{document}     \chemfig{\lmethyl-\rmethyl}     \end{document}      I thought I would be able to create the code of methane using this. I know the macros are all run at the same time and hence creates the following. ![enter image description here](http://i.stack.imgur.com/tgzE0.png)


title: dynamic macro definition problem

text: It is likely that the answer to the problem is buried on this site somewhere -- it is my limited understanding of macro expansion which seems to defy my search foo... I am trying to define macros which I can use like this:               \begin{document}            \AimTaskDef{1}{task 1}       \AimTaskAdd{1}{task 2}            \AimTaskDef{2}{task 3}       \AimTaskAdd{2}{task 4}            ...       % later, in some table       \AimTaskGet{1}            \AimTaskGet{2}      Which should result in output like this               \begin{itemize}      \item task 1      \item task 2     \end{itemize}          \begin{itemize}      \item task 3      \item task 4     \end{itemize}      I have the following macro set in place:                \def\AimTaskDef#1#2{%        \expandafter\def\csname AimTask#1\endcsname{ \item #2}      }           \def\AimTaskAdd#1#2{%        \expandafter\def\tmp{\expandafter\csname AimTask#1\endcsname}        \expandafter\def\csname AimTask#1\endcsname{ \tmp \item #2}      }           \def\AimTaskGet#1{ \begin{itemize} \csname AimTask#1\endcsname \end{itemize} }      I am doing something wrong with the 'tmp' definition/usage, as I see the following errors:               \AimTaskAdd #1#2->\expandafter \def \tmp                                              {\expandafter \csname AimTask#1\end...     l.28       \AimTaskAdd{1}{task 2}          ?     ! Missing control sequence inserted.     <inserted text>                     \inaccessible     l.28       \AimTaskAdd{1}{task 2}          ?      and the result contains only the last specified task. I would appreciate any insight in what is going on with \tmp. Many thanks, Andre.