title: mdframed error missing begin{document}

text: I'm trying to use `mdframed` package. I had a problem running the file `Makefile` on ubuntu but I found and installed the `md-frame-0-1-2-3.mdf` files from another pc along with the `.cls` file my code is               \documentclass{book}          \usepackage{mdframed}              \begin{document}         hello     \end{document}      and I got this error file any help would be welcomed.


title: Is there a "selective" input command in LaTeX?

text: I'm likely going to have to write a document that includes some portions of source code, which I'd rather keep in separate source files. I know that I can include the contents of those files in my document using `\input{example.cpp}`, and use various environments to pretty-print the code, but the source files will certainly start with a few commented lines explaining what the code does, whether it can be redistributed and so on, and this will be irrelevant in the main document. Is there a package or a specific command that allows me to omit those lines when including an external file?


title: Package for taking notes

text: After reading a book, I often take notes on that book. It usually has my thoughts about what I have just read and many cites (often long, more that 2 or 3 paragraphs, sometimes even more than one page). I used to just type that all in LaTeX, but such notes are hard to read and look ugly (there is no visible diference betwen cites and my thoughts; cites are just marked with ,, and ''). My question is: is (are) there a good method(s) to taking notes using LaTeX? I don't have much experience in TeX field, I know basics packages. I want to have nice looking notes, with visible difference between thoughts and cites and easy to read. Should I use some packages or styles? Or something else? How to do this? Thank You for help.


title: List of abbreviations

text: Is there a way to get an alphabetical list of abbreviations automatically? At the moment I have:               \begin{longtable}{ll}          APC & antigeen-presenterende cel \\          \end{longtable}      I use `longtable` because my table is very long.


title: Xindy error: "A" does not name a letter group

