title: Inconsistent Author et al Behavior with LaTeX+BibTeX

text: I am having some issues while using BibTeX to cite papers in an article I am writing. The journal I am submitting to supplies their own *.bst and *.sty files that are supposed to format to the journal's desired style. The problem is I am having really incosistent behavior with Author truncating (i.e. et al). In some places when I am citing the same paper I get:               Author1 et al. (2003)      whereas in others I get:               Author1, Author2, Author3, and Author4 (2003)      This is all while using \cite{key} in the same way. To try and diagnose the issue I took a look at the paper.aux file. In this file I can see that the Authors are correctly parsed by BibTeX. Here is an example of the *.aux file entry:               \bibcite{key}{{5}{2003}{{Author1 et~al.}}{{Author1, Author2, Author3, and Author4}}}      To me the next logical step is to take a look at the *.bst file. Unfortunately I am very inexperienced with BibTeX. Here is the code that I think is relevant from the *.bst file:               FUNCTION {bbl.etal}     { "et~al." }     FUNCTION {format.names}     { 'bibinfo :=       duplicate$ empty$ 'skip$ {       's :=       "" 't :=       #1 'nameptr :=       s num.names$ 'numnames :=       numnames 'namesleft :=         { namesleft #0 > }         { s nameptr           duplicate$ #1 >             { "{f.~}{vv~}{ll}{, jj}" }             { "{vv~}{ll}{, f.}{, jj}" }           if$           format.name$           bibinfo bibinfo.check           't :=           nameptr #1 >             {               namesleft #1 >                 { ", " * t * }                 {                   s nameptr "{ll}" format.name$ duplicate$ "others" =                     { 't := }                     { pop$ }                   if$                   numnames #2 >                     { "," * }                     'skip$                   if$                   t "others" =                     {                       " " * bbl.etal *                     }                     {                       bbl.and                       space.word * t *                     }                   if$                 }               if$             }             't           if$           nameptr #1 + 'nameptr :=           namesleft #1 - 'namesleft :=         }       while$       } if$     }


title: Two conflicting packages in one document — doable?

text: I have two packages I want to use in the same document. Specifically `musixtex` and `tengwarscript`. However they do conflict. Both packages use some of the same commands, obviously for very different things. Is there a way to load both packages in the same document, but only load one of them temporarily or intermittently?


title: Date plot using pgfplots with odd tick label

text: How do I make the time label in the following image appear as "10:00" (i.e. 10 o'clock) rather than the unexpected and unwelcome "09:60"? ![enter image description here](http://i.stack.imgur.com/Wo0D4.png) Here's the code that I am using:               \documentclass{beamer}     \usepackage{pgfplots}     \usepgfplotslibrary{dateplot}                \begin{document}           \frame{     \begin{tikzpicture}     \begin{axis}[     mark =none,     xmin=2009-08-18 08:30,     xmax=2009-08-18 10:29,     ymin=0,      ymax=189,     grid=both,     axis x line=bottom,     axis y line=left,     date coordinates in=x,     minor x tick num=5,     minor y tick num=4,     xtick={2009-08-18 09:00,2009-08-18 10:00},     ytick={0,50,100,150},     xticklabel= \hour:\minute,     ]     \addplot [thick,blue]coordinates {     (2009-08-18 08:30, 000)     (2009-08-18 09:00, 060)     (2009-08-18 09:20, 060)     (2009-08-18 10:00, 100)     (2009-08-18 10:10, 060)     } node [below] {Train A};          \end{axis}     \end{tikzpicture}     }          \end{document}      **Supplementary question:** In the image above, why don't the minor tick lines appear before "09:00" but only after?


title: CurVe document class: alignment issue with subrubrics

text: I have the following issue with the alignment of subrubric titles in a résumé written with the CurVe class by Didier Verna. When the rubric & subrubric titles are aligned left via options in the preamble:               \rubricalignment{l}%default: rubric titles centered     \subrubricalignment{l}%default: subrubric titles centered      the subrubric title ("Customer Services") shows an indent and is not aligned with the rubric title ("Professional Experience"). Screenshot of the issue: ![enter image description here](http://i.stack.imgur.com/Zh90x.png) Is there a way to align the subrubric title so **no indent** is produced? I am looking for a result / output in which rubric, subrubric title and entry are aligned consistently on the left-hand side. I suspect this behaviour is due to the CurVe class being based on the LTXtable package by David Carlisle. I played around with the options given in the documentation. However, as this was not successful one may have to adapt the curve.cls, which looks quite daunting. I put together a minimal working example:               \NeedsTeXFormat{LaTeX2e}     \documentclass[a4paper,skipsamekey,12pt,english,final]{curve}     \usepackage{filecontents}     \usepackage[english]{babel}          \begin{filecontents}{experience.tex}     \begin{rubric}{Professional Experience} %rubric title     \subrubric{Customer Services} % subrubric title     \entry*[Month/Year --- Month/Year]             Customer Service Assistant at Fresh'n'Fruity, a bar / caf\'e{} serving organic smoothies, London, UK (xy hours/week)          \subrubric{Research} % subrubric title     \entry*[Month/Year --- Month/Year]             Graduate Assistant, the Department for Science Fiction, Hogwarts School of Witchcraft and Wizardry, UK (xy hours/week)          \entry*[MM/YY --- MM/YY]             Research Intern with the ``Non-Violent Communication''-Project at the Peace Institute, Z\"urich, Switzerland          \end{rubric}     \end{filecontents}               \rubricalignment{l}%default: Rubriktitles centered     \subrubricalignment{l}%default: Subrubriktitles centered               \title{Graduate Student}     \subtitle{at the Peace Institute, Z\"urich, Switzerland}               \begin{document}          \maketitle     \makerubric{experience} % Engagement, praktische Erfahrungen, vorherige Jobs          \end{document} % schliesst das Hauptdokument      Any suggestions are appreciated!


title: mdframed: how to change the separator between the label and the title of a non-numbered thereom?

text: ## The problem There seems to be a bug in `mdframed` package. With the `theoremseparator` key, one should be able to change the text between the "label" and the title of a theorem ("Theorem" being the label and "Gauss" the title). It works in the usual case but when I use the starred version of the environment, it does not work. Do you agree? Can it be easily fixed? Thanks! ## MWE               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{mdframed}          \mdfdefinestyle{myStyle}     {     theoremseparator={ --},     theoremspace=\space     }          \mdtheorem[style=myStyle]{theo}{Theorem}               \begin{document}     \begin{theo}[test]     Hi     \end{theo}          \begin{theo*}[test]     Hi     \end{theo*}          \end{document}      ![enter image description here](http://i.stack.imgur.com/zit3l.png)


title: An arabic font problem

text: I have a problem with font in a file written in Arabic with this error message: > LaTeX Font Warning: Some font shapes were not available, defaults > substituted. further, I have this as an error: > {C:/Program Files/MiKTeX 2.9/fonts/enc/dvips/fontname/8r.enc} I apologize for beeing late! there is the code: * * *               \documentclass{minimal}     \usepackage{arabxetex} % default options are "novoc" and "fdf2alif",                             % other options are "voc", "fullvoc", "utf", "trans" and "fdf2noalif"     % arabxetex loads bidi.sty and fontspec.sty                      \newfontfamily\arabicfont[Script=Arabic, Scale=1.5]{Scheherazade}     % you can also define \farsifont, \uighurfont, etc if you want                         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{document}     This is some text in English with Arabic insertion \textarab{`arabI}.          This is some text in English with Arabic insertion \textarab[utf]{عربي}.          This is some text in English with Arabic insertion \textarab[voc]{`arabI}.          \begin{arab}     wa-ha_dihi fiqraT"uN bi-al-`arabiyaT ma`a kalimaT inklIziyaT (\textroman{English}).     \end{arab}          \begin{arab}[utf]     وهذه فقرةٌ بالعربية مع كلمة انكليزية (\textroman{English}).     \end{arab}     \end{document}      and there is the error message:               \PackageError{bidi}{TeX engines other than XeTeX and LuaTeX are not yet supported} \fi


title: TeXMaker on Mac - "Could not start the command"

text: I recently downloaded TeXMaker on my MacBook Pro. I already use TeXShop and TeXworks. I downloaded and opened the program without any problems, however, when I try to compile and view my file (via Quick Build) it says, "Could not start the command." Any suggestions??


title: \part and tocloft

text: The following code was provided by Martin Scharrer in reply to a post in May 10.               \documentclass{book}     \usepackage[british]{babel}     \usepackage[titles]{tocloft}          \usepackage{tocloft}          \newlength\mylenprt     \newlength\mylenchp     \newlength\mylenapp          \renewcommand\cftpartpresnum{\partname~}     \renewcommand\cftchappresnum{\chaptername~}     \renewcommand\cftchapaftersnum{.}          \settowidth\mylenprt{\cftpartfont\cftpartpresnum\cftpartaftersnum}     \settowidth\mylenchp{\cftchapfont\cftchappresnum\cftchapaftersnum}     \settowidth\mylenapp{\cftchapfont\appendixname~\cftchapaftersnum}     \addtolength\mylenprt{\cftpartnumwidth}     \addtolength\mylenchp{\cftchapnumwidth}     \addtolength\mylenapp{\cftchapnumwidth}          \setlength\cftpartnumwidth{\mylenprt}     \setlength\cftchapnumwidth{\mylenchp}          \usepackage{hyperref}     \hypersetup{colorlinks=true}               \begin{document}          \tableofcontents     \mainmatter          \part{First Part}     \chapter{First Chapter}          \appendix     \addtocontents{toc}{% NB!!! must be inside the first \include         \protect\renewcommand\protect\cftchappresnum{\appendixname~}%         \protect\setlength{\cftchapnumwidth}{\mylenapp}}%          \chapter{First Appendix}          \end{document}      To experiment with hyperlinks, I have added the following to the above.               \usepackage{hyperref}           \hypersetup{colorlinks=true}      After running LaTeX, a table of contents is created with `Part I. First Part` as the title of the part above. However, the word `Part`, unlike the rest, does not have hyperlink. I wonder how the hyperlink can be extended to include the word `Part`.


title: Outline font installation in self-contained tree

text: I'd like to achieve the following: a user should be able to grab a copy of a given directory, place that anywhere in his home directory, and run `make` to build LaTeX documents in that tree _without modifying his own configuration._ The documents in that tree depend on custom truetype fonts, and the provider of these fonts suggests using `updmap-sys` to install these. But requiring users to install these fonts system-wide is unacceptable, and even having to install them locally should be avoided. The best I could find so far are the following rules, added to my `Makefile`:               export TEXMFHOME=$(CURDIR)/texmf     export TEXINPUTS=$(CURDIR)/styles:$(CURDIR)/texmf:          texmf/web2c/updmap.cnf: texmf/fonts/map/dvips/tumhelv/tumhelv.map         @mkdir -p $(@D)         @echo -n "" > $@         updmap --cnffile $(TEXMFHOME)/web2c/updmap.cnf \             --dvipdfmxoutputdir $(TEXMFHOME)/fonts/map/dvipdfmx/updmap \             --dvipsoutputdir $(TEXMFHOME)/fonts/map/dvips/updmap \             --pdftexoutputdir $(TEXMFHOME)/fonts/map/pdftex/updmap \             --pxdvioutputdir $(TEXMFHOME)/fonts/map/pxdvi/updmap \             --setoption dvipsPreferOutline=true \             --setoption pdftexDownloadBase14=true \             --enable Map=customFont.map      This apparently does install the fonts in the `texmf` subtree of the directory where my `Makefile` resides. I haven't even begun checking whether the font is actually available, because suddenly my `pdflatex` starts using bitmap font instead of outline fonts. I added the two `--setoption` lines above, copied from the `updmap.cnf` of my main TeXlive `texmf` tree, but they changed nothing. I also noticed that `updmap` will create a file `~/Library/texlive/2012/texmf- var/web2c/updmap.log` (on OS X), but I guess a single additional environment variable should take care of that. How can I use environment variables to install a font without modifying the user's configuration, and still use outline fonts in my PDF files?


title: Sharelatex 'swallows' 80 pages of my work when compiling pdf

text: I'm extremely new to LaTeX, since I have to use it for my thesis. Anyway, when compiling the PDF Sharelatex kind of swallows at least 80 pages of my thesis?! Anybody know what could be causing this error? Any help is deeply appreciated. Thanks Sorry for giving so little info. No `\end{document}` is in fact at the end of the document. I'm writing in the document class {book} and am using the following packages:               \documentclass[11pt,a4paper,english,oneside]{book}     \usepackage{etex}      \usepackage[left=1in, right=1in]{geometry}      \usepackage[Lenny]{fncychap}      \usepackage[utf8]{inputenc}      \usepackage[british]{babel}     \usepackage{dsfont}      \usepackage{fancyhdr}      \usepackage{booktabs}      \usepackage[hang,bottom,stable,multiple]{footmisc}      \usepackage{appendix}      \usepackage{amsmath}     \usepackage[pdftex]{graphicx}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{multirow}     \usepackage{amssymb}     \usepackage{mathtools}     \usepackage[margin=10pt, font=small, labelfont=bf, labelsep=endash]     \usepackage{chngcntr}      \usepackage{etoolbox}     \usepackage{amsthm}      \usepackage{thmtools}      \usepackage{setspace}      \usepackage{lipsum}      \usepackage{datetime}      \usepackage{graphicx,listings,xcolor,textcomp}      \usepackage{hyperref}      \usepackage{xparse}      \usepackage{cleveref}      \usepackage{arydshln}      \usepackage{array,hhline}      \usepackage{amssymb,amsmath}     \usepackage{rotating}      \usepackage{tabularx}      \usepackage{graphicx}     \graphicspath{{Images/}}     \usepackage{natbib}     \bibliographystyle{abbrvnat}     \setcitestyle{authoryear,open={((},close={))}}      Further I have an awful high amount of Pictures, Graphs, and Tables in my thesis and interestingly it swallows everything after the start of mathematical equations up to the point of the Appendix if that helps... Thank you for your help


title: Undefined control sequence tables with figures

text: I'm trying to make a table with figures in them but LateX keeps giving me the same error over and over again. This is the text I'm using:               \begin{table}[h!]       \centering       \begin{tabular}{ | c | m{5cm} | m{5cm} | }         \hline         Shape & Area & Moments of Inertia \\ \hline\hline         \begin{minipage}{.3\textwidth}           \includegraphics[width=\linewidth, height=60mm]{figure/circle}         \end{minipage}         &         %\begin{minipage}[t]{5cm}           \begin{itemize}             \item $A=\piR^2$           \end{itemize}         %\end{minipage}         &          %\begin{minipage}{5cm}           \begin{itemize}             \item $I_{yy}=I_{zz}=\frac{1}{4}\piR^2$             \item $I_{yz}=0$             \item $I_p=\frac{1}{2}\piR^4$           \end{itemize}         %\end{minipage}         \\              \begin{minipage}{.3\textwidth}           \includegraphics[width=\linewidth, height=60mm]{figure/thincircle}         \end{minipage}         &         %\begin{minipage}[t]{5cm}           \begin{itemize}             \item $A=2\piRt$           \end{itemize}         %\end{minipage}         &          %\begin{minipage}{5cm}           \begin{itemize}             \item $I_{yy}=I_{zz}=\piR^3t$             \item $I_{yz}=0$             \item $I_p=2\piR^3t$           \end{itemize}         %\end{minipage}                  \hline       \end{tabular}       \caption{Sectional variables for circle and hollow circle}\label{tab:inertiasum}     \end{table}      Hope anyone can help


title: Hyperref to the correct entry when using multiple bibliographies

text: This is a follow-up question to this issue with several bibliographies and backref. I want to generate two bibliographies, a short one in the beginning and a full one in the end. All entries appear in the full bib, and some entries appear in both. Based on the helpful answers there, the code looks as follows:               \documentclass{report}     \usepackage{hyperref}     \usepackage[backref=true, hyperref=true, backend=biber]{biblatex}     \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @misc{A01, author = {Author, A.}, year = {2001}, title = {Alpha Title}, keywords = {self}}     @misc{B02, author = {Author, B.}, year = {2002}, title = {Beta Title}, keywords = {other}}     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}     \begingroup\renewbibmacro{pageref}{}     \printbibliography[heading=bibintoc, keyword=self, title={Previous Work}]     \endgroup          \chapter{First}     Some text \cite{A01, B02}.          \printbibliography[heading=bibintoc, title={References}]          \end{document}      When using hyperref, clicking on the B02 link leads to the references in the back. The problem however is that the other A01 link goes to the front bibliography, which is not consistent and it is not possible to go back to the text page using a backref. I'm looking for a way to flush the hyperlink targets after the first bibliography so that all links go the full bibliography only, without breaking the rest of hyperref.


title: How to manually increment the chapter number in ConTeXt?

text: I need to manually adjust the chapter number in a book, so that three chapter numbers are missing.               \starttext         \chapter{Birds of Africa}         \chapter{Birds of Australia}     \stoptext      "Birds of Africa" should appear as chapter 1, but "Birds of Australia" should appear as chapter 5. I tried `\incrementnumber[chapter][4]`, but this did not work. How can I manually increment the chapter number?


title: Indenting equations

text: I'm using `amsmath[fleqn]` but I'd like to also indent equations outside equation/align/gather environments. A natural choice would be to indent using the same length `amsmath` uses, but I don't know how to do that. I've tried to use `\mathindent` (without defining its value) but it gives a "missing number" error. How should I do this? Thanks


title: Horizontal Rule - reducing the distance

text: Here is the M.W.E to draw a horizontal line across the page. Now, how do I reduce the space between the name and line. The gap is too high.               \documentclass[letterpaper,11pt]{article}     \pagestyle{empty}     \begin{document}     \begin{flushleft}     \bfseries SUBHAM SONI S.     \end{flushleft}     \makebox[\linewidth]{\rule{\linewidth}{0.4pt}}     \end{document}      ![enter image description here](http://i.stack.imgur.com/Hf59D.png)


title: How to put vertical text in an equation?

text: I want to put vertical text in my equation, like in this example: ![vertical](http://i.stack.imgur.com/PNMjt.png) I got               \begin{equation}         Dir(\alpha) \xrightarrow{iid}      \end{equation}      and tried to put in linebreaks, but that does not work. How can I do this?


title: Centering bars on xticks in pgfplots

text: My wife is working on her master thesis and we are trying to make some bar graphs to use with it. We have managed to create a nice-looking graph, but the labels/xtick does not align in center. When adding more addplots, things get even worse. We're both new to LaTex, and even after quite a few hours of browsing websites and manuals, I cannot find a solution to this problem. My first try on a "MWE":               \documentclass{article}            \usepackage[utf8]{inputenc}     \usepackage{tipa}          \usepackage{pgfplots}     \pgfplotsset{compat=1.8}          \begin{document}               \begin{tikzpicture}     \pgfplotsset{width=10 cm}                                            \begin{axis} [     symbolic x coords={Label 1,Label 2},             xtick={Label 1, Label 2},     x tick label style={rotate=45, anchor=east, align=center},     axis lines=left,     y label style={rotate=-90},     ylabel=\Large{\textbf{\%}},                                      title= \Large{Some Heading} ,                    legend style={at={(0.5,-0.10)},         anchor=north,legend columns=1},                              ybar=0pt ,         ymin=0,         ymax=50,                                                         samples=2,         domain=1:2,         bar width=2.5cm,                                         enlarge x limits={abs=3.2cm},        ]     \addplot [blue,fill=blue]                            coordinates{ (Label 1,35.5) } ;     \addplot [red,fill=red]     coordinates{ (Label 2,14.8) } ;          \end{axis}     \end{tikzpicture}          \end{document}      Please help us find a solution. Suggestions of other (simpler/better) packages to use are also welcome. Thank you!


title: "Lua tree" (analogue of texmf tree)

text: I have a lua file that I would use in many of my TeX's documents, loading it with dofile(). I thought it was ok if I simply put it in the (local) texmf tree*, but this doesn't work. Instead I have the following error message :               LuaTeX error cannot open the mycode.lua: No such file or directory      Is there any nice solution ?   * I try to save the file in ~/Library/texmf, in ~/Library/texmf/tex, ~/Library/texmf/tex/latex and even in ~/Library/texmf/lua (I had to create the directory).


title: Asymmetric "enlarge x limits" in pgfplots

text: I need to specify different "enlarge x limits" for the lower and upper axis extrema. Something like `enlarge x limits={{value=0.2,upper}, {value=0.4,lower}}` does not work however. Any ideas? Using xmin and xmax to modify the range first is not an option as I use "symbolic x coords".               \documentclass{standalone}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[ybar,ymin=0,symbolic x coords={a,b,c}, enlarge x limits=true, xtick=data, legend pos=south east]     \addplot coordinates { (a,10) (b,15) (c,20) };     \addlegendentry{legend}     \end{axis}     \end{tikzpicture}     \end{document}      Here I want to make room at lower side to show the bar properly and add more whitespace at the upper side to make room for the legend (I prefer to keep the legend inside the plot).


title: Hyperref: Include part number for cross-references to chapters

text: I have the following code               \documentclass{scrreprt}     \usepackage{hyperref}          \begin{document}         \part{First Part}         \chapter{First Chapter}         \label{inner} Some text.              \part{Second Part}         \chapter{First Chapter}         \ref{inner}     \end{document}      that produces a reference `1` for the label `inner`. How can I include the number of the part associated with the chapter in this reference, i.e. automatically create a cross-reference of the form `I.1`?


title: How to reduce line spacing of the footnote

text: I want to reduce the line spacing of the footnotes to be less than single spacing. I am using the following to start the document:               \documentclass[12pt,openbib]{article}     \usepackage[singlespacing]{setspace}     \usepackage[flushmargin,multiple]{footmisc}          \begin{document}      What should I add to reduce the line spacing of the footnotes?


title: Aligning text off-center

text: I am wondering if there is a recommended way of centering text at a certain point in a line of text? When trying to align monospace characters on multiple consecutive lines, alignment is fine with strings of equal length, with the alignment point in the middle. However, if the strings are of different length and/or the point where the string is to be aligned is off-center it is a bit more challenging. I managed to do it by adding/subtracting space at the beginning of the lines using `\hspace*`, but am curious if there is a better way of doing it. Below is an example. First, there is the characters A-G, with "D" aligned in the center. If the "A" is removed from the first line, and "G" from the second, the text is no longer aligned at the "D". Finally, the last part shows the way I found of realigning at the "D".               \documentclass{article}     \begin{document}     \begin{center}         \texttt{ABCDEFG}\\         \texttt{GFEDCBA}         \par\vspace*{10pt}         \texttt{BCDEFG}\\         \texttt{GFEDCB}         \par\vspace*{10pt}         \hspace*{5pt}\texttt{BCDEFG}\\         \hspace*{-6pt}\texttt{GFEDCB}     \end{center}     \end{document}


title: How to change color of menukeys?

text: I cannot understand how to change the colors of the text in the menus typeset using `menukeys`. A minimal example (taken from the `menukeys` manual) follows:               \documentclass[12pt]{article}     \usepackage[T1]{fontenc}     \usepackage{xcolor}     \usepackage{menukeys}     \pagestyle{empty}          \begin{document}     \noindent%     \menu{Alfa > Beta > Gamma} \\     \directory{One / Two / Three} \\     \keys{\cmd + \shift + 4} \\[4ex]     \renewmenumacro{\menu}[>]{roundedmenus}     \menu{Alfa > Beta > Gamma} \\[4ex]     \changemenucolor{menu}{txt}{named}{red}     \changemenucolor{roundedmenus}{txt}{named}{red}     \menu{Alfa > Beta > Gamma}     \end{document}      (the second `\changemenucolor` has been added since the first one didn't work; but the `\renewmenumacro` works like expected). Any hint?


title: Styling the \part page

text: I'm using `\part` for defining parts of my "book". The thing is, that the part takes a whole page. I use `\documentclass[12pt]{book}`. I want to style the `\part` in a way that it looks like the `fncychap` style `Conny` and don't take a whole page. How do I accomplish that?


title: Simple Draw in Latex

text: Hi I want to draw this simple figure in latex ![Simple Draw](http://i.stack.imgur.com/mDGIb.png) can anyone please help me?


title: Pass several comma separated TikZ options to a single keyval key

text: I'm still improving my answer to Need help creating a 3D cube from a 2D set of nodes in TikZ. One of the options should be to emphasize the edges of the cuboid. This would mean e.g.               \draw[red, very thick, dashed] <some coordinates>      I'm using `keyval` to define parameters for the cuboid. Now my quesrion is, how can I pass all these commands to a single key? I would do this:               \tikzcuboid{%             emphedge=Y,%             emphstyle=very thick,         }      I can only pass one option (here `very thick`), as further commas (e.g. `very thick, red, dashed`) are interpreted as delimiters for keys by `keyval`. I tried several things, like               emphstyle={very thick, red, dashed}     emphstyle=style={very thick, red, dashed}     emphstyle=(very thick, red, dashed)      So my question basically is: are there some kind of special delimiters for `keyval` that I can put a list of comma separated arguments in? These special delimiters should however not be passed on, since this would probably cause problems with `TikZ`.


title: How to build parallel paths between nodes?

text: I want to create a figure with TikZ: ![Wanted result](http://i.stack.imgur.com/OoH4K.png) I tried first with the following code (remark: Complete MWE on bottom):               \begin{tikzpicture}     \node [block] (A) at (0,0) {\rule{2cm}{2cm}};     \node [block] (B) at (5,5) {\rule{2cm}{2cm}};          \path [draw,red, line width=3] (A) |-( B);     \path [draw,blue, line width=3] (A) |-( B);     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/liqGa.png) I created the two nodes A and B and draw the two pathes between them. But the 2nd one overwrites the first. Then I tried to shift the 2nd path, but the the starting and end point are also shifted:               \begin{tikzpicture}     \node [block] (A) at (0,0) {\rule{2cm}{2cm}};     \node [block] (B) at (5,5) {\rule{2cm}{2cm}};          \path [draw,red, line width=3] (A) |-( B);     \path [draw,blue, line width=3,transform canvas={shift={(-0.2,-0.2)}}] (A) |-( B);  %   shift complete path     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/LhGDH.png) Then I tried to modify the start and end point with degrees (example now with three lines):               \begin{tikzpicture}     \node [block] (A) at (0,0) {\rule{2cm}{2cm}};     \node [block] (B) at (5,5) {\rule{2cm}{2cm}};          \path [draw,red, line width=3] (A) |-( B);     \path [draw,blue, line width=3] (A.80) |-( B.190);  %set target with angle     \path [draw,green, line width=3] (A.70) |-( B.200); %set target with angle     \end{tikzpicture}      This looks good (see my first image), but it is _try and error_ to get the right degrees. I the node shape changes, the distance between two pathes changes and I have to look for another degree.               \begin{tikzpicture}     \node [block] (A) at (0,0) {\rule{2cm}{5cm}}; %modified node     \node [block] (B) at (5,5) {\rule{2cm}{2cm}};          \path [draw,red, line width=3] (A) |-( B);     \path [draw,blue, line width=3] (A.80) |-( B.190);  %set target with angle     \path [draw,green, line width=3] (A.70) |-( B.200); %set target with angle     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/hC505.png) My last attempt was using an offset for start and end position:               \begin{tikzpicture}     \node [block] (A) at (0,0) {\rule{2cm}{2cm}};     \node [block] (B) at (5,5) {\rule{2cm}{2cm}};          \path [draw,red, line width=3]  (A) |-( B);     \path [draw,blue, line width=3] (A.north)+(0.2,0) |-( B.west)+(0,-0.2);     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/LS212.png) To use the offset I must decide the start orientation (north, west...). And in my example the starting point is ok, but the 2nd part of the path is not shifted. I also found TikZ parallel Edges between Nodes, but I found now way to use it. Is there an easier way to create parallel pathes? I don't want to need _try and error_ methods to find the correct positions. My last try with the offset seems to be the logical version, but there is a problem with the end position. Heres my MWE:               \documentclass[]{scrartcl}          \usepackage{tikz}     % ----------------------------------------------------------------     \begin{document}          \tikzstyle{block} = [draw=black,very thick, rectangle, rounded corners]          \section{Problem: Pathes are overwritten}     \begin{tikzpicture}     \node [block] (A) at (0,0) {\rule{2cm}{2cm}};     \node [block] (B) at (5,5) {\rule{2cm}{2cm}};          \path [draw,red, line width=3] (A) |-( B);     \path [draw,blue, line width=3] (A) |-( B);     \end{tikzpicture}          \section{Shift path}     \begin{tikzpicture}     \node [block] (A) at (0,0) {\rule{2cm}{2cm}};     \node [block] (B) at (5,5) {\rule{2cm}{2cm}};          \path [draw,red, line width=3] (A) |-( B);     \path [draw,blue, line width=3,transform canvas={shift={(-0.2,-0.2)}}] (A) |-( B);  %   shift complete path     \end{tikzpicture}          \section{Set point with degrees}     \begin{tikzpicture}     \node [block] (A) at (0,0) {\rule{2cm}{2cm}};     \node [block] (B) at (5,5) {\rule{2cm}{2cm}};          \path [draw,red, line width=3] (A) |-( B);     \path [draw,blue, line width=3] (A.80) |-( B.190);  %set target with angle     \path [draw,green, line width=3] (A.70) |-( B.200); %set target with angle     \end{tikzpicture}          \subsection{But with other nodes}     \begin{tikzpicture}     \node [block] (A) at (0,0) {\rule{2cm}{5cm}}; %modified node     \node [block] (B) at (5,5) {\rule{2cm}{2cm}};          \path [draw,red, line width=3] (A) |-( B);     \path [draw,blue, line width=3] (A.80) |-( B.190);  %set target with angle     \path [draw,green, line width=3] (A.70) |-( B.200); %set target with angle     \end{tikzpicture}          \section{Use offsets}     \begin{tikzpicture}     \node [block] (A) at (0,0) {\rule{2cm}{2cm}};     \node [block] (B) at (5,5) {\rule{2cm}{2cm}};          \path [draw,red, line width=3]  (A) |-( B);     \path [draw,blue, line width=3] (A.north)+(0.2,0) |- ( B.west)+(0,-0.2);     \end{tikzpicture}          \end{document}     % ----------------------------------------------------------------


title: Controlling parindent in enumerate inside customized list environment

text: I'm trying to control the indentation of paragraphs in an enumerated list that is inside a customized list environment. I find that changing \parindent in the inner list has no effect. Here's an example that reproduces the problem:               \documentclass{report}     \usepackage{lipsum}     \usepackage{enumitem}          \newlength{\exlabelwidth}     \settowidth{\exlabelwidth}{\small 99.99}     \newlength{\exlabelsep}     \setlength{\exlabelsep}{0.5em}     \newlength{\exsymbolwidth}     \settowidth{\exsymbolwidth}{\small\ensuremath{*}}          \newcounter{exercise}[chapter]     \renewcommand{\theexercise}{\thechapter.\arabic{exercise}}        \newcommand{\exitem}{}     \newenvironment{exercises}%       {\begin{list}{\exitem}{%         \usecounter{exercise}%           \small%         \setlength{\itemindent}{\exlabelwidth}%         \addtolength{\itemindent}{\labelsep}%           \setlength{\labelwidth}{\exlabelwidth}%          \addtolength{\labelwidth}{\exsymbolwidth}%              \addtolength{\labelwidth}{\exlabelsep}%            \setlength{\leftmargin}{0.0cm}%         \setlength{\itemsep}{0.0cm}%         \setlength{\parsep}{0.0cm}%         \setlength{\listparindent}{\parindent}%               }%       }%       {\end{list}%     }       \newcommand{\ex}[1][]{%       \renewcommand{\exitem}{%         \makebox[\exsymbolwidth][r]{#1}\hspace{\exlabelsep}%         \makebox[\exlabelwidth][r]{\bfseries\theexercise}}\item%     }          \begin{document}     \begin{exercises}       \ex         \lipsum[1]         \lipsum[2]       \ex          \lipsum[3]         \begin{enumerate}[parsep=0pt,listparindent=\parindent]           \item              \lipsum[1]             \lipsum[2]         \end{enumerate}     \end{exercises}     \end{document}      The environment is based on advice I received on tex.stackexchange. I tried to make the code shorter, but I get errors. What I would like to be able to do is to have the second paragraph in the enumerate environment indented. Right now, it starts flush left regardless of whether I use the enumitem package and set parsep to zero or not. Thanks for any advice.


title: Set variable with mathematical expression

text: I need to do something like the following,               \includegraphics[width=(\textwidth - 50mm)/2]{myfig.eps}      What keywords can I use to search for doing this operation? Everything I've searched for was about mathematical typing instead of setting variable.


title: the selected document class requires external files that are not available - LyX portable

text: I'm using LyX portable on windows, and I get this message > the selected document class article(hebrew) requires external files that are > not avialable. ... the following prerequisites are installed: article.cls > theorem.sty I can't convert lyx to pdf. i have seen an answer to this question, but not for LyX portable.


title: Lemma numbering by first instance of referencing

text: My document is long with proofs broken into several lemmas and many of them are in the appendix. However, it seems odd when I am using Lemma 25 (which should ideally be Lemma 1) to prove Lemma 2. It does not immediately make clear that I am not making cyclic errors in proofs. Ideally, in any proof I'd like to reference only to Lemmas with numbers lower than them so that I do not make this error as my proofs get more and more complex. This means that I'd like to have my Lemmas numbered by the first time they are referenced (or stated, one of the two that happens first). Any way that I can achieve this?


title: Shell-escape with LaTeX 3

text: What is the LaTeX 3 equivalent to `\write18` if there is one? I want to call `lilypond` from within my TeX document.


title: Remove "Chapter" in header of the backmatter

text: In my backmatter the header appears as `Chapter x: chapter-name`, where `x` is the number (or letter if I have an appendix) of the last chapter before the backmatter. How can I make the header in the backmatter to just show `chapter- name`? I already modified the `chaptermark` according to this solution to not have the `Chapter 0` in the header of the frontmatter (Removing this does not affect the header in the backmatter). How can I adapt it to not have the `Chapter x` in the header?               \documentclass[a4paper,11pt,twoside]{book}     \usepackage{fancyhdr}     \pagestyle{fancy}          \renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}     \renewcommand{\chaptermark}[1]{%       \ifnum\value{chapter}>0         \markboth{Chapter \thechapter{}: #1}{}%       \else         \markboth{#1}{}%     \fi}          \begin{document}          \frontmatter      \chapter{abstract}     some text          \mainmatter     \chapter{some chapter}     some text          \appendix     \chapter{some appendix}     some text          \backmatter     \chapter{some backmatter}     some text     \newpage     some text     \newpage     some text               \end{document}


title: TikZ flowchart child

text: Is it possible to show block C as a single block rather than having 3 blocks? ![enter image description here](http://i.stack.imgur.com/seRkB.png)               \documentclass[landscape]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage[margin=1in]{geometry}     \usepackage{tikz-qtree}     \usetikzlibrary{shadows,trees}     \begin{document}     \tikzset{font=\small,     edge from parent fork down,     level distance=1.75cm,     every node/.style=         {top color=white,         bottom color=blue!25,         rectangle,rounded corners,         minimum height=8mm,         draw=blue!75,         very thick,         drop shadow,         align=center,         text depth = 0pt         },     edge from parent/.style=         {draw=blue!50,         thick         }}          \centering               \begin{tikzpicture}     \Tree [.A             [.{B}                 [.{C} ]     ]              [.{D}                 [.{C} ]                  ]       [.{C}     ]             [.{E}     ]     ]     \end{tikzpicture}               \end{document}


title: Relative paths in a subimport-ed file, when using pdfpages

text: Short version: a subimport-ed file has correct relative path when using \includegraphics, but incorrect relative path when using \includepdf. Long version: File a.tex is located in my main a directory 'a_dir'. It incorporates a file b.tex (which is located in directory 'a_dir/b_dir/') using '\subimport{b_dir/b.tex}'. b.tex includes a number of images, that are located in the directory 'a_dir/b_dir/images/'. b.tex uses both the commands \includegraphics and \includepdf (the latter from the pdfpages package). When a.tex is compiled, the \includegraphics command works fine, but the \includepdf command looks for the images in the (non- existent) directory 'a_dir/images' - it is looking for them relative to a.tex, not b.tex! I can't simply change the path in b.tex as I also compile that file on its own. How can I get pdfpages to look in the path relative to the file it is located, not the main compiling file?


title: How to resize or scale a longtable - revised

text: _**Further to my earlier post, I am now getting errors and no output from latex simply by inserting: %\resizebox{.88\hsize}{!}{ } into my code. I have edited the code below to show where I am inserting it. Am I missing something incredibly simple here?! - any assistance would be appreciated as I am truly at a loss. thank you! R_ ** _*_ ****** I am new here and will try to be as specific as possible. I have searched everywhere to try and figure out how to resize or scale a table spanning several pages using \longtable. I have added the \usepackage{longtable} in the preamble and have coded as follows:               \documentclass[12pt]{article}     \usepackage{longtable}     \begin{document}     \begin{center}     \resizebox{.88\hsize}{!}{     \begin{longtable}{|c|c|c|c|}     \caption{A simple longtable example}\\     \hline     \textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\     \hline     \endfirsthead     \multicolumn{4}{c}%     {\tablename\ \thetable\ -- \textit{Continued from previous page}} \\     \hline     \textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\     \hline     \endhead     \hline \multicolumn{4}{r}{\textit{Continued on next page}} \\     \endfoot     \hline     \endlastfoot     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     \end{longtable}     }     \end{center}     \end{document}      The table reacts as it should, meaning, it does not go into the margins, it continues from one page to the next until all rows have been displayed. My problem is that I am trying to reduce the size of the table: shorter row heights, smaller font, etc, in order to scale my table down a page or two. I would be happy with a simple scaling just to make the entire thing smaller. Any ideas? I have searched through the questions and answers on here already - but no luck. Thanks, R


title: How Do I Indent My Proofs in the Following Manner?

text: I'm interested in indenting my proofs so that they look like this. Please note that the alignment of the word "proof" with the word "theorem" is significant. However, Google does not appear to yield an answer.               Theorem: If there is a quadratic form that is Lipschitz then there is an isotropic               manifold locally resembling ℍ[x] in the quotient of Ker(ϕ) and ℍⁿ ⊗ G            Proof: Let ψ be a square-summable sequence in the rational quotient group. A simple              application of trichotomy completes the proof, which is left as an exercise for              the reader.


title: Does anyone have a "\newrgbcolor{colourname}{x.x.x}" list?

text: When I want to use colours in LaTeX, I normally use this colour chart of predefined colours that LaTeX knows by name: ![enter image description here](http://i.stack.imgur.com/Aaxb9.png) However, I've recently needed to use `pstricks` (I think it's called) and to use colours (at least in the template I'm working with) I need to type in RGB values, which is unsatisfactory. Does anyone know of a nice big list like the one below but for RBG values? Here is a MWE of a template I'm using:               \documentclass[landscape,a0b,final]{a0poster}          \usepackage{epsfig}     \usepackage{multicol}     \usepackage{pstricks,pst-grad}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % Definition of some variables and colors     %\renewcommand{\rho}{\varrho}     %\renewcommand{\phi}{\varphi}     \setlength{\columnsep}{6cm}     \setlength{\columnseprule}{1.5mm}     \setlength{\parindent}{0.0cm}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%               Background                     %%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \newcommand{\background}[3]{     \newrgbcolor{cgradbegin}{#1}     \newrgbcolor{cgradend}{#2}     \psframe[fillstyle=gradient,gradend=cgradend,     gradbegin=cgradbegin,gradmidpoint=#3](0.,0.)(1.\textwidth,-1.\textheight)     }          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%                Poster                        %%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \newenvironment{poster}{     \begin{center}     \begin{minipage}[c]{0.95\textwidth}     }{     \end{minipage}      \end{center}     }          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%                pcolumn                       %%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \newenvironment{pcolumn}[1]{     \begin{minipage}{#1\textwidth}     \begin{center}     }{     \end{center}     \end{minipage}     }          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%                pbox                          %%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \newrgbcolor{lcolor}{0. 0. 0.80}     \newrgbcolor{gcolor1}{1. 1. 1.}     \newrgbcolor{gcolor2}{.80 .80 1.}          \newcommand{\pbox}[4]{     \psshadowbox[#3]{     \begin{minipage}[t][#2][t]{#1}     #4     \end{minipage}     }}          %=======================================================================          \usepackage{eso-pic}     \newcommand\BackgroundPic{     \put(10,-50){     \parbox[b][\paperheight]{\paperwidth}{%     \vfill     \centering     \includegraphics[width=\paperwidth,height=\paperheight,     keepaspectratio]{TheSun2.eps}\vfill}}}          \begin{document}          \AddToShipoutPicture{\BackgroundPic}          %\background{1. 1. 1.}{1. 1. 1.}{0.5}          \vspace*{2cm}          \newrgbcolor{lightblue}{0. 0. 0.80}     \newrgbcolor{white}{1. 1. 1.}     \newrgbcolor{whiteblue}{.80 .80 1.}          \newrgbcolor{brightblue}{0.310 0.749 1}          \begin{poster}          %=======================================================================          \vspace*{2cm}          %%% Begin of Multicols-Enviroment     \begin{multicols}{3}          %%% SECTION 1     \begin{center}\pbox{0.8\columnwidth}{}{linewidth=2mm,framearc=0.1,linecolor=lightblue,fillstyle=gradient,gradangle=180,gradbegin=    white,gradend=whiteblue,gradmidpoint=1.0,framesep=1em}{\begin{center}     \textbf{Introduction} \end{center}}\end{center}\vspace{1.25cm}          Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla.          %=========================================================================          \end{multicols}     \end{poster}     \end{document}


title: Sublime Text 2 and bibtex

text: I'm using Sublime Text 2 (ST2) with LaTeXTools to build my .tex-documents. But the .bib-file is not found or doesn't build (I believe the last one). The LaTeX log reports undefined citations, and the entire bibliography is missing form the PDF. I have searched the web for a solution. Although a similar problem occurs in Bibliography missing from PDF (Sublime Text 2 and Miktex), I made a new LaTeX build command using the answer from elleestcrimi, but it doesn't work. Somebody have an idea about what I can do? I call the .bib-file from the `\bibliography{ref.bib}` command and have the standard LaTeXTools build-file:               {     "cmd": ["latexmk", "-cd",                 "-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'",                 //"-silent",                 "-f", "-pdf"],     "path": "$PATH:/usr/texbin:/usr/local/bin",     "file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)"     },      Edit: As the latexmk documentation points out that bibtex will be run even if there is no .bib-file present, I haven't really considered the alternative to manually run bibtex. I would like bibtex to build anyhow. Edit2: When I build my document from ST2 with LaTeXTools (see above), then the bibtex-command from github:               {     "cmd": ["bibtex", "$file_base_name"],     "path": "$PATH:/usr/texbin:/usr/local/bin",     "file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)",     "selector": "text.tex.latex"     }      and rebuild with LaTeXTools the bibliography is included and the sun is shining. EDIT3: I'm now not able to reproduce the problem. It somehow seems to have solved itself. Typesetting with ST2 produces all the files it should, and the bibliography is included.


title: How can I left align the labels in a customized description list

text: I have this code:               \SetLabelAlign{rightbox}{\hss\llap{#1\quad}}     \setlist[description,1]{align=rightbox,labelsep=0pt,leftmargin=0pt}              \section{Project 55d5396fed}         \begin{tabular}{@{\hspace{19ex}}p{42em}}         \begin{description}              \item[student number] 55d5396fed                     \item[student name] We have already seen that a case of semigrammaticalness of a different sort is necessary to impose     an interpretation on irrelevant intervening contexts in selectional rules.                \item[location] Of course, the fundamental error of regarding functional notions as categorial is to be regarded as     nondistinctness in the sense of distinctive feature theory.                 \end{description}            \end{tabular}      The labels are right aligned. I want the labels to be left aligned. I mean the `items`.


title: Highlight theorem environment using todonotes

text: I'm trying to highlight theorem-like environment (defined using `amsthm`) utilizing `todonotes`. In the preamble I have:               \newtheorem{que}{Question}     \newcommand*{\question}[1]{%       \todo[inline,color=red!10,caption={}]{\begin{que}           #1         \end{que}       }}      Problem is, that in the body, when having something like:               \question{\lipsum[10]}      It yields: ![enter image description here](http://i.stack.imgur.com/efhIB.png) I tried to define a `theoremstyle` as follows:               \newtheoremstyle{queSty}%     {-1em} % Space above     {0pt} % Space below     {} % body font     {} % Indent amount     {} % Theorem head font     {:} % Punctuation after theorem head     {.5em} % Space after theorem head     {} % Theorem head spec      Using this style yielded the following box: ![enter image description here](http://i.stack.imgur.com/Ladnq.png) This is better, but still not good enough. Setting the first argument to `40pt` for instance does increases this vertical spacing, but I cannot make it go away. **How can I get rid of the empty line at the beginning of the box? I want to have the same spacing as the one at the bottom.** I guess I could tweak the solution provided here for example, but I want to try and use `todonotes`.


title: Insert image in the header

text: I am a real beginner in LyX and I want to insert a small image into the header. Actually I want to insert two images. But let's begin by one. I have no idea how to do this and would appreciate any help.


title: Vertical lines are being broken up (disrupted) by the horizontal booktabs lines

text: My vertical lines are being broken up (disrupted) by horizontal `booktabs` lines. How can I fix this? It's well and good to say use `\hline` but I also need a `cmidrule` that spans only the second two columns which have no `\hline` equivalent to my knowledge. Also `\hline` is ugly because it doesn't automatically leave any vertical space between the line and the preceding/following lines of text. ![Table](http://i.stack.imgur.com/UHNHq.jpg)               \documentclass[a4paper,12pt]{article}     \date{}     \usepackage{a4wide}     \usepackage{booktabs} %for top, middle and bottomline     \usepackage{multirow} %multi column and row spanning     \usepackage{amsmath}     \usepackage{multirow}     \usepackage{tabularx}     \usepackage{multicol}     \usepackage{blindtext}                   \begin{document}              \begin{multicols}{2}              \subsection*{Results}           \resizebox{\columnwidth}{!}{%     \begin{tabular}{@{} l | c | c @{}}     \toprule     Characteristic & \multicolumn{2}{c}{Result}\     \cmidrule{2-3}      & Seaweed isolate & Coral isolate \    \midrule     Cell shape & Rod & Rod\    Gram stain & $-$ & $-$\    Oxidase & $+$ & $-$\    Catalase & $+$ & $-$\    MSA & Growth & No growth\    Anaerobic & Growth (weak) & No growth\    Motility & & \    Indole production & & \    Hugh \& Leifsons & & \    \bottomrule     \end{tabular}     }              \blindtext              {\noindent         \begin{tabularx}{\columnwidth}         { | l | >{\raggedright\arraybackslash} X | >{\centering\arraybackslash} X | }         Leave this column alone. & Left justify and adjust this column. &         Centre and adjust this column. \\          \end{tabularx}         }              \end{multicols}              \end{document}


title: Stupid error caused by doing stupid things

text: When I was writing my thesis I wrote the following two commands which I found useful (and still do). They are both ways of defining other commands.               \usepackage{ifthen}     \makeatletter       \def\optional #1[#2]#3#4{\newcommand{#1}[#2][@rGUmentmiSSing]{\ifthenelse{\equal{##1}{@rGUmentmiSSing}}{#4}{#3}}}       \newcommand{\starredcommand}[4][*]{\newcommand{#2}{\@ifnextchar#1{\expandafter #4\@gobble}{#3}}}       \makeatother      They aren't easy to read. The first one allows me to define a command with an optional argument, where the behaviour of the command is very different if the optional argument is there or not. The second allows me to define a command with a modifier which I usually use if I have two versions of the same object but one defined on a larger space. For example I have               \optional{\foo}[1]{F(#1)}{F}      \starredcommand{\barr}{\mathcal B}{\mathscr B}      So I can write               \begin{align}         \foo &= \foo[x] \\          \barr &\neq \barr*     \end{align}      Which would give me the same effect as               \begin{align}         F &= F(x) \\          \mathcal B &\neq \mathscr B     \end{align}      I like these commands but they don't play nicely together. For example if I write `\foo[\bar]` or `\foo[\bar*]` I get over 100 errors, which is bad. It's not to do with the `\@gobble` command eating the bracket. `\foo[\bar* 123456789]` Gives me the same thing. And it's not to do with the square brackets. If I define               \newcommand{\fine}[1][y]{X^{#1}}      then `\fine[\bar]` works exactly as it's supposed to. I have no idea what's going wrong. It would be great if someone could help. Here's a follow up question if that one's too easy. At the moment there's no way of including arguments in my `\starredcommand` If I wanted to give `\barr` an argument I'd normally do something like               \makeatletter     \newcommand{\@barr}[1]{\mathcal B^{#1}}     \newcommand{\@barrstar}{\mathscr B^{#1}}     \starredcommand{\barr}{\@barr}{\@barrstar}     \makeatother      Which works fine (even with optional arguments or my `\optional` command) but it sort of defeats the point of defining the `\starredcommand` in the first place. I'd love a version of starred command that could work with arguments but I can't think of a way of doing it.


title: Centering an image and a two-column layout.

text: Here's what I'd like to do. Place a centered image, and then have two columns of text centered below it. I did the following:               \begin{center}     \includegraphics{image}          \begin{multicols}{2}     lots of text     \end{multicols}     \end{center}      All that happens is that the image is centered, but the two column block is aligned left. I tried variants where I used two center environments, one for the image and one for the multicol. I also tried using `\centering` instead, and even tried encapsulating the multicol inside a minipage. All to no avail. It's a minor issue, but it's driving me nuts. Any help would be greatly appreciated. **Update: Here's an MWE:**               \documentclass{article}     \usepackage{multicol}     \usepackage[demo]{graphicx}     \begin{document}     \begin{center}       \includegraphics[width=3in]{plan}     \end{center}         \begin{multicols}{2}             \begin{enumerate}     \item 1     \item 2     \item 3     \item 4     \item 5     \item 6     \item 7     \item 8     \item 9     \item 10     \item 11     \item 12     \item 13     \end{enumerate}         \end{multicols}     \end{document}      which produces this:![Example of bad centering](http://i.stack.imgur.com/AP67v.jpg)


title: Vertically center text in a specific cell

text: I want to vertically center the "Characteristic" heading in its respective cell? ![enter image description here](http://i.stack.imgur.com/2YqOv.jpg)               \documentclass[a4paper,12pt]{article}          \usepackage{booktabs} %for top, middle and bottomline     \usepackage{multirow} %multi column and row spanning     \usepackage{multicol}     \usepackage{graphicx}          \begin{document}          \begin{multicols}{2}          \subsection*{Results}               \resizebox{\columnwidth}{!}{%     \begin{tabular}{@{} l c c @{}}     \toprule     Characteristic & \multicolumn{2}{c}{Result}\\      \cmidrule{2-3}      & Seaweed isolate & Coral isolate \\      \midrule     Cell shape & Rod & Rod\\     Gram stain & $-$ & $-$\\     Oxidase & $+$ & $-$\\     Catalase & $+$ & $-$\\     MSA & Growth & No growth\\     Anaerobic & Growth (weak) & No growth\\     Motility & & \\     Indole production & & \\     Hugh \& Leifsons & & \\     \bottomrule     \end{tabular}     }               \end{multicols}          \end{document}


title: loop video clip in beamer

text: I am creating a presentation using beamer and would like to have my embedded video clip automatically play on a loop. I can get the video to appear and play in the pdf; however, it does not loop. I have tried different video formats (mp4,mpg,avi), all would play but none would loop. According to the beameruserguide.pdf, repeat should have the same effect as loop. Below is a minimum working example:               \documentclass{beamer}     %%%% PREAMBLE     \usetheme{Warsaw}     \useinnertheme{rectangles}     \setbeamercovered{transparent}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{multimedia}     \usepackage{hyperref}     \title{Short Paper Title}     \author{Author's Name}     \institute[University of LaTeX]{     Department of Computer Science\\     Graphics Lab}     \begin{document}     %------------------- TITLE PAGE FRAME -------------------%     \begin{frame}[plain]      \titlepage     \end{frame}     %------------------------ slide -------------------------%     \begin{frame}     \frametitle{The frame title}     \begin{center}        \movie[width=9.1cm,height=6.5cm,showcontrols=true,loop,poster]{}{video1.mp4}     \end{center}     \end{frame}     \end{document}      Obviously, one would need to have the file "video1.mp4" on their local system to test this script. edit: I have a default installation of TeXLive 2011 (downloaded from ctan.org) and use pdflatex to build my document.


title: How to disable automatic indentation on new paragraphs?

text: I'm using a template that I can't/shouldn't modify. This template forces that every time a new paragraph begins, there is an indentation added. In some rare cases this is just looking really ugly and that's why I'd like to avoid this indentation. Is there any way to do this without changing the template?


title: When to use @ in an \if statement

text: I am new to LaTeX and so this question might come across as rather basic. It might also reflect my biases/assumptions from my C/C++ programming days. I was seeing the code of the 'exam' class and noticed that some `\if<xyz>` had an `@` while others didn't. For example, below are a few lines of code from the class file (in order of appearance/execution)   1. `\newif\ifcancelspace`   2. `\newif\if@addpoints`   3. `\def\addpoints{\global\@addpointstrue}`   4. `\@addpointsfalse` I can't understand the following:   * Is the `\if@addpoints` in [2] evaluated (when it appears) using the value of `@addpoints` (declared in [4])    * Is there a significance to prepending an `@` to addpoints above?      * Is it just good programming practice for naming variables in class/package files?     * Or, was it necessary because there is another `\def\addpoints` in [3] and the `@` was required to differentiate between the two?   * What is the default scope for variables in LaTeX?    * How can `@addpoints` be made global in [3] when it is not defined until [4]?


title: Inserting Code in multiple pages as an appendix

text: I am trying to insert a script (bash shell code) to the appendix of my document. I am trying to import the script from separate file. The script file name is `Event_Db_BckUp_Script.als`. The problem is that the code is very long and it requires to be split into multiple pages. When I use the following code, it is only shown in single page and cut the rest of the code. How can I display the whole script in multiple pages? Here is what I am doing right now:               \begin{Listing}[H]      \filein{Event_Db_BckUp_Script.als}      \caption{IDSaaS initialization Script}      \label{list:Idsaas_Script}      \end{Listing}


title: Why am I getting this "Missing $ inserted" error in an algorithm figure just like all my other algorithm figures?

text: I'm writing a paper in LaTeX, and I'm getting a strange "`Missing $ inserted`" error when I try to compile the paper using `pdflatex`, but only if it contains the following code.               \begin{algorithm*}[tbh]       \begin{haskell}       translate :: \textsc{Featherweight Java} \Rightarrow \textsc{Feather-Sub terms}\\       translate (class C_1 extends C_2 \{T_i f_i ^ \{i \in 1...n\}\; K M_j ^ \{j \in 1...m\}\}) = \hsbody{\langle C_1 = \{(translate C_2), f_i \: (translate T_i) ^ \{i \in 1...n\}\} \rangle where (translate K) and (translate M_j ^ \{j \in 1...m\}) are emitted as separate translations into the same unit}\\            translate (C(C_i f_i) \{ super(f_i); this.f_i = f_i; \} ^ \{i \in 1...n\}) = \hsbody{\hslet{C = \lambda f_i.\langle C = \{l_i = f_i\} ^ \{i \in 1...n\}}{rest of translation unit}}\\            translate (C' m(C_i x_i ^ \{i \in 1...n\}) \{ return e; \} in class C) = \hslet{ m = \lambda t.case t of \langle C=this \rangle \Rightarrow \lambda x_i.(translate ((C')e)) for each subclass C' of C with overriding method m' \langle C' = this \rangle \Rightarrow m' t x_i}{rest of translation unit}\\            translate x = x            translate t.f \hswhere{t is known to have type C} = case t of \langle C = x \rangle x.f for each subclass C' of C \langle C' = x \rangle x.f\\            translate t_1.m_i ^ \{i \in 1...n\} = m (translate t_1) (translate t_i) ^ \{i \in 1...n \} \\            translate (new C(t_i ^ \{i \in 1...n\})) = C (translate t_i) ^ \{i \in 1...n \} \\            translate ((C)t) = \hslet{t' = (translate t)}{\langle C = \{for each f_i : \tau_i \in (translate C) f_i = t'.f_i\} \rangle}       \end{haskell}     \caption{Encoding of Featherweight Java into Feather Sub\label{fig:Encoding-of-Featherweight}}     \end{algorithm*}      I already have `\usepackage` commands in my prelude for the `algorithm*` and `haskell` environments, and I use them earlier in the paper. This algorithm is listed in an appendix section, could that change things somehow? What can I do to fix it? I would really appreciate any help I can get with this, as the submission deadline is this Friday! Everything else about the paper is ready for submission except this, so, once again, would really appreciate any help.


title: Custom LaTeX chapter

text: Be default chapters look like:               Chapter 1          Chapter name.      How can I make chapters in LaTeX look something like this?               Chapter 1. Chapter Name.      That is: add a dot after chapter number, and place the chapter name straight after the chapter number.


title: Defining rules for line breaks in \newcommand

text: Thanks to the help of this answer, I've defined a command for creating a blank line:               \newcommand{\blank}[1]{\rule{#1}{0.4pt}}      However, because this is a user-defined command, LaTeX doesn't seem to factor it in to its calculations of when to start a new line. For example, if I write:               This is a long line and the blank line at the end is going to run off the page \blank{6cm}      then the blank line at the end runs off the page. How can I prevent this from happening? EDIT: This actually only happens in a specific case: when I'm in the `amsthm` package's `proof` environment, and I have at least one line of writing followed by an enumeration.               \documentclass{article}     \usepackage{amsthm}     \newcommand{\blank}[1]{\rule[-3pt]{#1}{0.4pt}}  % nice blank underscores     \begin{document}     \begin{proof}     Here is my proof:     \begin{enumerate}     \item This is a long line and the blank line is going to run off \blank{8cm}     \item This is the second line.     \end{enumerate}     \end{proof}     \end{document}      Even when the blank line doesn't run off the page, I still get an `overfull hbox` warning for each instance of `\blank` I have within an enumerate in a proof.


title: Farsi alphabet order for glossary

text: I am using `glossaries` with `makeidx` in a Farsi document with `xepersian`. Currently it sorts the output using Arabic alphabet order and places words starting with گ, چ, پ and ژ at the end of list. How can I force Farsi alphabet order?


title: Kashida with XePersian and XB Series Font

text: I am using `xepersian` and _XB Niloofar_ font to produce Farsi documents. When enabling `[Kashida]` option, although _XB Niloofar_ has the kashida (U+0640) glyph, I get a fuzzy output. Any solution?               \documentclass[12pt]{article}     \usepackage[Kashida]{xepersian}     \settextfont[Scale=1]{XB Niloofar}     \setdigitfont[Scale=1]{XB Niloofar}     \setlatintextfont[Scale=0.9]{Junicode}          \begin{document}     سلام، من هر روز به مدرسه می‌روم.      بایستی به قدری بنویسم که تراز کردن      اتفاق بیفتد و از کشیده استفاده شود.      این کشــــــــیــــــــــده است؟     \end{document}


title: Double 'evaluate' in one PGF's \foreach

text: percusse may know if I can do the following with `\foreach`:               \begin{document}     \foreach [       evaluate=\x as \z using \x*10,       evaluate=\x as \p using \x mm*3     ] \x in {1,...,5}{       \endgraf       \hskip\p pt\relax       \textcolor{red!\z!blue}{\x}%     }     \end{document}      **Aside** `\foreach` should help newbie with an intelligent message in a case like the following:               \foreach [       remember=\x % as \lastx (initially A) % n00b forgot the rest.     ] \x in {B,C,D,E,F,G,H}{%       $\overrightarrow{\lastx\x}$,     }


title: Expanded toc-like environment

text: I'm typesetting a book. It has a special toc-like text at the begining of each chapter. What I want to do is: use after each section an environment (say abstract) and get the result at the begining of each chapter.               \documentclass{book}          \usepackage[inline]{enumitem}          \begin{document}     \chapter{First Chapter}         \begin{abstract}             \begin{itemize*}                 \item First this abstract talks about....                 \item Second we have ...             \end{itemize*}         \end{abstract}          Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod     tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At     vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,     no sea takimata sanctus est Lorem ipsum dolor sit amet.          \section{First Section}         \begin{abstract}             \begin{itemize*}                 \item this section talks about ....                 \item it also tals about             \end{\itemize*}         \end{abstract}          bla bla bla     \end{document}      result:               First Chapter     -- First this abstract talks about.... -- Second we have ...     1. First Section: -- this section talks about .... -- it also talks about          Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod     tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At     vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,     no sea takimata sanctus est Lorem ipsum dolor sit amet.          *First Section*     bla bla bla      Is this possible? Note that this isn't just minitoc, because each section will have a summary in the toc. Edit: the description is actually an itemize* environment provided by the enumitem package.


title: Using tikz to modify List of Figures

text: I have successfully used tikz to modify the table of contents of a $\Tex$ document, and cannot quite figure out how to achieve the same effect for the list of figures, list of tables, acknowledgements, etc.. My (simplified) style file looks like:               % Style file to get green boxes in TOC.          \usepackage{tikz}     \usepackage{xcolor}     \usepackage{titletoc}     \usepackage[titletoc]{appendix}     \usepackage{etoolbox}     \usepackage{lmodern}          % define color     \definecolor{uvmgreen}{rgb}{0,0.35,0.23}          % ToC title with color box.     \patchcmd{\tableofcontents}{\contentsname}{     \vspace*{-70pt}%     \begin{tikzpicture}[remember picture, overlay]%     \pgftext[right,x=12cm,y=0.2cm]{\color{uvmgreen}\Huge\bfseries \contentsname};%     \draw[fill=uvmgreen,draw=uvmgreen] (13.5,-.75) rectangle (10,1);%     \clip (15.5,-.75) rectangle (10,1);     \pgftext[right,x=12cm,y=0.2cm]{\color{white}\Huge\bfseries \contentsname};%     \end{tikzpicture}}{}{}      and an example report looks like:               \documentclass{report}          % import style file     \usepackage{greenBoxTOC}     \usepackage[pdftex]{graphicx}          \begin{document}          \tableofcontents     \newpage          \listoffigures     \newpage          \chapter{Quantum Harmonic Oscillator}     \section{test section}          \begin{figure}     \includegraphics[scale=1.0]{image.png}     \caption{sample caption} \label{fig: first figure}     \end{figure}          \section{test section }     \subsection{test subsection}     \section{test section}     \subsection{test subsection}     \subsection{A test subsection with a long title spanning more than one line in the table of contents}     \section{test section}               \chapter{Is it a Riemann Integral?}      \section{test section}     \subsection{test subsection}     \section{test section with a long title spanning more than one line in the table of contents}     \subsection{test subsection}          \end{document}      I would really like to be able to add a `\listoffigures` that would use the same green boxes which show up at the top where it says 'List of Figures'. My (unsuccessful) attempt at this was to add the following to the style file:               \patchcmd{\listoffigures}{\figurename}{     \vspace*{-70pt}%     \begin{tikzpicture}[remember picture, overlay]%     \pgftext[right,x=12cm,y=0.2cm]{\color{uvmgreen}\Huge\bfseries \figurename};%     \draw[fill=uvmgreen,draw=uvmgreen] (15.5,-.75) rectangle (10,1);%     \clip (15.5,-.75) rectangle (10,1);     \pgftext[right,x=12cm,y=0.2cm]{\color{white}\Huge\bfseries \figurename};%     \end{tikzpicture}}{}{}      but when I add this, nothing seems to happen. Any suggestions would be much appreciated. Thanks in advance!


title: How to use \simeq in equation?

text: I need to use `\simeq` in an equation, but my code is not workin':               \begin{equation}\label{m-step}     P(t) \simeq {\sum_{g\in G} {\sum_{f\in F} P(t|f,g)     \end{equation}      Can you tell me why?


title: Is it possible to use abbreviations with cleveref?

text: I would like to use the full name in most circumstances for references. But sometimes, e.g. in               $\xRightarrow{\cref{prop:15.2d}}$      the full name might be too long. In this example, it gives "Proposition 11.15 (d)" So I would like to use something like               $\xRightarrow{\crefabbr{prop:15.2d}}$      to get something like "11.15 (d)" or "Prop. 11.15 (d)" Does `cleveref` have a feature like this?


title: References by chapter and global references

text: I'm writing my thesis, but I need to get the bibliography for each chapter, and place a global bibliography at the end of the document. I use the \usepackage[sectionbib]chapterbib, works well but I can not get the global references What I need to get is about   1. Name of the Chapter 1 1 1.1 Section 1 ................................................. 2 1.2 Section 2 ................................................. 3 References .................................................... 4   2. Name of the Chapter 2 2.1 Section 1 ................................................. 5 2.2 Section 2 ................................................. 6 References .................................................... 7 Global References 10


title: Best practice on organising your preamble

text: I am putting together a large document and my preamble is unwieldly and disorganised. What order does it make sense to load packages. Obviously, `hyperref` goes last, apart from things that have to go after `hyperref`. I tend to load font packages first, as they seem like a big global change. What other categories should I arrange my preamble around? Are there other cases where load order is important? Should I keep other commands close to the packages they relate to? e.g. should I keep my bibliography formatting commands near my `\usepackage{biblatex}` call?


title: Difference between {\tt \{} and \verb+{+

text: Why is `{\tt \{}` typeset as an ordinary `{` and not the same as for instance `\verb+{+`? To illustrate:               {\tt With tt:~ \{}          \verb+With verb: {+      yields ![](http://i.stack.imgur.com/oLDhm.png)


title: Problems with \pgfplotstableread and relative paths

text: I have this folder structure in my project:   * main.tex   * mystyle.sty   * tex      * mytex.tex   * img      * myimg.tex   * dat      * mydat.dat  And the following files: main.tex:               \documentclass{scrartcl}     \usepackage{mystyle}          \begin{document}       \input{tex/mytex}     \end{document}      mytex.tex:               \begin{figure}[ht]       \centering       \input{img/myimg.tex}     \end{figure}      myimg.tex:               \documentclass[tikz]{standalone}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \IfStandalone{       \newcommand{\fromRoot}[1]{../dat/#1}     }{       \newcommand{\fromRoot}[1]{./dat/#1}     }     \pgfplotstableread{\fromRoot{mydat.dat}}\datatable     \begin{document}       \begin{tikzpicture}         \begin{axis}[width=10cm, height=6cm]           \addplot table[x=0,y=1]{\datatable};         \end{axis}       \end{tikzpicture}     \end{document}      mydat.dat:               1 0.4032     2 0.40241     3 0.38704      mystyle.sty:               \ProvidesPackage{mystyle}          \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{standalone}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{pgfplotstable}      In my understanding should the path to the mydat.dat file be ./dat when I'm compiling the main file main.tex. But I always get the error message:               (./img/myimg.tex     ! Undefined control sequence.     \pgfplotstableread@filename ^^@-\datatable


title: How to create linearized PDF using TeX?

text: Is it possible to create linearized PDFs (optimized for "fast web view") using TeX with free software? (I don't have Acrobat available.)


title: Remove blank page between last chapter and appendix?

text: I'm having this problem: > last chapter [annoying blank page] appendix I tried solving it by looking up for some answers here but nothing seems to work for me. Please help me. Thanks. (below is the code)               \documentclass[oneside]{etd}     \usepackage{graphicx}     \usepackage{float}     \usepackage{url}     \makeindex     \begin{document}          \begingroup     \renewcommand*{\addvspace}[1]{}     \tableofcontents     \listoffigures     %\listoftables     \endgroup          \beginbody     \pagenumbering{arabic}          \include{chap_introduction}     \include{chap_review}     \include{chap_techbackground}     \include{chap_methodology}     \include{chap_recommendations}     \appendix     \include{appendix_BR2}          \include{vita}          \end{document}


title: Open Type Fonts have different scale in XeLaTeX

text: I am trying to create a template that allows easy switching of the main font using fontspec. I have noticed that the size of different fonts varies greatly, as the picture below illustrates. If we take the Palatino fonts as the benchmark, Adobe Garamond Pro and Linux Libertine are much smaller and Minion Pro and Adobe Caslon Pro are slightly larger than those, but still smaller than Palatino. I always thought that open type fonts are somewhat "normalised" so that this does not occur. I could now use trial and error with fontspec's `scale` option, but maybe there are some guidelines out there that tell me what I am supposed to do to scale fonts to the same size. ![Comparison of Open Type Fonts](http://i.stack.imgur.com/RXESf.jpg) This has been generated with the following MWE (except Pazo Math):               \documentclass{scrartcl}     \usepackage{fontspec}     \defaultfontfeatures{Mapping=tex-text}          \begin{document}          \setmainfont{TeX Gyre Pagella}     The quick brown fox jumps over the lazy dog (TeX Gyre Pagella)          \setmainfont{Adobe Garamond Pro}     The quick brown fox jumps over the lazy dog (Adobe Garamond Pro)          \setmainfont{Linux Libertine O}     The quick brown fox jumps over the lazy dog (Linux Libertine)          \setmainfont{Adobe Caslon Pro}     The quick brown fox jumps over the lazy dog (Adobe Caslon Pro)          \setmainfont{Minion Pro}     The quick brown fox jumps over the lazy dog (Minion Pro)          \end{document}


title: ! You can't use `\eqno' in math mode

text: what is wrong with this??? please,can anyone help?               \begin{equation} \label{probabilityy}     P^{t}({E_{0})=P_{0}+(1-P_{0})P_{1}+ (1-P_{0})(1-P_{1})P_{2}+.......+P_{n}\Pi_{k_{0}}^{n-1}(1-P_{k})     \end{equation}      Naema


title: page numbers gone with xelatex + moderncv

text: In Win7 with MikTeX 2.9 I'm trying to compile a `resume.tex` file with **xelatex** , written in `moderncv.cls`. It has `\moderncvicons{awesome}` to get new icons for phone, email and website, among other things. How can I get _1/2_ or _2/3_ in the bottom of the page to indicate _current page/tot. pages_? I've tried with               \pagestyle{fancy}     \rfoot{\thepage\ of \pageref{LastPage}}      but it doesn't work, instead gives "1/??".


title: using IEEEtran document class -how to format three authors using IEEEtran

text: I am using IEEE Transactions conference class \documentclass[10pt, conference, compsocconf]{IEEEtran} How I should align the author properly so that it appears in this format?                        title     author1        author2             author3      can't attach an image because of low reputation,sorry for this:(


title: Different approach to literate programming for LaTeX

text: I have spent a couple of hours rethinking the literate style tools we have for `LaTeX`, which are essentially `doc`, `docstrip` and `ltxdoc`. Although the traditional workflow with a good editor can be less of a pain, imprisoning the code in guards and percentage marks can be disruptive to the flow of writing code, especially to newcomers. With this in mind and also to try and improve the typography and the functionality of the code, I came up with an alternative. The central idea is to be able to use any class as the base class (in the MWE I have used the tufte-book) and to be able to have _pretty printing_ using a package such as `listings`. The approach is to use only one `.tex` file which when compiled produces the documentation as well as the class, package or files. Essentially it saves code verbatim when is defined. The MWE example only outputs to one `.sty` file, but it is possible to save to as many files as one needs (simulating the `docstrip` guards). A small installation script can be incorporated and self generated with `LuaLaTeX` if one wants to also simulate `docstrip`s ability to install files in different directories. **What precautions should one take in developing such a code and are there any essential features of the`doc/docstrip` approach that cannot be incorporated in my approach?**               \documentclass{tufte-book}     \usepackage{microtype,soul}     \makeatletter     \usepackage[charter]{mathdesign}      \def\rmdefault{bch} % not scaled      \def\ttdefault{blg}     \usepackage{xcolor,filecontents,ragged2e}     \usepackage[listings, theorems]{tcolorbox}     \definecolor{theblue} {rgb}{0.02,0.04,0.48}     \definecolor{thered}  {rgb}{0.65,0.04,0.07}     \definecolor{thegreen}{rgb}{0.06,0.44,0.08}     \definecolor{thegrey} {gray}{0.5}     \definecolor{theshade}{gray}{0.94}     \definecolor{theframe}{gray}{0.75}          \lstloadlanguages{[LaTeX]TeX, [primitive]TeX}          % Emphasis     \newcommand\emphasis[2][thered]{\lstset{emph={newcommand,def,gdef,#2},        emphstyle={\ttfamily\textcolor{#1}}}}%          \lstset{language={[LaTeX]TeX},           escapeinside={{(*@}{@*)}},             numbers=left, gobble=2,            stepnumber=1,numbersep=5pt,             numberstyle={\footnotesize\color{gray}},firstnumber=last,            breaklines=true,            framesep=5pt,            basicstyle=\small\ttfamily,            showstringspaces=false,          % keywordstyle=\ttfamily\textcolor{thegreen},           stringstyle=\color{orange},           commentstyle=\color{black},           rulecolor=\color{theshade},           breakatwhitespace=true,          showspaces=false,  % shows spacing symbol           xleftmargin=0pt,           xrightmargin=5pt,           aboveskip=3pt plus1pt minus1pt, % compact the code looks ugly in type           belowskip=7pt plus1pt minus1pt,  % user responsible to insert any skips           backgroundcolor=\color{theshade}     }     \lst@RequireAspects{writefile}          \lstnewenvironment{Macro}[1][Test]         {\emphasis{#1}\marginpar{\vskip0.5\baselineskip\footnotesize\color{thered}\texttt{\string#1}}        \lst@BeginAlsoWriteFile{textsamples.sty}}        {\endgroup}          \newcommand\lorem{Fusce adipiscing justo nec ante. Nullam in enim.      Pellentesque felis orci, sagittis ac, malesuada et, facilisis in,      ligula. Nunc non magna sit amet mi aliquam dictum. In mi. Curabitur      sollicitudin justo sed quam et quadd. \par}               \DeclareRobustCommand{\todo}[1]{\sidenote{\hl{#1}}}     \author{Y Lazarides}\publisher{Camel Press}     \title{\parindent0pt A New Approach in\\ Documenting Macros}     \begin{document}          \backmatter     \maketitle     \parindent0pt               \mainmatter          \tableofcontents          \chapter{The Approach}     \section{User Documentation}     The user documentation can be styled a bit better. The user should be able to      write the package or class in a more natural style.\todo{Write a few more notes here.}     \medskip          \begin{tcblisting}{colframe=thegreen,boxrule=1pt,colback=thered!5,listing options={style=tcblatex}}     The macro  \verb+\LaTeXe+, typesets the \LaTeXe logo.     \end{tcblisting}          \section{Implementation}          \lorem          \Macro[\ProvidesPackage]       \NeedsTeXFormat{LaTeX2e}       \ProvidesPackage{textsamples}[2012/02/13 v1.0 sample texts]     \endMacro          \lorem               \begin{Macro}[\lorem]       \newcommand\lorem{\leavevmode          Fusce adipiscing justo nec ante. Nullam in enim.         Pellentesque felis orci, sagittis ac, malesuada et, facilisis in,         ligula. Nunc non magna sit amet mi aliquam dictum.          In mi. Curabitur sollicitudin justo sed quam et quadd.         \par       }     \end{Macro}          \lorem          \emphasis{\tex}     \begin{Macro}[\tex]       \gdef{\tex}{%           \TeX\xspace (*@\sidenote{You can even place sidenotes.%            These notes have no impact on the %           code being written to the file.} @*)       }     \end{Macro}      % closes the open file     \begingroup\lst@EndWriteFile          \section{Full listing of {textsamples.sty}}     \lstinputlisting{textsamples.sty}     \end{document}      Note, I have used `listings` for the verbatim writes and `tcolorbox` for the example self-running box. It also omits `doc's` many useful macros which would still need to be adapted.


title: How to connect different own TikZ macros together + default names of node

text: I will ask you for solution about a little bit more complex problem. Maybe it isn't so hard as it seems to be but, for me it is hard one. Let's say that i want to create four own macros `\objecta`, `\objectb`, `\objectc`, `\objectd` of these drawings: ![objects](http://i.stack.imgur.com/YoSp9.jpg)               \documentclass{article}     \usepackage{tikz}          \newcommand{\objecta}[1]{     \begin{tikzpicture}\draw (0,0)--(1,0)--(1,1)--(0,1)--cycle;                     \draw [->](-0.2,0.5)--(0.5,1.2);                     \node at (-0.5,0.5){#1};     \end{tikzpicture}}                \newcommand{\objectb}[2]{     \begin{tikzpicture}     \draw (0,0)--(2,0)--(2,1)--(0,1)--cycle;     \draw (0.3,0.5)--(0.5,0.5);     \draw (1.5,0.5)--(1.7,0.5);     \draw (0.5,0.35)--(1.5,0.35)--(1.5,0.65)--(0.5,0.65)--cycle;     \node at (0.2,0.8){$\triangledown$};     \node at (1.8,0.2){$T$};     \node at (0.4,1.2){#1};     \node at (-0.3,0.5){#2};     \end{tikzpicture}}          \newcommand{\objectc}{     \begin{tikzpicture}     \node[minimum height=2cm,minimum width=2cm, draw, rectangle] at (0,0) {PI};     \draw (0.3,-1)--(1,0)--(0.3,1);     \end{tikzpicture}}          \def\objectd{\node [circle,draw] {M};}          \begin{document}      .      .      .     \end{document}      ObjectA has only 1 node (label). ObjectB has four nodes (labels) (drawing under first with all labels), but only one is default (T). The rest two objects have default nodes. So my **first question** is how to specify macro where when I put nothing in `{#1} {#2} {#3} ...` the default text will be displayed. So I have these macros, now I want to connect them together like this: ![scheme](http://i.stack.imgur.com/Zgbvz.jpg) It is possible to create a macro or procedure for positioning those objects and macro/procedure for creating paths? Something that i will specify only node of first macro, node of second macro and path will be created. Many thanks. ( sorry for the grammar if it is bad ) EDIT:   * Sorry I'm quite new so don't know right now what I can define as node,anchor,label when I have it only in my mind and you can have different solution. Due that i didn't post any code, because though that for you it will be easier to work with own code not with mine clumsy one.   * problem with the default text of node is minor, mainly I want help with positioning and creating paths from macro to another macro. And if it's possible and how to create macro or procedure for it.   * Added macro code, as you see it is clumsy code. Don't know how to work with node placement (text) to be ok.   * Hmm again my post has to be edited - due pictures   * Will appreciate any help, due I'm hopelessly lost and don't know how to move with it.   * I would like to help more if I could, but dunno move with it


title: Moving the bar on hbar

text: I've been using the mathdesign package (specifically with the garamond font), and whenever I try using `\hbar`, the bar is much too high and to the left. In order to fix this, I wanted to know how to redefine `\hbar` to be an h with a bar that I can move around until it looks aesthetically pleasing.


title: Draw Pareto chart with pgfplots?

text: I've been following the pgfplots documentation to make some basic bar charts, mostly following this example:               \begin{tikzpicture}       \begin{axis}[         ybar, ymin=0,         width=12cm, height=3.5cm, enlarge x limits=0.5,         ylabel={\#participants},         symbolic x coords={no,yes},         xtick=data,         nodes near coords, nodes near coords align={horizontal},         ]         \addplot coordinates {(3,no) (7,yes)};       \end{axis}     \end{tikzpicture}      Now I'd like to overlay a line plot on the bar chart this produces, in order to create a Pareto chart (which uses the line to show cumulative data). Can pgfplots put these two things on the same axis?


title: Draw horizontal line left and right of some text (a single line)

text: I want a horizontal line to the left and right of some text, that is at most one line wide. The lines should be equally sized such that they fill the remaining horizontal space (like two `\hfill`s in a `\hbox`). In case it's not clear what I want, at the top of this page there is a row of buttons labeled **Questions | Tags | Users | Badges | Unanswered**. And above that row of buttons are two horizontal lines filling the remaining space around a symbol. That is what I want to accomplish in LaTeX.


title: Making footnote numbering per-page when using acronym package

text: When I use the acronym package like this :               \usepackage[footnote]{acronym}      The footnotes are numbered across the whole document, which gets ugly when you have more than 10 acronyms in my opinion. So apparently this is a problem with the footnote package, and there are some other footnote packages that allow per-page footnote numbering, but I don't know how to do this with the acronym package ? Thank you very much


title: Hard whitespace

text: I am using plainTeX and would like to typeset some (python) code examples. Switching to `\tt` gets me partway there, but I (obviously) need the whitespace respected. Is there a trick for doing this? The last time I needed this I ended up writing a preprocessor that inserted appropriate `\` everywhere. Oh dear, I guess I also need to eliminate paragraph indenting, and force newlines.


title: Scatterplot with pgfplots

text: I want a 2x2 scatterplot matrix of the data in the file scatter.dat:               0.5334437   0.4824717     0.6848940   0.6865826     0.5818373   0.6335347     0.5465202   0.5290712      The following code works:               \begin{tikzpicture}       \pgfplotstableread{scatter.dat}\myscatter       \begin{groupplot}[           group style={             group size=2 by 2,             horizontal sep=0pt, vertical sep=0pt,             xticklabels at=edge bottom,yticklabels at=edge left},           height=3.5cm,width=3.5cm,         ]              \nextgroupplot         \addplot+[only marks] table[header=false,x index=0,y index=0] {\myscatter};         \nextgroupplot         \addplot+[only marks] table[header=false,x index=0,y index=1] {\myscatter};         \nextgroupplot         \addplot+[only marks] table[header=false,x index=1,y index=0] {\myscatter};         \nextgroupplot         \addplot+[only marks] table[header=false,x index=1,y index=1] {\myscatter};       \end{groupplot}     \end{tikzpicture}      I would prefer an automatic version with loops for larger scatter plot matrices by modifying the code from above as follows:               \begin{tikzpicture}       \pgfplotstableread{scatter.dat}\myscatter       \begin{groupplot}[           group style={             group size=2 by 2,             horizontal sep=0pt, vertical sep=0pt,             xticklabels at=edge bottom,yticklabels at=edge left},           height=3.5cm,width=3.5cm,         ]              \foreach \columnA in {0,...,1} {           \foreach \columnB in {0,...,1} {             \nextgroupplot             \addplot+[only marks]                table[header=false,x index=\columnA,y index=\columnB]               {\myscatter};           }         }       \end{groupplot}     \end{tikzpicture}      However, compiling this code with pdflatex yields the following error:               ! Illegal unit of measure (pt inserted).     <to be read again>


title: File biblatex.sty and eforms.sty not found

text: I tried compiling a file that uses the `fancytooltips` package, according to Gonzalo Medina's answer at Showing the bibliographic entry in a popup when you hover over the citation key. And it cannot find some .sty files. How can I fix it? I'm on Ubuntu and compiling on command line using `pdflatex`.               ! LaTeX Error: File `biblatex.sty' not found.          Type X to quit or <RETURN> to proceed,     or enter new name. (Default extension: sty)          Enter file name:      (/usr/share/texmf-texlive/tex/latex/fancytooltips/fancytooltips.sty     (/usr/share/texmf-texlive/tex/latex/ms/everyshi.sty)     (/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty     (/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)     (/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty     (/usr/share/texmf-texlive/tex/latex/graphics/trig.sty)     (/etc/texmf/tex/latex/config/graphics.cfg)))     (/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty     (/usr/share/texmf-texlive/tex/generic/xkeyval/xkeyval.tex))     (/usr/share/texmf-texlive/tex/latex/eso-pic/eso-pic.sty)          Package fancytooltips Warning: ** The filename with tooltips is not given. ** o     n input line 52.               ! LaTeX Error: File `eforms.sty' not found.          Type X to quit or <RETURN> to proceed,     or enter new name. (Default extension: sty)          Enter file name:


title: MacPorts: install packages for use in Texmaker

text: I'm using Texmaker and want to install the package `algorithmicx` to write some pseudocode. I've tried using MacPorts to download and install the package but I can't seem to load it in Texmaker or in TeXShop. Also, MacPorts appeared to download a new distribution of TeX Live. How do I use the downloaded package, and what does MacPorts actually do with the packages I download?


title: Stretching text in a node in a tree

text: I'm trying to make a try, similar to the one visible here. ![enter image description here](http://i.stack.imgur.com/Uhebh.png) As it is seen in the example, the writer wrote `Bag 1 $4W, 3B$` and got it in two different lines. I don't want that; I want the lines to be complete (I'm having my growing direction upwards, so it's okay). How do I do that?


title: Is there a way to uncover arrows in an xymatrix?

text: Is there a way to uncover arrows in an `xymatrix`? Usually when I have problems with `\uncover` I use multiple frames, but I would like to be able to do this on a single frame. Here is a sample: I would like the first slide to read "B", and then uncover "A →". The following code doesn't cover the "→".               \documentclass{beamer}     \usepackage[all]{xy}              \begin{document}          \begin{frame}[plain]          \xymatrix{     \uncover<2->{A \ar[r]}& B     }          \end{frame}          \end{document}


title: PdfLaTeX in Texmaker doesn’t work: “Could not start the command”

text: I have a problem with LaTeX. I have installed MiKTeX 2.9 and Texmaker, and when I try to compile a `.tex` file in Texmaker, I get the error               Could not start the command      When I try to build it from the terminal (using pdfLaTeX) it works, though. By the way, I have found the same question here, but when I try to do as in the answers (i.e., go to `options` > `configure` and then choose the correct documents for LaTeX and pdfLaTeX) it doesn't work. What can I do, other the build my files every time from the terminal? ![My configuration](http://i.stack.imgur.com/CORiC.png)


title: AUCTeX's csquotes integration does not work together with babel

text: I use the AUCTeX feature to expand `"` into `csquotes` macros. To enable it I have put the following in my .emacs:               ;; " expands into csquotes macros     (setq LaTeX-csquotes-close-quote "}"           LaTeX-csquotes-open-quote "\\enquote{")      However, when I use it together with `babel` `"` is not expanded to `csquotes` macros. For instance, pressing `"` in the following example               \documentclass{article}          \usepackage[danish]{babel}     \usepackage{csquotes}          \begin{document}          \end{document}      results in > "` Here is a screenshot of when I press `"` inside the `document` environment: ![Screenshot of what happens when I press "](http://i.stack.imgur.com/woj6b.png) What I would like to happen is that `\enquote{` is inserted.


title: How does TeX actually work?

text: Lots of useful information for human beings, especially in academia. But, what is actually underlying the TeX engine? How does it really work? Does it parse everything and just put the stuff together? Or any special spec info?! Or even any good resources for further reading? How is it possible to write some modules and how to develop something more for the community?


title: What are the relative strengths of TikZ and Asymptote?

text: I want to compare TikZ and Asymptote for their abilities in 2D & 3D functional plot and other general purpose, simple drawings. What are the strong aspects of TikZ over Asymptote?