title: Problem with ntheorem, mathtools and cleveref

text: I have two (related) problems. I'm writing a project where the following is part of my preamble:               \documentclass[a4paper,11pt,oneside]{memoir}       \usepackage[T1]{fontenc}       \usepackage[utf8]{inputenc}       \usepackage{amsmath,amssymb}       \usepackage[amsmath,thmmarks]{ntheorem}       \usepackage{mathtools}       \usepackage{cleveref}       \mathtoolsset{showonlyrefs}        The first problem is that with the preamble above, the following example shows the reference to the second equation with the number '2' when it should be '1', and the tag is not shown next to the equation. The second problem is that if I don't load the `cleveref`-package, the same example now shows the tag but the number is now '3'. If I don't load the `cleveref`-package and if I remove the option `thmmarks` from the `ntheorem`-package, the example works well. What do I do to correct this? Here's the full example showing the problem:               \documentclass[a4paper,11pt,oneside]{memoir}       \usepackage[T1]{fontenc}       \usepackage[utf8]{inputenc}       \usepackage{amsmath,amssymb}       \usepackage[amsmath,thmmarks]{ntheorem}       \usepackage{mathtools}       \usepackage{cleveref}       \mathtoolsset{showonlyrefs}            \begin{document}     This is the first equation:     \begin{equation}     a^2 + b^2 = c^2\label{eq1}     \end{equation}     This is the second equation:     \begin{equation}     \alpha^2 + \beta^2 = \gamma^2\label{eq2}     \end{equation}     This line is referring to the second equation, \eqref{eq2}.     \end{document}      I might also want to point out I did the compiling on Windows with TeXLive 2010 when I wrote the post. I am now on Ubuntu with TeXLive 2009. The result is slightly different. With the preamble as it is, I now get ([equation][2][0]2) as the referring number, and no tag is shown. (I apologize for the lack of example in the original post.)


title: Place nodes on an A4 document similar to drawing on a graph sheet

text: As my figure keeps crossing the margins I end up rescaling it at the end using   `\begin{tikzpicture}[scale=5/10,transform shape]`. This works most of the time but it seems to me like its a hackish way of doing so. Is it possible to place nodes like we draw on a graph paper in the following manner:   1. Draw a thin background of a 'grid' with the size of each square defined according to your needs.    2. Use the grid to place the nodes. This way we can take precaution when deciding the size of our node objects so that we don't cross the margin.  Although I can draw a grid and select the right position of the grid by choosing the right relative coordinate, the task of selecting the coordinate becomes repetitive and painful. Is there a better way to make sure that the nodes are laid out in a `tikzpicture` a better way?


title: Highlight text in code listing while also keeping syntax highlighting

text: I’m using the _listings_ package for code listings. Now I try to highlight some part of the code using `\hl` from the _soul_ package. Here’s an example of a resulting query where the injected part of a SQL injection should be highlighted:               \begin{lstlisting}[escapechar=@,language=SQL]     SELECT name, password FROM users WHERE name='@\hl{' UNION SELECT "10", 1 \#}@';     \end{lstlisting}      But inside the highlighted part the SQL syntax highlighting is not applied. So I tried to use `\lstlinline` for the code part inside `\hl` as well but it didn’t work:               \begin{lstlisting}[escapechar=@,language=SQL]     SELECT name, password FROM users WHERE name='@\hl{\lstinline[language=SQL]$' UNION SELECT "10", 1 #$}@';     \end{lstlisting}      Although this `\lstinline` part works outside the _lstlisting_ block, it doesn’t work inside it. The error I get for that particular line is: > Extra }, or forgotten \endgroup. Maybe I’m just missing just some special syntax to get this working. Or is it not possible at all to get proper syntax highlighting for the `\hl`-highlighted part as well?


title: Pointing from Data in a pgfplotstable to a pgfplot

text: Are there PGF coordinates available for elements in a `pgfplots` table? Groupplots allow to address plots via `(group c2r1.center)` (column 2, row1).               \pgfplotstabletypeset[col sep=&,row sep=\\,sci zerofill]{       colA & colB & colC \\       11   & 12   & 13   \\       21   & 22   & 23   \\     }      With such coordinates I could draw an arrow from data in a pgfplotstable to its representation in a plot.


title: Bibliography Style cite style

text: How can I change cite style? If I cite a book I get, for example, [KA40]. I would like to have something like [Ka40]. I'm using BibTeX, `\usepackage[numbers,square]{natbib}` and `\bibliographystyle{alphadin}`. Does it depend on the bibliography style?


title: How to remove the default set logo from the title page and the ToC's page

text: How to remove a logo from the title page and from the ToC's page, please? Using this code :               \documentclass[xcolor={dvipsnames}]{beamer}     \usetheme{CambridgeUS}          \author{The Author}     \title{Work Culture}     \begin{document}     \begin{frame}     \titlepage     \end{frame}     \logo{\includegraphics[height=0.5cm]{mylogo}}          \begin{frame}     \frametitle{Test title}     \framesubtitle{Test subtitle}     test text     \end{frame}          \end{document}      Thanks a lot!


title: Memoir: How to trim set correctly?