text: I have a problem with calling the makeglossaries script. Here is a MWE:               % !TeX program = xelatex     % !TeX encoding = utf-8     % !TeX spellcheck = ru_RU          \documentclass[12pt, a4paper]{article}          \usepackage{polyglossia}     \setdefaultlanguage{russian}     \setmainfont[Ligatures=TeX]{Times New Roman}          \usepackage[xindy]{glossaries}     \makeglossaries          \begin{document}          \newacronym{exm}{123}{Пример} % russian acronym          Штука называется \gls{exm}. % some russian text          \printglossaries          \end{document}      System: Windows 8, TeX Live 2013 (up to date), TeXstudio as IDE. The first compile run is fine - I get .glo .glsdefs and .xdy files. When I run makeglossaries script after, I receive the following log with error:                ERROR: "A" does not name a letter group in      (DEFINE-LETTER-GROUP "glsnumbers" :PREFIXES      ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9") :BEFORE "A")           *** Unable to execute: '"xindy"  -L russian -C utf8 -I xindy -M "temp" -t "temp.glg" -o "temp.gls" "temp.glo"' ***           Failed with error code 1.           Status report:           Opening logfile "temp.glg" (done)      Reading indexstyle...      Loading module "0tI0EhWrtr"...      Loading module "lang/russian/utf8-lang.xdy"...      Loading module "lang/russian/utf8.xdy"...      Finished loading module "lang/russian/utf8.xdy".      Finished loading module "lang/russian/utf8-lang.xdy".      Loading module "temp.xdy"...      Loading module "tex.xdy"...      Finished loading module "tex.xdy".           Error in line 426:                ; additional letter groups           (define-letter-group "glsnumbers"         :prefixes ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")         :before "A")      ERROR: "A" does not name a letter group in      (DEFINE-LETTER-GROUP "glsnumbers" :PREFIXES       ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9") :BEFORE "A")      C:\Dev\TeXLive\2013\bin\win32\runscript.tlu:650: command failed with exit code 1:      perl.exe c:/Dev/TeXLive/2013/texmf-dist/scripts/xindy/xindy.pl -L russian -C utf8 -I xindy -M "temp" -t "temp.glg" -o "temp.gls" "temp.glo"      I can't understand, why is this happenning. Any help is much appreciated.


title: How to clip an external image inside an ellipse

text: I am trying to create a fancy image by clipping an external image by an ellipse- the area inside the ellipse will be shown only. I have seen this, but I still need help. Can anybody help? Here's an instance of what I am saying: ![img](http://i.stack.imgur.com/VeBOl.jpg)


title: \rule not aligned

text: The `\rule`s not aligned. I want to be in parallel to be each other and start from the same position horizontally. Here is the code:               \documentclass[12pt]{book}     \begin{document}     \begin{titlepage}     \rule{\linewidth}{4pt}     \rule{\linewidth}{4pt}     \end{titlepage}     \end{document}       ![enter image description here](http://i.stack.imgur.com/pYoiQ.png)


title: how to draw a diagram that forks out, then joins in the middle then forks out again?

text: **Update:** ref comments: I've slightly corrected the terminology and the title. I am using the term diagram now, instead of tree, and I am just asking on how to draw this diagram in Tikz. Any tool or library would be OK. I used qtree since that is what I know now, any other method is welcome. **end of update** I'd like help/hint on how to draw this diagram ![enter image description here](http://i.stack.imgur.com/htdFl.jpg) The part I am having problem with is how to make it go from `B C` children to one node `D` then fork out again. This is latest attempt. I tried also to use `grow'=up` in the middle, but could not figure the syntax without splitting it into two pictures. I wanted it all to be one picture.               \documentclass{article}     \usepackage{tikz}     \usepackage{tikz-qtree}          \begin{document}     \tikzset{font=\small,              edge from parent path={(\tikzparentnode.south) -- +(0,-8pt) -| (\tikzchildnode)}}          \begin{tikzpicture}         \Tree [.A                  [.B ]                  [.C ]               ]     \begin{scope}[xshift=0in,yshift=-1.5cm]         \Tree [.D                  [.E ]                  [.F ]               ]     \end{scope}     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/WFgqj.jpg) **update 7/21/13 1 AM** Here is a general diagram as requested. But I am not really asking someone to draw all of this for me in Tikz, I was just asking for the technique on how to join then fork in a middle of building a general diagram since all the examples I've seen seem to show forks at each node. ![enter image description here](http://i.stack.imgur.com/hKWea.jpg)


title: Table widths have changed - rerun LaTeX

text: I have an application which stores LaTeX documents, and then (when the user clicks on a link) renders them into PDF files to be downloaded or viewed. This works well in general, but I'm running into a small problem. Sometimes (it's not totally clear to me under what circumstances this happens), when a file is rendered with `pdflatex`, a warning will be issued: `Table widths have changed. Rerun LaTeX.` And the resulting PDF, although rendered, will be incorrect (namely, column headers seem to be mis-aligned relative to the actual body columns of the table. Doing as the warning instructs, and running `pdflatex` a second time on the input file, renders the PDF completely correctly (everything aligned properly), with no warnings. As an example, here is a table which exhibits this problem:               \begin{longtabu}{ r r r r r }     \multicolumn{1}{c}{\textbf{Description}} &         \multicolumn{1}{c}{\textbf{Available}} &         \multicolumn{1}{c}{\textbf{Billed}} &         \multicolumn{1}{c}{\textbf{Current}} &         \multicolumn{1}{c}{\textbf{Remaining}} \\     \endhead     1 - Foo & \$1,791.04 & \$0.00 &         \$1,567.16 & \$223.88 \\     2 - Bar & \$58,730.01 & \$0.00 &         \$19,579.01 & \$39,151.00 \\     Baz & \$6,839.00 & \$0.00 &         \$0.00 & \$6,839.00 \\     \hline     \textbf{Profit} & \textbf{\$14,255.48} & \textbf{\$0.00} &         \textbf{\$2,581.85} & \textbf{\$11,673.63} \\     \textbf{Total} & \textbf{\$145,055.13} &         \textbf{\$0.00} & \textbf{\$25,032.69} & \textbf{\$120,022.44} \\     \end{longtabu}      I suppose there are two ways to answer my question:   * Am I causing this warning by giving `pdflatex` some "smelly" input? If so, how should I adjust my code to avoid this issue?   * Is there some way to tell `pdflatex`, "just re-run yourself if needed, don't tell me about it"? The naive solution to this issue would be to just detect this warning and then re-run `pdflatex`, but this seems like a very messy way to solve my problem. It seems that, from e.g. this question, these repeated runs may simply be necessary. In this case, I'd like to make `pdflatex` do it automatically, rather than having to run it by hand two or more times.


title: Special Unicode characters with XeTeX

text: Most of the modern fonts out there are encoded in Unicode, but provide only a subset of the whole range of glyphs defined in Unicode. Most lack the _Latin Extended Additional_ range (http://www.unicode.org/charts/PDF/U1E00.pdf). In TeX, characters outside the ASCII range can be constructed with commands like `\"a` for ä, `\=a` for ā, `\\.n` for ṅ etc. It seems this mechanism is not supported in XeTeX. You can still use those commands like `\d{m}` to get a `ṃ`, but if it it's not in the font, it will not be constructed from `.m` as in TeX, so they are of no help in XeTeX. Then I was happy to find the `newunicodechar` package which can redefine characters, like `\newunicodechar{ṃ}{\d{m}}` and then just type ṃ in the document, but although this works in pdfTeX, is doesn't work in XeTeX since the latter just lacks the "character building function". So XeTeX will again try to find the character in the font, where it is not available. The only way to get the character printed is to substitute the font for those special characters (also by way of `\newunicodechar`for example). But this may look rather ugly. Packages like `\usepackage[utf8x]{inputenc}` are also not compatible with XeLaTeX, at least not in my installation (MikTeX 2.9). At least this is my conclusion after some hours of trial and error. So it seems for my document I either have the choice to go back to (pdf)LaTeX and miss the easy font features of XeLaTeX, or I have to substitute the font with another one for the special characters. Or is there another way to get around the problem without having to fall back on pdfLaTeX? Here is the MWE for pdfLaTeX, or XeLaTeX if you remove the % and put them in front of the `\usepackage{palatino}`.               \documentclass[a4paper,12pt]{article}          % \usepackage{fontspec}  % <----- XeLaTeX     % \defaultfontfeatures{Mapping=tex-text}      % \setmainfont{Adobe Garamond Pro} % <-- or another font without Latin Ext. Additional          \usepackage{palatino}  % <---- pdfLaTeX          \usepackage{newunicodechar}          % \newfontfamily{\diafont}{Junicode} % <---- redefining the font works in XeLaTeX      % \newunicodechar{ṃ}{\diafont ṃ}          \newunicodechar{ā}{\={a}} % <-- character substitution works in pdfLaTeX     \newunicodechar{ṃ}{\d{m}} %    but could also be achieved bei inputenc package     \newunicodechar{ṅ}{{\.n}}          \begin{document}     German Umlaute:      \begin{itemize}      \item Unicode characters: ä ö ü Ä Ö Ü      \item by \LaTeX command: \"a \"o \"u \"A \"O \"U          \end{itemize}          a with macron above:     \begin{itemize}     \item by function: ā     \item by \LaTeX: {\=a}     \end{itemize}          m with dot underneath:      \begin{itemize}     \item by function: ṃ     \item by \LaTeX: \d{m}     \end{itemize}          n with dot above:     \begin{itemize}     \item by function: ṅ     \item by \LaTeX: {\.n}     \end{itemize}          \end{document}


title: How to convert a TeX file with custom commands into LyX?

text: LyX doesn't understand certain pieces of a .tex file when it converts it into .lyx via `tex2lyx` program. For instance:               \rowcolors{1}{gray!15}{white}      If this line is present in the .tex file, LyX imports it as a mix of tex code and simple text: ![enter image description here](http://i.stack.imgur.com/0eQTL.png) How to convert this case properly? Apart from using `\input` and `\include` for each line of code? Or using `\input` for the entire block inside `\begin{document}`?


title: Problem formula with \usepackage{marvosym} \usepackage{tikzsymbols} \usepackage{MnSymbol,wasysym}

text: I have the following code:               \documentclass[12pt,a4paper]{article}     \newcounter{conto}     \setcounter{conto}{\time}     \usepackage{lmodern}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{ dsfont }     \usepackage{mathrsfs}     \usepackage[a4paper,top=1cm,bottom=2cm,left=3cm,right=3cm]{geometry}     \begin{document}     \begin{flushleft}     \section{Prove}     \( x \in A \subseteq \mathcal{P}(B)\)      \end{flushleft}     \end{document}      and the output is: ![enter image description here](http://i.stack.imgur.com/sttQR.png) but if I have:               \documentclass[12pt,a4paper]{article}     \newcounter{conto}     \setcounter{conto}{\time}     \usepackage{lmodern}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{ dsfont }     \usepackage{mathrsfs}     \usepackage[a4paper,top=1cm,bottom=2cm,left=3cm,right=3cm]{geometry}     \usepackage{marvosym}     \usepackage{tikzsymbols}     \usepackage{MnSymbol,wasysym}     \begin{document}     \begin{flushleft}     \section{Prove}     \( x \in A \subseteq \mathcal{P}(B)\)      \end{flushleft}     \end{document}      the output is: ![enter image description here](http://i.stack.imgur.com/yoTK0.png) Why Are outputs different? Thanks in advance!


title: Sub-figures in multiple pages but with one figure caption and showing "continued on next page"

text: The below code (together with Knitr package in R) creates figures on 3 pages under one caption of "Figure 1: Lots of figure". What I want to have is something like "footer" underneath figures in pages 1 and 2 saying "continued on next page". Similar as how "longtable" handles with the split of a long table over pages. Or maybe "Figure 1: Lots of figure (continued)" as captions for figures on pages 2 and 3? Can someone help? -Yaming               \documentclass[letterpaper]{article}     \usepackage{morefloats}     \usepackage{caption}          \begin{document}          \begin{center}     \captionof{figure}{Lots of figure}          <<test, echo=FALSE, fig.show='hold'>>=     library(lattice)     dat <- data.frame(x = rnorm(100),                       y = rnorm (100),                       a = rep(1:5, ea = 2)                       )     xyplot(y~x|a,            data = dat,            layout = c(2, 1)            )     @          \end{center}          \end{document}      ![Figures over pages](http://i.stack.imgur.com/ZnZmP.jpg)


title: Why do I have to set the pagestyle to fancy before setting it to something else?

text: I have a minimal example here that creates lowercase headings.               \documentclass[12pt, a4paper, oneside, onecolumn]{book}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[ngerman]{babel}     \usepackage[round]{natbib}          \usepackage{lipsum, filecontents}     \usepackage{fancyhdr}          \pagestyle{fancy}          \renewcommand{\chaptermark}[1]{%     \markboth{#1}{}}     \renewcommand{\sectionmark}[1]{%     \markright{\thesection\ #1}}     \fancyhf{} % delete current header and footer     \fancyhead[LE,RO]{\bfseries\thepage}     \fancyhead[LO]{\bfseries\rightmark}     \fancyhead[RE]{\bfseries\leftmark}     \renewcommand{\headrulewidth}{0.5pt}     \renewcommand{\footrulewidth}{0pt}     \addtolength{\headheight}{0.5pt} % space for the rule     \newcommand{\plainplain}{%       \fancypagestyle{plain}{%           \renewcommand{\headrulewidth}{0pt}           \fancyhead[LO]{}           \fancyhead[RE]{}     }}     \newcommand{\myplain}{%       \fancypagestyle{plain}{%         \fancyhead[LO]{\bfseries\rightmark}         \fancyhead[RE]{\bfseries\leftmark}         \renewcommand{\headrulewidth}{0.5pt}         }}          \plainplain     \pagestyle{plain}          \begin{document}          \frontmatter     \pagenumbering{Roman}          \tableofcontents     \clearpage          \listoffigures     \clearpage          \chapter*{Abkürzungsverzeichnis}     \lipsum[1-4]     \clearpage          \listoftables     \clearpage          \mainmatter % implies arabic pagenumbering     \myplain     \pagestyle{plain}          \chapter{Introduction}     \lipsum[1-7]          \section{New Section}     \lipsum[8-14]          \clearpage     \plainplain     \pagestyle{plain}          \backmatter     \pagenumbering{roman}     \setcounter{page}{5}          \nocite{mybook1}          \bibliographystyle{plainnat}          \begin{filecontents}{bibliography.bib}     @book{mybook1,         title = {Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod         tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,         quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo         consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse         cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non         proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod         tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,         quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo         consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse         cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non         proident, sunt in culpa qui officia deserunt mollit anim id est laborum.},         author = {myauthor},         year = {2010}     }     \end{filecontents}          \bibliography{bibliography}     \end{document}      If you instead comment out the first `\pagestyle{fancy}`, some of the section headlines become uppercase. Here is the same code again, but `\pagestyle{fancy}` is removed.               \documentclass[12pt, a4paper, oneside, onecolumn]{book}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[ngerman]{babel}     \usepackage[round]{natbib}          \usepackage{lipsum, filecontents}     \usepackage{fancyhdr}          % \pagestyle{fancy}          \renewcommand{\chaptermark}[1]{%     \markboth{#1}{}}     \renewcommand{\sectionmark}[1]{%     \markright{\thesection\ #1}}     \fancyhf{} % delete current header and footer     \fancyhead[LE,RO]{\bfseries\thepage}     \fancyhead[LO]{\bfseries\rightmark}     \fancyhead[RE]{\bfseries\leftmark}     \renewcommand{\headrulewidth}{0.5pt}     \renewcommand{\footrulewidth}{0pt}     \addtolength{\headheight}{0.5pt} % space for the rule     \newcommand{\plainplain}{%       \fancypagestyle{plain}{%           \renewcommand{\headrulewidth}{0pt}           \fancyhead[LO]{}           \fancyhead[RE]{}     }}     \newcommand{\myplain}{%       \fancypagestyle{plain}{%         \fancyhead[LO]{\bfseries\rightmark}         \fancyhead[RE]{\bfseries\leftmark}         \renewcommand{\headrulewidth}{0.5pt}         }}          \plainplain     \pagestyle{plain}          \begin{document}          \frontmatter     \pagenumbering{Roman}          \tableofcontents     \clearpage          \listoffigures     \clearpage          \chapter*{Abkürzungsverzeichnis}     \lipsum[1-4]     \clearpage          \listoftables     \clearpage          \mainmatter % implies arabic pagenumbering     \myplain     \pagestyle{plain}          \chapter{Introduction}     \lipsum[1-7]          \section{New Section}     \lipsum[8-14]          \clearpage     \plainplain     \pagestyle{plain}          \backmatter     \pagenumbering{roman}     \setcounter{page}{5}          \nocite{mybook1}          \bibliographystyle{plainnat}          \begin{filecontents}{bibliography.bib}     @book{mybook1,         title = {Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod         tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,         quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo         consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse         cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non         proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod         tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,         quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo         consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse         cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non         proident, sunt in culpa qui officia deserunt mollit anim id est laborum.},         author = {myauthor},         year = {2010}     }     \end{filecontents}          \bibliography{bibliography}     \end{document}      I thought that `\pagestyle{fancy}` would be unnecessary there because the pagestyle is later defined to be `\pagestyle{plain}` and `plain` itself is redefined. Why do I have to set the pagestyle to something that I do not use at all when configuring fancyhdr?


title: \cite without hyperlink (Citation in captions)

text: I want cite a reference (by using `\citet`, `\citeauthor` or `\citeyear`.) inside a `\caption{}`. Something like this:               \caption{Characteristics assessed in \citet{perell_fall_2001}}      I'm using the `natbib` package as well as `hyperref`. The thing is that I don't want the reference to have the hyperlink to its bibliography entry (because it looks awful in the list of tables at the beginning of the document). Is there any way to achive this? I've found one question very close to what I'm looking for: Selected references without hyperlink But it is for `\ref`, not for `\cite`... MWE:               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{tabularx}     \usepackage{natbib}     \usepackage{hyperref}          \begin{document}          \begin{table}\small     \centering         \caption{Characteristics assessed in \citet{perell_fall_2001}}         \newcolumntype{Y}{>{\raggedright\arraybackslash}X}         \begin{tabularx}{\textwidth}{YY}     \bfseries Patient Characteristic & Number of studies\\     \firsthline\\     Mental status or cognitive impairment & 5 \\             \lasthline\\         \end{tabularx}         \label{tab:PerrellAssesment}     \end{table}          \nocite{*}     \bibliographystyle{IEEEtranSN}     \bibliography{refs}               \end{document}      Where `refs.bib` is:               @article{perell_fall_2001,         title = {Fall Risk Assessment Measures An Analytic Review},         volume = {56},         issn = {1079-5006, 1758-{535X}},         url = {http://biomedgerontology.oxfordjournals.org/content/56/12/M761},         doi = {10.1093/gerona/56.12.M761},         number = {12},         journal = {The Journals of Gerontology Series A: Biological Sciences and Medical Sciences},         author = {Perell, Karen L. and Nelson, Audrey and Goldman, Ronald L. and Luther, Stephen L. and Prieto-Lewis, Nicole and Rubenstein, Laurence Z.},     }


title: Enumerate: only indent numbers

text: I want to make the `enumerate` environment look like this:                   1. First item [...]     [first item continued]         2. Second item [...]      That is, the text should look like normal body text except with indented numbers. I'd like to be able to control the vertical spacing between items as well, so that I have the option of changing it from the default value to zero. Here is an MWE:               \documentclass{article}     \usepackage{lipsum}     \begin{document}          \begin{enumerate}        \item \lipsum[1]        \item \lipsum[2]     \end{enumerate}          \end{document}


title: Biblatex-apa trouble: missing package?

text: I can't get my build to work. When I try I get these errors: There were errors in your LaTeX source               /usr/share/texlive/texmf-dist/tex/latex/biblatex-apa/apa.bbx:194: Undefined control sequence. [\DeclareLabeldate]     /usr/share/texlive/texmf-dist/tex/latex/biblatex-apa/apa.bbx:195: Undefined control sequence. [  \field]     /usr/share/texlive/texmf-dist/tex/latex/biblatex-apa/apa.bbx:195: LaTeX Error: Missing \begin{document}. [  \field{p]     /usr/share/texlive/texmf-dist/tex/latex/biblatex-apa/apa.bbx:196: Undefined control sequence. [  \field]     /usr/share/texlive/texmf-dist/tex/latex/biblatex-apa/apa.bbx:197: Undefined control sequence. [  \literal]     /usr/share/texlive/texmf-dist/tex/latex/biblatex-apa/apa.bbx:224: Package keyval Error: labeldate undefined. [                            eventdate=comp}]     /usr/share/texlive/texmf-dist/tex/latex/biblatex-apa/apa.bbx:224: Package keyval Error: datelabel undefined. [                            eventdate=comp}]     /usr/share/texlive/texmf-dist/tex/latex/biblatex-apa/american-apa.lbx:71: Package keyval Error: reprintfrom undefined. [}]      The file is not changed at all, and is working on another ubuntu system. I assume there is some packages I'm missing, but I can't solve it..


title: Electron distribution box diagram

text: Just for sharing. Improvements are welcome.               \starttext          Electron distribution box diagram          \startMPcode     picture finalpicture ; finalpicture := nullpicture ;     numeric n ; n := 0 ; bboxmargin := 0pt ;          vardef boxx(expr nu, orbitalname)=         draw unitsquare scaled 1cm;        path p; p:= origin shifted(.333cm,.1cm) -- origin shifted (.333cm, .8cm);        if nu<>0:        drawarrow p; fi;        if nu=2: drawarrow (reverse p ) shifted (.3cm,0); fi;         label(textext(orbitalname) scaled .7, (.5cm,1.3cm));        addto finalpicture also currentpicture shifted(n*1.1cm,0) ;         currentpicture := nullpicture ; n := n+1 ;         enddef;                vardef box(expr nu, orbitalname)=            numeric N;          if orbitalname ="2p":             if nu<=3:            N:=nu-1; boxx(1, "2px"); boxx(min(N,1),"2py"); N := max(N-1,0); boxx(N,"2pz");             elseif nu=6:            boxx(2,"2px"); boxx(2,"2py"); boxx(2,"2pz");            elseif nu=5:             boxx(2,"2px"); boxx(2,"2py"); boxx(1,"2pz");                  else:                  boxx(2,"2px"); boxx(1,"2py"); boxx(1,"2pz");             fi;             elseif orbitalname ="3p":             if nu<=3:            N:=nu-1; boxx(1, "3px"); boxx(min(N,1),"3py"); N := max(N-1,0); boxx(N,"3pz");             elseif nu=6:            boxx(2,"3px"); boxx(2,"3py"); boxx(2,"3pz");            elseif nu=5:             boxx(2,"3px"); boxx(2,"3py"); boxx(1,"3pz");                  else:                  boxx(2,"3px"); boxx(1,"3py"); boxx(1,"3pz");             fi;            else: boxx(nu,orbitalname);          fi;       enddef;       box(2,"1s");       box(2,"2s");       box(6,"2p");           box(2,"3s");       box(5,"3p");           currentpicture := finalpicture ;          \stopMPcode          \stoptext


title: Check Printing With EC13B Font in PDFLaTeX

text: I have made a template for printing checks from blank check stock but I am stuck on printing the MICR E-13B font at the bottom. I have found the true type font here. I am using PDFLaTeX but can't seem to find any information on specifying a font with anything other than XeLaTeX. Is this possible with PDFLaTeX? The numbers at the base of the check are mostly static (account and routing number) but the check number is dynamic so that rules out a work around of simply positioning a pre-made EPS.


title: XeLatex: problem with aux-directory and include-directory options on TexLive?

text: I am trying to port some app from MikTex to TexLive (Windows to Ubuntu basically). The options that works perfectly fine with MikTex just ended up as not recognized for TexLive The options in question are 'include-directory' and 'aux-directory' for XeLatex. Tried the default TexLive 2009 of Ubuntu as well as the latest TexLive 2012 - same result as below:               /usr/local/texlive/2012/bin/x86_64-linux/xelatex: unrecognized option '-aux-directory=/home/user/Desktop/Tex/Aux_sample3_MT2886/'     /usr/local/texlive/2012/bin/x86_64-linux/xelatex: unrecognized option '-include-directory=/mnt/host/WinApp/CarMusTy/bin/template'     /usr/local/texlive/2012/bin/x86_64-linux/xelatex: unrecognized option '-include-directory=/mnt/host/WinApp/CarMusTy/src/res/fonts/wip'     This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012)      No difference if -aux-directory or --aux-directory. And the 'xetex -- help' command does not show those options either. Wondering if these are MikTex specific options or if I am missing something. Help is appreciated. Thank you. ps: For those curious, this is happening in the CarMusTy application while building the generated tex files on ubuntu (which works perfectly fine on Windows with MikTex, though)


title: Writing big block matrix in double column using IEEEtran class

text: I'm writing a paper in IEEE journal format. I have a BIG matrix as follows:               \begin{align}     \begin{bmatrix}     \begin{pmatrix}     E^\top KA &0 \\     0 &V^\top E^\top U \hat{K} U^\top AV     \end{pmatrix} +     \begin{pmatrix}     A^\top KE &0 \\     0 &V^\top A^\top U \hat{K} U^\top EV     \end{pmatrix}     &\begin{pmatrix}     E^\top KB \\     V^\top E^\top U \hat{K} U^\top B     \end{pmatrix} \\     \begin{pmatrix}     B^\top KE &B^\top U \hat{K}U^\top EV     \end{pmatrix}     &0     \end{bmatrix} + \cr     \begin{bmatrix}     \begin{pmatrix}     C^\top C &-C^\top CV \\     -V^\top C^\top C &V^\top C^\top CV     \end{pmatrix}     &0 \\     0 &-\gamma^2 I     \end{bmatrix} = Q_2 \preceq 0     \end{align}      How can i make it fit in the two column paper format? I am relatively new to LaTeX. Thanks in advance.


title: How can I type an expression of a column vector

text: I want to type a column vector like below:                    [  dx     ]     UI = [  dy     ]          [  dtheta ]      `U` is the name of this vector, and `I` is the subscript. Two brackets like the matrix style. `dx`, `dy` and `dtheta` are actually three items with a dot on their head, and theta is a Greek letter.


title: How to make the first page of a latex document like other pages

text: I am writing a paper with the article document class. The first page contains a large footer than other pages. I want to make it filled with text like the other pages and contains the same footer. a minimal working code is:               \documentclass[11pt]{article}     %\usepackage[width=5cm,height=20cm]{geometry}     \usepackage[b5paper,lmargin=2cm,rmargin=2cm,tmargin=2.5cm,bmargin=4.3cm]{geometry}     \usepackage{graphicx} % for pdf, bitmapped graphics files     %\usepackage{indentfirst}     \usepackage{amsmath} % assumes amsmath package installed     \usepackage{amssymb}  % assumes amsmath package installed     %\usepackage{deleq} % to divide on equation     %\usepackage{bbm} % to represent the space dimension     %\usepackage{bbding} % to represent the space dimension     \usepackage{dsfont} %to represent the space dimension     \usepackage{color}     \usepackage{algorithm}     \setcounter{secnumdepth}{3}     \usepackage{multicol}%%%%%%%%%%%%     %\usepackage{lipsum}%%%%%%%%%%%%%%%%%%%     \usepackage{theorem}     \newtheorem{theorem}{Theorem}     \newcounter{tempcount}     \graphicspath{{figures/}}          \usepackage[T1]{fontenc}     \usepackage{mathptmx}     \usepackage{titlesec}     \titleformat{\section}[block]       {\fontsize{12}{15}\bfseries\rmfamily}       {\thesection}       {1em}       {}     \titleformat{\subsection}[hang]       {\fontsize{12}{15}\itshape\rmfamily}       {\thesubsection}       {1em}       {}     \titleformat{\subsubsection}[hang]       {\fontsize{12}{15}\itshape\rmfamily}       {\thesubsubsection}       {1em}       {}       %\usepackage{fontspec}     %\setmainfont{Times New Roman}     \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhead{}     \fancyfoot{} %\fancyfoot[LE,RO]{\thepage}     %\fancyhead[L] {\thepage\\}CO,CE     %\fancyhead[le,ro]{}     \fancyhead[le,ro]{\thepage\\ \it{LPVIOID-Toolbox .}}     \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\footrulewidth}{0.4pt}     %\headsep=10pt     \footskip=13pt          \titlespacing\section{0pt}{6pt}{6pt}     \titlespacing\subsection{0pt}{6pt}{6pt}     \titlespacing\subsubsection{0pt}{6pt}{6pt}          \renewcommand*{\thefootnote}{\fnsymbol{footnote}}     \newcommand{\ParGraph}{\\ \indent}     \usepackage[noblocks]{authblk}     \title{\bfseries \fontsize{13}{15}\selectfont     LPVIOID- toolbox}          \author[ ]{\bfseries \fontsize{11}{13}\selectfont Mustafa Rabeei}     \affil[ ]{\itshape \fontsize{10}{15}\selectfont Electrical Engineering Department.      E-mails: {\tt eng.mustafa.rabeay@gmail. }}          \usepackage{lipsum}          \begin{document}     \date{}     \graphicspath{{figures/}}     \maketitle     \thispagestyle{fancy}     %\thispagestyle{empty}     %\pagestyle{empty}     %\pagestyle{headings}     \setcounter{page}{1}          \pagenumbering{arabic}          \section{the first section}     \lipsum     \section{the second section}     \lipsum[1-10]     \end{document}


title: Lyx underbrace is broken

text: While using underbrace in Lyx, the result looks really bad. ![enter image description here](http://i.stack.imgur.com/r2XoP.png) The left to are done with `Ctrl`+`L` option, with `\underbrace{Earth}_{E}` (or similar), and the right three are `\overset{\underbrace{Comparison\, to}}{I}` or similar. As you can see, the brace is broken. How can I fix this?


title: PdfTexify versus dvi2pdf: problem with eps figure

text: I have problem to get eps pictures when I use PdfTexify in WinEdt 8.0 (MikTeX 2.9). It works if I use dvi2pdf, but I prefer PdfTexify, because it allows me to include attachments in pdf file as well as to make hyperlinks on references. Here is sample code               \documentclass[aps,pra,amsmath,amssymb,twocolumn,showpacs]{revtex4-1}     \usepackage{epsf}     \usepackage{graphicx}     \usepackage{attachfile}     \begin{document}     \begin{figure}[htb]        \epsfxsize=6.5cm\centering{\epsfbox{f/1.eps}}     \end{figure}     check attached here \attachfile{2013-05-17.nb}     \end{document}      Also, I would like to know which of those two ways to get PDF output is more preferred/professional? Or is there a more professional way? Thank you in advance.


title: Plain text index via pdflatex

text: I would like to obtain a plain text version of the index so thought it might be easier to extract it from the existing packages somehow. The MWE below produces: ![enter image description here](http://i.stack.imgur.com/jIeMP.png) What I want is a text file containing:               Fiction:         Star Trek,          Jedi:         Star Wars,          Science:         Star Trek,          Science Fiction:         Star Trek,         Star Wars,          Spock:         Star Trek,      ## Notes:   * I have numerous files which will each be generating the temp files in a similar manner as below. I would like to post-process the all the temporary files and obtain a single combined index.   * Not at all concerned with the page numbers.   * I thought of writing a script that `greps` the files for the appropriate macros but thought that there might be a more elegant method either using the existing `\index` functionality or some other technique.   * Not stuck on the syntax of the output. Anything that can easily be parsed is fine.   * I don't know why I am getting a opening square bracket at the beginning of each entry, but apparently does not show up when others run similar code. ## Code:               \documentclass{article}     \usepackage{lipsum}     \usepackage{imakeidx}          \makeindex[columns=2]          \newcommand*{\Index}[2]{%         \newpage\lipsum[1]%  just for this MWE         \index{#2!#1}%     }%          \begin{document}       \Index{Star Trek}{Spock}       \Index{Star Trek}{Science}       \Index{Star Trek}{Science Fiction}            \Index{Star Wars}{Jedi}       \Index{Star Trek}{Fiction}       \Index{Star Wars}{Science Fiction}          \printindex     \end{document}


title: How to get default math font globally

text: This is the font in math mode in my whole document. ![enter image description here](http://i.stack.imgur.com/6DItG.png) It doesn't even recall the default font (math fonts table). It looks more like `\mathcal{}`, which I used once, didn't like, and quickly removed. How can I revert math font to default in whole document?


title: TikZ-Editor: Preview error

text: How can I setup my TikZ-Editor to enable preview? I use MacTeX 2013, installed with the ISO file. Could you give me some clue about how I can configure this software? The error message reads: > Preview Error: Can't convert the source file to PDF. Please check the LaTeX > command in preview's preferences. ![enter image description here](http://i.stack.imgur.com/97EKz.png)


title: embed a terminal command in a beamer presentation

text: I know this may be extravagant, but I was wondering if it was possible to embed a terminal command in a beamer pdf that can be launch by clicking on it. My idea is that during my presentation, I could just click on a button displayed on my slide to launch a program. This way, I don't have to quit the presentation and open a terminal window. I'm using **mac OSX** and I need the view the pdf **with Adobe Reader**. Is there a way to do it without using php forwarding like in here? ## Edit: I tried this code:               \begin{filecontents*}{shell.command}     #!/usr/bin/env sh     echo "Hello, World!"     \end{filecontents*}          \documentclass{beamer}          \begin{document}          \begin{frame}         \href{run:shell.command}{here}     \end{frame}     \end{document}      And Adobe Reader says it can't find an app to open the file. I also tried opening the file with Safari and it shows the script file, it doesn't run it. This is annoying because if I click on the `shell.command` file through the Finder, it simply runs it, as it should.


title: Is possible \footnote{} inside PsTricks/Psmatrix?

text: Is possible inserting "\footnote{This is a footnote you can see in the lower side}" in a graph with Pstricks Psmatrix?


title: Logo and picture on titlepage

text: I need to make a title page with a logo on the top left corner, the title and the author centered and another picture under this. I tried this code but the problem is that the second image is right under the logo and the title and the author are on another page.               %%!TEX encoding = UTF-8 Unicode          \documentclass[a4paper,12pt]{article}     \usepackage{geometry}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{xspace}     \usepackage{epstopdf}     \usepackage[frenchb]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \geometry{dvips,a4paper,margin=1.5in}     \DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}                    \begin{document}              \begin{titlepage}                  \includegraphics[width = 40mm]{logo.jpg}                  \begin{center}                      \title{Report}                 \author{Author}                 \date{Septembre 2013}                      \includegraphics[width = 40mm]{image.png}                  \end{center}              \end{titlepage}              \maketitle          \newpage          \tableofcontents          \newpage          \vspace{2.5cm}          \section{Abstract}          \newpage          \section{Introduction}          \end{document}


title: how to use "splncs.bst" style file?

text: I have a reviewer asked me to put "splncs.bst" style file in a lncs conference paper for bibliography formatting, how should I do this?


title: Problem with spaces in listings package and hyphenation

text: I use the listings package and there is a space that is inserted when the line breaks and the code goes to that new line. Why is this space inserted in the new line? How can I remove it?               \documentclass[12pt]{article}     \usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}          \setlength{\parindent}{0cm}          \usepackage{listings}          \begin{document}     \lstset{basicstyle=\ttfamily}               \begin{lstlisting}[breaklines=true]          //Comments are // and /* */          //Namespaces Classes Methods          namespace General //Can be ommited     {         class Specific         {             static void Main             {                 int[] array=new int[n] {1, 2,..., n};                      int [,] array;                      string[] names = new string[] {"Matt", "Joanne", "Robert"};                      //Also the new can be omitted                      int[] array={1, 2, ..., n};                      string[] names = string {"Matt", "Joanne", "Robert"};                  }         }     }          \end{lstlisting}          \end{document}      ![enter image description here](http://i.stack.imgur.com/7p01I.png) Edit I: I used a long comment and I ended up with a peculiar result: `//When declaring an abstract property (such as Area in this example), you simply indicate what property accessors are available, but do not implement them. In this example, only a Get accessor is available, so the property is read-only.` Why is so much space before the word "available" and why the same word start a little to the left compared to the others? Also if it was the indentation shouldn't only the first line started with more space and not the others, or at least all the lines should have the same? ![enter image description here](http://i.stack.imgur.com/MipoY.png) Edit II: Also I think that the problem comes from hyphenation. I used `breakindent=0pt, breakatwhitespace=true` and there was an improvement but there was also a lot of space in some lines so I think that the problem stems from hyphenation. If yes how can I fix it? If not then what's is the reason for that? ![enter image description here](http://i.stack.imgur.com/aMwCP.png)


title: How to avoid defined para from appearing at bottom of page?

text: I defined a poem-environment for two lined poems with the macro below. And could get both lines unbroken with `samepage` environment. But how do I make them to not end on last line of a page.               \def\shloka{\bgroup\bfseries\begin{flushleft}\fontsize{13}{15}\selectfont\leftskip=10pt\begin{samepage}}     \def\endshloka{\end{samepage}\end{flushleft}\egroup}


title: \nameref breaks for star versions of section/paragraph when titlesec is loaded

text: `\nameref` breaks for the `star` versions of `section`, `paragraph` when `titlesec` is loaded. I have a document that numbers paragraphs by default, but I have a few I do not want to number but would like to refer to. These are marked with `\paragraph*`, however, if the `titlesec` package is loaded at the same time, it causes `nameref` to display an empty string (the link box of hyperref is still visible). MWE:               \documentclass[12pt]{article}     \usepackage[sf]{titlesec} %comment this out and it works fine.     \usepackage{hyperref}     \begin{document}     \section{Sections}     \label{sec}     This is \nameref{sec}     \paragraph{A named Paragraph}     \label{par}     This is \nameref{par}     \paragraph*{A starred named Paragraph}     \label{par:star}     This is \nameref{par:star}     \end{document}      I suspect titlesec causes this defect for ALL star variants of sectioning commands but have not tested this. For me only `paragraph*` is relevant however a fix for all variants would be the best. I have a hunch it might be related to this: http://tex.stackexchange.com/a/6658/19326 however this happens to go way beyond my latex knowledge and is just "magic" for me.


title: listings: How to increase space between backgroundcolor-box and code?

text: As you can see, the colored box created by `backgroundcolor` is quite tight. How can one increase the "padding", i.e., the space between the box and its content? This seems to be related, but I don't have a frame around the color box, and the suggestions there did not solve the problem. The package `framed` can put in shaded boxes (see the comments below), so one possibility would be to redefine `lstlisting`. Has anyone done that?               \documentclass{scrartcl}          \usepackage[T1]{fontenc}     \usepackage[american]{babel}     \usepackage{graphicx}     \usepackage{fancyvrb}     \usepackage{listings}     \usepackage{xcolor}     \usepackage{framed}          \xdefinecolor{shadecolor}{rgb}{0.97,0.97,0.97}     \lstset{% setup listings         language=R,% set programming language             backgroundcolor=\color{yellow}% background color     }          \begin{document}     \noindent Just some text.     %\begin{shaded*}     \begin{lstlisting}[caption={A first example}, label=list:ex]     x <- c(1, 3, 2)     id <- function(x){         x # just a dummy     }     3 <= 4     3 != 4     !TRUE     y <- "foo"     (pv <- sum(x * x^x))     y ~ x + a     \end{lstlisting}     %\end{shaded*}     \end{document}


title: Is ConTeXt a good choice for creating a nice large catalog?

text: I only know a little of ConTeXt but I was wondering if it would be a good idea to use ConTeXt for creating a large catalog containing hundreds of books with a three column layout inside. I was thinking that context would be easier to add products and remove products and their positions on each page would be handled automatically based on my settings. This would be better than using InDesign, Scribus, or Office Publisher, etc. and having to manually create each page and insert and space out each product, while trying to fit as many on a page and later having to manually shift over books to add or the opposite to remove books. My fear is that ConTeXt is not capable of doing what I want or that it would take too much work to get it the way I want in order for it to be worth it. **Summary:** using design software would require to much manual work to update and change the catalog. I'm curious if ConTeXt is worth using for such a project or if I should find something else. **Example:** here's a picture inside the old catalog. I would like the new to look similar: ![This is picture of the inside of the old catalog](http://i.stack.imgur.com/Q6pPa.jpg)


title: Cross reference to counter in section title

text: I am trying to use a custom counter in Latex in order to auto number Use Cases in section titles (eg. `\section{UC <counter>: use case title}`). I also want a `\usecaseref` command to substitute a reference by the full use case name: _UCx: use case title_. This is what I got so far:               \documentclass[a4paper]{article}     \usepackage[english]{babel}     \usepackage{hyperref}          \newcounter{UCcounter}          \newcommand{\usecaseprint}[1]{UC \arabic{UCcounter}: #1}          \newcommand{\usecaseincrease}{\refstepcounter{UCcounter}}          \newcommand{\usecaseref}[1]{\emph{\nameref{#1}}}          \begin{document}          \usecaseincrease     \section{\usecaseprint{First Use Case Name}\label{sec:first}}              This is the forwards reference: \usecaseref{sec:second}.          \usecaseincrease     \section{\usecaseprint{Second Use Case Name} \label{sec:second} }              This is the backwards reference: \usecaseref{sec:first}          \end{document}      This however produces the following: ![enter image description here](http://i.stack.imgur.com/rdEDX.png) As you can see, when calling the `\nameref` command, it uses the current value of the `UCcounter` instead of the value of the counter in the section title. I already tried to replace the `\newcommand` occurences with `\DeclareRobustCommand`, but that doesn't change anything.


title: Is there any way to use a custom font with moderncv?

text: The package `moderncv` proposes only two available options for the font selection `roman` & `sans`. I've seen the following declaration in the source code of the package:               \DeclareOption{sans}{\AtBeginDocument{\renewcommand{\familydefault}{\sfdefault}}}      Are there any tricks around to overload this inside a .tex file in order to load another font ?


title: Filter exercises according to their difficulty

text: This is somehow a follow-up question after this question. I came across this problem when writing the answer, but I was wrong when I thought I would easily be able to get this to work later. Shame. The problem is that while the filter works correctly for keys such as `type`, it doesn't for the key `difficulty`. Here is a MWE :               \documentclass{article}          \usepackage{exercise}          \begin{document}          Here is a short exercise :          \ExerciseSelect[type={short}]          \begin{Exercise}[type={short}]       Prove that $1+1=2$.      \end{Exercise}          \begin{Exercise}[type={long}]       Prove that $P \neq NP$.     \end{Exercise}          \ExerciseStopSelect          \vspace{1cm}\hrule\vspace{1cm}          Now here is a hard exercise :     \ExerciseSelect[difficulty={2}]          \begin{Exercise}[difficulty=0]       Prove that $1+1=2$.      \end{Exercise}          \begin{Exercise}[difficulty=2]       Prove that $P \neq NP$.     \end{Exercise}          \ExerciseStopSelect          Or an easy one :          \ExerciseSelect[difficulty={0}]          \begin{Exercise}[difficulty={0}]       Prove that $1+1=2$.      \end{Exercise}          \begin{Exercise}[difficulty={2}]       Prove that $P \neq NP$.     \end{Exercise}          \ExerciseStopSelect               \end{document}      And its output : ![Output](http://i.stack.imgur.com/QieNz.jpg) As you can see, nothing is selected by the `difficulty` filters.


title: How to change the default value bond length to an absolute value in chemfig?

text: Chemfig allows you to set bond length in the second argument of the bond, like `-[,2]` (a multiple of 2 to the default value). How to set the value of bond length for an absolute value (like 5mm), instead of a multiple of the default value?


title: How to install the chemfig.sty package under Ubuntu 12.04 LTS?

text: I am using TexMaker on ubuntu 12.04 to edit my Latex-documents. Lately, I needed to create a chemical structure with 'chemfig'. However, this package is not included in the 'TexLive-all'-package and thus, I had to install it manually. Here's how I did it:


title: Different colours for tikz node frame sides

text: I have a tabular with and use tikz to create a frame around it. Right now it looks like this:               \documentclass{scrartcl}     \usepackage{tikz}     \begin{document}     \tikz\node[draw=black,ultra thick,double=gray,inner sep=.3pt+\pgflinewidth]{     \begin{tabular}{l|l}     A & B\\     \hline     C & D\\     \end{tabular}};     \end{document}      For some very simple 3d effect I want to seperatly adjust the colour of the frame parts. For example in the top and right part of the frame the outer line in black and the inner line in gray. And in the left and bottom part the outher way round. **EDIT:** I did a minimal example in HTML/CSS: ![enter image description here](http://i.stack.imgur.com/xPJA3.png) To get the desired effect I need the edges to be in an angle of 45°.


title: Using same margin-settings in acronym as in listoffigures

text: As the two pictures show, the first entry of `listoffigures` begins further to the right than in the case of my list of abbreviations. Is it - and if yes, how - possible to retrieve the margin-settings used in the `listoffigures`-environment and to apply these to the `acronym`-environment? ![ListOfAbbr](http://i.stack.imgur.com/w1XAD.png) ![listoffigures](http://i.stack.imgur.com/3PX6q.png) **MWE**               \documentclass{scrbook}          \usepackage[demo]{graphicx}     \usepackage{booktabs}     \usepackage{imakeidx}     \makeindex          \usepackage{acronym}          \begin{document}          \chapter*{List of abbreviations}     \begin{acronym}     \acro{3PL}{Third-party logistics}     \acro{APS}{Advanced Planning and Scheduling}     \end{acronym}          \listoffigures          \chapter{First chapter}          \section{Section}              \begin{figure}[htbp]            \centering            \includegraphics{example.png}             \caption{example caption}            \label{fig:example1}         \end{figure}         \index{Figure!Example1}          \end{document}


title: How to make text divided spacing on a line equally?

text: Here is an example I am trying to accomplish. ![enter image description here](http://i.stack.imgur.com/4Tz2B.png) How would I latex the second line where it is   `overdamped ----- critically damped ------ underdamped` Thanks for the help I appreciate it.


title: xelatex -Undefined control sequence

text: So I am trying to work with this tex file for CV available at http://kjhealy.github.com/kjh-vita/ The only thing I change is the font from pragmata to consolas. 2 problems I get a pdf output, with a tiny "on" at the end of the page plus 12 errors all with the same description in the output:               xelatex! Undefined control sequence      OK so let's decribe the errors in detail(as you might see them upon compiling the above file).               1.Pointer at \ind command in the code---error in output window is the following     xelatex>! undefined control sequence.     xelatex><argument>\scriptsize \VCRevision     xelatex>                       \ on \VCDateTEX     xelatex>l.265 \ind     xelatex>       Kieran Healy.1999.``href{http://www.k........      Could anyone also please let me know how to copy-paste the error details from the output window?


title: HTML Navigation

text: I have a large document written in LaTeX (memoir class) that I also use to produce HTML, using:               htlatex.exe "Test.tex" "html,3" "" "Test" "--interaction=nonstopmode"      I've been attempting to find a more efficient navigation method than the "prev,next,front,up" that is produced by default. A blog located here indicates that there are options built in that should give me a sidebar, however, the `frames` option just produces a blank title page and `obj-toc` doesn't produce anything different from the default settings. One of the other ideas I thought of was a "breadcrumb" navigation using the hyperref package. I've tried the breadcrumb package (post by Sean Allred) at this stack exchange post , however, these breadcrumbs (which look great in the PDF) do not appear at all in the HTML version. Any help in this would be greatly appreciated. Edit: P.S. I am using FireFox as my browser.


title: xdvipdfmx refuses to process multiple diacritics

text: so i'm trying to typeset a book with chinese characters and pinyin transcription, and xelatex is throwing errors. i managed to narrow down the problems to the doubly-accented ê̄ down here:               \documentclass{book}     \usepackage{polyglossia}     \setdefaultlanguage{english}     \setmainfont[Mapping=tex-text]{Sun-ExtA}     \begin{document}     ê̄     \end{document}      that's a u+00ea `LATIN SMALL LETTER E WITH CIRCUMFLEX` followed by a u+0304 `COMBINING MACRON`. now these suckers really don't behave all too well on my osx mountain lion—depending on application they're rendered ugly, don't want to get copy-and-pasted, all kinds of errors. but worst, they make xelatex—more specifically, `xdvipdfmx`—quit:               otf_cmap>> Creating ToUnicode CMap for "Sun-ExtA/H/65536/0/0"...     No Unicode mapping available: GID=50878, name=(none)(CID:Sun-ExtA/H/65536/0/0[IPIDPM+Sun-ExtA][CIDFontType2]     ** ERROR ** Invalid glyph index (gid 50878)          Output file removed.      )     Error 256 (driver return code) generating output;     file dictionary/output-pdf/dictionary.pdf may not be valid.      Now you might be tempted to point at the specific font i used here, and you would be right in a way—when i omit the font specification, i do get a page rendered (with a quite unsightly ê̄). i did check Sun-ExtA for code point availability, and yes, it does contain both codepoints. it doesn't seem to be the only culprit; in the process of narrowing down the location of the failure, i also removed another font (http://www.georgduffner.at/ebgaramond/) which lead to similar errors (with different alleged GIDs). the document i'm typesetting is quite complex as it contains chinese characters from the Astral Planes (cjk extensions b and c), pinyin, hiragana, katakana, hangul and so on. it is quite difficult to find nice, correct fonts for all these characters that go together well, so i'm not like, well that one doesn't work so let's just replace it with another font. that won't fly. to go on, i must specifically find out:   * how to **narrow down this class of errors** in the first place. it took me many hours to superficially understand the cause and find the source. there is painfully little in the thousands of lines of output that goes to the screen and into the log file (hell i wasn't even able to redirect all output—how does tech print to the screen if its neither `stdout` nor `stderr`?). the message that i did manage to isolate does not tell any line number or textual context and is slightly crazy—i mean, when EB Garamond was still in `xdvipdfmx` complained about GIDs that map to a unicode cyrillic block, which i do not use, and the GID in the above message would correspond to 욾, which does not occur in my data either. are those GIDs even _supposed_ to be unicode codepoints? **how are you expected to hunt this down?**   * next, i need to know what the best practices are to **typeset multiple diacritics** in xelatex. it doesn't have to be the most general solution, as there are only a couple relevant cases. **edit** others seem to believe just writing out combining accents is a solution, but my trials (also with other fonts) just lead to overlapping accents next to the letter. **edit** per the recommendations from the discussion linked above, i tried to `\usepackage{covington}` and `\twoacc[\~|\={a}]`—that works with standard fonts and with Sun-ExtA, but _not_ with the Ubuntu font; allegedly GID 1267 being the culprit. i consider this a TeX bug—i mean it's just stacking three outlines on top of each other, right? **edit** i forgot to mention: i'm on osx 10.8.4 here; the xetex installation is the one from MacTeX-2012. i did check on multiple fonts, as i had heard about problems (there was a single double font, which i resolved). **edit** this example makes `xdvipdfmx` quit with `Invalid glyph index (gid 1265)`:               \documentclass{book}     \usepackage{polyglossia}     \setmainfont{Ubuntu}     \setdefaultlanguage{english}     \begin{document}     x́     \end{document}      the combining accent used here is u+0301; with u+0304 it quits with a GID of 1268; other diacritics either show a missing chr box or throw similar errors.


title: Need help creating a 3D cube from a 2D set of nodes in TikZ

text: I'm working on a figure where I need a 3D cube. My plan was to create a 2D set of nodes, then draw the top and right side of the cube, and lastly draw the missing lines. I got this far until I ran into trouble: ![enter image description here](http://i.stack.imgur.com/wahpj.png) I can't get the side to align properly with the face of the cube. Also, I have a vague idea on how to draw the lines but I bet I will have problems with that, too. Here's the code:               \documentclass[a4paper, 11pt]{article}          \usepackage[rgb]{xcolor}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows}     \usetikzlibrary{positioning}     \usetikzlibrary{calc}          \definecolor{shade0}{named}{white}     \definecolor{shade1}{rgb}{0.9, 0.9, 0.9}     \definecolor{shade2}{rgb}{0.8, 0.8, 0.8}     \definecolor{shade3}{rgb}{0.65, 0.65, 0.65}     \definecolor{shade4}{rgb}{0.45, 0.45, 0.45}          \newlength{\gpgpuElemSize}     \setlength{\gpgpuElemSize}{8mm}     \newlength{\gpgpuElemSep}     \setlength{\gpgpuElemSep}{1mm}          \begin{document}     \begin{tikzpicture}[%         auto,         box/.style={%           draw,           rectangle,           semithick,         },         thread-s/.style={           draw,           semithick,           fill=shade1,         },         thread/.style={%           box,           thread-s,           minimum size=0.5\gpgpuElemSize,           inner sep=0,           node distance=0pt,         },       ]            % Draw boxes       \foreach \i in {1, ..., 4} {%         \foreach \j in {1, ..., 4} {%           \ifnum \j=1             \ifnum \i=1               \node [thread] (thread\i-\j) {};             \else               \pgfmathtruncatemacro\prevI{\i-1}               \node [thread, below=of thread\prevI-1, yshift=\pgflinewidth]                 (thread\i-\j) {};             \fi           \else             \pgfmathtruncatemacro\prevJ{\j-1}             \node [thread, right=of thread\i-\prevJ, xshift=-\pgflinewidth]               (thread\i-\j) {};           \fi         }       }            % Create 3D perspective       \path let \p1 = (thread4-4.south east),                 \p2 = (thread1-4.north east)              in                [thread-s]                (thread1-4.north east) -- ++(30:0.5\gpgpuElemSize)                -- ++(0, \y1-\y2-\pgflinewidth) -- (thread4-4.south east) --                   cycle;     \end{tikzpicture}     \end{document}


title: How to make listings display characters special characters

text: I am trying to show a directory structure of a tree using the listings package like so:               ├── controllers     │   ├── application_controller.rb      what I get looks like this:                   controllers                 application_controller.rb      when I use               \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}      the error given is:               Package inputenc Error: Unicode char \u8:\lst@FillFixed@\lst@EC not set up for use with LaTeX. [├── ]      trying with utf8x gives:               ./directory_listing.txt:1: Package utf8x Error: MalformedUTF-8sequence. [├── ]      and               [U+FFFD][U+FFFD][U+FFFD]     1     controllers     [U+FFFD][U+FFFD][U+FFFD]     2     [U+FFFD][U+FFFD][U+FFFD]     a p p l i c a t i o n _ c o n t r o l l e r . rb      and               âŤIJâŤĂâŤĂ controllers     âŤĆÂăÂă âŤIJâŤĂâŤĂ application_controller.rb      If I do not include the utf8 line. Is there a way to get it to correctly encode the emdashes, pipes and three way pipes so that they show in the output? (P.s. I need some form of [T1]fontenc or underscores are not displayed correctly elsewhere.)


title: expanding variable inside picture environment

text: (this version of this question is highly edited based on suggestions) I thought to quickly create a fax cover sheet last night and, quickly creating one, I ran into a problem I can't figure out so I thought I'd ask around. First, the structure: I have 2 files: one is the style file and the other is the file with the specific fax info. In the style file I've created some variables to hold data that is specified in the info file. Here is the style file:               \newcommand{\myfaxdate}[1]{\newcommand{\@myfaxdate}{#1}}     \newcommand\myfaxto[1]{\newcommand{\@myfaxto}{#1}}     \newcommand\myfaxfrom[1]{\newcommand{\@myfaxfrom}{#1}}     \newcommand\myfaxre[1]{\newcommand{\@myfaxre}{#1}}     \newcommand\myfaxnumpages[1]{\newcommand{\@myfaxnumpages}{#1}}     \newcommand\myfaxtelnum[1]{\newcommand{\@myfaxtelnum}{#1}}     \newcommand\myfaxnum[1]{\newcommand{\@myfaxnum}{#1}}     \newcommand\myfaxcomments[1]{\newcommand{\@myfaxcomments}{#1}}          \newsavebox{\faxcover}     \savebox{\faxcover}{%      \put(0,7){\makebox{\bfseries Date:} \@myfaxdate}        \put(0,6){\makebox{\bfseries To:} \@myfaxto}       \put(0,5){\makebox{\bfseries From:} \@myfaxfrom}       \put(0,4){\makebox{\bfseries Re:} \@myfaxre}       \put(0,3){\makebox{\bfseries Comments:} \@myfaxnumpages}       \put(0,2){\makebox{\bfseries From:} \@myfaxtelnum}       \put(0,1){\makebox{\bfseries Re:} \@myfaxnum}       \put(0,0){\makebox{\bfseries Comments:} \@myfaxcomments}     }           \newcommand{\makefax}{%      \begin{picture}(10,10)        \put (0,0){\usebox\faxcover}      \end{picture}     }      Here's the other file (the top-level file)               \documentclass[10pt]{report}     \usepackage{./myfax}     \begin{document}          \myfaxdate{09-28-2011}     \myfaxto{Ozymandius, King of Kings}     \myfaxfrom{Bev}     \myfaxre{Two vast and trunkless legs of stone}     \myfaxnumpages{3 counting the cover sheet}     \myfaxtelnum{(516) 676-4099}     \myfaxnum{(800) 123-4567}     \myfaxcomments{blah not blee}          \makefax          \end{document}      When I compile, I get an error telling me that `\@myfaxdate` is an undefined control sequence. I should add that the purpose of dividing into 2 files is because I want to create my own fax style that I may want others in my org to use (maybe). This will simplify it so all they have to know how to do is to fill in some blanks in the main file.


title: Figure caption does not continue on new page

text: I have a large figure caption that I want to display. However, it just runs off the page into nowhere instead of onto the next page. What command do I need to fix this? Googling the problem doesn't seem to help, but I probably just don't know what to type in.               \begin{figure}[ht!]      \begin{center}       \includegraphics[width=\textwidth]{Schematic.PNG}       \caption{Really Long Caption Here\label{fig:apparatus} }      \end{center}     \end{figure}      ![Picture of caption running off the page.](http://i.imgur.com/HOMpc5K.png) Thanks for your help.


title: What is the DRY way to get Theorem 1(a)?

text: I am typesetting a document with the `memoir` class and the `cleveref` package. Often I have a numbered theorem and enumerated parts. I would like to be able to refer to a part of a theorem as simply as possible. Here is a MWE:               \documentclass{memoir}     \usepackage{amsthm}     \usepackage{cleveref}          \newtheorem{theorem}{Theorem}          \begin{document}     \begin{theorem}\label{thm}     My big theorem     \begin{enumerate}[(a)]     \item\label{thm!simple} Simple case     \item\label{thm!complex} Complex case     \end{enumerate}     \end{theorem}          \Cref{thm}\cref{thm!simple} % Theorem1item a          \Cref{thm}\ref{thm!simple}  % Theorem 1a     \Cref{thm}(\ref{thm!simple})% Theorem 1(a), but redundant coding          \end{document}      None of these is optimal. If I change the label format, I have to change every reference, which goes against the DRY mantra. My best workaround so far is to redefine the reference format, as in:               \begin{theorem}\label{thm2}     My second big theorem     \begin{enumerate}[(a)]     \crefformat{enumi}{#2(#1)#3}     \item\label{thm2!simple} Simple case     \item\label{thm2!complex} Complex case     \end{enumerate}     \end{theorem}          \Cref{thm2}\cref{thm2!simple} % Theorem2(a)      Then if I want to change the label format I still have to change it in two places, but at least they are next to each other. I guess the next level hack would be to look into how `memoir` extends `enumerate` and have it update `\crefformat` at the same time. But before I got my hands dirty I thought I would ask the hive.


title: Classicthesis citation style (author,year instead of numerical)

text: I'm using classicthesis 4.1 in LyX to write my thesis and I need help with natbib's citation style. I can't seem to change the natbib numerical citation style to (Author et al., XXXX; Author2 et al., YYYY). I have this current line, however, I cant find the right place to put it to make it work:               \usepackage[authoryear,round,colon]{natbib}      Present situation: ![present](http://i.imgur.com/WPDskmd.png) Desired result: ![goal](http://i.imgur.com/CQRgchb.png) PS. I am aware that the classicthesis manual states: > Citation format is governed by the natbib numerical style invoked in the > document settings of the main thesis file (beware, options chosen in > classicthesis-config.tex will have no effect).


title: How can I use arara to get a graphics file?

text: In a standard TeX Live distribution Ghostscript is, to my knowledge, present; it is hidden, but it is there. **Edit: Yes, it is under**               \Texlive\2013\tlpkg\tlgs       So to my question: How can I use `arara`, to activate the _internal_ Ghostscript to get a graphics file as an output? For example `mydocument.png` (in addition to `mydocument.pdf`). Note, that I do not ask, how can I convert a PDF to a PNG (we know there are 1000s of possibilities), I am interested to use only internal TeX Live tools (that means NO extra software) and let `arara` do the job.


title: Frame number right of presentation controls

text: I currently use               \setbeamertemplate{footline}[frame number]      to get frame numbers on my slides produced by the LaTeX beamer class. But the presentation controls are above them and not on the left and thus taking too much space of the slides. How can I get both the controls and the frame number in one line? For illustration purposes a little code example:               \documentclass{beamer}     \usepackage[utf8]{inputenc}     \usepackage[english,german]{babel}          \title{Title}     \subtitle{Subtitle}     \author{Me}     \date{\today}          \setbeamertemplate{footline}[frame number]          \begin{document}          \begin{frame}     \titlepage     \end{frame}          \begin{frame}{Overview}     \tableofcontents     \end{frame}          \end{document}


title: Red words in bibliography structure tree in Texstudio

text: I am using LaTeX for a few months now and already have completed my first report with it. Recently I switched to TeXstudio and made an outline for my thesis. However, in the the bibliography part of the structure tree it shows parts of the thesis in red. I have tried to find out what causes this but could not find a solution, so I ended up here. Anyone knows what causes this? I tried to attach an screenshot of it but I do not have enough reputation. *Apparently, TeXstudio was a little buggy. The red markings appeared when I opened all the .tex files at once. When I open the master .tex file the red marking disappeared. Check out the screenshots. Furthermore, thanks for the additional info. I will read the stuff on how to add a MWE and will use it in future posts. ![red words](http://i.stack.imgur.com/lj8w8.png) ![no red words](http://i.stack.imgur.com/4ekNv.png)


title: adding location field on biblatex entry

text: I'm trying to include in a bibliography with biblatex the location field in an inproceedings entry. A minimal working example is the following               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[sorting=ynt,bibstyle=authoryear-comp,defernumbers=true,maxnames=300,firstinits=true,uniquename=init,backend=biber,dashed=false,arxiv=abs]{biblatex}     \DeclareFieldFormat{url}{\url{#1}}     \DeclareFieldFormat[article]{pages}{#1}     \DeclareFieldFormat[inproceedings]{pages}{\lowercase{pp.}#1}     \DeclareFieldFormat[incollection]{pages}{\lowercase{pp.}#1}     \DeclareFieldFormat[article]{volume}{\textbf{#1}}     \DeclareFieldFormat[article]{number}{(#1)}     \DeclareFieldFormat[inproceedings]{title}{#1}     \DeclareFieldFormat{shorthandwidth}{#1}     \DeclareNameAlias{sortname}{first-last}          \DeclareBibliographyDriver{inproceedings}{%     \usebibmacro{bibindex}%     \usebibmacro{begentry}%     \usebibmacro{author/editor}%     \setunit{\labelnamepunct}\nopunct     \usebibmacro{title}     \newunit\newblock     \usebibmacro{byauthor}%     \newunit\newblock     \usebibmacro{byeditor+others}%     \newunit\newblock     \usebibmacro{in:}%     \printfield{booktitle}%     \setunit{\bibpagespunct}%     \printfield{pages}     \newunit\newblock     \printfield{issn}%     \newunit\newblock     \printfield{location}%     \newunit\newblock     \usebibmacro{pageref}%     \usebibmacro{finentry}}          \begin{filecontents}{\jobname.bib}     @inproceedings{trial,     location = {Venice, Italy},     author = {Doe, J and Mouse, M},       booktitle = {Proceedings of my conference},     pages = {133--158},     title = {A possible title},     year = {2001}     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}     \nocite{*}     \printbibliography     \end{document}      Unfortunately I'm not able to make the location entry to appear in the bibliography. Any clue?


title: Inject JavaScript with pdflatex etc. for page level events

text: I am experimenting a little bit with JavaScript in PDF documents generated via pdflatex. I wonder, whether there is a method to access the event handler of Adobe Acrobat or Acrobat Reader in order to react on certain events not just within a form, but for example on page level. Although this is not a useful example for productivity, but how it is possible, to apply JavaScript code in a `.tex` file that plays a sound each time a (new) page is viewed within Acrobat Reader (or other PDF viewers if applicable)? This is connected to the page levels events `Page Open/Close`. I know, this is something like a toy occupation for me (and others), but perhaps it could be of importance to other users as well. The various documents on JavaScript provided by Adobe give no clue, except for directly using Adobe Acrobat (;-)), which has to be bought, however.


title: How to define a style for drawings using a special font and siunitx?

text: I would like to define a style (e. g. `style=techDraw`) that gives me the possibility to define the behavior of all technical drawings made by `tikz` or imported as `pdf_tex` a. s. o. when the style `techDraw` is set for this graphic. It should enable a standardized font (in my case DIN EN ISO 3098 approximated by `osifont.ttf`), a font size that varies by the paper format (e. g. 7 mm height for DIN A4) and proper parsing of all appearing numbers by `siuntix` For example a drawing like this shall be taken. And also a graphic I exported from inkscape with pdf and text separated. I would like to get settings like this:               %The following commands are invented and not serving as an MWE     \documentclass[tikz]{standalone}     \usepackage{siunitx}     \usepackage{ifthen}     \defineGraphicsStyle{techDraw/.style=     {\sisetup{mode=text, parse-numbers=true},     \setmainfont{osifont},     % some if-else routine to change fontsize (if papersize = A4 set fontsize = 7mm else...)     %maybe some function telling latex, that all text should be treated as math input.      %Include "$ $" to all text fields.      \tikzset{font=osifont}}}          \begin{document}     \begin[style=techDraw]{tikzpicture}     %some nodes with input such as dimensions "15000", angles "\ang{90}",      %symbols "\alpha" or units "\SI{5}{\kilogram}"     \end{tikzpicture}     %     \begin[style=techDraw]{figure}     \input{someInkscapeDrawing.pdf_tex}     %it would be easier not to write "$ $" and "\num" when constructing the original svg.      %Therefore same settings as above would be useful.     \end{figure}     \end{document}      I'm very sorry for such ugly code. I just want to give some ideas of what I imagine and don't know how to implement. The idea for that is to get a template for ISO-conform drawings in each thesis. * * * While trying around (for a single graphic as I don't know how to set it globally without affecting other fonts) I got a problem with `siunitx`. The included MWE shows, that the "dot" and "comma" symbol of my font is not used by the `\num{}` operation.               \documentclass{scrreprt}     \usepackage[ngerman]{babel}     \usepackage[]{siunitx}     \usepackage{xltxtra,fontspec,xunicode}     \setmainfont{osifont}     %     \begin{document}     %     \noindent 123456789.0\\     \num{123456789.0}\\     123456789,0\\     \sisetup{locale=DE}     \num{123456789,0}     %     \end{document}


title: Why does the less than equal to symbol not appear as intended in the following code?

text: When I use the following code on stats.stackexchange.com (which is powered by MathJax) the `\le` does not render properly. Is this a bug in MathJax or am I not using the `\le` symbol properly?               $X_3 =      \begin{cases}        X_{31} & \mbox{if }Y_1 Y_2 \mbox{ >  0} \\\       X_{32} & \mbox{if }Y_1 Y_2 \mbox{ \le 0}      \end{cases}$


title: Sideways margin with parbox?

text: How to get right margin in parboxed header? Top, bottom and left margin are ok, but there is no margin at the right (top) side of 'Parameter' header.               \begin{table}[ht]\footnotesize     \centering     \begin{tabular}{|c|}     \hline     \begin{sideways}\parbox{2cm}{Parameter etc etc ....}\end{sideways}      \end{tabular}          \caption{Summary}     \label{tab:summary}     \end{table}      ![No right margin](http://i.stack.imgur.com/s8g18.png) There are top,bottom and left margin, but there is no margin at right side of the header, as you can see at attached image.


title: Apply ToC part indenting to chapter

text: I have a problem with my ToC chapter titles similar to one posted a long while back about part titles. I'm looking for guidance on how to apply these changes to chapter titles. I'm working with the university's style files, so using `tocloft` is not practical at this point. Here's the code example for creating consistent indents for long part titles:               \documentclass{book}     \makeatletter     \def\@part[#1]#2{%     \ifnum \c@secnumdepth >-2\relax       \refstepcounter{part}%       \addcontentsline{toc}{part}{\protect\numberline{\thepart}#1}%NEW     \else       \addcontentsline{toc}{part}{#1}%     \fi     \markboth{}{}%     {\centering      \interlinepenalty \@M      \normalfont      \ifnum \c@secnumdepth >-2\relax        \huge\bfseries \partname\nobreakspace\thepart        \par        \vskip 20\p@      \fi      \Huge \bfseries #2\par}%     \@endpart}     \renewcommand*\l@part[2]{%       \ifnum \c@tocdepth >\m@ne         \addpenalty{-\@highpenalty}%         \vskip 1.0em \@plus\p@         \setlength\@tempdima{3.3em}%NEW: indentation for lines 2,3,... change according to your needs         \begingroup            \parindent \z@ \rightskip \@pnumwidth            \parfillskip -\@pnumwidth            \leavevmode\large\bfseries            \advance\leftskip\@tempdima% NEW: comment out if no indentation required for lines 2,3,...            \hskip -\leftskip            #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par            \penalty\@highpenalty       \endgroup     \fi}\makeatother          \begin{document}     \tableofcontents          \part{Test part one with a really really long title spanning two lines}     \part{Test part two with a really really long title spanning two lines}     \part{Test part three with a really really long title spanning two lines}     \part{Test part four with a really really long title spanning two lines}          \end{document}      Output looks like this ![enter image description here](http://i.stack.imgur.com/ERHpC.png)


title: complicated form

text: \documentclass{complicatedform}     %title{Writing a LaTeX Class File to Produce a Form}     \begin{document}     \collaborator{Dr A Person}{CMP}{1234}     \collaborator{Prof A.N. Other}{ENV}{5678}     \otherfunding{This proposal has also been submitted to     the intergalactic federation of Nog last year.}     \begin{projectdescription}     This is a really interesting project!     \end{projectdescription}     \training{The student will be trained in intergalactic space      exploration.}     \monitored{Telepathically}     \end{document}      error, File `complicatedform.cls' not found. \begin


title: Formatting the thesis chapter title

text: I am presently working on my masters thesis. My code is as follows               \documentclass[12pt, a4paper, oneside]{thesis}          \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}          \usepackage{fullpage}     \begin{document}         \chapter{Introduction}         %My introduction     \end{document}      But I am getting the output as follows: ![enter image description here](http://i.stack.imgur.com/ibFuP.png) I need the page to look like as follows: ![enter image description here](http://i.stack.imgur.com/hy62Z.png) What shall I do?


title: XeLaTeX with polyglossia and Greek

text: I'm struggling a lot with XeLaTeX and `polyglossia`. Somehow the font selection doesn't seem to work as I would expect it (and as the error messages suggest). Please consider the following example:               \documentclass{scrreprt}          \usepackage{fontspec}     \setmainfont{Times New Roman}     \setsansfont{Arial}     \newfontfamily\greekfont[Script=Greek]{Linux Libertine O}          \usepackage{polyglossia}     \setdefaultlanguage{french}          \begin{document}     \tableofcontents{}          \section{Αυτό είναι ελληνικά.}     {\bfseries Welcome to Greek:} Αυτό είναι ελληνικά          Or Russian: Привет          Or Hebrew: מה הבעיה?     \end{document}      This works perfectly well with an automatically generated "Table des matières" thanks to `polyglossia`. When I change the default language to Greek by using:               \setdefaultlanguage{greek}      XeLaTeX issues an error from `polyglossia`:               ! Package polyglossia Error:     The current roman font does not contain the Greek script!     Please define \greekfont with \newfontfamily.     See the polyglossia package documentation for explanation.     Type H <return> for immediate help.     ...     l.12 \tableofcontents     {}      I did declare the `\greekfont` with `\newfontfamily` as you can see, but somehow `\tableofcontents` seems to do and expect something else. In the end I would like to use the same document with different languages in `\setdefaultlanguage` to get all the nice automatic texts of `polyglossia` for my chapters, table of contents, etc... in the appropriate language. Can anyone please help?


title: Generating Random arrows in tikz

text: I would like to draw this figure :   ![enter image description here](http://i.stack.imgur.com/bS7uY.png)   Hence, I resort to TikZ. But, it seems to be very difficult drawing arrows precisely in TikZ with the precise locations (x,y). I have achieved this:   ![enter image description here](http://i.stack.imgur.com/L4O8I.png)   Here is the **MWE** :               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \filldraw[color=gray] (1,0) rectangle (10,5);     \draw[->, line width=2pt, color=red] (2,1) -- (3,1);     \draw[->, line width=2pt, color=red] (2,2) -- (3,2.5);     \draw[->, line width=2pt, color=red] (3,2) -- (30:3);     \end{tikzpicture}     \end{document}       Now, my question is ## How to generate arrows of random length (between 2cm and 3cm) and random inclination (if possible of random colors too like red, yellow, violet, etc.) without crossing in TikZ. Is there any function to generate Random Numbers ## Note: If not Tikz, pstricks or MetaPost will also do. For now, Asmptote will not work because there seems an error in the execution in my system.


title: \mathscr (LaTeX or XeLaTeX)

text: I'm trying to use `\mathscr` in my documents, but it just doesn't show up. I'm using MacTeX, with pdfTeX and XeTeX version 3.1415926 and TeXShop version 3.26. As an MWE, I can use:               %!TEX TS-program = xelatex       %!TEX encoding = UTF-8 Unicode       \documentclass[a4paper]{report}       \usepackage{mathrsfs}       \begin{document}       $\mathscr{abcdefghijklmnopqrstuvwxyz}$       \end{document}        the first two lines being TeXShop's way to be told to use XeLaTeX (though using pdfTeX changes nothing) and to save the document in UTF-8 Unicode encoding. How do I get the `\mathscr` to appear?


EDITED: Is there a bibliography style file for Audio Engineering Society (AES) conventions (like a .dtx or a .bst file or something)? Or alternatively, is there a way I can create my own that takes my .bib file and formats, for example, a conference entry as shown below? Author, "Title," presented at the AES 114th convention, Amsterdam, The Netherlands, 2003 March 22--25. For example, I have a .bib file with a number of entries. When I use the American Institute of Aeronautics and Astronautics (AIAA) conference template package, they provide the necessary files which allow me to use \bibliographystyle{aiaa} and this automatically formats the entries in the .bib file as the conference requires it to be. I want to know if anyone knows of a similar file for AES conferences or if there isn't one, is there a tutorial where I can learn to create my own file that controls how my bibliography is formatted. I want to use the same .bib file I have for different conferences and have a file (I think the needed file is a .dtx file or a .bst file) that indicates how the bibliography is formatted in the final latex document. Thanks.


title: Difference in PDF loading in lua- and xelatex

text: Someone is trying to install a package of mine (http://www.ctan.org/pkg/lilyglyphs) in MiKTeX on Windows 7. After some hassles with file and font paths we managed to get him going, but there is one strange issue left. The package has a command that prints a PDF file from a subdirectory. When compiling a document with LuaLaTeX the document is fine while with XeLaTeX doesn't print anything but preserves the space (the package relies on OpenType fonts, so it has to be compiled with one of these). I find the portions from the logfile interesting: XeLaTeX gives:               ABD: EveryShipout initializing macros     File: lilyglyphs_logo.pdf Graphic file (type QTm)      <use  "lilyglyphs_logo.pdf" > [1          ]      while LuaLaTeX reports:                ABD: EveryShipout initializing macros     <lilyglyphs_logo.pdf, id=4, 40.40294pt x 14.79527pt>     File: lilyglyphs_logo.pdf Graphic file (type pdf)      <use lilyglyphs_logo.pdf>     Package pdftex.def Info: lilyglyphs_logo.pdf used on input line 5.     (pdftex.def)             Requested size: 39.1908pt x 14.35138pt.          [1          {C:/Users/Daniel/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map} <C:/local-t     ex-files/tex/latex/lilyglyphs/documentation/lilyglyphs_logo/lilyglyphs_logo.pdf     >] (C:/Users/Daniel/Desktop/lilyglyphs-docs/luatex.aux) )      Seeing these different logs it looks quite clear that XeLaTeX doesn't print the PDF correctly, but I don't have a clue to why this happens.


title: Adding different entities to a table of contents, part 2

text: This is a follow-on to the question: Adding different kinds of entities to table of contents As I build a huge document, things don't work as in the MWE from the previous problem. I stripped out the entire document and have just the commands and a couple of sample pages to demonstrate what I want, and what the problems are.   1. The table of contents crashes. The error message states there is an extra close brace } but I don't see it.   2. The labs are supposed to be separate, standalone units like appendices. But every page starts with a header "Chapter 1. Title ... " because the book style thinks that everything must be inside chapters. How do I suppress that header? * * *               \documentclass[12pt]{book}              % Book class in 12 points     \parindent0pt  \parskip10pt             % make block paragraphs     \raggedright                            % do not right justify     \usepackage{mathptmx}  % times roman, including math (where possible)     \usepackage{mathpazo}  % palatino, including math (where possible)     \usepackage{helvet}    % helvetica     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage[usenames,dvipsnames]{color}     \usepackage{amsthm}     \usepackage{graphicx}     \usepackage{etoolbox}% http://ctan.org/pkg/etoolbox     \usepackage{comment}     \usepackage{listings}     \usepackage{grffile}     \usepackage{listing}     \usepackage{changepage}     \usepackage{multirow}     \usepackage{outlines}     \usepackage{enumitem}     \usepackage{fancyhdr}     \usepackage{subfigure}     \usepackage{hyperref}     \usepackage{textcomp}     \usepackage[top=1in, bottom=1.5in, left=1in, right=1in]{geometry}     %usepackage{fullpage} would fix the margins problem     \cfoot{\sffamily\textcopyright 2005-2014 copyright notice }     \rfoot{\thepage}     \graphicspath{ {C:/LaTeX/img/} }     \pagestyle{fancy}     \title{\bf Grandiose Title Here \\ %\includegraphics[scale=.5]{ Logo.jpg}\\     Organization Name Here}    % Supply information     \author{Primary Author}            %   for the title page.     \date{\today}                           %   Use current date.      \definecolor{lgray}{rgb}{0.9,0.9,0.9}     %\definecolor{graycolor}{rgb}{0.9,0.9,0.9}     \definecolor{white}{rgb}{1,1,1}     \definecolor{dkgreen}{rgb}{0,.5,0.1}     \definecolor{wrongcolor}{rgb}{.9,.5,.4}     \definecolor{purple}{rgb}{0.6,0,0.6}     %\input state.tex               \newcommand{\underscore}{ %UNDERLINE COMMAND       \underline{ \hspace{3 cm}}     }          \makeatletter     \newcounter{lab}% also defines \thelab          % roughly equivalent to \chapter     \newcommand{\lab}[1]{% #1 is lab heading       \refstepcounter{lab}%       \if@openright\cleardoublepage\else\clearpage\fi%       \addtocontents{toc}{\string\contentsline {chapter}%         {\hbox to .65in{Lab}\protect\numberline{\thelab}#1}{\thepage}}%       \global\@topnum\z@% page number to bottom?       \noindent%       \@lab{#1}% fixed first character separation     }          % roughly equivalent to \@chapter     \def\@lab#1{% #1 is lab heading       \if@twocolumn%         \@topnewpage[{\huge\bfseries Lab \thelab: #1\par}]%       \else{\huge\bfseries Lab \thelab: #1\par}%       \@afterheading% no idea       \fi}          % copied from mwe     \renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi        \thispagestyle{plain}%        \global\@topnum\z@        \@afterindentfalse        \secdef\@chapter\@schapter}          % copied from book.cls and modified     \def\@chapter[#1]#2{%       \ifnum \c@secnumdepth >\m@ne         \if@mainmatter           \refstepcounter{chapter}%           \typeout{\@chapapp\space\thechapter.}%           \addtocontents{toc}{\string\contentsline {chapter}%             {\hbox to .65in{Chapter}\protect\numberline{\thechapter}#1}{\thepage}}%         \else           \addtocontents{toc}{\string\contentsline {chapter}%             {\hbox to .65in{Chapter}\protect\numberline{\thechapter}#1}{\thepage}}%         \fi       \else         \addtocontents{toc}{\string\contentsline {chapter}%           {\hbox to .65in{Chapter}\protect\numberline{\thechapter}#1}{\thepage}}%       \fi       \chaptermark{#1}%       \addtocontents{lof}{\protect\addvspace{10\p@}}%       \addtocontents{lot}{\protect\addvspace{10\p@}}%       \if@twocolumn         \@topnewpage[\@makechapterhead{#2}]%       \else         \@makechapterhead{#2}%         \@afterheading       \fi}     \makeatother               % Note that book class by default is formatted to be printed back-to-back.     \begin{document}                        % End of preamble, start of text.     \setenumerate[1]{label=\arabic*.}     \setenumerate[2]{label=\Alph*.}     \setenumerate[3]{label=\roman*.}     \setenumerate[4]{label=\alph*.}     \frontmatter                            % only in book class (roman page #s)     \maketitle                                  % Print title page.     \pagebreak     {\Large Acknowledgements }          Acknowledgements ... Thanks Stack Overflow experts!          {\Large Authors}          Main author \\     author2 \\     author3          {\Large Editors} \\     editor-in-chief          {\Large Layout and LaTeX Programming} \\     interns who laid out the document          {\Large Contributors} \\     contributor 1 \\     contributor 2               {\Large Example Programs in Java} \\          Code contributors          {\Large Example Programs in C++}          {\Large Online Quiz Development and Testing}          {\Large Lab Photos and  Testing}          \pagebreak     \tableofcontents                        % Print table of contents     \mainmatter                                 % only in book class (arabic page #s)          \chapter{How to Use this Document}                % Print a "chapter" heading     This is where we describe how it all works          Now, here come the individual short self-paced lessons,     called labs for now for want of a better term.          \lab{ Let There be Light}          To embed a live link ...     %\url{http://www.AdAstraEducation.org}          \lab{C++ Code and BadCode Styles}          Write some code, yadayada          \end{document}


title: How to reduce the space between the hat of overset and the symbol?

text: I would like to place the `\rightharpoonup` on r and get them closer. I had tried the `\overset` and `\Rvector` package. But the spacing of the former is too much. And the latter performs bad when placing in smaller font size. I provide the code as follow:                \documentclass[titlepage]{article}      \usepackage[cm]{fullpage}      \usepackage{amsmath,amssymb}      \begin{document}      \[\mathbf{e}_{\overset{\rightharpoonup}{r}}\]      \end{document}


title: Are there "draw split" keys for other split shapes besides the rectangle split?

text: The TikZ rectangle shape has a draw split key "/pgf/rectangle split draw splits=boolean" but in the TikZ manual there is no reference of similar keys for the: circle split, ellipse slipt, circle solidus, etc... By any chance, do similar key exist? If no, any suggestions on how to create them? That is how can we **suppress** the split line? Is the an equivalent of **rectangle split draw splits=false** for the other shapes? If not, any suggestions on how to implement it? The MWE (circle split draw split=false also does not work but for the rectangle as in the manual it does work)               \documentclass{beamer}     \usepackage{tikz}     \usetikzlibrary{external,automata,trees,      positioning,shadows,matrix,arrows,shapes.geometric,shapes.multipart,trees,      calc,  fit,decorations.pathmorphing}      \begin{document}      \begin{frame}      \begin{tikzpicture}       \node [circle split, circle split draw splits=false]       {test 1  \nodepart{lower} test 2};       \end{tikzpicture}       \begin{tikzpicture}       \node [rectangle split, rectangle split parts=2, rectangle split draw splits=false]       {test 1  \nodepart{two} test 2};      \end{tikzpicture}       \end{frame}      \end{document}


title: How to change LaTeX Font Style?

text: How do I change the font in LaTeX? I want to create font that looks like this: ![Good Font](http://i.stack.imgur.com/MDzJx.png) but TeXShop gives me this font: ![Bad Font](http://i.stack.imgur.com/N5znP.png) How do I can make the font in the bottom image look like the font in the top image? The text looks a bit thicker and darker than the first text. The second paragraph was produced by:               \documentclass[12pt]{article}          \usepackage[ left = 23mm, right  = 23mm, top = 24mm, bottom = 24mm ] {geometry}     \usepackage{mathtools}     \usepackage{graphicx}     \usepackage{pgfgantt}     \usepackage{tikz}     \usetikzlibrary{positioning}     \usetikzlibrary{arrows,matrix}     \usepackage{amssymb, amsmath, mathptmx}     \usepackage{pstricks, pst-node, pst-plot, pst-circ}     \usepackage{moredefs}     \usepackage{verbatim}     \usepackage{subcaption}     \interlinepenalty=10000          \begin{document}     \begin{titlepage}     \noindent     This is a simple and traditional approach involving storage of the piece positions, in      a 64-bit word, to represent each of the 64 positions on the chess board. Representing a      piece on the board implies turning on that bit. There are 12 bit-boards to encode the      6 white and 6 black pieces (king, queen, rook, bishop, knight, pawn). Figure 2.6      illustrates the bit-board of the white queen corresponding to the position h5.     \end{titlepage}     \end{document}


title: Problem with column widths

text: I'm trying to create a table that has 2 rows: 25% and 75% of the `\textwidth` I also want the left column to be bold and right aligned by default. The second column is also right aligned. Now I want some cells in the left column to be left aligned, I searched for this and this should be how to do it: `\multicolumn{1}{l}{Left}` This is my code with some dummy rows               \noindent     \begin{tabularx}{\textwidth}{|>{\raggedleft\hsize=.5\hsize\bfseries}X|>{\raggedleft\hsize=1.5\hsize}X|}     \hline     \multicolumn{1}{l}{Left} & Right\\     \hline     Right & Right\\     \hline     Right & Right\\     \hline     \end{tabularx}      But I'm having some problems:   1. It's not correctly 25 and 75 %, the last column ends too quick.   2. It's not compiling, I get errors about my alignment tabs


title: Paragraph settings

text: I am using the paragraph settings shown below: Correct use of \paragraph titles? 1) How can I reduce the size between the paragragphs? 2) Should I reduce the gap between paragraph title and text, and if yes, how can I do it? MWE:               \documentclass[12pt,ngerman,twoside]{article}          \let\originalparagraph\paragraph     \renewcommand{\paragraph}[2][.]{\originalparagraph{#2#1}}          \begin{document}          \paragraph{Paragraph name}          Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text.Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text. Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text.Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text.          \paragraph{Paragraph name}          Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text.Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text. Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text.Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text Text text.          \end{document}