text: How do I set the trim correctly? In my case it was wrong on some pages.               \documentclass[a4paper,showtrims]{memoir}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[brazil]{babel}     \usepackage[paperwidth=18cm,paperheight=24cm]{geometry}     \usepackage{hyperref,lipsum}     \hypersetup{pdfpagelayout=TwoPageLeft}          % Trim options     \trimFrame       \settrimmedsize{24cm}{18cm}{*}      \settrims{0cm}{0cm}          \title{Memoir with Trim}     \author{R\'egis}     \date{\the\year}     %*******************************************************     \begin{document}          \begin{titlingpage}       \maketitle     \end{titlingpage}          \tableofcontents          \chapter{Memoir with Trim}          \section{First section}          \lipsum          \chapter{Second Chapter}          \lipsum          \end{document}      Its is my result, wrong. ![enter image description here](http://i.stack.imgur.com/lHgtb.png)


title: Trimming whitespace around text (like LTRIM, RTRIM and TRIM)

text: When working in Excel with text strings, it is convenient to use the LTRIM, RTRIM and TRIM functions which removes white space around text string. What would be an efficient way of duplicating this in LaTeX? For example, say you programmatically produce variables               \def\firstname{FirstName}% First name     \def\lastname{LastName}% Last name     \edef\fullname{\firstname\ \lastname}% Full name     \fullname% Display full name      yet should also accommodate for when `\firstname` _or_ `\lastname` may be empty. Without testing whether they are empty, something like               \def\firstname{FirstName}% First name     \def\lastname{}% Last name (none)     \edef\fullname{\firstname\ \lastname}% Full name     \trim{\fullname}% Display full name      would take care of this. My first thought was to define               \def\trim#1{\ignorespaces#1\unskip}      but this would most certainly not work in a general setting, since this does not take care of an empty group. Moreover, `\unskip` would only take care of the last skip, of which there may be more than one. In particular, is it possible to define `\trim` such that it will take care of   * `\hspace`s and `\hskip`s?   * `\ `'s?   * empty groups `{}` and perhaps non-printing tokens like `\relax`? ![enter image description here](http://i.stack.imgur.com/lUacq.png)               \documentclass{article}     \begin{document}     Without \verb|\trim|:\par\medskip     \def\firstname{FirstName}\def\lastname{LastName}     \edef\fullname{\firstname\ \lastname}\fbox{\fullname}          \def\firstname{FirstName}\def\lastname{}     \edef\fullname{\firstname\ \lastname}\fbox{\fullname}          \def\firstname{}\def\lastname{LastName}     \edef\fullname{\firstname\ \lastname}\fbox{\fullname}          \bigskip          With \verb|\trim|:\par\medskip     \def\trim#1{\ignorespaces#1\unskip}     \def\firstname{FirstName}\def\lastname{LastName}     \edef\fullname{\firstname\ \lastname}\fbox{\trim{\fullname}}          \def\firstname{FirstName}\def\lastname{}     \edef\fullname{\firstname\ \lastname}\fbox{\trim{\fullname}}          \def\firstname{}\def\lastname{LastName}     \edef\fullname{\firstname\ \lastname}\fbox{\trim{\fullname}}          \end{document}


title: LaTeX probability tree

text: Please could you tell me if the Probability tree posted on 2006-12-14 by Kjell Magne Fauske can be done with three branches instead of just two.


title: How can I get font like the font of the Mathematics Magazine (MAA)?

text: I like the font Mathematics Magazine very much, but I don't know how to select this font. How can I get font like Mathematics Magazine? ![enter image description here](http://i.stack.imgur.com/oFW61.jpg)


title: Multiline table header

text: Is it possible typeset a table with `\pgfplotstabletypeset` and change the style of 1 column header to be multiline? This code doesn't work and can't compile:               ...     columns/errorRelC/.style={         column name=Line 1\\Line 2     },     ...


title: Capitalize chapter* in toc with classicthesis

text: When adding a chapter entry in the toc, I would like to get it as the other chapters, ie capitalized… For instance, add this line               \addcontentsline{toc}{chapter}{Test}      between these two lines of ClassicThesis.tex (around line 213 in my version):               \cleardoublepage\part{Some Kind of Manual}     \include{Chapters/Chapter01}      It tried to modify classicthesis.sty without success by changing (around line 570               \newcommand\ChapS[1]{\oldchap*{#1}}%      to               \newcommand\ChapS[1]{%       \ifpdf\oldchap*{\texorpdfstring{\spacedlowsmallcaps{#1}}{#1}}%       \else\oldchap*{\spacedlowsmallcaps{#1}}%       \fi%     }      Any help will be greatly appreciated… Thanks! :)


title: automatic truncate author list in revtex4-1

text: I have a problem about using `revtex4-1`. This version does not automatically truncate long author lists anymore. So I followed the instruction I found here, I made an new `.bst` file through `makebst` and use `\bibliographystyle{mybstfile}`. But I got a strange result as shown in the fig. below: > all my ref. starting from [3], and I got something strange in [1] and [2]. it looks like > [1] > > [2],08.. > > [3]normal ref. starting from here I think, maybe revtex4-1 is written to show all the author list, so I found the older version `revtex4`, and use `\bibliographystyle{mybstfile}`, under this version and using my `bst` file, the ref. list is ok. However, I cannot use `superscriptaddress` in the `documentclass`, otherwise, I get the same crazy ref. list as before. In other words, in order to have a normal ref. list, I am forced to use `groupedaddress` in the `documentclass` which will take a lot of space. please, is there any one who can help me with this problem? I am fine with both 4, or 4-1 version, as long as I can have a normal ref. list and `superscriptaddress` working properly in the same time...


title: Redefining figure* for Beamer

text: I have a single `figure*` graphic in a separate file (let's just call this `x.tex`). This file is shared across several latex documents and is inserted with `input` for each document. Unfortunately, when I try to insert this in a Beamer slide document with `\input{x}`, Beamer chokes and says `Environment figure* undefined`. I've tried fooling around with `newenvironment` but I don't know enough about it to create a new definition for `figure*`. What's the simplest way to insert this file in a Beamer document without having to modify the file being inserted?


title: Un-fulfilled reference listing

text: Is there a simple way (i.e not inspecting the output of a processing run) to get a list of un-fulfilled references? As in, if i reference something               \ref{SomethingReallyCoolIHaventThoughtOfYet}      And I continue writing, is there a clean way of getting a list;               LineNo:SomethingReallyCoolIHaventThoughtOfYet     LineNo:SomethingElseIAlreadyForgotAbout      If those references don't point to anything?


title: Get latex output of \cite

text: Is there a way to get the output of what latex would use to the write the citation in latex? For example, if I'm running bibtex and I want to just get the latex output of what would generate my "references" section. This example is a little contrived because the bib entries are explicitly formatted, but I hope it helps illustrate what I'm trying to accomplish.               \documentclass[12pt]{article}     \begin{document}          Testing\cite{lamport94}          \begin{thebibliography}{9}         \bibitem{lamport94}         Leslie Lamport,         \emph{\LaTeX: A Document Preparation System}.         Addison Wesley, Massachusetts,         2nd Edition,         1994.     \end{thebibliography}     \end{document}      Let's suppose, however, that "lamport94" was contained in a .bib file with all the @author, etc... I would then be looking for something to give me "Leslie Lamport, \emph{\LaTeX: A Document Preparation System}. Addison Wesley, Massachusetts, 2nd Edition, 1994." I can see some stuff in the .bbl file generated when I run bibtex, but it's not quite what I'm looking for... Thanks! **UPDATE** I'm looking for something that would give general output without all of the definitions. For example, in my .bbl I have something like:               [{\citenamefont {Moore}(2006)}]{moore_cramming_2006}%       \BibitemOpen       \bibfield  {author} {\bibinfo {author} {\bibfnamefont {G.~E.}\ \bibnamefont       {Moore}},\ }\href {\doibase 10.1109/N-SSC.2006.4785860} {\bibfield  {journal}       {\bibinfo  {journal} {{IEEE} {Solid-State} Circuits Newsletter}\ }\textbf       {\bibinfo {volume} {20}},\ \bibinfo {pages} {33} (\bibinfo {year}       {2006})}\BibitemShut {NoStop}%      but it requires a whole slew of definitions from the top of the .bbl file. I'm wondering if there's something that could just be copy+pasted more easily.


title: How to put numbers in parenthesis using cleveref

text: I am using the cleveref package for cross-referencing. When I use > \cref{tab1} and \cref{fig1} I got the output as > table 1 and fig. 1 respectively. I would instead like to get > table (1) and fig. (1) How can I achieve this?


title: How can I make a package that accepts an optional argument?

text: I am writing a package that has a bunch of values that are going to be the same most of the time, but that I might want to change in select cases. I want to do this by giving this package an optional argument, the way geometry does it:               \usepackage[margin=2cm]{geometry}      How would I go about doing this?


title: space between columns titles in tabular

text: I am having trouble doing the following in the `tabular` environment:               title1   title2     ------   ------     a        1     b        2     .        .     .        .     .        .     z        26      That, having only the column titles underlined and instead of the usual line across all columns. I want the space in between columns without having a vertical line in between columns.


title: Math mode: Spacing after Superscripts

text: Math mode adds extra horizontal space after superscripts. I have listed various options for removing it in the MWE. I would like to know if there is any recommended way of doing this in `amsmath`. I am thinking of using `\negthickspace` for now. However, I am interested to know if that looks too tight for a professional typographer. As my thesis has a lot of superscripts, this small decision is going to make a lot of difference in the look and feel of the whole document. ![enter image description here](http://i.stack.imgur.com/GbYSn.png) **MWE:**               \documentclass[preview]{standalone}     \usepackage{amsmath}          \begin{document}       %\noindent       $R(u,x) = R(u^{*},x)$            $R(u,x) = R(u^{*}\!,x)$            $R(u,x) = R(u^{*}\negmedspace,x)$            $R(u,x) = R(u^{*}\negthickspace,x)$            $R(u,x) = R(u^{*}\!\!,x)$     \end{document}      **EDIT:** The default behaviour of latex looks more reasonable when you write `$u^{*}\negmedspace \Sigma &= R(u^{*}\negmedspace,\Sigma)$` which yields ![enter image description here](http://i.stack.imgur.com/SUbSq.png) So if a global macro is to be written to introduce this negative spacing then it has to take into account the character that comes after the superscript. I don't know if this is possible or advisable.


title: No letters of certain fonts using winfonts package

text: I am trying to use the `winfonts` package on Windows 8. I installed according to instructions—copied them to texmf-local, edited local config files, update the file names and map files. When I compile this test file under pdflatex,               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage{winfonts}     \begin{document}     \fontfamily{georgia}\selectfont     abcdefg          \fontfamily{arial}\selectfont     abcdefg          \fontfamily{times-ttf}\selectfont     abcdefg          \fontfamily{verdana}\selectfont     abcdefg          \fontfamily{franklingothic}\selectfont     abcdefg          \fontfamily{impact}\selectfont     abcdefg     \end{document}      three of the fonts display correctly (Georgia, Franklin Gothic and Impact) while the other three are displayed only as ▯▯▯▯▯▯. What is the cause of this? I'm using TeXLive 2012, last updated on 2012-12-26. * * * The log file is very long, but there is something interesting               pdfTeX warning: pdflatex.exe (file c:/Windows/fonts/verdana.ttf): glyph `a' not found


title: How to expand a LaTeX counter when adding to token list

text: In short: I am trying to append counter values to a token list, but when I print the token list at the end I get the final values of those counters. What I want is the value of the counters at the moment that I added them to the list. I realise that I somehow need to change the way things are (not) being expanded, but I don't really understand any of the answers to related questions on this. Background: I am trying to solve my own question, which I posted earlier today, on counting the number of pages in each chapter/section in my document. I am quite close, but this is the remaining issue I have. Minimal example: Here is a simplified version of the tex file I'm using. I want the final output to be 1,4; 2,7; 2,8 but instead I get 2,8; 2,8; 2,8.               \documentclass{article}          % Create the \mytoks token list, and give a way to add to it.     \newtoks\mytoks     \mytoks={}     \newcommand{\appendtomytoks}[1]{%         \mytoks=\expandafter{\the\mytoks#1}%     }          % Create the counter I'll be using.     \newcounter{mycounter}          % Now the command for storing the counter in the token list.     % (Really it's more complicated than this.)     \newcommand{\toplevelcmd}{%         \setcounter{mycounter}{\thepage}%         \addtocounter{mycounter}{3}%         \appendtomytoks{\the\value{section}, \the\value{mycounter}\par}%     }          \begin{document}          \section{First section}          % S1 P1, so should add 1,4 to token list     \toplevelcmd           \newpage{}          .          \newpage{}          .          \newpage{}          \section{Second sectionx}          % S2 P4, so should add 2,7 to token list     \toplevelcmd           \newpage{}          % S2 P5, so should add 2,8 to token list     \toplevelcmd           \the\mytoks          \end{document}      Here is part of the preamble of the actual document I'm working on. `\appendtopagecounttable` is just renamed `\appendtomytoks`, but as you can see the commands are a bit more complicated. Arguments `#1` and `#3` to the commands below should just be counter values, but #2 could be something a bit more complicated (but probably not, I think).               \newcommand{\addchapterpagecount}[3]{%         \appendtopagecounttable{\medskip\par\noindent\textbf{\makebox[\parindent][l]{#1}#2\hfill #3}}     }     \newcommand{\addsectionpagecount}[3]{%         \appendtopagecounttable{\noindent\hspace{\parindent}\makebox[0.8cm][l]{#1}#2\dotfill #3}     }


title: LyX forbids horizontal centering of tables inside a theorem environment!

text: How can I center a table in a, say, theorem environment in LyX ? When I have a centered table in the standart LR-mode writing mode everythings ok. But when I select the whole table and try to turn it into a theorem, by clicking on "`theorem`" in LyX's environment box, I get the message               The new layout does not permit the alignment previously used.     Setting to default.      And the table wanders to left inside the newly created theorem environment. Looking at the source code LyX generates, when doing the things I just described, I can see that LyX forbids be to put the tabular environment inside a `\begin{center}` ... `\end{center}` environment as soon as the tabular environment is inside a `\begin{thm}` ... `\end{thm}` environment. In plain LaTeX this works fine, therefor I can't see why LyX forbids this.


title: Output Filename

text: I'm using texmaker and PdfLaTeX. With the exception of changing the `.tex` filename, does anyone know how to modify the output file name based on a parameter? I am aware that the following line...               %& -job-name=XYZ      if placed at the beginning of the document would be parsed as an additional parameter. In the above case this would instruct the generation of `XYZ.pdf` when typeset, therefore:               %& -job-name=XYZ_26Dec2012      would accordingly produce `XYZ_26Dec2012.pdf` How can I get the `26Dec2012` to change based on the actual date (automatically), therefore keeping a chronology of working documents as they change over time?


title: TikZ add frame to a picture

text: I want to add a frame to a picture. i start to draw the picture by tikz. after drawing, it is the time adding frame. now, how can i know the following two points to add the frame, assuming that frame's width is equal to the page's width:   1. how can i get the lower left corner's coordinate of the picture?   2. how can i get how high the picture is? if i have these two points, i can draw a rectangle for the frame. or is any other way to realize this purpose? @Thorsten: just adding `fbox` seemed not to be enough.               \documentclass[titlepage,a4paper]{article}          \usepackage{tikz}     \usepackage[lmargin=2.500000cm,rmargin=2.500000cm,tmargin=2.500000cm,bmargin=2.500000cm]{geometry}          \begin{document}     \section[General remarks]{General remarks}     \subsection[Geometry and coordinate system]{Geometry and coordinate system}     The main layout of the structure is adopted:\\          \fbox{     \begin{tikzpicture}[scale=1,thick]       \useasboundingbox (0,0) rectangle (70mm,5);       \begin{scope}[shift={(20mm,0)}]         \foreach \xoffset in {0,5.2}         {           \begin{scope}[shift={(\xoffset,0)}]           \draw[xstep=1,ystep=1] (0,0) grid (5,5);           \end{scope}         }       \end{scope}     \end{tikzpicture}     }          \end{document}      ![enter image description here](http://i.stack.imgur.com/LolrG.jpg) based on `Martin`'s comment, following code is added. as a newbie, it took me some time to find a way to add some spacing around picture. so this might save time for other newbies.               \documentclass[titlepage,a4paper]{article}          \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage[lmargin=2.500000cm,rmargin=2.500000cm,tmargin=2.500000cm,bmargin=2.500000cm]{geometry}          \begin{document}     \section[General remarks]{General remarks}     \subsection[Geometry and coordinate system]{Geometry and coordinate system}     The main layout of the structure is adopted:\\          \begin{tikzpicture}[scale=1,thick]       \begin{scope}[shift={(20mm,0)}]         \foreach \xoffset in {0,5.2}         {           \begin{scope}[shift={(\xoffset,0)}]           \draw[xstep=1,ystep=1] (0,0) grid (5,5);           \end{scope}         }       \end{scope}            \coordinate (B) at (current bounding box.south west);       \draw[line width=10pt]       let         \p2 = ($(B) - (10mm,10mm)$)       in       (current bounding box.north east) ++(10mm,10mm) rectangle (\p2);     \end{tikzpicture}          \end{document}      another method uses `backgrounds`. please refer to `Andrew`'s comment at the below.


title: What is the difference between the combination of split inside equation* and align*?

text: What is the difference between the combination of `split` inside `equation*` and `align*`?               \begin{equation*}     \begin{split}     A   &= B+C\\         &= X+Y     \end{split}     \end{equation*}          \begin{align*}     A   &= B+C\\         &= X+Y     \end{align*}


title: How to change #catcode in a macro

text: I want to change the catcode in a macro, but it seems it doesn't work. Can anyone help me?               \def\A{\catcode`\|=0 |bf{test}}       `|bf{test}` would not work as expect.


title: How to use pgfkeys with "to path"

text: I'm not sure if the title is correct but I'll try to explain my problem correctly. I always work on the pgfvectorian package and I try to add some useful macros. One of these macros is to place an vector ornament between two nodes. The next code give you a vector object named `\myobject` the I define a macro `\pgfobj` to draw this object. In this example I added 3 options : `scale` , `width` and `anchor`. `width` is to draw the object with a predefined width and `anchor` is used to place the object. I also defined a style `object` to easily place the object between two points. I calculate the distance between the 2 points and then I place the object with `sloped` and `pos`. My problem : I would like to extend the style `object`. I would like for example change the value of `pos` and the value of `anchor` but I can't find a solution to this. I would like a syntax like `\draw [black] (A) to [object,pos=.2,anchor=north] (B);` but apply these values at `node [anchor=south,pos=.5,sloped,allow upside down,inner sep=0pt]` Sorry fot the long code but I think it's necessary to understand the question :               \documentclass[landscape]{scrartcl}     \usepackage{fullpage,tikz}     \usetikzlibrary{shapes.geometric,calc}          %8<------8<------8<------8<------8<------8<------8<------8<------8<------     \def\myobject{%     \pgfpathmoveto{\pgfqpoint{0bp}{0bp}}      \pgfpathcurveto{\pgfqpoint{50bp}{0bp}}                    {\pgfqpoint{150bp}{0bp}}                    {\pgfqpoint{200bp}{16bp}}     \pgfpathcurveto{\pgfqpoint{250bp}{0bp}}                    {\pgfqpoint{350bp}{0bp}}                    {\pgfqpoint{400bp}{0bp}}     \pgfpathlineto{\pgfqpoint{400bp}{1bp}}     \pgfpathcurveto{\pgfqpoint{350bp}{0bp}}                    {\pgfqpoint{250bp}{0bp}}                    {\pgfqpoint{200bp}{22bp}}       \pgfpathcurveto{\pgfqpoint{150bp}{0bp}}                    {\pgfqpoint{50bp}{0bp}}                    {\pgfqpoint{0bp}{1bp}}     \pgfpathlineto{\pgfqpoint{0bp}{0bp}}        \pgfusepath{fill,stroke}}       %8<------8<------8<------8<------8<------8<------8<------8<------8<------       \makeatletter     \pgfkeys{     /obj/.cd,     scale/.code     =  {\def\pgfogjscale{#1}},      width/.code     =  {\def\pgfogjwidth{#1}},     anchor/.code    =  {\def\pgfobjanchor{#1}}     }     %8<------8<------8<------8<------8<------8<------8<------8<------8<------      \def\pgfobj{\pgfutil@ifnextchar[{\pgf@obj}{\pgf@obj[]}}     \def\pgf@obj[#1]{%     \pgfkeys{%     /obj/.cd,     scale    =  1,     width    =  {},     anchor   = south     }%      \pgfqkeys{/obj}{#1}%           \begin{tikzpicture}[baseline=(current bounding box.\pgfobjanchor)]     \ifx\pgfogjwidth\empty  \else       \pgfmathsetmacro{\pgfogjscale}{\pgfogjwidth /400 bp}%     \fi      \pgftransformscale{\pgfogjscale}%      \myobject     \end{tikzpicture}%     }%     %8<------8<------8<------8<------8<------8<------8<------8<------8<------      \tikzset{%     object/.style={to path={%     \pgfextra{%              \tikz@scan@one@point\pgfutil@firstofone(\tikztostart)\relax                  \pgf@xa=\pgf@x                 \pgf@ya=\pgf@y               \tikz@scan@one@point\pgfutil@firstofone(\tikztotarget)\relax                 \pgf@xb=\pgf@x                 \pgf@yb=\pgf@y                  \advance\pgf@xa by-\pgf@xb                  \advance\pgf@ya by-\pgf@yb                \pgfmathveclen{\pgf@xa}{\pgf@ya}               \global\let\objlen\pgfmathresult        \path (\tikztostart)  -- node [anchor=south,pos=.5,                  sloped,allow upside down,inner sep=0pt]%                  {\pgfobj[width=\objlen]} (\tikztotarget) ;            }%end pgfextra         }% end to path       }% end style     }     %8<------8<------8<------8<------8<------8<------8<------8<------8<------      \makeatother     \begin{document}      vector ornament with \texttt{scale=.5}: \pgfobj[scale=.5]            vector ornament between 2 nodes :      \begin{tikzpicture}     \node (A) at (0,0) {};  \node (B) at (7,5) {};      \draw [help lines]  (0,0) grid (7,5);     \draw [fill=black]  (A) circle (2pt)                          (B) circle (2pt);         \draw [black]       (A) to [object]  (B);          \end{tikzpicture}           Ornaments with a pentagon :     \begin{tikzpicture}     \node[regular polygon, regular polygon sides=5,            minimum size=8cm,inner sep=0pt](h)  {};      \foreach \i [count=\next from 2] in {1,...,5}       {%         \draw (h.corner \i) to [object] (h.corner \next);        \pgfmathtruncatemacro{\next}{mod(\next,5)} }     \end{tikzpicture}           \end{document}       ![enter image description here](http://i.stack.imgur.com/cYBGK.png) Remark 1) I can use another code to draw the object like :                       \pgfmathsetmacro{\objangle}{atan2(\pgf@xa,\pgf@ya)}              \node[anchor=south,rotate=\objangle,inner sep=0pt] at                 ($(\tikztostart)!.5!(\tikztotarget)$){\pgfobj[width=\objlen]} ;       2) In fact I work with several objects also the syntax is something like :                  \draw [black]   (A) to [object = integer]  (B); % integer = numero of the object      3) Perhaps I may have taken a wrong way also if you have a better idea, I'm listening !


title: Which choice of line-breaking parameters gives the minimum number of lines

text: Sometimes, you don't care about the "beauty" of TeX line-breaking algorithm, but just want that one or two extra lines in a document. When faced with such a situation, I start adding `~` at appropriate places, and hope that TeX finds a line-breaking that uses less number of lines. And if often does! Are there values of the TeX line-breaking parameters that bias the result towards fewer lines in a (justified) paragraph. Note that I already use hanging punctuation.


title: \labelfont from caption package not working

text: I am trying to change the font of the label in the caption, but it seems not work. The font is changed in the text of the cation but not in the label This is my preamble:               \documentclass[a4paper,12pt,english,oneside]{report}     \sloppy     \usepackage[paper=a4paper,left=40mm,width=150mm,top=20mm,bottom=40mm]{geometry}      \usepackage{setspace} % This is used in the title page     \usepackage{graphicx}      \usepackage[english]{babel}     \usepackage[colon]{natbib}     \usepackage{color}     \usepackage{fancyhdr}     \usepackage{nomencl}     \usepackage[tableposition=top]{caption}     \captionsetup{font={small}, textfont={sf}, labelfont={bf,sf}}     \usepackage{wrapfig}     \usepackage{float}     \usepackage{semtrans}     \usepackage{gensymb}     \usepackage{colortbl}     \usepackage{array}     \usepackage{texshade}     \usepackage{hyperref}     \usepackage{wasysym}     \usepackage[T1]{fontenc} %font choice     \usepackage{tgtermes} %font     \usepackage{layouts}     \usepackage{rotating}     \usepackage{fixltx2e}     \usepackage{lscape}     \usepackage{listings}     \usepackage{pdfpages}     \definecolor{lightgray}{rgb}{.9,.9,.9}     \lstset{%frame=tb,       backgroundcolor=\color{lightgray},       aboveskip=3mm,       belowskip=3mm,       showstringspaces=false,       columns=flexible,       basicstyle={\footnotesize\ttfamily},       numbers=none,       numberstyle=\tiny\color{gray},       keywordstyle=\color{blue},       commentstyle=\color{dkgreen},       stringstyle=\color{mauve},       breaklines=true,       breakatwhitespace=true       tabsize=3     }          \hypersetup{         bookmarks=true,         % show bookmarks bar?         bookmarksopen=true,          bookmarksnumbered=true,         pdftitle={},    % title         pdfauthor={},     % author         pdfsubject={},   % subject of the document         pdfcreator={},   % creator of the document         colorlinks=true,       % false: boxed links; true: colored links         linkcolor=black,          % color of internal links         citecolor=black,        % color of links to bibliography         filecolor=magenta,      % color of file links         urlcolor=cyan           % color of external links     }           and this what I get back ![](http://i.stack.imgur.com/JJ9kO.png) I would like to have everything in sf. Any help? Thanks G


title: How to remove page break after \part in report/book

text: I have tried to look through, but I couldn't find a clear solution on this. I have a document that uses `report` with multiple `\chapter`s in multiple `\part`s as:               \part{foo}     \chapter{uno}     \chapter{dos}     \part{bar}...      This results in an entire page that is "Part I Uno". I would like to remove the page break, and have both part foo, and chapter uno on the same page as:               Part I foo     Chapter 1 Uno      How do I do that?


title: How to incorporate tikz elements into latex labels without (xe)latex apparently hanging

text: I am very new to TeX, and having seen the fantastic wine label examples I thought I would see what I could come up with for some homebrew which is ready to bottle. I've got some Avery labels (MD4001, 4 labels to a sheet, each label 90 x 120mm). What I (eventually) want to do is use these labels to produce 4-up prints of customised bottle labels. Tikz and the LaTex package for mailing labels looked like just the thing. The problem is that when I try to combine `\usepackage{labels}` with tikz, the xelatex session hangs, requiring a break (CTRL-C):               *************************************************     * LaTeX warning: "xparse/redefine-command"     *      * Redefining document command \oldstylenums with arg. spec. 'm' on line 128.     *************************************************     ) (/usr/local/texlive/2014/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty     (/usr/local/texlive/2014/texmf-dist/tex/latex/base/fontenc.sty     (/usr/local/texlive/2014/texmf-dist/tex/latex/euenc/eu1enc.def)     (/usr/local/texlive/2014/texmf-dist/tex/latex/euenc/eu1lmr.fd))     (/usr/local/texlive/2014/texmf-dist/tex/xelatex/xunicode/xunicode.sty     (/usr/local/texlive/2014/texmf-dist/tex/latex/tipa/t3enc.def     (/usr/local/texlive/2014/texmf-dist/tex/latex/euenc/eu1lmss.fd)))     (/usr/local/texlive/2014/texmf-dist/tex/latex/fontspec/fontspec.cfg)))     (/usr/local/texlive/2014/texmf-dist/tex/latex/xltxtra/xltxtra.sty     (/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/ifluatex.sty)     (/usr/local/texlive/2014/texmf-dist/tex/latex/realscripts/realscripts.sty     *************************************************     * LaTeX warning: "xparse/redefine-command"     *      * Redefining document command \textsubscript with arg. spec. 's' on line 25.     *************************************************     *************************************************     * LaTeX warning: "xparse/redefine-command"     *      * Redefining document command \textsuperscript with arg. spec. 's' on line 28.     *************************************************     ) (/usr/local/texlive/2014/texmf-dist/tex/latex/metalogo/metalogo.sty))     (./Example.aux) (/usr/local/texlive/2014/texmf-dist/tex/latex/tipa/t3cmr.fd)     *geometry* driver: auto-detecting     *geometry* detected driver: xetex     ABD: EveryShipout initializing macros     To print info, put `\LabelInfotrue' in the preamble     ^C! Interruption.     \tikz@path@overlay #1->\let \tikz@signal@path                                                    =\tikz@signal@path \pgfutil@if...     l.45 ]          ? x     No pages of output.     Transcript written on Example.log.      The example to produce this was as follows. Can someone enlighten me if I have managed to do something stupid?:               % XeLaTeX can use any Mac OS X font. See the setromanfont command below.     % Input to XeLaTeX is full Unicode, so Unicode characters can be typed directly into the source.          % The next lines tell TeXShop to typeset with xelatex, and to open and save the source with Unicode encoding.          %!TEX TS-program = xelatex     %!TEX encoding = UTF-8 Unicode          \documentclass[12pt]{article}     \usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.     \geometry{a4paper}                   % ... or a4paper or a5paper or ...      \geometry{landscape}                % Activate for for rotated page geometry     %\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{labels}     \numberoflabels=4     \LabelCols=2     \LabelRows=2     \LeftBorder=5mm     \RightBorder=5mm     \TopBorder=5mm     \BottomBorder=5mm     \usepackage{tikz}     \usepackage{pgfornament}          % Will Robertson's fontspec.sty can be used to simplify font choices.     % To experiment, open /Applications/Font Book to examine the fonts provided on Mac OS X,     % and change "Hoefler Text" to any of these choices.          \usepackage{fontspec,xltxtra,xunicode}     \defaultfontfeatures{Mapping=tex-text}     \setromanfont[Mapping=tex-text]{Hoefler Text}     \setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}     \setmonofont[Scale=MatchLowercase]{Andale Mono}          \begin{document}          \begin{labels}     \begin{tikzpicture}     \node[       text width=10mm,       text height=10mm,       fill={RGB}{248,240,201}     ]       (rect) {};     \end{tikzpicture}     John E. Smith     \TeX{}nician     3.14159265 Knuth Avenue     Anytown     Anyshire     H8W 0RD     Untied Kingdom     \end{labels}          \end{document}


title: context tex poster template

text: There are Latex poster package, such as beamerposter, baposter, a0poster . Any such resource for making a conference poster in ConTeXt TeX?


title: How to indicate a sliding window in a table

text: I have a table as follows in beamer.               \documentclass{beamer}          \usepackage[utf8]{inputenc}     \usepackage{default}          \begin{document}     \begin{frame}      \frametitle{test}      \begin{center}     \huge \Huge     \begin{tabular}{|c|c|c|c|c|c|c|}     \hline     A&     B&     C&     B&     A&     B&     C\\     \hline     \end{tabular}     \end{center}     \end{frame}      I would like in the first frame for the first three cells to be highlighted by having the external border of the rectangle containing those three cells thicker and in a different color. For the next frame for cells 2 to 4 to have this and for the next one cells 3 to 5 and for the last one cells 4 to 6. How can one do this? I thought I could do it by having four mostly duplicated frames and in each one just stick tables together side by side. This doesn't seem a nice solution however.


title: A (La)TeX with only one special control character in the source file

text: One thing I find annoying about (La)TeX is that there are too many special characters. To have any of `\ $ % & # _ ~ ^ { }` in a text in the document we have to escape it using `\`. Personally I think this is stupid - after all we are writing a text document and not doing programming. I think it would be great if there was a mode where we only have one escape character (and `\` would suite me just fine) and _all_ commands and control sequences would have to be preceded by `\`. Comments would be (e.g.) `\%` math could be introduced with `\$` etc. Are there any packages/hacks/modifications that allow this?


title: How to remove dots and page number of list of figures and list of tables in table of contents

text: Heydo! I need to include the first pages to TOC and NOT include page numbers. How I can I achieve this? \listoffigures and \listoftables makes a dotted line and a page number to TOC which I want to get rid of. I've searched for a number of questions but I always find answers to remove page number IN toc, which I have done already. My table of contents should look like this:               ABSTRACT     LIST OF FIGURES     LIST OF TABLES     CONTENTS     CHAPTER 1...................................6     CHAPTER 2...................................7      Minimal working example:               % docmentclass     \documentclass[12pt]{article}          % table of contents package      \usepackage{tocloft}                  % package to enable commands after pages     \usepackage{afterpage}                % dots to TOC     \AtBeginDocument{                                                        \renewcommand{\cftsecleader}{\cftdotfill{\cftsecdotsep}}             \renewcommand\cftsecdotsep{\cftdot}                                  \renewcommand\cftsubsecdotsep{\cftdot}                               \renewcommand{\cftfigleader}{\cftdotfill{\cftsecdotsep}}         \renewcommand{\cfttableader}{\cftdotfill{\cftsecdotsep}}         }          %remove incremental number from TOC     \let\oldsection\section      \newcommand{         \abstractsection}[1]{            \newpage           \oldsection*{#1}           \addcontentsline{toc}{section}{#1}         }          %for captions to show up in lof and lot     \usepackage{caption}          \begin{document}          %frontcover     \begin{center}         \vspace*{5cm}         \normalsize{Tuomas-Matti Soikkeli} \\         \large{Front Cover}         \vfill{}     \end{center}           %abstract     \abstractsection{ABSTRACT}     Some abstract content     \newpage          %list of figures and list of tables     \listoffigures     \addcontentsline{toc}{section}{LIST OF FIGURES}     \listoftables     \addcontentsline{toc}{section}{LIST OF TABLES}     \newpage          %ToC     \tableofcontents      \addcontentsline{toc}{section}{CONTENTS}     \newpage          %contents     \section{FIRST CHAPTER}     \begin{figure}[H]       figure       \caption[EXAMPLE FIGURE]{example figure}     \end{figure}          \section{SECOND CHAPTER}     \begin{table}[h]     table     \caption[EXAMPLE TABLE]{example table}     \end{table}          \end{document}      Ends up being: ![TOC.png](http://i.stack.imgur.com/WgWis.png)


title: Hyperref-ize the keywords in toc

text: once I asked in Insert key words & key phrases into toc whether it is possible to insert some keywords in the toc that it looks like this:               Contents          1 section .............................1          key word 1 - key phrase 2 - key word 3              1.1 subsection ...............................5              key word 1 - key phrase 2 - key word 3 -              key word 4 - key phrase 5 - key word 6      egreg provided this answer which works perfectly well:               \documentclass[a4paper]{article}     \usepackage{etoolbox}          \makeatletter     \newif\ifsection     \newif\ifsubsection     \newtoks\keywordstoks     \preto\section{\flushkeywords\sectiontrue\subsectionfalse}     \preto\subsection{\flushkeywords\sectionfalse\subsectiontrue}     \preto\enddocument{\flushkeywords}          \newcommand{\flushkeywords}{%         \ifsection\addtocontents{toc}{\formatkwsection{\protect\@gobble\the\keywordstoks\relax}}\fi       \ifsubsection\addtocontents{toc}{\formatkwsubsection{\protect\@gobble\the\keywordstoks\relax}}\fi       \keywordstoks={}}          \newcommand{\keyword}[1]{\@bsphack\keywordstoks=\expandafter{\the\keywordstoks\kwsep#1} \@esphack}     \newrobustcmd{\kwsep}{~-- }     \newrobustcmd{\formatkwsection}[1]{#1\par\medskip}     \newrobustcmd{\formatkwsubsection}[1]{{\leftskip=2.2em\relax#1\par}\smallskip}     \makeatother          \begin{document}          \tableofcontents          \section{Section}          Abc \keyword{key1} def \keyword{key2}          \subsection{Subsection}          Ciao \keyword{key3} ciao \keyword{key4}          \subsection{Another}          x          \end{document}      Now my question: Is it possible to hyperref-ize the keywords?


title: Add new bibliography style

text: I want to use a bibliography style that not installed with texlive. How could I install new bibliography style on texlive (windows 7)?


title: Can someone make my command for formatting variable names work better?

text: So, I've got this command that I use to format variable names in my homework:               \newcommand*{\var}[1]{\ensuremath{\mathord{\mathtt{#1}}}}      The problem is that it doesn't handle subscripts smoothly. I end up typing this frequently:               \var{Something}_{\var{SomethingElese}}      Which is a bit cumbersome. Can I make it work with:               \var{Something_SomethingElse}      or at least:               \var{Something}_\var{SomethingElse}


title: Numbering theorems in the appendix by adding the appendix letter in front/after the theorem number

text: Can someone please tell me how to make definitions, theorems etc. in the appendix look like **Definition A1** or **Definition 1A** (an "A" should be somewhere), if the appendix is "numbered" with **A** (meaning latex shows **A Appendix** , if I compile the document). Right now all the definitions, theorems etc.are numbered from 1 to n, where n is the last definition, theorem etc. of my document (sections don't change the numbering), even if this last one is in the appendix. Equation numbering is ok though; the first numbered equation is "A.1". The thing is, I'm using LyX, so I would prefer it, if there were some command that I could use to reset the counter and globally change the look of definitions, theorems etc. in the appendix, so that I 1) don't have to remove all the LyX-created environments (like for example the LyX-created definition environment) and replace them by hand-coded ones in order to maybe pass some additional arguments to each them, because that looks horrible in LyX. 2) don't have to use a different way to insert the appendix other then the one LyX provides and that is via \appendix (not via the appendix package). FYI: I'm using LyX 2; the document class is article; my appendix is situated after several sections (I don't used any other divisioning of my document like subsections etc. - if that makes any difference).


title: Maple code in comment create with tcolorbox package

text: i have 4 questions:   * Insert a char like \sqcup between 'Hello' and 'World' in the **"Hello World"**?   * How can i change code environment so that comment (not in mathmode) is sensitive for Maple keyword, for example, change its color?   * Is there a way for define **'smart indent'** of MATLAB software, automatically indents my code?if not, How can i define a command like **\mapleIndent** (for indent), that work in upper part, instead i insert space by hand? ![enter image description here](http://i.stack.imgur.com/8OfAp.png)   * How can i Move the lower part of Fib algorithm (last code env below) **together** to the middle of line? in i use **center lower** , output isn't nice format. ![enter image description here](http://i.stack.imgur.com/kkREg.png) the code is:               \documentclass{article}          \usepackage[svgnames]{xcolor}     \usepackage{tcolorbox}     \usepackage{amsmath,amsfonts,amssymb,amsthm}     \usepackage[top=2.5cm,right=3.5cm,bottom=2.5cm,left=2.5cm]{geometry}            %----------------------------------------------------------------------------------------     %     MAPLE CODE     %----------------------------------------------------------------------------------------          \tcbuselibrary{listings,skins,theorems}          \lstdefinelanguage{Maple}{                 morekeywords={                 and,assuming,break,by,catch,description,do,done,                 elif,else,end,error,export,fi,finally,for,from,global,if,                 implies,in,intersect,local,minus,mod,module,next,not,od,                 option,options,or,proc,quit,read,return,save,stop,subset,then,                 to,try,union,use,uses,while,xor                 },                 sensitive=true,                 keywordstyle=\color{black},                 morecomment=[l][\color{green!50!black}]\#,                 morestring=[b]",                 morestring=[d]"                 aboveskip={0pt},                 belowskip={0pt},                 }[keywords,comments,strings]          \makeatletter     \tcbset{every listing line/.code={%       \def\lst@NewLine{%           \ifx\lst@OutputBox\@gobble\else               \par\noindent \hbox{}#1%           \fi           \global\advance\lst@newlines\m@ne           \lst@newlinetrue}}}     \makeatother          \newtcblisting{code}[1]{                  skin=bicolor,                  colback=white,                  colbacklower=white,                  colupper=red!40!black,                  collower=blue,                  listing options={language={Maple}},                  fontupper=\ttfamily\bfseries,                  boxrule=0mm,                  top=0mm,bottom=0mm,middle=0mm,     %             center lower,                  nobeforeafter,                 listing and comment,                comment={ #1},                every listing line={\textcolor{red!40!black}{\ttfamily> }}                }          \newdimen\Tab     \Tab=3ex     \def\mapleIndent#1{\hbox{\hskip#1\Tab\relax}}          \begin{document}                         \begin{code}{ F := proc() "Hello World " end proc}     F := proc() # comment          "Hello World"     end proc;     \end{code}               \begin{code}{}     Max := proc()     local i,m;      if nargs = 0 then     return -infinity     end if;     m := args[1];     for i from 2 to nargs do     if args[i] > m then     m := args[i]     end if;     end do;     m;     end proc:     \end{code}                         \begin{code}{     Fib := proc(n::nonnegint)\\     option remember;\\     \mapleIndent{1} if $n < 2$ then $n$ else Fib$(n - 1)$ + Fib$(n - 2)$ end if\\     end proc}     Fib := proc( n :: nonnegint )          option remember;          if n<2 then               n          else               Fib(n-1) + Fib(n-2)          end if;     end proc;     \end{code}               \end{document}


title: How can I caption an enumerated list?

text: When I have a list such as               \begin{enumerate}     % List contents here...     \end{enumerate}      Or               \begin{itemize}     % List contents here...     \end{itemize}      How can I caption it, eg. as "List 1.1"? I could put it inside a table environment, but then the caption would say "Table 1.1", and this isn't a table.


title: How to have citations individually bracketed with biblatex-ieee

text: I'm using `biblatex` with the `biblatex-ieee` style and I've run into a problem with the formatting of citations in a group. For example, I can use:               This is two citations~\cite{ref1,ref2}.  This is three citations~\cite{ref3,ref4,ref5}.      According to IEEE style, this should yield: > This is two citations [1], [2]. This is three citations [3]–[5]. Instead, what is actually produced is: > This is two citations [1, 2]. This is three citations [3–5]. In `numeric-comp.cbx` (referenced by `ieee.cbx`), there is a line saying `\renewcommand*{\multicitedelim}{\addcomma\space}`, but I don't see how I would modify this to close provide "`], [`" in one case and "`]–[`" in the case of several citations. Of course, I don't see from this line how `biblatex` knows to transform `\addcomma` to a dash in the first place, so I might be looking in the wrong place altogether. Could someone guide me on how to adjust things to obtain the first example?


title: How to correctly use equal sign in keywords for listings?

text: I work on a listings code style for HTML5. The style looks quite good but I have a little problem with the equals sign. I defined the equals sign as a keyword:                ndkeywords={=, ... }      This will cause the equals sign to appear in green (which is what I want). However, in `+=` the `=` is also green (but not the `+`). **Screenshot:** ![enter image description here](http://i.stack.imgur.com/3qRGr.png) Can I define that the equals sign is only highlighted when there is a space before? Here is the code example: https://www.writelatex.com/74567mmxwkw


title: diagonal text in math mode w/ vertical equality

text: The goal is a code where one can label elements in math mode in the following way: ![label](http://i61.tinypic.com/25hfp5j.png) without having to manually position each letter of each word as a node in tikz. Preferably, other than the stacks plugin, tikz does not have to be invoked, but no problem if it is in the end. The two types of diagonals as a macro is the challenging bit. A macro or something is needed to convert a word in               \macro_name{word}       to a diagonal, growing right from the top, or growing left from the bottom, like in the two examples above. Then it can be used, w/ Steven Segletes's tabstackengine package in the MWE below:               \documentclass{minimal}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{tabstackengine}     \usepackage{mathtools}          \stackMath     \makeatletter     \renewcommand\TAB@delim[1]{\scriptstyle#1}     \def\req{\protect\rotatebox{90}{$\scriptstyle=$}}     \def\rne{\protect\rotatebox{90}{$\scriptstyle\ne$}}     \makeatother          \begin{document}          \[     \setstackgap{L}{.6\baselineskip}\setstacktabulargap{0pt}\TABbinary     \tabularCenterstack{rcl}{     &\mathclap{alpha}& &\mathclap{beta}&\\ &\req& &\req& \\ (&A& , &B&) \hspace{1mm}= \hspace{1mm} F\\      &\rne&\\ &\mathclap{(D , B)}&}     \]          % BTW, for some reason, tex cannot compile if <<\mathclap{(D , B)}>> is replaced with <<\mathclap{\overbrace{(D , B)}}>> or <<\mathclap{\underbrace{(D , B)}}>> but this is a different question, no?          \end{document}      EDIT: I just noticed that it looks strange if only vertical spacing is controlled. There needs to be a parameter to space the letters horizontally in each diagonal. Is that possible? (When writing by hand, I observe the letters are placed CLOSER together horizontally to make it more readable in addition to the vertical displacement which is already presently controlled in the answer below.)


title: Installing pfgornament?

text: Note: I have already searched through this site on how to do this but a lot of the things explained make little to no sense to me, I am a novice at this stuff so I was wondering if could get a little more info. I am using MiKTeX 2.9. I would love to be able to use the `pgfornament` package but I always get the following error: > Errors: > > C:/Users/Chase/Documents/LaTeX Files/ornament trial.tex:3: LaTeX Error: File > `pgfornament.sty' not found. Is there a simple way to remedy this? I found a couple things about a "TDS Tree" and I am not sure what that is or how to use it. I have also found the packages folder in my MiKTeX folder with a lot of .tpm files. How can I add this package to MiKTeX?


title: Paragraph style footnotes in plain XeTeX

text: I’m trying to get footnotes set in the paragraph style in plain XeTeX. I’ve pasted the code from `fnpara.tex` into the preamble of my document and changed the fonts used in the actual footnotes to Palatino Linotype by pasting:               \font\footnumberfont="Palatino Linotype/R:mapping=tex-text" at 8pt          \font\footnotesize="Palatino Linotype/R:mapping=tex-text" at 8pt      after the code from `fnpara'. The main font in my document is set like this:               \font\pala="Palatino Linotype/R:+onum:mapping=tex-text" at 10pt      I call it by putting `\pala' at the start of the text. Everything works fine except for one thing: the superscript footnote reference numbers in the text block are in Computer Modern (cmr7), which looks strange, since everything else is in Palatino. I’m new to plain (Xe)TeX. minimum working example:               %!TEX TS-program = xetex          %!TEX encoding = UTF-8 Unicode          \input eplain          \font\pala="Palatino Linotype/R:+onum:mapping=tex-text" at 10pt          PLACE CODE FROM "fnpara.tex" HERE          \font\footnumberfont="Palatino Linotype/R:mapping=tex-text" at 8pt      \font\footnotesize="Palatino Linotype/R:mapping=tex-text" at 8pt          \pala          Lorem\footnote{First footnote.} ipsum dolor sit amet,\footnote{Second footnote.     (Every once in a while a long footnote might occur, just to make things difficult.)}     consectetur adipisicing\footnote{Third footnote.} elit,          \bye      i put the MWE in the question; thanks Torbjørn T.


title: Vertical alignment of "nobeforeafter" tcolorbox

text: Is there a way to vertically center the little tcolorboxes ?               \documentclass[]{article}     \usepackage[skins]{tcolorbox}          \begin{document}          \newtcbox{\LittleBox}[1][]{enhanced,nobeforeafter,#1}%          \begin{tcolorbox}[enhanced,sidebyside,sidebyside align= center, colbacktitle=white,coltitle=black,colback=white,fonttitle=\large\bfseries,title= Little boxes not centered vertically]          % not working: valign=center,valign lower=center, before=  \begin{center}, \vfill, \[\vcenter{}\], \begin{tabular}{cc}\end{tabular},sidebyside align= center,   \centering          \LittleBox{\scriptsize First}      \LittleBox{\huge Second}     \tcblower     \LittleBox{\Large Third}     \LittleBox{\small Fourth}          \end{tcolorbox}      ![enter image description here](http://i.stack.imgur.com/bSCS7.jpg)


title: How to make a cross symbol in LaTeX

text: I found the post on Small cross and small upside down cross symbols but this did not work for me using the default font in LaTeX. I am hoping for a way to print a special character that is a cross. Alt+0134 does not display, I already tried that. I am open to another font just for the cross (not for the entire document), but I don't know which one will display the symbol. I am most interested in how to make a cross similar to the one circled in the image below, but it would be neat to learn to make any others also. ![Cross pictures](http://i.stack.imgur.com/eBwUP.png)


title: XeTeX: better using system fonts or packages?

text: I've recently switched to XeTeX. In my document I use this code to set the fonts:               \usepackage[math-style=ISO,bold-style=ISO]{unicode-math}     \usepackage{xunicode}     \usepackage{fontspec}     \defaultfontfeatures{Mapping=tex-text}     \setmainfont{Linux Libertine O}     \setsansfont{Linux Biolinum O}     \setmonofont{Inconsolata}     \setmathfont{XITS Math}      I installed Libertine and biolinium from the ubuntu repositories and I downloaded XITS and installed in my `.fonts` directory... Now I'd like to know what are the main differences between my approach and using the real latex packages (like `libertineotf`.)


title: Strange problem with `longtabu`

text: I would like to share with you a quite simple example LaTeX is not able to compile. I use the `longtabu` environment provided by `tabu` package. I am using commands from `booktabs` as recommended in the documentation of `tabu`.               \documentclass[11pt]{book}     \usepackage[a4paper,showframe]{geometry}          \RequirePackage[latin1]{inputenc}               \usepackage{booktabs}     \usepackage{tabu}     \usepackage{longtable}          \usepackage[english]{babel}          \begin{document}                    \begin{footnotesize}          \begin{longtabu} to 0.75\textwidth{cX[L]ll}     % We use commands from 'booktabs' package because it is recommended by 'tabu'.     %     \caption[Short caption for index.]{Long caption to be shown at the top of the first page of the table.\label{tab:label}}     \toprule     Col 1 & Col 2 & Col 3 & Col 4\\     \midrule     \endfirsthead     %     \caption[]{(Cont.) Long caption to be shown at the top of the rest of the table.}     \toprule     Col 1 & Col 2 & Col 3 & Col 4\\     \midrule     \endhead     %     \bottomrule     \endfoot     %     \endlastfoot     % Now the regular content :     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     $\Phi(z)$ &     Description wich is quite long, normally. &     $]0,1[$ &     This is a reference page.     \\     \addlinespace     \bottomrule     \end{longtabu}     \end{footnotesize}          \end{document}       In the `.log` file I get this error:               ! Misplaced \noalign.     \toprule ->\noalign                          {\ifnum 0=`}\fi \@aboverulesep =\abovetopsep \global \@b...     l.88 \end{longtabu}          I expect to see \noalign only after the \cr of     an alignment. Proceed, and I'll ignore this case.          ! Missing } inserted.     <inserted text>                      }     l.88 \end{longtabu}          I've inserted something that you may have forgotten.     (See the <inserted text> above.)     With luck, this will get me unwedged. But if you     really didn't forget anything, try typing `2' now; then     my insertion and my current dilemma will both disappear.      and many other similar errors. And the compiler doesn't end. I have to force it to stop. The problem could be related with `caption` sentences, because if I delete them, the example is compiled and a proper document is produced. What am I missing? Maybe it's a silly question, but I am not able to understand what's happening, so I would really appreciate your help. Thank you in advance.


title: How to scale a dirtree inside a figure?

text: I drew a tree structure with `\dirtree`. This tree is located in a `{figure}` environment. It is possible to adjust the size of the figure? With `\includegraphics` one can do it with `scale`. Is there a similar attribute for figure? **My code looks like this (MWE):**               \documentclass{article}     \usepackage{dirtree}     \begin{document}          \begin{figure}[H]     \label{fig:directory}            \fbox{%       \parbox{\textwidth}{%             \begin{center}                 \begin{minipage}[t]{0.3\linewidth}                     CSS3                     \dirtree{%                     .1 html.                         .2 head.                             .3 title.                             .3 meta.                             .3 style.                         .2 body.                             .3 div (square).                                 .4 div (card).                     }                 \end{minipage}                 %                 \begin{minipage}[t]{0.3\linewidth}                     SVG                     \dirtree{%                     .1 html.                         .2 head.                             .3 title.                             .3 meta.                             .3 style.                         .2 body.                             .3 svg.                                 .4 image.                                     .5 animateTransform.                     }                 \end{minipage}                   %                 \begin{minipage}[t]{0.3\linewidth}                     Canvas                     \dirtree{%                     .1 html.                         .2 head.                             .3 title.                             .3 meta.                         .2 body.                             .3 canvas.                             .4 script.                     }                 \end{minipage}             \end{center}       }%     }     \end{figure}          \end{document}      **Screenshot:** ![enter image description here](http://i.stack.imgur.com/m9hTG.png)


title: Chemstyle creates export error

text: So I finally got everything working after having to add several packages I never thought I'd have to. Live preview shows a perfect manuscript, but for some reason, when I go to export, I get this error:               /usr/local/texlive/2012/texmf-dist/tex/latex/chemstyle/chemstyle.sty:441: LaTeX Error: Command \c@scheme already defined.                Or name \end... illegal, see p.192 of the manual.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        ￼l.441 ...\@nameuse{cst@float@make@\cst@float@pkg}}      When I click on the link (I'm using LaTeXian) it brings me to the `chemstyle.sty` file, highlighting this line of code:               \cst@float@execute{\@nameuse{cst@float@make@\cst@float@pkg}}      I'm not sure what to do, as I don't want to ruin the `.sty` file. Here's also a typical scheme formatting:               \begin{scheme}[htb]         \schemeref[TMP6]{cmpd:cyclenam}         \schemeref[TMP7]{cmpd:cyclylide}         \schemeref[TMP8]{cmpd:cyclindole}         \schemeref[TMP9]{cmpd:cyclinter}              \begin{center}         \includegraphics[scale=0.7]{Figures/photolysis.eps}         \end{center}          \caption{Proposed mechanism of photochemical cyclization}     \label{sch:photolysis}     \end{scheme}      Here is my document header:               \documentclass[super,compress]{proposalnsf} %super=superscript citations, compress=compressed citations     \usepackage{epsfig}     \usepackage{graphicx}     \usepackage[version=3]{mhchem}     \usepackage{amsmath}     \usepackage{chngcntr}     \usepackage{chemscheme}     \usepackage[runs=2]{auto-pst-pdf}     \usepackage{chemnum,chemstyle} %chemnum,     \usepackage{setspace}     \usepackage[nottoc]{tocbibind}     \settocbibname{References}               \DeclareFontFamily{OT1}{psyr}{}     \DeclareFontShape{OT1}{psyr}{m}{n}{<-> psyr}{}     \def\times{{\fontfamily{psyr}\selectfont\char180}}               %Chemical Equation Formatting          \newcounter{reaction}     \renewcommand\thereaction{\arabic{reaction}}          \renewcommand{\thereaction}{\arabic{reaction}}     \newcommand{\thealignedreaction}{\arabic{equation}}          %changing the equation tag appereance when amsmath has been loaded     \makeatletter       \def\tagform@#1{\maketag@@@{[#1]\@@italiccorr}}     \makeatother          \makeatletter     \newenvironment{reactionalign}{%         \mathchardef\c@mainequation\c@equation         \protected@edef\themainequation{\theequation}%         \let\theequation\thealignedreaction         \global\c@equation\c@reaction         }%         {         \global\c@equation\c@mainequation         \global\@ignoretrue         }     \makeatother               \newcommand{\thesubreaction}{\themainreaction\alph{equation}}          \makeatletter        \newenvironment{subreactions}{%         \refstepcounter{reaction}%         \mathchardef\c@mainequation\c@equation         \protected@edef\themainequation{\theequation}%         \mathchardef\c@mainreaction\c@reaction         \protected@edef\themainreaction{\thereaction}%         \let\theequation\thesubreaction         \global\c@equation\z@         }{%         \global\c@reaction\c@mainreaction         \global\c@equation\c@mainequation         \global\@ignoretrue         }     \makeatother          %figure counting rules     %\counterwithin{figure}{section}          % this handles hanging indents for publications     \def\rrr#1\\{\par     \medskip\hbox{\vbox{\parindent=2em\hsize=6.12in     \hangindent=4em\hangafter=1#1}}}          \def\baselinestretch{1}      Any help is much appreciated.


title: Typeset a number in hexdecimal format (preferably math mode)

text: Is there a macro for formatting numbers in programming style `0x` hex notation, e.g. instead of `-1155484576` have `0xbb20b460`. I would like to embed these numbers in a math mode context. E.g. if I just type               $\langle 0xbb20b460, 0xd4d95138, 0x3d93cb7a \rangle$      the numbers aren't properly displayed.


title: Creating lists of figures based on groups

text: Friends, consider the following code:               \documentclass{article}          \usepackage{graphicx}     \usepackage{lipsum}          \begin{document}          \listoffigures          \newpage          \lipsum[2]          \begin{figure}[h]     \centering     \includegraphics{imgs/shark.png}     \caption{A shark.}     \label{fig:shark}     \end{figure}          \lipsum[2]          \begin{figure}[h]     \centering     \includegraphics{imgs/duck.png}     \caption{A duck.}     \label{fig:duck}     \end{figure}          \lipsum[2]          \begin{figure}[h]     \centering     \includegraphics{imgs/elephant.png}     \caption{An elephant.}     \label{fig:elephant}     \end{figure}          \lipsum[2]          \end{document}      Basically, I have some text and three figures, as seen in the output: ![My document](http://i.stack.imgur.com/ItwLZ.png) I also have a `\listoffigures`: ![List of figures](http://i.stack.imgur.com/z0G9D.png) I was wondering if it's possible to create lists of figures based on groups. For instance, group those animals by their habitat: _First list of figures_ > **Animals that live in water** > > 1 . A shark. ................. 2 _Second list of figures_ > **Animals that live in land** > > 2 . A duck. ................. 2 > > 3 . An elephant. ........ 2 I'm also wondering if it's possible to have intersections, e.g., the duck could be in both lists. I was thinking if there is some magical command like this:               ...     \magicalcommandhere{water}     \includegraphics{imgs/shark.png}     ...     \magicalcommandhere{water,land}     \includegraphics{imgs/duck.png}     ...         \magicalcommandhere{land}     \includegraphics{imgs/elephant.png}     ...     \magicallist{water}     \magicallist{land}     ...      I was thinking on the `float` package for my first attempt, but I'm not sure if it's the right choice. Any ideas?


title: Obfuscating TeX

text: Given TeX's system of catcodes, I imagine that one can obfuscate TeX to a remarkable degree. With a view to learning more about the internals of TeX, I ask: How might I go about adding a block of obfuscated code to my document? Let's say I want to add a watermark to my document that I don't want my co- author to be able to edit. How might I do that? What tricks can I use to make a certain piece of code harder to understand?


title: Enumerate label numbers

text: I have an enumerate list in this MWE.               \documentclass[]{beamer}     \usetheme{Madrid}     \setbeamertemplate{items}[circle]          \begin{document}          \begin{frame}     \frametitle{Example}     \begin{enumerate}     \item First one     \item Second one     \item Third one     \end{enumerate}     In the above list, 2 and 3 are what more important.     \end{frame}          \end{document}      I want "2" and "3" in the text to be the same as in the list, a blue solid circle with white numbers. How do I do that? Thank you. ![enter image description here](http://i.stack.imgur.com/JDAXA.jpg)


title: Filled out form fields are left blank when using /includepdf

text: I have included a PDF file in my document using               \includepdf[pages=-]{pdf/document_to_include.pdf}      This works fine, except document.pdf has form fields which are filled out (and the document has been saved) and those are left blank in my output PDF. (When I open document_to_include.pdf in any PDf viewer, the form fields are filled out.) Any Chance of having them rendered in the output PDF?


title: Different Font in a Math Environment

text: I would like to use two different fonts in my document, differentiated as follows: In the body/text of my document, I would like to use Times, and in the equations I would like to default to standard computer modern. Additionally, if any text should appear in my math environments, I would like that to be rendered in Times as well. How can this be done?


title: Need help with cosmetic changes to longtable

text: I need some assistance with a longtable (code below). I have a few things that I've been trying to accomplish but have not been able to. 1) I want the grey background to cover the table in a similar fashion to this table: ![enter image description here](http://i.stack.imgur.com/WD81w.png) 2) I want the width of the table to take up the whole page and to be perfectly aligned with the heading and the footer (the same example as in (1)) 3) I don't want `mdframed` to display a black line around the edge of the shading. 4) I want the non-decimal elements of each column to align with the decimal elements. I'm not sure how to accomplish this with dcolumn package. Right now I'm resorting to a bad hack with `\multicolumn` and Gray (i.e. for practical purposes invisible) elements before or after the text to nudge it to the center. Note that I can't use `\rowcolor` from `colortbl` with `\multicolumn`. Thanks for any help :) P.S. I am quite new to LaTeX and not just being lazy!               \documentclass[a4paper,11pt]{article}     \usepackage{color,amsmath,amsfonts,amssymb}     \usepackage[english]{babel}     \usepackage{graphicx}     \usepackage{natbib}     \usepackage{rotating}     \usepackage{colortbl}     \usepackage{booktabs,dcolumn,caption}     \usepackage{expdlist}  %expanded list environment     \usepackage{pdflscape} %landscape single pages     \usepackage{longtable} %multipage table     \usepackage{xcolor, mdframed}          \captionsetup{labelsep=newline,singlelinecheck=false} % optional     \newcolumntype{d}[1]{D{.}{.}{#1}} % "decimal" column type     \renewcommand{\ast}{{}^{\textstyle *}} % for raised "asterisks"          \oddsidemargin 0.5cm %     \evensidemargin 0.5cm %     \textwidth 15cm %     \topmargin  -0.2in  %     \textheight 23.5cm %     \headheight 15pt %               \doublerulesep2pt          \begin{document}     \renewcommand{\baselinestretch}{1.1}          \fontsize{11}{16pt} \selectfont     \definecolor{Gray}{gray}{0.9}               \begin{landscape}     \footnotesize     \begin{mdframed}[backgroundcolor=Gray]     \begin{longtable}{@{}l@{\extracolsep{\fill}}d{4}d{4}d{4}d{4}d{4}d{4}d{4}d{4}d{4}@{}}     \caption{HEADING} \\     %\begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}d{4}d{4}d{4}d{4}d{4}d{4}d{4}d{4}d{4}@{}}     \toprule     & \multicolumn{3}{c}{Category 1} & \multicolumn{3}{c}{Category 2} & \multicolumn{3}{c}{Category 3} \\     & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{PWLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS}  \\     \midrule     \endfirsthead     \caption[]{\emph{(continued)}} \\     \toprule     & \multicolumn{3}{c}{Category 1} & \multicolumn{3}{c}{Category 2} & \multicolumn{3}{c}{Category 3} \\     & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{PWLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS} & \multicolumn{1}{c}{OLS}  \\     \midrule     \endhead                    \multicolumn{4}{l}{\emph{Heading1}} & & &  & & & \\     Var1 & -0.086 & -0.082 & -4.525 & -0.028 & -0.022 & 2.441 & -0.092 & -0.099 &     -3.837\ast \\     & (0.107) & (0.110) & (3.948) & (0.087) & (0.091) & (4.346) & (0.076) & (0.070) &     (1.505) \\     Var2\textsuperscript{a}  & 0.012 & 0.012 & -0.007 & 0.004 & 0.003 & 0.046 & 0.000 &     -0.002 & 0.465\ast \ast \\     & (0.009) & (0.009) & (0.319) & (0.007) & (0.007) & (0.351) & (0.006) & (0.006) &     (0.120) \\     Var3\textsuperscript{b} & -0.006 & -0.005 & 0.452 & 0.001 & 0.003 & -0.204 & 0.003 &     0.009 & -0.082 \\     & (0.007) & (0.007) & (0.247) & (0.005) & (0.006) & (0.272) & (0.007) & (0.006) &     (0.132) \\     Var4\textsuperscript{c} & -0.333\ast \ast & -0.333\ast \ast & 15.347\ast \ast &     -0.179\ast \ast & -0.180\ast \ast & -8.593\ast \ast & -0.050 & -0.013 & -3.678\ast \ast \\     & (0.078) & (0.080) & (2.87) & (0.063) & (0.066) & (3.160) & (0.053) & (0.049) &     (1.049) \\         Var5\textsuperscript{d} & -0.037 & -0.010 & -2.073\ast \ast & -0.066\ast \ast &     -0.035\ast & 2.166\ast \ast & -0.161\ast \ast & -0.043\ast & -0.834 \\     & (0.021) & (0.021) & (0.761) & (0.017) & (0.017) & (0.838) & (0.023) & (0.021) &     (0.451) \\     Var6 & \multicolumn{1}{c}{Yes\textsuperscript{**}} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} \\     R-squared & 0.151 & 0.146 & 0.191 & 0.111 & 0.07 & 0.086 & 0.151 & 0.013 & 0.187 \\     & & & & & & & & & \\          \multicolumn{4}{l}{\emph{Heading2}} & & &  & & & \\     Var1 & -0.086 & -0.082 & -4.525 & -0.028 & -0.022 & 2.441 & -0.092 & -0.099 &     -3.837\ast \\     & (0.107) & (0.110) & (3.948) & (0.087) & (0.091) & (4.346) & (0.076) & (0.070) &     (1.505) \\     Var2\textsuperscript{a}  & 0.012 & 0.012 & -0.007 & 0.004 & 0.003 & 0.046 & 0.000 & -0.002 & 0.465\ast \ast \\     & (0.009) & (0.009) & (0.319) & (0.007) & (0.007) & (0.351) & (0.006) & (0.006) & (0.120) \\     Var3\textsuperscript{b} & -0.006 & -0.005 & 0.452 & 0.001 & 0.003 & -0.204 & 0.003 & 0.009 & -0.082 \\     & (0.007) & (0.007) & (0.247) & (0.005) & (0.006) & (0.272) & (0.007) & (0.006) & (0.132) \\     Var4\textsuperscript{c} & -0.333\ast \ast & -0.333\ast \ast & 15.347\ast \ast & -0.179\ast \ast & -0.180\ast \ast & -8.593\ast \ast & -0.050 & -0.013 & -3.678\ast \ast \\     & (0.078) & (0.080) & (2.87) & (0.063) & (0.066) & (3.160) & (0.053) & (0.049) & (1.049) \\     Var5\textsuperscript{d} & -0.037 & -0.010 & -2.073\ast \ast & -0.066\ast \ast &     -0.035\ast & 2.166\ast \ast & -0.161\ast \ast & -0.043\ast & -0.834 \\     & (0.021) & (0.021) & (0.761) & (0.017) & (0.017) & (0.838) & (0.023) & (0.021) & (0.451) \\         Var6 & \multicolumn{1}{c}{Yes\textsuperscript{**}} & Yes^{**} & Yes^{**} &     Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} \\         R-squared & 0.151 & 0.146 & 0.191 & 0.111 & 0.07 & 0.086 & 0.151 & 0.013 & 0.187 \\     & & & & & & & & & \\          \pagebreak          \multicolumn{4}{l}{\emph{Heading3}} & & &  & & & \\     Var1 & -0.086 & -0.082 & -4.525 & -0.028 & -0.022 & 2.441 & -0.092 & -0.099 & -3.837\ast \\     & (0.107) & (0.110) & (3.948) & (0.087) & (0.091) & (4.346) & (0.076) & (0.070) &     (1.505) \\     Var2\textsuperscript{a}  & 0.012 & 0.012 & -0.007 & 0.004 & 0.003 & 0.046 & 0.000 & -0.002 & 0.465\ast \ast \\     & (0.009) & (0.009) & (0.319) & (0.007) & (0.007) & (0.351) & (0.006) & (0.006) & (0.120) \\     Var3\textsuperscript{b} & -0.006 & -0.005 & 0.452 & 0.001 & 0.003 & -0.204 & 0.003 & 0.009 & -0.082 \\     & (0.007) & (0.007) & (0.247) & (0.005) & (0.006) & (0.272) & (0.007) & (0.006) & (0.132) \\     Var4\textsuperscript{c} & -0.333\ast \ast & -0.333\ast \ast & 15.347\ast \ast & -0.179\ast \ast & -0.180\ast \ast & -8.593\ast \ast & -0.050 & -0.013 & -3.678\ast \ast \\     & (0.078) & (0.080) & (2.87) & (0.063) & (0.066) & (3.160) & (0.053) & (0.049) & (1.049) \\     Var5\textsuperscript{d} & -0.037 & -0.010 & -2.073\ast \ast & -0.066\ast \ast & -0.035\ast & 2.166\ast \ast & -0.161\ast \ast & -0.043\ast & -0.834 \\     & (0.021) & (0.021) & (0.761) & (0.017) & (0.017) & (0.838) & (0.023) & (0.021) & (0.451) \\         Var6 & \multicolumn{1}{c}{Yes\textsuperscript{**}} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} & Yes^{**} \\         R-squared & 0.151 & 0.146 & 0.191 & 0.111 & 0.07 & 0.086 & 0.151 & 0.013 & 0.187 \\     & & & & & & & & & \\     No. 1 & \multicolumn{1}{c}{219\textcolor{Gray}{ss}} & \multicolumn{1}{c}{219} &     \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} &     \multicolumn{1}{c}{219} & \multicolumn{1}{c}{445} & \multicolumn{1}{c}{445} & \multicolumn{1}{r}{445\textcolor{Gray}{s}} \\     No. 2 & \multicolumn{1}{c}{219\textcolor{Gray}{ss}} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{445} & \multicolumn{1}{c}{445} &     \multicolumn{1}{r}{445\textcolor{Gray}{s}} \\     No. 3 & \multicolumn{1}{c}{219\textcolor{Gray}{ss}} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{445} & \multicolumn{1}{c}{445} & \multicolumn{1}{r}{445\textcolor{Gray}{s}} \\     days 1 & \multicolumn{1}{c}{219\textcolor{Gray}{ss}} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{445} & \multicolumn{1}{c}{445} & \multicolumn{1}{r}{445\textcolor{Gray}{s}} \\     days 2 & \multicolumn{1}{c}{219\textcolor{Gray}{ss}} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{219} & \multicolumn{1}{c}{445} & \multicolumn{1}{c}{445} & \multicolumn{1}{r}{445\textcolor{Gray}{s}} \\     \midrule[\heavyrulewidth]     \end{longtable}     \vspace{0.12cm}     \end{mdframed}          {Dependent variables have been scaled by a factor of 10. Standard errors in parentheses. *Significant at 5\%; **Significant at 1\%.     \begin{description}\compact{             \item[\small \textsuperscript{a}] Description 1.         \item[\small \textsuperscript{b}] Description 1.         \item[\small \textsuperscript{c}] Description 1.             \item[\small \textsuperscript{d}] Description 1. }     \end{description} }     \end{landscape}                    \end{document}


title: Balance package messes up vertical space between lines in second column

text: I am writing an article with the ACM Sigplan class and want to balance the two columns on the last page of my text (before the bibliography section, which is on a separate page). I usually use the `balance` package and the `\balance` command on the last page, but in this case it sometimes messes up the vertical space between two lines in the second column, as you can see here: ![snippet of text with too less distance between paragraphs](http://i.stack.imgur.com/gnE2h.png) The balancing itself is correct. Without balancing, the space at this position is correct. There is nothing special at this position in the source code (just text). Whether the problem happens, depends on a lot of other things, for example the content of previous pages. It is also not always between the same two lines, the position also varies depending on other document content. Here is the smallest example where I could reproduce the problem (yes it has three pages, but if you remove any of the first two, the problem goes away):               \documentclass{sig-alternate}     \usepackage[english]{babel}     \usepackage{blindtext}     \usepackage{balance}     \begin{document}          \begin{figure*}[t]     \blindtext \blindtext \blindtext \blindtext     \end{figure*}          foo     \clearpage          \blindtext \blindtext          \balance          \section{Heading}          \blindtext \blindtext          \blindtext          \blindtext          \end{document}      In this example, the problem occurs between the 6th and 7th line in the right column of the last page (compiled PDF). I use pdflatex (version 3.1415926-1.40.10 TeX Live 2009/Debian), and several PDF viewers show the problem (at least evince and acroread). I also tried the `flushend` package, with no effect at all, and the `\balancecolumns` command provided by the document class, which produces completely wrong layout. I have it working with a manual column break at the right position in the text (using `\vfill\pagebreak\noindent`), but I'm wondering if there is an automatic solution, of if I can fix the problem with the `balance` package. I cannot change the provided class file or use the `multicol` package instead of `\twocolumn`.


title: 16th century French Bible compilation

text: How should the tex file for this project (dowload zip) be compiled? I use TeXLive 2011 and texmakerx22b12_win32 for editing. I have found it in this post.


title: pst-pulley produce big red dots

text: Based on the document I use the `pst-pulley` package by XeLaTeX in TeX Live 2013, but (without grid) produces the big red dots. ![output](http://i.stack.imgur.com/VzSeM.jpg) What is wrong? Here the codes:               \documentclass[11pt]{article}     \usepackage[paperheight=11.7in,paperwidth=8.3in,bindingoffset=0in,left=0.8in,right=0.8in,     top=0.7in,bottom=1in,headsep=.5\baselineskip]{geometry}     \usepackage[utf8]{inputenc}     \usepackage[svgnames]{xcolor}     \usepackage{pst-pulley}          \begin{document}     \psset{unit=1cm}          \section*{Contoh 3}     \begin{center}     \pspulleys[N=3,M=60,h=25]     \end{center}          \end{document}      **Edit:** After using `\listfiles` at first line, I get as follow and the big red dots are still there.               This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/W32TeX)      restricted \write18 enabled.     entering extended mode     (./cobi4.tex     LaTeX2e <2011/06/27>     Babel <3.9h> and hyphenation patterns for 78 languages loaded.     (c:/texlive/2013/texmf-dist/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (c:/texlive/2013/texmf-dist/tex/latex/base/size11.clo))     (c:/texlive/2013/texmf-dist/tex/latex/geometry/geometry.sty     (c:/texlive/2013/texmf-dist/tex/latex/graphics/keyval.sty)     (c:/texlive/2013/texmf-dist/tex/generic/oberdiek/ifpdf.sty)     (c:/texlive/2013/texmf-dist/tex/generic/oberdiek/ifvtex.sty)     (c:/texlive/2013/texmf-dist/tex/generic/ifxetex/ifxetex.sty))     (c:/texlive/2013/texmf-dist/tex/latex/base/inputenc.sty     (c:/texlive/2013/texmf-dist/tex/latex/base/utf8.def     (c:/texlive/2013/texmf-dist/tex/latex/base/t1enc.dfu)     (c:/texlive/2013/texmf-dist/tex/latex/base/ot1enc.dfu)     (c:/texlive/2013/texmf-dist/tex/latex/base/omsenc.dfu)))     (c:/texlive/2013/texmf-dist/tex/latex/xcolor/xcolor.sty     (c:/texlive/2013/texmf-dist/tex/latex/latexconfig/color.cfg)     (c:/texlive/2013/texmf-dist/tex/xelatex/xetex-def/xetex.def)     (c:/texlive/2013/texmf-dist/tex/latex/xcolor/svgnam.def)) (./pst-pulley.sty     (c:/texlive/2013/texmf-dist/tex/latex/pstricks/pstricks.sty     (c:/texlive/2013/texmf-dist/tex/generic/pstricks/pstricks.tex     (c:/texlive/2013/texmf-dist/tex/generic/xkeyval/pst-xkey.tex     (c:/texlive/2013/texmf-dist/tex/latex/xkeyval/xkeyval.sty     (c:/texlive/2013/texmf-dist/tex/generic/xkeyval/xkeyval.tex)))     (c:/texlive/2013/texmf-dist/tex/generic/pstricks/pst-fp.tex     `pst-fp' v0.05, 2010/01/17 (hv))     (c:/texlive/2013/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex)     (c:/texlive/2013/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex     (c:/texlive/2013/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex)     ) (c:/texlive/2013/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex)     `PSTricks' v2.49b  <2013/12/21> (tvz)     (c:/texlive/2013/texmf-dist/tex/xelatex/xetex-pstricks/pstricks.con     (c:/texlive/2013/texmf-dist/tex/generic/pstricks/config/xdvipdfmx.cfg))     (c:/texlive/2013/texmf-dist/tex/xelatex/xetex-pstricks/pstricks.con     (c:/texlive/2013/texmf-dist/tex/generic/pstricks/config/xdvipdfmx.cfg     Using PSTricks configuration for XeTeX+xdvipdfmx     ))) (c:/texlive/2013/texmf-dist/tex/generic/pstricks/pst-fp.tex))     (c:/texlive/2013/texmf-dist/tex/generic/pst-pulley/pst-pulley.tex     (c:/texlive/2013/texmf-dist/tex/generic/pst-grad/pst-grad.tex     `pst-grad' v1.06, 2006/11/27 (tvz,dg,hv))     (c:/texlive/2013/texmf-dist/tex/generic/pst-slpe/pst-slpe.tex      v1.31, 2011/10/25)     (c:/texlive/2013/texmf-dist/tex/generic/pst-eucl/pst-eucl.tex     (c:/texlive/2013/texmf-dist/tex/generic/pst-node/pst-node.tex      v1.30, 2013/09/17) (c:/texlive/2013/texmf-dist/tex/generic/multido/multido.tex       v1.42, 2010/05/14 <tvz>)     `PST-Euclide v1.48, 2013/05/02 (Dominique RODRIGUEZ)      This version uses the pst-xkey package for managing parameters      Please read the doc, some macros have a new syntax      use option old for upward compatibility)     (c:/texlive/2013/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex     (c:/texlive/2013/texmf-dist/tex/generic/pst-plot/pst-plot.tex      v1.57, 2013/12/01 (tvz,hv))     (c:/texlive/2013/texmf-dist/tex/generic/pst-3d/pst-3d.tex     `PST-3d' v1.11, 2010/02/14 (tvz))     (c:/texlive/2013/texmf-dist/tex/generic/pst-math/pst-math.tex     `pst-math' v0.62 , (CJ,hv)) `pstricks-add' v3.63, 2013/12/14 (dr,hv))      v0.01, 2012/01/17(ts)  v0.01, 2012/01/17))     (c:/texlive/2013/texmf-dist/tex/latex/xkeyval/pst-xkey.sty) (./cobi4.aux)     *geometry* driver: auto-detecting     *geometry* detected driver: xetex     [1] (./cobi4.aux)


title: Is it possible to use \autoref without thmtools?

text: I have the following tex file;               \documentclass[a4paper]{article}     \usepackage{amsthm}     \usepackage{thmtools}     \usepackage[hidelinks]{hyperref}     \newtheorem{thm}{Theorem}     \begin{document}          \begin{thm}\label{thm1}     Blah.     \end{thm}          Consider \autoref{thm1}.          \end{document}      With this set up, `\autoref{thm1}` prints "Theorem 1", but if I disable `thmtools`, it only prints "1". I was led to believe that `\autoref` is part of `hyperref` and should not require `thmtools`. Where am I going wrong? Is there a better way to do this?


title: amsthm with shared counters messes up autoref references

text: When I define `amsthm` theorem environments with shared counters, autoref messes up the names of the references. For example, in the output below, we should have "Definition 2" instead of "Theorem 2".               \documentclass{article}          \usepackage{amsthm}     \usepackage{hyperref}          \theoremstyle{theorem}     \newtheorem{theorem}{Theorem}     \theoremstyle{definition}     \newtheorem{definition}[theorem]{Definition}          \begin{document}          \begin{theorem}     \label{wonderful-theorem}     This is a wonderful theorem.     \end{theorem}          \begin{definition}     \label{awesome-definition}     This is an awesome definition.     \end{definition}          Look at the wonderful \autoref{wonderful-theorem}     and the awesome \autoref{awesome-definition}.          \end{document}      ![enter image description here](http://i.stack.imgur.com/b5ZqD.png)


title: Iterating through two lists

text: I have two comma delimited lists:               ListA(a,b,c,d,e,f,g)      and               ListB(name1,name2,name3,name4,name5)      I would like to iterate through both lists at the same time, something like:               loop        readvalue from list A        readvalue from list B        create new variable aname1{}     repeat      Iteration should stop, if it reaches to the end of either lists.


title: Vertical line next to a block with no margins

text: I've seen on this website several possibilities to include a line next to a paragraph. Like this: (the line is continuous)               text text text |     text text text |     text text text |      However, I would like to print that line on the margin, so that the original paragraph doesn't get any modification. In other examples the paragraph get an extra spacing with the next and previous paragraphs and the text is move a little to one side. One of the other options I've seen is with the package pdfcomments, but I just want a real line, not a comment that will cause problems when printing. Is that possible? Maybe with Tikz?


title: Reference to a table before it appears

text: I want to reference a table before it appears.The TeX code is pasted below               \documentclass{article}     \begin{document}     The results given in Table~\ref{tab:a} show the  performance of     the class.          \begin{table}         \begin{center}             \begin{tabular}{lrc}\hline             Name & Mark & Grade \\             \hline             Prasad & 99 & A+ \\             Prakash & 51 & C\\             Shine & 5 & F\\ \hline             \end{tabular}             \caption{Class Mark List}\label{tab:a}         \end{center}     \end{table}     \end{document}      But the text               The results given in Table~\ref{tab:a} show the  performance of         the class.      is coming after the table. How can I put the table immediately after the text.


title: Error trying to align series of equations

text: I am new to LaTex and I am using TexWorks and PDFLaTeX. This is the following code that I am trying to compile.               El Random Fores es muy basico y intuitivo:%$$     \begin{gather}     \text{Dado que tienes el Training Set } ((x_{1}, y_{1}),...,(x_{n}, y_{n}))=D:\\     \text{Por cada } i=1,...,B \text{ Donde $B$= Numero de Arboles:}\\     \text{Escoge un Bootstrap muestra $D_{i}\in D$}\\     \text{Construye Decision Tree $T_{i}$ utilizando $D_{i}$ de tal manera que:}\\     \text{En cada nodo escoges de un subconjunto azar de $m$ variables y solo considera                separaciones\\ utilizando esos variables}\\     \text{Al final despues de que has construido tus $B$ arboles, cuando enfrentes un ejempo                                                                                $x$, \\clasifica lo utilizando tus $B$ trees y dale la clasificacion que le dan la mayoria       de arboles.}     \end{gather}     %$$      I keep on getting this very error:               ! Misplaced alignment tab character &.     \math@cr@@@ ->\ifst@rred \nonumber \fi &     \relax \make@display@tag \ifst@rred ...     l.126 \end{gather}      I would appreciate help resolving this issue, thanks!