title: Biblatex : custom articles and books

text: I recently started to use Biblatex and customize it a bit with some of your answers (A lot actually !!) but I'm still struggling with some of the features I like as I, sadly, don't understand much to most of the commands... First, I'd like to show you what I've already done because there is probably a lot to say about it!                   \usepackage[language=french,sorting=nyt, hyperref=true,urldate=long,         bibstyle=authortitle,citestyle=verbose,dateabbrev=false]{biblatex}              \addbibresource{These.bib}              \defbibheading{bibliography}{         \setcounter{secnumdepth}{-1}         \chapter{Bibliographie thématique}         \markboth{\itshape Bibliographie thématique}{}         }                                         %******** Custom Bibliography *********              \makeatletter         \def\MKbibnamefirst#1{\expandafter\mkbibnamefirst@i#1..\@nil}         \def\mkbibnamefirst@i#1.#2.#3\@nil{#1}              \renewbibmacro*{name:last-first}[4]{%           \ifuseprefix             {\usebibmacro{name:delim}{#3#1}%              \usebibmacro{name:hook}{#3#1}%              \ifblank{#3}{}{%                \ifcapital                  {\mkbibnameprefix{{#3}}\isdot}              {\mkbibnameprefix{#3}}%                \ifpunctmark{'}{}{\addhighpenspace}}%              \mkbibnamelast{#1}\isdot              \ifblank{#4}{}{\addlowpenspace\mkbibnameaffix{#4}\isdot}%              \ifblank{#2}{}{\addlowpenspace\mkbibnamefirst{#2}}}             {\usebibmacro{name:delim}{#1}%              \usebibmacro{name:hook}{#1}%              \mkbibnamelast{#1}\isdot              \ifblank{#4}{}{\addlowpenspace\mkbibnameaffix{#4}\isdot}%         %     \ifblank{#2#3}{}{\addcomma}%              \ifblank{#2}{}{\addlowpenspace\MKbibnamefirst{#2}}%         %     \ifblank{#3}{}{\addlowpenspace\mkbibnameprefix{#3}\isdot}         }}         \makeatother              % Commas as separators         \renewcommand*{\newunitpunct}{\addcomma\space}              % Comma before and after journal volume         \renewbibmacro*{volume+number+eid}{%           \setunit*{\addcomma\space}% NEW           \printfield{volume}%           \setunit*{\addcomma\space}% NEW           \printfield{number}%           \setunit{\addcomma\space}%           \printfield{eid}}              % Prefixes for journal volume and number         \DeclareFieldFormat[article]{volume}{\bibstring{volume}~#1}% volume of a journal         \DeclareFieldFormat[article]{number}{\bibstring{number}~#1}% number of a journal              % Comma before date; date not in parentheses         \renewbibmacro*{issue+date}{%           \setunit*{\addcomma\space}% NEW             \iffieldundef{issue}               {\usebibmacro{date}}               {\printfield{issue}%                \setunit*{\addspace}%             \usebibmacro{date}}% NEW           \newunit}              % Issue/date macros removed after journal number         \renewbibmacro*{journal+issuetitle}{%           \usebibmacro{journal}%           \setunit*{\addspace}%           \iffieldundef{series}             {}             {\newunit              \printfield{series}%              \setunit{\addspace}}%           \usebibmacro{volume+number+eid}%           \newunit}              % "In:" removed for articles; issue/date macros added after note+pages macro         \DeclareBibliographyDriver{article}{%           \usebibmacro{bibindex}%           \usebibmacro{begentry}%           \usebibmacro{author/translator+others}%           \setunit{\labelnamepunct}\newblock           \usebibmacro{title}%           \newunit           \printlist{language}%           \newunit\newblock           \usebibmacro{byauthor}%           \newunit\newblock           \usebibmacro{bytranslator+others}%           \newunit\newblock           \printfield{version}%           \newunit\newblock           \usebibmacro{journal+issuetitle}%           \newunit           \usebibmacro{byeditor+others}%           \newunit           \usebibmacro{note+pages}%           \setunit{\addspace}           \usebibmacro{issue+date}           \setunit{\addcolon\space}           \usebibmacro{issue}           \newunit\newblock           \iftoggle{bbx:isbn}             {\printfield{issn}}             {}%           \newunit\newblock           \usebibmacro{doi+eprint+url}%           \newunit\newblock           \usebibmacro{addendum+pubstate}%           \setunit{\bibpagerefpunct}\newblock           \usebibmacro{pageref}%           \usebibmacro{finentry}}              \DeclareFieldFormat[book]{title}{\mkbibquote{\mkbibemph{#1}}}          %Switch t. to vol.     \DeclareFieldFormat[article]{volume}{vol.~#1}          %Put ibid, op cit & co in italics     \renewcommand*{\mkibid}{\emph}          %Interligne entre les items Biblio     \DeclareFieldFormat{shorthandwidth}{#1}     \setlength{\bibitemsep}{6pt}          %Change p. to pp.     \DefineBibliographyStrings{french}{%       pages = {pp\adddot},              \begin{document}         (...)         \nocite{*}         \begin{singlespace}         \hyphenpenalty 10000         \printbibheading         \printbibliography[keyword=enreg,heading=subbibliography,title=Enregistrements audiovisuels des auditions]         \printbibliography[keyword=justice,heading=subbibliography,title=Justice]         \printbibliography[keyword=management,heading=subbibliography,title=Management et modernisation]         \printbibliography[keyword=visio,heading=subbibliography,title=Visioconférence]         \end{singlespace}         \end{document}      I'd like to modify the appearance of my articles and books : **FOR ARTICLES :**   I'm getting :   LASTNAME Firstname, « Title », _Journal_ , Vol. 10, no 3, pp. 56 – 79, month year.   And I'd like :   LASTNAME Firstname, « Title », _Journal_ , month year, vol. 10, no 3, pp. 56 – 79.   Which means:   \- Get the month year block after the journal **FOR BOOKS :**   I'm getting :   LASTNAME Firstname, « _Title_ », Address : Publisher, year, 271 p.   And I'd like :   LASTNAME Firstname, « _Title_ », Publisher, Address, year, 271 p.   Which means:   \- Get the year after the adress   \- Get in order the publisher separated from the adress with a comma I realise that it's a lot to ask!! But I couldn't get nowhere with my experimentations and I'm lacking time to do more sad failures!! Tks very much in advance for any help, or comment on my present modifications ! ;-)


title: Installing Circuit Macros package

text: I use Ubuntu 12.04 LTS. And I need to install the graphics package called _circuit-macros_ from CTAN. Here's the link for the package: http://www.ctan.org/tex-archive/graphics/circuit_macros I have downloaded the package. I do not know how to install any package manually on Ubuntu. I am used to working with Lyx, in which packages can be installed by running a command in the terminal. For example, to install Noweb I just need to type,               sudo apt-get install noweb       I have seen the readme file. I am not clear about where I need to copy the .m4 files in order to be recognized by LATEX. Please tell where I should copy the package files. It says that I've to copy to $HOME/circuit_macros. But this doesn't work. In addition to this, I even need to install m4 macro, dpic, etc as mentioned in the readme file. Kindly help me in installing these packages. I just know how to install any package using the terminal. Please give a brief procedure showing how to install all these packages.


title: Making size of a 4x4 matrix that consist only 2 parameter of 2x2 matrix to be same size as 4x4 matrix

text: From the picture below, both are supposed to be 4x4 matrices, but I want to express the first one with 2x2 matrix within 2x2 matrix where the J1 and J2 are 2x2 matrices while the 0 is 2x2 zero matrix. I wanted to make the size to look the same as this looks somehow ugly. Anyone has idea? I attached the code as well.                 \begin{multicols}{2}     \begin{enumerate}         \item $\begin{Bmatrix}         J_1 & 0 \\         0 & J_2          \end{Bmatrix}$         \item $\begin{Bmatrix}             \lambda_0 & 1 & 0 & 0 \\             0 & \lambda_0 & 1 & 0 \\             0 & 0 & \lambda_0 & 0 \\             0 & 0 & 0 & \lambda_1             \end{Bmatrix}$          \item $\begin{Bmatrix}                 \lambda_0 & 1 & 0 & 0 \\                 0 & \lambda_0 & 1 & 0 \\                 0 & 0 & \lambda_0 & 1 \\                 0 & 0 & 0 & \lambda_0                 \end{Bmatrix}$          \item $\begin{Bmatrix}                 \alpha & \beta & 1 & 0 \\                 -\beta & \alpha & 0 & 1 \\                 0 & 0 & \alpha & \beta \\                 0 & 0 & -\beta & \alpha                  \end{Bmatrix}$     \end{enumerate}     \end{multicols}      ![enter image description here](http://i.stack.imgur.com/LgVnS.png)


title: Hebrew letters in a math equation

text: I'm using the Lyx editor. Is it possible, in general, to mix Hebrew characters in a math formula ("math- mode" in Lyx)? When trying to compile a Lyx file with Hebrew in a math formula I get this kind of error: > LaTeX Error: Command \hebgimel unavailable in encoding T1. > > LaTeX Error: Command \hebayin unavailable in encoding T1. Example of a .Lyx file which gives the mentioned error: http://pastebin.com/UvPTwML1 Example of a .tex file which gives the mentioned error: http://pastebin.com/61VES9wV


title: Pgfplots circles

text: I'm having a little trouble drawing circles in pgfplots. Here is my code and then I'll explain:               \documentclass{article}     \usepackage{amsmath}     \usepackage{pgfplots}     \usepackage{color}     \usepackage{tikz}     \begin{document}          \begin{figure}     \centering     \begin{tikzpicture}[shift={(0,0)}]     \begin{axis}[          ticks=none,         axis lines = middle,         axis line style={->},         ymin=0,         xmin=-3,         xmax=3,         xlabel={$Y$},         ylabel={$\pi$}]     \addplot[black, domain=-2:2] {3*x+2};     \addplot[black, domain=-2:2] {2*x+2};     \addplot[red,mark=*] coordinates {(0,3)};     \addplot[red,mark=*] coordinates {(1,3)};     \draw(axis cs:0,3) circle[blue, radius=1];     \end{axis}     \end{tikzpicture}     \end{figure}          \end{document}      Imagine infintely many concentric circles about (0,3). The actual numbers and line equations aren't important; I'm only interested in showing the following relationship: as the line gets steeper, it is tangent to a circle of smaller radius at a higher \pi and lower x. I know there is probably a way for LaTeX to take care of the tangencies for me through intersections or something, but I'm fine with doing the math on my own. My main problem is how can I code the radius of the circle in terms of the coordinates? For example, in my code, the circle has radius one, so it should intersect with the far right red dot. But it doesn't, it's so small you can't see it. Please let me know if you don't understand my request.


title: How to fix the error when importing EPS images with spaces in their path?

text: I am using Windows. The objective is to import all images in a sub directory. I divide into 2 categories, for PNG and EPS, separately as follows. ## For PNG This category works without problem. So you can skip it.               \documentclass{article}          {         \catcode`\^0         \catcode`\\12         ^gdef^dirsep{\}     }          \usepackage[a6paper,margin=15mm]{geometry}     \usepackage{graphicx}     \edef\subdir{Sub Dir\dirsep}          \graphicspath{{"\subdir"}}          \immediate\write18{cmd /c dir /b "\subdir*.png" > imagelist.txt}               \begin{document}     \makeatletter     \newread\reader     \openin\reader=imagelist.txt\relax     \begingroup     \endlinechar=-1\relax     \loop         \readline\reader to \data         \unless\ifeof\reader                 \filename@parse{\data}\noindent                   \includegraphics[scale=.5,ext=.\filename@ext,width=\textwidth,height=\textheight,keepaspectratio]{"\filename@base"}\newpage     \repeat     \endgroup     \closein\reader     \makeatother     \end{document}      ## For EPS               \documentclass{article}          {         \catcode`\^0         \catcode`\\12         ^gdef^dirsep{\}     }          \usepackage[a6paper,margin=15mm]{geometry}          \usepackage{graphicx}     \edef\subdir{Sub Dir} % must be no double quotes used          \graphicspath{{\subdir/}}          \usepackage[space]{grffile}     \usepackage{etoolbox}     \makeatletter     \patchcmd\Gread@eps{\@inputcheck#1 }{\@inputcheck"#1"\relax}{}{}     \makeatother          \immediate\write18{cmd /c dir /b "\subdir\dirsep*.eps" > imagelist.txt}               \begin{document}     \makeatletter     \newread\reader     \openin\reader=imagelist.txt\relax     \begingroup     \endlinechar=-1\relax     \loop         \readline\reader to \data         \unless\ifeof\reader                 \filename@parse{\data}\noindent                   \includegraphics[scale=.5,ext=.\filename@ext,width=\textwidth,height=\textheight,keepaspectratio]{\filename@base}\newpage% must be no double quotes used.     \repeat     \endgroup     \closein\reader     \makeatother     \end{document}      The compilation fails with some errors as follows.               This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/W32TeX)      restricted \write18 enabled.     entering extended mode     (./for eps.tex     LaTeX2e <2011/06/27>     Babel <3.9g> and hyphenation patterns for 78 languages loaded.     (c:/texlive/2013/texmf-dist/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (c:/texlive/2013/texmf-dist/tex/latex/base/size10.clo))     (c:/texlive/2013/texmf-dist/tex/latex/geometry/geometry.sty     (c:/texlive/2013/texmf-dist/tex/latex/graphics/keyval.sty)     (c:/texlive/2013/texmf-dist/tex/generic/oberdiek/ifpdf.sty)     (c:/texlive/2013/texmf-dist/tex/generic/oberdiek/ifvtex.sty)     (c:/texlive/2013/texmf-dist/tex/generic/ifxetex/ifxetex.sty))     (c:/texlive/2013/texmf-dist/tex/latex/graphics/graphicx.sty     (c:/texlive/2013/texmf-dist/tex/latex/graphics/graphics.sty     (c:/texlive/2013/texmf-dist/tex/latex/graphics/trig.sty)     (c:/texlive/2013/texmf-dist/tex/latex/latexconfig/graphics.cfg)     (c:/texlive/2013/texmf-dist/tex/latex/graphics/dvips.def)))     (c:/texlive/2013/texmf-dist/tex/latex/oberdiek/grffile.sty     (c:/texlive/2013/texmf-dist/tex/latex/oberdiek/kvoptions.sty     (c:/texlive/2013/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)     (c:/texlive/2013/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty     (c:/texlive/2013/texmf-dist/tex/generic/oberdiek/infwarerr.sty)     (c:/texlive/2013/texmf-dist/tex/generic/oberdiek/etexcmds.sty     (c:/texlive/2013/texmf-dist/tex/generic/oberdiek/ifluatex.sty))))     (c:/texlive/2013/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty))     (c:/texlive/2013/texmf-dist/tex/latex/etoolbox/etoolbox.sty     (c:/texlive/2013/texmf-dist/tex/latex/etex-pkg/etex.sty))     No file "for eps".aux.     *geometry* driver: auto-detecting     *geometry* detected driver: dvips     ! Bad character code (-1).     \Gread@eps ...catcode `\    10 \catcode \endlinechar                                                        5 \@makeother \:\@makeothe...     l.36 \repeat          ?       ## Downloadable complete MWE The complete code with dummy images in both PNG and EPS format can be downloaded here.


title: Math in section strange PDF output

text: A recently upgraded my computer and on my old PC, this code               \RequirePackage{fix-cm}     \documentclass{scrbook}     \usepackage[no-math]{fontspec}     \usepackage{xunicode,xltxtra}      \usepackage{mathspec}     % Mathfont     \setmathfont{STIXGeneral}     \usepackage[german]{babel} % Neue Rechtschreibung     \usepackage{hyperref}     \usepackage[all]{hypcap}            % Link to start of figures, not captions          \newcommand{\interpolationOp}[1]{\ensuremath{L_{#1}}}     \begin{document}         \tableofcontents         \section{Der Interpolationsfehler         \texorpdfstring{\( \|f-\interpolationOp{\mathbf{M}}f\| \)}{||f- IMf||}          }     \end{document}      Would produce both a correct PDF-Meta-TOC and a correct TOC using XeLaTeX. However, now the TOC looks like this ![Faulty TOC](http://i.stack.imgur.com/LWjWo.png) Deleting either mathspec or the babel packes removes the faulty TOC, but I need both packages. Further, the `.aux` file states               \@writefile{toc}{\contentsline {section}{\numberline {0.1}Der Interpolationsfehler \( \delimiter "026B30D f-\ensuremath  {L_{\mathbf  {M}}}f\delimiter "026B30D  \)}{1}{section.0.1}}      Which looks like `TeX`is expanding (but somehow just since I changed my computer) the `\|`, though the hint from here, declaring a robust command would not work. Any ideas, why this is introduced in my new setup (though i can't say what the difference is, the old PC is not available atm, maybe a difference between MacTex 2013 and 2012)?


title: Howto center images in a size defined table?

text: I have the problem that I have a table which includes two images next to each other and below in the next line there is the caption of the image. The problem is that the images are not shown next to each other, they are up and down. My code:               \begin{table}[!ht]\label{tab:subsecfeeling}     \begin{tabular}{|p{7cm}|p{7cm}|}     \hline     \centering     \includegraphics[width=0.7\linewidth]{Screenshots/Routing/closed_area_ex1.png}     \label{fig:closed_area_ex1}     &      \begin{center}     \includegraphics[width=0.7\linewidth]{Screenshots/Routing/closed_area_ex3.png}     %\label{fig:closed_area_ex3}     \end{center}     \\      \hline     The shown route in this figure is the shortest path from current position to the destination. In this route there exists no closed area. & The shown route in this figure is avoiding the closed door. Therefore the shortest path is to use the way through the next office. \\     \hline      \end{tabular}      \end{table}      The images shows that the images are not next to each other. I want that they are next to each other and not up and down. Besides the text in the next line has to be line braked. I tried also centering in the second image, but then the result was almost the same as I get now. How can put both images in two columns next to each other? ![enter image description here](http://i.stack.imgur.com/hmSPK.png)


title: minipage misalignment when using multicol in a tikzposter

text: Is there anyway to align the multicolumn text with the fiure in the follwoing MWE?               \documentclass[25pt, a0paper, portrait, margin=0mm, innermargin=15mm, blockverticalspace=15mm, colspace=15mm, subcolspace=8mm]{tikzposter}              \usepackage{xcolor}         \usepackage{filecontents}% http://ctan.org/pkg/filecontents         \usepackage{lipsum}% http://ctan.org/pkg/lipsum         \usepackage{tikz}         \usepackage{multicol}         \usepackage{adjustbox}              \setlength{\columnsep}{2cm}              \begin{filecontents*}{myDummyPictureCode.tex}           \begin{tikzfigure}[Some nice caption for the figure]             \centering             \begin{tikzpicture}               \draw [color=red] (0,0) rectangle (20,10) node [midway] {\huge myFigure};             \end{tikzpicture}           \end{tikzfigure}         \end{filecontents*}              \title{Title}         \author{Name}              \usetheme{Autumn}\usecolorstyle[colorPalette=BrownBlueOrange]{Germany}              \begin{document}\maketitle              \begin{columns}          \column{0.7} \block{FigureOutside Block}{           \lipsum[1]         }              \column{0.3} \block{}{         \input{./myDummyPictureCode.tex}         }         \end{columns}              % Text and figure Inside the Block         \block{Text and figure Block using COLUMNS}{         \begin{columns}          \column{0.7} \lipsum[1]         \column{0.3} \input{./myDummyPictureCode.tex}         \end{columns}         }              % Text and figure Inside the Block using minipage         \block{Text and figure Block using MINIPAGE}{           \fbox{           \begin{minipage}[t]{0.7\linewidth}             \lipsum[1]           \end{minipage}%           }           %           \fbox{           \begin{adjustbox}{valign=t}           \fbox{           \begin{minipage}[t]{0.3\linewidth}             \input{./myDummyPictureCode.tex}           \end{minipage}            }           \end{adjustbox}           }         }              % playing with multicolumn text         \block{Text and figure Block using MULTICOLS}{           \begin{multicols*}{3}             \lipsum[1]             \input{./myDummyPictureCode.tex}           \end{multicols*}         }              % playing with multicolumn text         \block{Text and figure Block using MINIPAGE and MULTICOLS}{           \fbox{           \begin{minipage}[t]{0.7\linewidth}           \begin{multicols*}{2}             \lipsum[1]           \end{multicols*}           \end{minipage}%           }           %           \fbox{           \begin{adjustbox}{valign=t}           \fbox{           \begin{minipage}[t]{0.3\linewidth}             \input{./myDummyPictureCode.tex}           \end{minipage}            }           \end{adjustbox}           }         }              \end{document}      ![enter image description here](http://i.stack.imgur.com/aUJzB.png)


title: How to create a complex table?

text: Since I have only little experience in Latex, I'm not sure how to create a specific table as shown in the example screenshot. Is such a table even possible with Latex and if yes, where do I need to start? Or is the layout maybe not the best choice and I should setup the layout of the table in another way? ![Table Layout example](http://i.stack.imgur.com/JTOEV.jpg)


title: How to make multiline numbered heading?

text: is it possible to have for example sections numbered in row above ? kind of like chapters work instead of having: > 1 Section alpha > > 2 Section beta i'd like to have > Section 1 > > Alpha > > Section 2 > > Beta is it possible to achieve with generic heading style?


hyperref: Wrong DVI mode driver option `dvips',(hyperref)     because pdfTeX or LuaTeX is running in PDF mode. \ProcessKeyvalOptions{Hyp}      How can i fix this error? I m trying to compile a template of MMA journal. It is under this link MMA Template


title: Breaking words at the end of line

text: LaTeX tends to break words at the end of the line when that causes better typography. Great. I'd like to have some sort of influence on where the words are broken, though. For example, LaTeX currently breaks `cryptography` into `cryptog-raphy` when it does not fit, while I would much rather break it into `crypto-graphy`. I've tried putting an mbox around it (or around both parts of the word) but that just ends up overflowing the hspace. Is there a way I can put a box around the word but still allow a break at designated points, i.e. after `crypto` and before `graphy`? I'm fine with doing this on a per-word basis manually.


title: Images not visible in PDF

text: I have a strange problem. In some of the PDF readers, the images are not visible. In others, the images are visible but font size of the text below the image for that page becomes really tiny. Is it a problem with the images?


title: footnoterule not moving with footnote

text: I'm using the `book` documentclass and the `footmisc` package. I made some changes to the original footnote macros, and this causes the following problem when the footnoted word is on the last couple of lines of the page: ![](http://i.stack.imgur.com/effHT.png) A minimal (not)working example:   book.main.tex   mylayout.sty If line 67. in mylayout.sty is commented out, the footnoterule and the footnote moves to the next page, which is the expected behaviour. It beats me why it leaves the rule on the prev. page otherwise.


title: printf-style number formatting in LaTeX

text: Is there a way to use printf-style number formatting strings in Latex like `%.3f`, `%d`, etc? I'm loading some data from csv files using the `datatool` package and would like to have it displayed exactly to my specifications.


title: If pagestyle equal to... -- How should I ask it?

text: I'd like to use (or define) an If-statement for pagestyle.   I have no idea :( Update:   I'm using in my document about 4 pagestyles. Just as a little example I wish to have at the border of my document informations about jobname, date, time, lastsheet and sheetsequence AND size of the actual page. The size of the actual page is not everytime the same. That is why I thought, if I could define easy an if statement, it could be a great solution. What I mean:               \ifthenelse{\equal{pagestyle}{numberone}}{size: $210 \times 297 $}{size: $420 \times 297$}      I hope it is clear now


title: Including a length-dependent page range using pdfpages

text: I'd like to extract pages from 16 to (last page minus one) using `pdfpages`. I know I can access the last page via the token `last`, but I need to do arithmetic on it, to get a page range that looks like `16-(last-1)`. Is there a way to do this in `pdfpages` ?


title: Bracket position rule

text: What is rule in specifying bracket position:               \foo[]{} %or      \foo{}[]        Following syntaxes are clear, is there any other combinations?               \foo{}{}      \foo{}      ...


title: How can I make comments and text appear side-by-side?

text: I need your help. I'm going to write philological commentary on Cicero's speech in XeLaTeX, but I don't know how to make a combination of text and commentary (look below for examples). Is it possible to do? Below are two pages from another commentary (Caesaris Commentarii de bello Gallico). You can see the main idea. ![Caesaris Commentarii de bello Gallico, page 11](http://i.stack.imgur.com/rizvm.png) ![Caesaris Commentarii de bello Gallico, page 12](http://i.stack.imgur.com/sEFFp.png)


title: XeTeX, fontspec and Garamond

text: I've got the opportunity to play with a machine with some premium fonts installed. I ran some experiments with XeTeX and e.g. Palatino Linotype, which worked, but for some reason cyrillic breaks with Garamond Premier Pro. The result may be downloaded here. UPDATE: It turns out the machine had two versions of Garamond Premier Pro installed, one of which apparently has faulty Cyrillic support even though it advertises cyrillic in `otfinfo -s`. I disabled this version and everything now works fine.               \documentclass[a4paper,12pt]{article}     \usepackage[MnSymbol]{mathspec}     \usepackage{xunicode,xltxtra}          \setmainfont[Mapping=tex-text,Numbers={OldStyle},Ligatures{Common},Contextuals=Alternate]{Garamond Premier Pro}          \begin{document}     Queue stop acte effet shelfful shelf{\null}ful παιδείαὫ $\pi\alpha\phi\Omega$ Черникова ---     \end{document}


title: Naming LyX layout appropriately

text: I am continuing my question from Class relationship between two given .cls file? To use an custom document class one needs to create LyX layout named appropriately. In my custom document class. I have code like this               \if@Synopsis          \LoadClass[12pt,a4paper]{article}     \else         \LoadClass[12pt,a4paper]{report}     \fi      It is dynamically loading either the `article` or `report` class. So, in this case can anyone let me know how to name my LyX layout?


title: Disabling use of long form when first using an acronym generated by glossaries

text: When using the acronym option of the `glossaries`-package, the first use of an acronym results in the display of > Long Entry (Short Entry) I want to disable this globally. I know, I could just solve this by changing my entries for every single acronym. But I don't want to do this. There has to be some kind of command to do this?               \documentclass{article}     \usepackage[acronym, shortcuts]{glossaries}           \makeglossaries     \begin{document}     \printglossaries     \newacronym{key}{Short Entry}{Long Entry}          The first use of $\backslash $ac\{key\} displays ''Long Entry (Short Entry)'', but should only display ''Short Entry''.          \end{document}


title: how to translate coordinate in tikz 3dplot?

text: \tdplotsetmaincoords{30}{30}            \begin{tikzpicture}[scale=5,tdplot_main_coords]              \def\x{1};         \def\y{1};         \def\z{1};              \coordinate (O) at (\x,\y,\z);         \tdplotsetcoord{P}{1.414213}{54.68636}{45}              \draw[fill=gray!50,fill opacity=0.5] (\x,\y,\z) -- ((\x,\y,\z)+Py) -- ((\x,\y,\z)+Pyz) -- ((\x,\y,\z)+Pz) -- cycle;        % \draw[fill=blue,fill opacity=0.5] (O) -- (Px) -- (Pxy) -- (Py) -- cycle;     %    \draw[fill=green,fill opacity=0.5] (O) -- (Px) -- (Pxz) -- (Pz) -- cycle;        % \draw[fill=yellow,fill opacity=0.5] (Pz) -- (Pyz) -- (P) -- (Pxz) -- cycle;         %\draw[fill=red,fill opacity=0.5] (Px) -- (Pxy) -- (P) -- (Pxz) -- cycle;         %\draw[fill=pink,fill opacity=0.5] (Py) -- (Pxy) -- (P) -- (Pyz) -- cycle;            \end{tikzpicture}      How can I translate every projection of P by ((\x,\y,\z) ?


title: I am using twocolumn svjour3 template to submit a paper. I want to write long equations as a single column. But I get an error message

text: Here's what I did: I have the same problem with long equations in the svjour3 document class. I want to display the long equations as a single column. I tried               \documentclass[twocolumn]{svjour3}          % twocolumn     \usepackage{widetext}     \begin{document}          \begin{widetext}     \begin{eqnarray}     %long equation here     \end{eqnarray}     \end{widetext}               \end{document}      but I get the error message:               ! LaTeX Error: Environment widetext undefined.      Please help. Thanks!


title: Tikz paths not starting/ending at edges of nodes

text: I'm trying to draw a graph with directed arcs. There will be quite a few arcs, so I'll need to bend them in various ways so the diagram is legible. Here is what I have so far:               \begin{tikzpicture}         \filldraw [pattern=north east lines] (0,0) circle (0.333) node (h1);              \fill [blue, opacity=0.33] (1.5,1.5) circle (0.333);         \draw (1.5,1.5) circle (0.333) node (1_1) { 1:1 };         \fill [green, opacity=0.33] (1.5,0) circle (0.333);         \draw (1.5,0) circle (0.333) node (2_1) { 2:1 };         \fill [red, opacity=0.33] (1.5,-1.5) circle (0.333);         \draw (1.5,-1.5) circle (0.333) node (3_1) { 3:1 };              \filldraw [pattern=north east lines] (3,0) circle (0.333) node (h2);              \fill [orange, opacity=0.33] (4.5,0.75) circle (0.333);         \draw (4.5,0.75) circle (0.333) node (4_1) { 4:1 };         \fill [orange, opacity=0.33] (6,0.75) circle (0.333);         \draw (6,0.75) circle (0.333) node (4_2) { 4:2 };         \fill [purple, opacity=0.33] (4.5,-0.75) circle (0.333);         \draw (4.5,-0.75) circle (0.333) node (5_1) { 5:1 };         \fill [purple, opacity=0.33] (6,-0.75) circle (0.333);         \draw (6,-0.75) circle (0.333) node (5_2) { 5:2 };              \filldraw [pattern=north east lines] (7.5,0) circle (0.333) node (h3);              \fill [teal, opacity=0.33] (9,0.75) circle (0.333);         \draw (9,0.75) circle (0.333) node (6_1) { 6:1 };         \fill [teal, opacity=0.33] (10.5,0.75) circle (0.333);         \draw (10.5,0.75) circle (0.333) node (6_2) { 6:2 };         \fill [olive, opacity=0.33] (9.75,-0.75) circle (0.333);         \draw (9.75,-0.75) circle (0.333) node (7_1) { 7:1 };              \filldraw [pattern=north east lines] (12,0) circle (0.333) node (h4);         \filldraw [pattern=north east lines] (13.5,0) circle (0.333) node (h5);              \draw [->] (0.333,-2.5) -- (13.3335,-2.5) node [midway, below] {Time};              \path [line, ->] (h1) edge [bend left=15] (1_1);         \path [line, ->] (h1) edge (2_1);         \path [line, ->] (h1) edge [bend right=15] (3_1);         \path [line, ->] (1_1) edge [bend left=15] (h2);         \path [line, ->] (2_1) edge (h2);         \path [line, ->] (3_1) edge [bend right=15] (h2);         \path [line, ->] (h2) -- (4_1);         \path [line, ->] (h2) -- (5_1);         \path [line, ->] (4_1) -- (4_2);         \path [line, ->] (5_1) -- (5_2);         \path [line, ->] (4_2) -- (h3);         \path [line, ->] (5_2) -- (h3);         \path [line, ->] (h3) -- (6_1);         \path [line, ->] (h3) -- (7_1);         \path [line, ->] (6_1) -- (6_2);         \path [line, ->] (6_2) -- (h4);         \path [line, ->] (7_1) -- (h4);         \path [line, ->] (h4) -- (h5);              \path [line, --] (h1) edge [bend left] ++(1.5,2.5) -- (h2);     \end{tikzpicture}      which produces: ![Current graph](http://i.stack.imgur.com/uTmSi.png) A few things that I can't seem to fix:   1. The directed arcs do not seem to start and end at the edges of the circles. I was just going `\path [line,->] (h1) -- (1_1);` which produced a different result, but I wasn't sure how to do the `bend left` with that. Also, `edge` seemed like it should fix the problem,even though it actually made it worse.   2. Notice my last line: `\path [line, --] (h1) edge [bend left] ++(1.5,2.5) -- (h2);`. I want to connect `(h1)` to `(h2)` but I want the line to go above `(1_1)` so it's not too cramped. For some reason, the line isn't getting to `(h2)`. I tried `bend left=200` but this just makes it look weird. Also, the arrow is different to the other arrows in the graph. And I'm not sure why there's an arrow at all, since there is no `->` on that line anywhere.


title: Three quotation levels for csquotes

text: The recommended way of solving nested quotations in Norwegian is to use «» for the outer level and then alternating between ‘’ and “”. (Source) ![](http://www.typografi.org/sitat/faustus_220x151.gif) Is it a large undertaking to do this with `csquotes`?


title: Reverse numbering of bibitems -- moderncv and plainnat

text: I want to number bibliography items in the reverse order -- with `moderncv` and `plainnat` bibliography style. # Reference: Enrico's answer at: Bibtex reverse numbering I tried with Enrico's code, but with `moderncv` and `plainnat` (as I want issn, doi etc). But I could not succeed without any errors and warnings. Here is the code that does not work at all. Sorry for the big code, but it contains necessary bib data and actual code is at the bottom and is minimal. This needs that `modercv.cls` and `.sty` files (from http://www.LaTeXTemplates.com) be put in the same directory.               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % "ModernCV" CV and Cover Letter     % LaTeX Template     % Version 1.1 (9/12/12)     %     % This template has been downloaded from:     % http://www.LaTeXTemplates.com     %     % Original author:     % Xavier Danaux (xdanaux@gmail.com)     %     % License:     % CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)     %     %% Important note:  %% <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<     % This template requires the moderncv.cls and .sty files to be in the same     % directory as this .tex file. These files provide the resume style and themes     % used for structuring the document.          %%%--------------------------Uncomment if bib files are needed---------------------------------%%          %\begin{filecontents}{mypub.bib}     %@Article{johnson-74,     %  author =       "G. B. Johnson",     %  title =        "Enzyme Polymorphism",     %  journal =      "Science",     %  volume =       "184",     %  pages =        "28--37",     %  year =         "1974",     %}     %     %@Article{johnson-howells,     %  author =       "G. B. Johnson and W. W. Howells",     %  title =        "Title title title title title title title title title     %                 title",     %  journal =      "Journal journal journal",     %  year =         "1974",     %}     %     %@Article{johnson-etc,     %  author =       "G. B. Johnson and W. W. Howells and A. N. Other",     %  title =        "Title title title title title title title title title     %                 title",     %  journal =      "Journal journal journal",     %  year =         "1976",     %}     %     %@Manual{anon-67,     %  author =       "Anon.",     %  title =        "Title title title title title title title title title     %                 title",     %  organization = "Organization organization organization",     %  year =         "1967",     %}     %     %@Article{aslin-49,     %  author =       "E. J. Aslin",     %  title =        "Photostat recording in library work",     %  journal =      "Aslib Proceedings",     %  year =         "1949",     %  volume =       "1",     %  pages =        "49--52",     %}     %     %@Article{fletcher-hopkins,     %  author =       "W. M. Fletcher and F. G. Hopkins",     %  title =        "Lactic Acid in Amphibian Muscle",     %  journal =      "J. Physiol.",     %  year =         "1907",     %  volume =       "35",     %  pages =        "247--309",     %}     %     %\end{filecontents}     %%%-conference bib data --------------------------     %\begin{filecontents}{mypub-conf.bib}     %@CONFERENCE{Raja2007a,     %  author = { R. Ganesh and Harish Kumar},     %  title = {Title of the paper Power Industry},     %  booktitle = {39\textsuperscript{th} North American Power Symposium},     %  year = {2007},     %  number = {978-1-4244-1726-1},     %  address = {USA},     %  month = {September 10--14,},     %  organization = {New Mexico State University},     %  publisher = {IEEE},     %  owner = {Anupama},     %  timestamp = {2013.01.26}     %}     %     %@CONFERENCE{Rac2010,     %  author = {R. Rajesh and Harish Kumar},     %  title = {Title of the paper Transfer Capability},     %  booktitle = {International Conference on Computer Applications in Electrical Engineering     %   Recent Advances},     %  year = {2010},     %  address = {Roorkee},     %  month = {February 19--21,},     %  organization = {IIT Roorkee},     %  publisher = {IEEE},     %  owner = {hcl},     %  timestamp = {2013.01.24}     %}     %     %@CONFERENCE{CRa2009,     %  author = {R. Rajesh and Harish Kumar},     %  title = {Title of the paper Using Differential Evolution},     %  booktitle = {International Conference on Control, Automation, Communication and     %   Energy Conservation},     %  year = {2009},     %  address = {Erode},     %  month = {June 4--6,},     %  publisher = {IEEE},     %  owner = {Anupama},     %  timestamp = {2013.01.26}     %}     %     %@CONFERENCE{Raj2007,     %  author = {R. Rajesh and Harish Kumar},     %  title = {Title of the paper deregulated     %   Environment},     %  booktitle = {International Conference on Power Systems},     %  year = {2007},     %  address = {Bangalore},     %  month = {December 12--14,},     %  organization = {Central Power Research Institute},     %  publisher = {IEEE}     %}     %     %@CONFERENCE{CRy2006,     %  author = {R. Rajesh and Harish Kumar},     %  title = {Title of the paper},     %  booktitle = {IEEE Power India Conference},     %  year = {2006},     %  number = {240},     %  address = {New Delhi},     %  month = {April 12--14,},     %  organization = {IIT Delhi},     %  publisher = {IEEE}     %}     %\end{filecontents}          \documentclass[11pt,a4paper,sans]{moderncv}          \moderncvstyle{classic}     \moderncvcolor{orange}     \usepackage{uri}          %----------------------------------------------------------------------------------------     %   NAME AND CONTACT INFORMATION SECTION     %----------------------------------------------------------------------------------------          \firstname{Harish} % Your first name     \familyname{Kumar} % Your last name          % ????????????????? will this be needed???????????????//     \makeatletter     \renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}     \makeatother     %     %% bibliography with mutiple entries     \usepackage{multibib}     \newcites{journal,conference}{{Journals},{Conferences}}     \usepackage{natbib}     %%%------------------------------------------------------------------     %%% Reverse numbering of bibliography: Enrico's code from -- http://tex.stackexchange.com/a/75613/11232     \usepackage{etaremune}     \makeatletter     \long\def\thebibliography#1{%       \subsection*{\refname}%       \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}       \settowidth{\dimen0}{\@biblabel{#1}}%       \setlength{\dimen2}{\dimen0}%       \addtolength{\dimen2}{\labelsep}       \sloppy       \clubpenalty 4000       \@clubpenalty       \clubpenalty       \widowpenalty 4000       \sfcode `\.\@m       \renewcommand{\labelenumiv}{\@biblabel{\theenumiv}} % labels like [3], [2], [1]       \begin{etaremune}[labelwidth=\dimen0,leftmargin=\dimen2]\@openbib@code     }     \def\endthebibliography{\end{etaremune}}     \def\@bibitem#1{%       \item \if@filesw\immediate\write\@auxout{\string\bibcite{#1}{\the\value{enumiv}}}\fi\ignorespaces     }     \makeatother          %%%------------------------------------------------------------------          \listfiles          %----------------------------------------------------------------------------------------          \begin{document}          \makecvtitle     %%------------------------------------------------------------------     \section{Publications}     \nocitejournal{*}     \bibliographystylejournal{plainnat}     \bibliographyjournal{mypub}     %     \nociteconference{*}     \bibliographystyleconference{plainnat}     \bibliographyconference{mypub-conf}          %----------------------------------------------------------------------------------------          \end{document}      # Question: How to get an output with references numbered in decreasing order using `moderncv`, `plainnat`, `multibib` all put together in action?


title: Cases environment with SIAM document class

text: It seems as though the SIAM class does not play nice with the cases environment. For example               $$     \begin{cases}     x & y     \end{cases}     $$      will produce the error               misplaced alignment tab character      Oddly enough,               $$     \begin{cases}     x \\ y     \end{cases}     $$      compiles, but puts x and y on the same line.


title: How can I mark a x-coordinate?

text: I made a little plot for the birthday paradox. It looks like this: ![enter image description here](http://i.stack.imgur.com/Dywjv.png) This is perfectly fine, but I would like to mark x=23. So my question is: **How do I get the following lime line?** ![enter image description here](http://i.stack.imgur.com/UqwH3.png) This is the current source:               \documentclass{article}     \usepackage[pdftex,active,tightpage]{preview}     \setlength\PreviewBorder{2mm}          \usepackage{pgfplots}     \usepackage{tikz}     \usetikzlibrary{arrows,positioning, calc}          \begin{document}     \begin{preview}     \begin{tikzpicture}         \begin{axis}[             width=15cm, height=8cm, % size of the image             grid = major,                        grid style={dashed, gray!30},             %xmode=log,log basis x=10,             %ymode=log,log basis y=10,             xmin=0,             xmax=62,             ymin=0,              ymax=1.1,             /pgfplots/xtick={0,5,...,60},             extra y ticks={0.507297},             ylabel=probability of at least one birthday-collision,             xlabel=people,              tick align=outside]           \addplot table [id=exp]{data.csv};           \addplot[domain=0:23, blue, dashed, thick] {0.507297};            %stirling-formulae           \addplot[domain=0:60, red, thick] {1-(365/(365-x))^(365.5-x)*e^(-x)};          \end{axis}      \end{tikzpicture}     \end{preview}     \end{document}


title: Create macro with several options

text: I struggle to create a macro that can take several options. What I want to create is for `\mycommand[up,middle]{Macro}` to output `Macro with 'up' and 'middle' specified`. Using `etoolbox` in the MWE below I can output single options as well as when nothing or an invalid option is given. But I don't know how to output multiple options. I do not have to use `etoolbox`, but I quite like the syntax. David Carlisle suggested something like `\newcommand\foo[2][]{\@for\tmp:=#1\do{.... something with \tmp and #2...}}` but I don't see how I can apply this to my example.               \documentclass{article}     \usepackage{etoolbox}          \newrobustcmd{\mycommand}[2][]{%      \ifstrequal{#1}{up}{% option up        #2 with `up' specified        }{% option middle        \ifstrequal{#1}{middle}{%         #2 with `middle' specified         }{% nothing specified         \ifstrempty{#1}{%          #2 with nothing specified          }{% something specified          #2 is invalid        }{\relax}%       }{\relax}%      }%     }%          \begin{document}          \mycommand[up]{Macro}          \mycommand[middle]{Macro}          \mycommand[]{Macro}          \mycommand[bla]{Macro}          \end{document}      ![enter image description here](http://i.stack.imgur.com/jkej3.png)


title: Adding labels to graph in xy package

text: I'm using `xy` package to draw a simple graph representation. How can I add the labels to the egdes? Here is the code I've produced so far:               \xygraph{     !{<0cm,0cm>;<1cm,0cm>:<0cm,1cm>::}     !{(0,1) }*+{\bullet_{r}}="r"     !{(3,0) }*+{\bullet_{k1}}="k1"     !{(4,1) }*+{\bullet_{a}}="a"     !{(2,1) }*+{\bullet_{b}}="b"     !{(3,2) }*+{\bullet_{c}}="c"     !{(2,3) }*+{\bullet_{d}}="d"     !{(1,2) }*+{\bullet_{e}}="e"     "k1":"a" "k1":"b"     "b":"c" "a":"c"     "b":"r"     "c":"d" "d":"e"     "e":"b"     }


title: Superimposing characters in text mode (pdfTeX)

text: I'm trying to compose a non-Unicode character by arranging Unicode characters one above the other or one next to the other close-up, but I'd need a negative space which in text mode isn't available. Is there a way to get something similar?


title: Disabling ligatures in section headings

text: I've redefined my `section` headings to be `\Huge` but I don't like the ff and fi ligatures at this size, how can I disable ligatures for sections or above a certain pt size? I'm using pdflatex with the MinionPro package (Minion Pro for both body text and section headings) and `\documentclass[10pt]{article}` and microtype `(\usepackage[protrusion=true,expansion=true]{microtype}`) but I can move to xelatex or lualatex if necessary. I'd like to keep microtype expansion though.               \documentclass[11pt]{article}     \usepackage{MinionPro}     \usepackage[protrusion=true,expansion=true]{microtype}     \usepackage{titlesec}     \titleformat*{\section}{\Huge}          \begin{document}          \section{I don't like the ff ligature here}          But I do like the ff ligature here!          \end{document}      A slight complication, perhaps, is that the document is written in Markdown and the pdf is produced through pandoc. Pandoc doesn't seem to like suppressing a ligature like `f{}f` but is happy for macros, so my current work-around is to use a macro `f\noligature f` where `\noligature` inserts `{}`. But this spoils the simplicity of the Markdown syntax.


title: Name and Title on separate lines in Modern CV

text: Basically I want to have the Name and Title sections in Modern CV on separate lines and not have the "|" separator. I figured out that to get rid of the separator I can just remove it in the moderncvbanking.sty file and then I replace it with \newline. Problem is the text is now off centre, how could I fix this? ![enter image description here](http://i.stack.imgur.com/y18rj.png)


title: Spacing of consecutive equation versus a single gather

text: I know the spacing produced by the following two approaches is slightly different. So my question is which one should I choose? Is it about personal preference? ## With 3 consecutive `equation` environments ![spacing example](http://i.stack.imgur.com/fWsiq.png) ## With a single `gather` environment ![gather example](http://i.stack.imgur.com/fSSAW.png) ## Code               \documentclass[preview,multi,border=12pt]{standalone}     \usepackage{amsmath}               \begin{document}          \begin{preview}     The following equations are too simple,     \begin{equation}     v_t=v_0+at     \end{equation}     \begin{equation}     s=v_0t+\tfrac{1}{2}at^2     \end{equation}     \begin{equation}     v_t^2=v_0^2+2as     \end{equation}     where $a$ is the acceleration.     \end{preview}               \begin{preview}     The following equations are too simple,     \begin{gather}     v_t=v_0+at\\     s=v_0t+\tfrac{1}{2}at^2\\     v_t^2=v_0^2+2as     \end{gather}     where $a$ is the acceleration.     \end{preview}          \end{document}


title: Flowchart: adding label in top of picture

text: I've got the following TikZ picture:               \begin{tikzpicture}[node distance=2cm, scale=0.7, transform shape]     \node (start) [func-entry] {Config.getText(\textbf{key})};     \node (dec1) [decision, below of=start] {\textbf{key} in\\ \emph{localized \_labels?}};     \node (dec2) [decision, right of=dec1, node distance=4cm] {\textbf{key} in\\ \emph{default \_language \_labels?}};     \node (stop) [stop, right of=dec2, node distance=4cm] {Return \textbf{key}};     \node (stop2) [stop, below of=dec1, node distance=2.6cm, xshift=2cm] {Return its value};          \draw [arrow] (start) -- (dec1);     \draw [arrow] (dec1) -- node[anchor=south] {No} (dec2);     \draw [arrow] (dec2) -- node[anchor=south] {No} (stop);     \draw [arrow] (dec1) |- node[anchor=east] {Yes} (stop2);     \draw [arrow] (dec2) |- node[anchor=west] {Yes} (stop2);          \end{tikzpicture}      which looks like this with my concrete node definitions: ![Result](http://i.stack.imgur.com/P2nq9.png) How do I add a label, like _localized_labels = /some/file/path/here_ to the top or bottom of the picture without affecting the layout of the current nodes? I want the label to be included IN the picture (e.g. just doing it outside the tikzpicture is not ideal). I've tried drawing a node with [draw=none] at (0,0), but it draws on top of the existing nodes. What I want to do is to "shift" the current group of nodes down and then add the label in the top, but without affecting alignment of current nodes.


title: How to provide a mask highlighting an arrow tip over a cluttered background in Tikz?

text: I have a series of technical drawings that I use for background, highlighting features or adding dimensions and notes with Tikz. In some cases the background is very busy, and arrows tend to "disappear" in it. Using colors for arrows is not an option as the final technical brochure will be B/W. I am looking for an easy way to draw a white arrow tip over the background, slightly oversized compared to the normal arrow tip, in order to mask the background locally and enhance the (black) arrow tip visibility, drawn later. I have supplied a MWE to illustrate the context. In reality, the backgrounds I deal with are worse that in the MWE.               \documentclass[border= 5mm]{standalone}     \usepackage{tikz}     \usetikzlibrary{patterns, arrows}     \begin{document}     \begin{tikzpicture}     \draw [step=0.1cm, pattern=north west lines] (-1,0) [very thick] rectangle (0.01, 3);     \draw [step=0.1cm, pattern=north west lines, very thick] (0,0) rectangle (1.42,1.4);     \draw [step=0.1cm, pattern=north east lines] (0,1.42) [very thick] rectangle (1.5,3);     \draw[] (-4.5,0)  -- (-2,0) node[above, midway, text width =2.3cm]{Clearance: 0,1 to 0,2 mm};     \draw[->, >= triangle 45] (-2,0)  -- (0.5,1.38);     \end{tikzpicture}     \end{document}


How can I duplicate the example in longtable.pdf? I see several features in the example table from the longtable package documentation pages 2 & 3\. I want to build an example from that table. I can see it in the dtx, but cannot get my sample to work.


title: top align minipage in tabular

text: I have one table with 2 minipages. I wish to top align the two minipages. e.g.               \documentclass{standalone}     \usepackage{adjustbox}     \begin{document}          \begin{tabular}{|l|l|} \hline         \begin{minipage}{.5\linewidth}             \begin{tabular}{|l|l|} \hline                 1 & 2 \\ \hline                 3 & 4 \\ \hline                 5 & 6 \\ \hline             \end{tabular}         \end{minipage} &              \begin{minipage}{.5\linewidth}             \begin{tabular}{|l|l|} \hline                 7 & 8 \\ \hline             \end{tabular}         \end{minipage} \\ \hline     \end{tabular}          \end{document}      Now the output is as below: ![enter image description here](http://i.stack.imgur.com/XoVbu.png) How can we align the second minipage on top? That means "7 8" line aligned with "1 2" line.


title: why I can't use footnote(insert) in nested boxes?

text: Sometimes, I need insert footnotes in nested boxes, but it seems that I can't use footnotes in nested boxes.               % ok     \hbox{a\footnote{$^1$}{a footnote}}      but not this               % won't get a footnote     \hbox{a\hbox{b\footnote{$^1$}{a footnote}}}      In TeXbook, it said > The `\footnote` macro should be used only in `paragraphs` or `hboxes` that > are contributed to TeX's main vertical list; insertions will be lost if they > occur inside of boxes that are inside of boxes. Thus, for example, you > should not try to put a `\footnote` into a subformula of a math formula. But > it's OK to use footnotes within `\centerline`(it is like the first example). so, why I can't use footnotes in nested boxes(the second example)? the reason behind the scenes? then, how can I use footnotes in nested boxes?


title: Crossrefs not showing up in bibliography with biblatex

text: I'm using BibDesk for mac (just a front-end for creating and maintaining a BibTex file) and `BibLaTeX-mla`. The problem I'm having is that as long as I'm setting `BibLaTeX` to `style=mla`, then the citation shows up in-line, but not in the actual bibliography. The hyperlink even works, but it just goes to below the other citation. The LaTeX file is as follows:               \documentclass[12pt,letterpaper]{article}     \usepackage[parfill]{parskip}     \usepackage[american]{babel}     \usepackage{csquotes}     \usepackage{hyperref}     \usepackage[style=mla]{biblatex}     \usepackage{mla}     \defbibheading{bibliography}{\newpage\centering Works Cited}     \bibliography{Bibliography}     \begin{document}     \begin{mla}{Stephen}{Searles}{Professor's last name}{Class name}{\today}{Title}     Start typing paragraph 1 here     Continue the rest of the paper as normal \cite{Kauffman:2002kx}.     \begin{center}     \printbibliography     \end{center}     \end{mla}     \end{document}      And the related BibTex records:               @book{shepard2002act,         Date-Added = {2011-02-25 12:48:03 -0800},         Date-Modified = {2011-02-25 12:48:03 -0800},         Editor = {Shepard, B. and Hayduk, R.},         Isbn = {1859843565},         Publisher = {Verso Books},         Title = {From ACT UP to the WTO: Urban protest and community building in the era of globalization},         Year = {2002}}          @inbook{Kauffman:2002kx,         Author = {Kauffman, LA},         Chapter = {A short history of radical renewal},         Crossref = {shepard2002act},         Date-Added = {2011-02-25 13:04:16 -0800},         Date-Modified = {2011-02-25 13:04:56 -0800},         Pages = {35-39}}      Am I doing something wrong here?


title: Customizing LyX Shortcuts

text: I am using LyX 2.0.6 on my macbook and would like to define a few custom shortcuts to make my life easier. In particular, I'd like to add the following command: `control``f``a` should insert an algorithm float. LyX is installed in `/Applications` and uses `/Applications/LyX/Contents/Resources/bin/mac.bind` as it's keyboard shortcuts config file   So I looked at the syntax in in there and came up with the following `custom.bind`:               # Command - C      # Option  - A      # Control - M      # Shift   - S           Format 1          \bind "C-S-r"                       "dialog-show-new-inset ref"     \bind "C-A-c"                       "citation insert"     \bind "C-A-t"                       "citation insert"     \bind "M-f ~S-a"                    "float-insert algorithm"     \bind "M-f ~S-f"                    "float-insert figure"     \bind "M-f ~S-t"                    "float-insert table"      Now, this custom.bind lives at `~/.config/LyX/custom.bind`, so I added the following line to my `mac.bind`:               \bind_file ~/.config/LyX/custom.bind      But I am unable to use the float command that I have defined in `custom.bind`. Thinking that this was an error in my syntax, I copied that line into `menus.bind` (and changed the bind file in LyX) and it did indeed work. So why don't the commands in my custom.bind work? Technical Specs:   * mac OSX 10.9.4 (Mavericks)   * LyX 2.0.6


title: Palatino displays wrong opening quotes

text: I've just started using Palatino for my documents, and I've realized the opening quotes are all rendered as closing quotes. As per the question What is the best way to use quotation mark glyphs I use ```hello''` to quote, but somehow Palatino is always showing both as closed. If I uncomment `\usepackage[sc]{mathpazo}` then they are rendered correctly. How can I fix this?


title: What settings for \[x]spaceskip would you suggest for Linux Libertine?

text: Quite contrary to my own answer here, I think that the default `\spaceskip` setting for Linux Libertine is rather unfortunate: seemingly, the shrink component is too high (and I end up getting to narrow spaces in tight lines). So my question is: what setting would you recommend, and how it should be achieved (`\spaceskip` is global for all fonts, and I'd like only to change the shrink component of a space in Linux Libertine). I am using XeLaTeX, and I don't know whether `\fontdimen`s work as in vanilla [pdf][e]tex.


title: TeXnicCenter typing macros

text: Sometimes my LaTeX document gets long and messy, and so it's hard for me to look through and find what I want. When I program, I usually have a macro in my IDE that creates a separator of comments to keep the code clean. I'm looking for something similar in TeXnicCenter. So it would insert the following               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%      Or something to that effect. Now if TeXnicCenter doesn't have the capability of making macros like this, is there a way I could take advantage of the autocomplete system to do this? So I would add a custom command to the TeXnicCenter LaTeX XML files so that it would autocomplete with the percent signs. Does anyone know how to do this?


title: Precompile header with xelatex

text: I read about precompiling the preamble in http://tex.stackexchange.com/a/15606/4918 and it worked fine with `pdflatex` but how can I do this for `xelatex`? I tried               xelatex -ini -shell-escape -job-name="header" "&xelatex header.tex\dump"      but it ends with an error:               ! Can't \dump a format with native fonts or font-mappings.     <*> &xelatex header.tex\dump


title: Opposite of \allowdisplaybreaks

text: If i load the `amsmath` package it doesn't allows to break by default alignments across the pages in the `multline`, `align`, `gather`, `alignat` environments and their starred versions. Howewer it exists the **global declaration** `\allowdisplaybreaks` (or `\allowdisplaybreaks[1-4]`) allowing breaks. This declaration can be placed in the _preamble_ of the document or in _anywhere_ of the document from which it has the effect. Suppose you want to cancel this effect later in the document (reset to default) thereafter, Is there a **global declaration** opposite to `\allowdisplaybreaks` to do this?


title: How do I activate hanging punctuation with XeteX under ConTeXt?

text: I'm noob at ConTeXt. I want to use auto2 font with ConTeXt, I think the easiest way to do that is using the XeTeX backend. ConTeXt can do some protrusion with pdfTeX and LuaTeX, but with XeTeX it doesn't, but as far as I know XeTeX does marging kerning. So why I need to enable it under ConTeXt? Any clue would be very appreciated!


title: Text being output when none should be

text: I am confused as to why the MWE below produces **any** black text. As the code is below, the output is: ![enter image description here](http://i.stack.imgur.com/SxHlJ.png) However, if you comment out the `\IfStrEq` line then it works fine and the black text goes away?               \documentclass{article}     \usepackage{xcolor}     \usepackage{xstring}     \usepackage{xparse}          \NewDocumentCommand{\GetTexFilePath}{m m m}{%         \IfStrEq{#1}{SpecialValue}{}{}% this should do nothing         %         ../../../#1/#2/#3%     }%          \begin{document}     \def\FileWithPath{\GetTexFilePath{01}{02}{z}}%     \IfFileExists{\FileWithPath}{%         \textcolor{red}{File \FileWithPath\ found.}%     }{%         \textcolor{red}{File \FileWithPath\ not found.}%     }%     \end{document}


title: Some issues with title page

text: I have a few problems whilst creating my title page.   1. How would italicize just the email, course, supervisor etc., and not the actual text itself?   2. How would I shift the `Email: <myemail>`, `Course: <course name>`, `Supervisor: <supervisor name>` etc. to the left? I tried using the `flushleft` command but it can't seem to work.   3. How would I shift the date right below my name? It does not work when I move the `\date` command below my name. I'm trying to follow the style in this: ![enter image description here](http://i.stack.imgur.com/11GIb.jpg) Currently my code is as follows:               \documentclass[11pt,a4paper]{report}     \usepackage{amsmath,amsfonts}               \begin{document}          \title{\bf TitleTitleTitleTitleTitleTitleTitle}     \author{My nameMy nameMy nameMy name\\     \\     \it {Email}: \texttt{123@myemail.com}\\     \it {Course}: Course Name\\     \it {Supervisor}: Professor Name\\     \\     Department of engineering     }     \date{\today}     \maketitle          \end{document}


title: Installing Language Tool in TexStudio

text: I am attempting to install `language tool` on my texstudio distribution in order to check my grammar. Currently, I am following this guide to install `Language tool`. http://wiki.languagetool.org/checking-la-tex-with- languagetool The problem is, I cannot find `languagetool-standalone.jar` nor `LanguageToolGUI.jar` in any of the downloads at the bottom of http://languagetool.org/ . Can anyone tell me where can I locate these files?


title: Writing documents easily editable by non-proficient LaTeX users

text: We often produce documents that will have to be edited by others who are not as proficient at LaTeX than us, and not as keen to spend time learning. It may be that such documents will persist for a long time after we lose responsibility for them. What are good practices to make such documents as durable as possible, such that non-experts can continue to productively edit and compile them, and further that there are minimal opportunities for a non-expert to break the document or turn it into messy code (say, by being wildly inconsistent with formatting and structure commands)? To provide a somewhat concrete example, suppose I am the current editor of an encyclopaedia which is amended very slowly. I have the opportunity to typeset it from scratch in LaTeX, but I would like it to continue to be amended (and beautiful) when new editors, who may arrive with no LaTeX knowledge, tend to it. How should I go about achieving this?


title: pgfplots in combination with gnuplot requires additional semicolon

text: I have the following example which produces a klein bottle. Whatever I compile with the option --shell-escape and I get the following warning:               "<file>.pgf-plot.gnuplot", line 2: ';' expected      Where is my mistake in the example and how can I fix this.               \documentclass{standalone}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}[axis equal image,axis lines=none,view={150}{40},]     \addplot3 [raw gnuplot,mesh] gnuplot [mesh]{        set parametric;        set pm3d explicit;        set pal rgb 9,9,3;        set hidden3d;        set isosamples 18,48;        set xrange[-8:10];        set yrange[-9:9];        set urange[0:2*pi];        set vrange[0:4*pi];        x(u,v)= v<pi ? (2.5-1.5*cos(v))*cos(u): v<2*pi ? (2.5-1.5*cos(v))*cos(u): v<3*pi ? -2+(2+cos(u))*cos(v): -2+2*cos(v)-cos(u);        y(u,v)= v<pi ? (2.5-1.5*cos(v))*sin(u):  v<2*pi ? (2.5-1.5*cos(v))*sin(u):  v<3*pi ? sin(u): sin(u);        z(u,v)= v<pi ? -2.5*sin(v): v < 2*pi ? 3*v-3*pi: v<3*pi ? (2+cos(u))*sin(v)+3*pi: -3*v+12*pi;        set multiplot;        splot x(u,v),y(u,v),-z(u,v) w pm3d        splot x(u,v),y(u,v),-z(u,v) lt 4        unset multiplot;     };     \end{axis}     \end{tikzpicture}     \end{document}      Here the relevant part of my file list:               pgfplots.sty    2011/12/29 v1.5.1 (git show 1.5.1-4-g53e640f )         tikz.sty    2011/06/07 v2.10-cvs (rcs-revision 1.81)      Add-on: How can I increase the size of the picture? ![enter image description here](http://i.stack.imgur.com/BeLDa.png)


title: Compress equation horizontally

text: Is there a command that compresses equation horizontally, so that everything is closer together in the horizontal direction? This is not for a real document but rather just for viewing and playing around.


title: Two-line spanning number in chapter title

text: I try to have the chapter's number in my document twice as big as the title on the left and the two-line chapter title on the right. The number should span two lines, so the two lines of the title are exactly the same size the number is and they are at the same height. You can see what I achieved so far here: ![enter image description here](http://i.stack.imgur.com/kWGl7.png) The problem now is that the title starts at the bottom of the number, but it should start at the top. I did this using `titlesec` package:               \titleformat{\chapter}[hang]{\Huge\bfseries\sffamily}{{\fontsize{75}{80}\selectfont\color{chpgrey}{\thechapter~|~}}}{15pt}{}      My document class is `scrreprt`. Does anyone have an idea how I can achieve what I want?


title: Zero parameters in command definition

text: Let us say I want to define a command for typesetting (a+b)^2:               \newcommand{\sumsquare}[2]{\ensuremath{(#1+#2)^2}}      How can I modify it so that `\sumsquare{a}{0}` will produce a^2?


title: Using \texttt with polyglossia Hebrew

text: `\texttt` does not work as expected when using it with the polyglossia package, in a segment in the Hebrew language, even when the actual text to be set is Latin. I tried reading `fontspec` documentation, but was overwhelmed by the quantity of the material, and the fix I tried did not work:               \documentclass{article} % Compile with xelatex     \usepackage{polyglossia}     \setmainlanguage{hebrew}     \setotherlanguage{english}     \newfontfamily\hebrewfont[Script=Hebrew]{David CLM}% or whatever     \begin{document}     \setLTR     The following should be mono-spaced, but isn't: \texttt{This should be mono-spaced.}     \end{document}      Based on the suggestions below, I tried also the following, but this does not help:               \documentclass{article}     % Compile with xelatex     \usepackage{polyglossia}     \setmainfont[Script=Hebrew]{Ezra SIL}%      \setmonofont[Script=Hebrew]{FreeMono}%      \setmainlanguage{hebrew}    % Document main language is Hebrew     \setotherlanguage{english}  % But it uses English every so often     \begin{document}     \setLTR\textenglish{The following should be mono-spaced, but isn't:        \texttt{This should be mono-spaced.}     }     \end{document}


title: dvips / mktexpk can't find font

text: I have an application that builds input for LaTeX, runs latex on that input, runs `dvips` on the output, and converts that file to an image. I just deployed the application to a new server with the 2012 version of TeXLive (instead of the 2011 version that I have successfully used in other deployments). I have run `texhash` and `updmap-sys`. TexLive was installed under root user on Ubuntu Server 10.4. I would like to get the app working on this server with TeXLive-2012 if I can. The problem is that my images look very wrong. Fonts are wayyy too small, spacing is off, etc., etc.. I am assuming that pdftex is fine with the fonts because PDFs produced from the same `.tex` files look fine. I am getting the following output in the terminal:               Executing thread: dvips -D 1200 my_file.dvi     This is dvips(k) 5.98 Copyright 2009 Radical Eye Software (www.radicaleye.com)     ' TeX output 2013.01.28:1129' -> my_file.ps          kpathsea: Running mktexpk --mfmode / --bdpi 1200 --mag 1+0/1200 --dpi 1200 ecbx1000     mktexpk: don't know how to create bitmap font for ecbx1000.     kpathsea: Appending font creation commands to missfont.log.     dvips: Font ecbx1000 not found,  using cmr10 instead.     </usr/share/texmf-texlive/fonts/pk/ljfour/public/cm/dpi600/cmr10.pk>     dvips: Checksum mismatch in font ecbx1000          kpathsea: Running mktexpk --mfmode / --bdpi 1200 --mag 1+0/1200 --dpi 1200 ecrm1000     mktexpk: don't know how to create bitmap font for ecrm1000.     dvips: Font ecrm1000 not found,  using cmr10 instead.     </usr/share/texmf-texlive/fonts/pk/ljfour/public/cm/dpi600/cmr10.pk>     dvips: Checksum mismatch in font ecrm1000      I don't get error output like this on my dev machine (OSX, TeXLive-2011) and my images look fine. What am I doing wrong?


title: Alternate he / she in text

text: > **This question led to a new package:**   >  `he-she` I have seen a book that instead of using the masculine pronoun (he, his, etc.) alternates the gender ('he' then 'she' then next time 'he' again). Is there a way to do this with LaTeX - to use a placeholder that alternates between two predefined words? (I'm looking for a pointer as to where to start.) EDIT: There is a useful discussion in the comments to Martin's answer for how to relax the strict he/she alternate (which can be confusing if applied too strictly).


title: Error PracTeX Jurnal Modules at ConTeXt

text: I have the same problem like My Way Module from question before (My Way Modules), i try to compile example PracTeX Jurnal document like this               \usemodule[pracjourn]          % Replace the text inside <+ ... +>          \setvariables       [pracjourn]       [    title=<+ Title of article +>,           author=<+ name of author +>,          address={<+ address of author +>},         revision={y=2006,m=11,d=14}, % Date in keyvalue format.        copyright=<+ Copyright statement +>,       ]          \useURL[website][<+ url of author's website+>] %Optional     \useURL[email][mailto:<+author's email id+>][][<+author's email id+>]          %D If any of the above information is not provided, the corresponding entry     %D will not apprear in the title.          \startbuffer[abstract]     <+ Write abstract here +>     \stopbuffer          \starttext  \setups[title]          <+ Write your article \unknown +>          \stoptext      But, i also get error like this :               Command Line:   C:\context\tex\texmf-mswin\bin\context.exe "PraC Jurnal.tex"     Startup Folder: D:\My Ways               mtx-context     | run 1: luatex --fmt="C:/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en" --jobname="PraC Jurnal" --lua="C:/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui" --no-parse-first-line --c:currentrun=1 --c:fulljobname="./PraC Jurnal.tex" --c:input="./PraC Jurnal.tex" --c:kindofrun=1 --c:maxnofruns=8 "cont-yes.mkiv"     This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/W32TeX) (rev 5024)       \write18 enabled.     open source     > 1 > 1 > C:/context/tex/texmf-context/tex/context/base/cont-yes.mkiv          ConTeXt  ver: 2014.06.25 19:46 MKIV beta  fmt: 2014.6.26  int: english/english          system          > 'cont-new.mkiv' loaded     open source     > 2 > 2 > C:/context/tex/texmf-context/tex/context/base/cont-new.mkiv     close source    > 2 > 2 > C:/context/tex/texmf-context/tex/context/base/cont-new.mkiv     system          > files > jobname 'PraC Jurnal', input './PraC Jurnal', result 'PraC Jurnal'     fonts           > latin modern fonts are not preloaded     languages       > language 'en' is active     open source     > 2 > 3 > D:/My Ways/PraC Jurnal.tex     resolvers       > modules > 'pracjourn' is loaded     open source     > 3 > 4 > C:/context/tex/texmf-context/tex/context/base/s-ptj-01.tex     loading         > Context Module for the PracTeX Journal     open source     > 4 > 5 > C:/context/tex/texmf-context/tex/context/base/type-imp-texgyre.mkiv     close source    > 4 > 5 > C:/context/tex/texmf-context/tex/context/base/type-imp-texgyre.mkiv          tex error       > error on line 323 in file C:/context/tex/texmf-context/tex/context/base/s-ptj-01.tex: ! Undefined control sequence          l.323 \setupnotedefinition                               [footnote]  [location=left,hang=1]          313     %D Footnotes are placed in a box with a width of 1.5em. The footnote numeral     314     %D are set in oldstyle font.     315          316     \setupnote     317       [footnote]     318       [margindistance=0em,     319            conversion=mediaeval,     320               command=\pracjournfootnote,     321       ]     322          323 >>  \setupnotedefinition  [footnote]  [location=left,hang=1]     324          325     \def\pracjournfootnote#1{\hbox to 1.5em{#1.}}     326          327     %D \pracjourn\ uses dash as the first level of itemize and text period as the second     328     %D level. The third level is left unspecified.     329          330     \definesymbol [1]     [{\symbol[dash]}]     331     \definesymbol [2]     [\periodcentered]     332          333     \setupitemize [each]  [packed]               ?           Process has been terminated ...      **How to resolve it ?**


title: Listing inside tabularx?

text: I have a tabularx environment where I want to put an `lstlisting` into. But Latex fails to compile it. Testcase:               \documentclass[a4paper,12pt]{scrreprt}     \usepackage[utf8x]{inputenc}          \usepackage{tabularx}     \usepackage{listings}          \begin{document}     \begin{tabularx}{\textwidth}{lX}      First column &      \begin{lstlisting}       Sample text      \end{lstlisting} \\     \end{tabularx}          \end{document}       I always get a `! Argument of \lst@next has an extra }`. Two questions:   1. What's causing it?   2. How can I fix it?


title: Regarding variable names and values of variables inside macros

text: I have to questions that I'd like to solve since I'm trying to build up a macro for my examination duties here. The first one is: is there a way to include numbers in the definition of variables? Say I'm writing a test exam consisting of 10 questions, and I want to assign a variable `\T1` the answer to question 1, a variable `\T2` the answer to question2, etc. Obvious things like               \def\T1{answer 1}     \def\T2{answer 2}      or similar with `\newcommand` doesn't work. Is there a properway to use numbers in variable definitions? Second question is: I have a macro that calls a second macro that defines a variable on it. WHen I try to access the value of the variable defined in the innermost macro, from the main code, the system complains. Is then a way to save variable names and values in macros, such that one can access them from outside? Thanks and sorry for my poor TeX/LaTeX knowledge :(


title: Shortcuts and/or user-defined shortcuts for math symbols in LaTeX?

text: I am very new to being able to use LaTeX to type up mathematical papers, and I just got my "system" set up. Currently I have installed TexWorks, and MikTex, and I have put together a 'hello world' article which seems to run well. I have also used the syntax "\usepackage{amsmath}" and "\usepackage{amssymb}" in the beginning of my .tex file to write math symbols, only because some online tutorial said so. My question is, firstly, are those the only packages I need to use for writing math, and secondly, I remember reading about some shortcuts(?) that can be used for writing math symbols, and/or user defined shortcuts that can be 'set' in the beginning so as to reduce the amount of LaTeX code needed to write mathematical symbols. However, I do not know if this is true, and if it is, how to go about 'installing' such a thing. Does such a thing exist? Am I able to make my own shortcuts? Thanks!


title: switch greek lowercase for times.sty to upright?

text: I need to "similarize" my latex output to web browser serif display. I would like all math to be switched to upright and mimick html browsers, too. \usepackage{mathastext} \usepackage{times} \usepackage{amsmath} are good starts. how do I get latex mathmode to default to upright lowercase greek letters to match the times font in its upright form now, rather than remain in italics. upgreek.sty would have been good, except that it requires me to change use in the document. I want the latex \beta to look like β (β) and not like _β_ (<i>β</i>), and preferably a little fattier than usual, too, because web browsers seem to be a little fatty...


title: When is the aux file read and written?

text: 1. I'd like to know when the `aux` file is read. I know it happens after the preamble, but does it come before or after the `\AtBeginDocument` hook?   2. I'd like to know when the `aux` file (or any other helper file) is actually written. I tried to trace the writing process by placing an undefined command after something should have been written to the `aux` file, and run `pdflatex` in interactive mode, like so:              \documentclass{article}     \begin{document}     \section{S}\label{s}% write something to the aux file          \foo% unknown command     \end{document}      but to my surprise the `aux` file is still empty when `pdflatex` stops at the error. I guess there is some buffering happening, but how would I resolve the synchronization issue? Say, when `\foo` is command that wants to read from the `aux` file?


title: Bibliographic references in a bulleted/numbered list

text: Let's say there are 3 bibliographic references I want to cite, but I want them to appear inmediatelly and in a bullet list, how can I do it? And in a numbered list?


title: Empty Table of Contents with Beamer

text: The first slide in the following `beamer` presentation is empty:               \documentclass{beamer}     \usepackage[english,ngerman]{babel}          \begin{document}     \begin{frame}     \tableofcontents     \end{frame}          \begin{frame} \frametitle{slide1}     slide 1     \end{frame}          \end{document}      How can I include `slide1` in the table of contents?


title: How can I tie two pieces of text together so LaTeX tries not to break exactly between them?

text: I'd like to typeset two chunks of text (a problem statement and solution) next to each other, but I don't want the problem to be the last thing on a page and the solution to be the first thing on the next page. Is there a way to get LaTeX to try to keep them together if they occur at a page boundary — for example, by pushing a few lines of the problem onto the solution page, or vice versa? (Each paragraph/section can be broken individually, but I would like the boundary to be on one page.)


title: multiple bibliographies in thesis

text: I am writing my PhD thesis using TeXmaker.               %---------------------Preamble---------------%     \documentclass[b5paper,twoside,10pt,openany]{book}     \usepackage[margin=1in]{geometry}            \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage[bitstream-charter]{mathdesign}     \usepackage{amsmath}     \usepackage{sectsty}     \usepackage{natbib}     \usepackage{chapterbib}     \pagenumbering{gobble}                           \usepackage{graphicx}                            \usepackage[normalem]{ulem}          \providecommand\phantomsection{}     \setcounter{secnumdepth}{3}          %---------------------Document starts here---------------%     \begin{document}          \input{titlepage}     \input{dedication}     \input{abstract}          %---------------------Chapters in the thesis---------------%          \input{chapter1}     \input{chapter2}          %------------------------------------%          \end{document}           %------------------------------------%      within each chapter: a separate bibliography and bibliography style (unsrt) is defined. When I do: bibtex chapter1, I get an error: Process started I couldn't open file name `chapter1.aux' Process exited normally. Can anyone help?


title: Break Lines in minted environment

text: Usually when adding code in a `LaTeX` document, I use the `listings` package. When trying to modify and personalise styles in listings, @1010011010 suggested to use the `minted` package. To be quite frank, I was impressed! I've managed to install it and make it work according to my needs and taste. I've added line numbers and used the `mdframed` package to add colored background that breaks along pages. At the moment I am trying to break a line when it's too large to fit within the `\textwidth`. I used @MarcoDaniel 's answer on Box around minted environment to break the lines but it's not working as expected. My code is               \documentclass{book}          \usepackage[]{minted}     \usepackage{tcolorbox}     \usepackage{lineno}     \usepackage{mdframed}               \def\gobble#1{}     \renewcommand\DeleteFile[1]{}     \usepackage{xparse}     \ExplSyntaxOn     \box_new:N \l_fvrb_box     \tl_new:N \l_fvrb_tl          \RenewDocumentCommand \FancyVerbFormatLine { m }      {        \hbox_set:Nn \l_fvrb_box { #1 }         \dim_compare:nNnTF { \box_wd:N \l_fvrb_box }>{ \linewidth }           {%box to big             \tl_set:Nn \l_fvrb_tl { #1 }            \fvrb_use_tl:N \l_fvrb_tl           }            {%box fits            \box_use:N \l_fvrb_box           }      }          \cs_new:Npn \fvrb_use_tl:N  #1      {       \group_begin:        \null\hfill\vbox_set:Nn \l_fvrb_box          {\hsize=\linewidth           \renewcommand\thelinenumber                {                  \ifnum\value{linenumber}=1\relax\else                       $\rightarrow$                  \fi                }           \begin{internallinenumbers}             \advance\hsize by -2em             \hspace*{-2em}\tl_use:N #1           \end{internallinenumbers}          }        \box_use:N \l_fvrb_box       \group_end:     }          \ExplSyntaxOff               \usepackage{etoolbox}     \usepackage{xcolor}     \definecolor{lbcolor}{rgb}{0.9,0.9,0.9}          \usepackage[margin=2.8cm]{geometry}     \begin{document}      \section{Section}       \begin{minted}[linenos=true,bgcolor=lbcolor,numberblanklines=true,showspaces=false]{java}       int slotADC = 22;// Change CAMAC controller's backpanel jumper, accordingly       int count = 0;                                                       int[] data = new int[1];       int[] offset = {0, 0};       int[] in = {1, 2};       int[] ones = {1,1};            report.setProperty("INSERT", "["+now.format(new Date())+"] Acquisition Started\n");       report.setProperty("INSERT", "["+now.format(new Date())+"] I am set to read "+evSize+" detectors.\n");       Initialize();       \end{minted}           \begin{mdframed}[linecolor=black, topline=true, bottomline=true,       leftline=false, rightline=false, backgroundcolor=lbcolor,userdefinedwidth=\textwidth]       \begin{minted}[fontsize=\normalsize, linenos, frame=lines]{java}        import java.awt.event.*;//for ActionListener          public class Runtime implements KmaxRuntime {         KmaxToolsheet tlsh;//Store a reference to the toolsheet environment         KmaxWidget wSlot;         KmaxWidget wAdd;         KmaxWidget wData;         KmaxWidget dataField;         KmaxWidget countField;         KmaxWidget setSRQ;         KmaxDevice dev;         KmaxHist hist1,hist2,hist3,hist4,hist5,hist6, histoLowX, histoLowY;         KmaxHist dee1;         KmaxWidget report;              KmaxWidget liveTime;         KmaxWidget realTime;         KmaxWidget deadTime;                  KmaxWidget progress;              KmaxWidget xcombo, ycombo, offsetButton;              KmaxWidget combo, checkBoxCalib;              /** ADC Levels */         KmaxWidget lld;         KmaxWidget setLLD;         KmaxWidget getLLD;         KmaxWidget lldText;         KmaxWidget uld;         KmaxWidget setULD;         KmaxWidget getULD;         KmaxWidget uldText;              /** Calibration - Check Box(use calibration) */         boolean eventFileOn = true;              int slotADC = 22;// Change CAMAC controller's backpanel jumper, accordingly         int count = 0;                                                         int[] data = new int[1];         int[] offset = {0, 0};         int[] in = {1, 2};         int[] ones = {1,1};         int points = 10;         int[] region = new int[points];         int timeTicks;         int totalTime;         int LiveTime = 0;         int totcount;         int evType = 1; //The Type ID for these kinds of events         SimpleDateFormat today = new SimpleDateFormat("dd/MM/yyyy");         SimpleDateFormat now = new SimpleDateFormat("HH:mm:ss:SSS");              Map<String,KmaxHist> histograms = new HashMap<String,KmaxHist>();              static final int evSize = 6;//The num of parameters per event of this type         static final int BUF_SIZE = evSize*1000;// Buffer size           static final int LP_MEM_TOP = 0xFFFF00;//Memory size 16MB            static final int READ_START = LP_MEM_TOP  -  BUF_SIZE;//We start the read/write pointer 1 buffer before the end       \end{minted}              %\inputminted[fontsize=\normalsize, linenos, frame=lines]{java}{DAQ.java}%[linenos=true,bgcolor=lbcolor]{java}{DAQ.java}     \end{mdframed}          \end{document}      Line breaking seems to be working fine when using it's built in option for colored background `bgcolor`. ![enter image description here](http://i.stack.imgur.com/dMQtU.png) This isn't the case when using `mdframed`. For instance text jumps out of the frame and there's a rather annoying identation when detecting a line break. Take a look for instance lines 39 and 60 in the following image ![enter image description here](http://i.stack.imgur.com/lhKAK.png) Any idea on how can this be fixed?


title: LaTeX compilation failure on Mac OS X from Python Script

text: I wrote a Python script to automate some LaTeX builds. Currently I develop/test on Mac OS X (did not try it on other UNIX flavors). The particular execution function which should compile the LaTeX into a pdf document looks like:               def execute(texinputs, params, proj_dir):         latex_cmd = '/usr/texbin/xelatex'              params=shlex.split(params)         if params is None or len(params)==0:             params = [latex_cmd]         else:             params.insert(0, latex_cmd)              environment = os.environ         oldenv = environment.get('TEXINPUTS', '')         prepand = ':'.join([input for input in texinputs])         environment['TEXINPUTS']=prepand+':'+oldenv         ptoken=subprocess.Popen(params, env=environment, cwd=proj_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)         with ptoken.stdout as stdout:             with ptoken.stderr as stderr:                 for _i in range(1,10):                     if ptoken.poll() is None:                         time.sleep(1)                 ret=ptoken.returncode                  if ptoken.returncode is None:                     ret = -1000                     ptoken.kill()                 outlines, errlines = stdout.readlines(), stderr.readlines()                 return ret, outlines, errlines       What I do here is passing the paths to some generated sources which should be pre-pended to TEXINPUTS to resolve relative paths inside my LaTeX template as well as some additional tex processor parameters. A typical shell command call (which works fine) is:               TEXINPUTS=/Users/ovanes/Documents/some_path/content:$TEXINPUTS /usr/texbin/xelatex -shell-escape main.tex This produces a main.pdf which is fine. However, running this shell command from the script I see the following output and no main.pdf is written.               Error 32512 (driver return code) generating output;     file main.pdf may not be valid.      Any ideas?


title: Write text to non-contigous regions

text: Not really sure how to describe this best so here is a picture: ![enter image description here](http://i.stack.imgur.com/MwpNS.jpg) In essence, I want rows 1 and 2 to pretend to be one row (with line breaks acting normally), and the same for rows 3 and 4. Additionally, all "cells" should be the same horizontal and vertical size, with the text lining up if row 1 was overlaid with row 2 (and same for 3 and 4 of course). Here is the horrible horrible code used to generate the image:               \documentclass{standalone}     \usepackage{tabularx}     \usepackage[english]{babel}     \begin{document}     \begin{tabular}{|p{\dimexpr.1\textwidth}|p{\dimexpr.1\textwidth}|p{\dimexpr.1\textwidth}|p{\dimexpr.1\textwidth}|p{\dimexpr.1\textwidth}|p{\dimexpr.1\textwidth}}     \hline     \parbox{2cm}{This \\ on and} && is some && text & \\     \hline     &\parbox{2cm}{that \\on} && I want && to flow \\     \hline     This && should && be a & \\     \hline     & whole && separate && sentance \\     \end{tabular}     \end{document}       **NOTE:** While I am currently using tabular, I would be happy to be rid of it and do this in Tikz, or really anything else.


title: pgfplots: work on single points in different files

text: I have a file containing a lots of data: time, position (3 coordinates), velocity (3 coordinates) and energy. I want to pick only the coordinates at t=50 (50th column of the table) and calculate the magnitude of position vector. Something like this:               \addplot        file{xxx1.dat}:        coordinate[line50]{0.1, \sqrt(\thisline{1}^2+\thisline{2}^2+\thisline{3}^3)};             file{xxx2.dat}:        coordinate[line50]{0.01, \sqrt(\thisline{1}^2+\thisline{2}^2+\thisline{3}^3)};             file{xxx3.dat}:        coordinate[line50]{0.001, \sqrt(\thisline{1}^2+\thisline{2}^2+\thisline{3}^3)};      To be more specific is like I have to use the `file` keyword with the `coordinate` keyword for mote than one file (because the x coordinate of my point is not stored on the file). As I said I have to do some algebra on data I get from the file... Is this possible with pgfplots? How? **EDIT:** I will explain better my problem. I'm working on a numerical simulation of Magnus effect (ballistic with air drag and lift). I have a file that contains a table containing time, position (3 coordinates), velocity (3 coordinates) and energy. This file is for one simulation with a fixed time-step. I have to plot the position at 50s in function to the time-step. So I have many file with the same simulation but with different time-steps. I have to get position (magnitude of position) at 50s from each file and plot it in function of time step (time step is not contained on the file)... I hope it's more clear now.


title: No white page before full pdf page as front cover. (title page)

text: I have a little problem with a pdf that I want as front cover for a report. When I add a pdf as front cover I get first a white page and after that the pdf. But I want it to print the pdf first than white page and after that the title page. Does anyone know what I'm doing wrong? PreTitle page code               \begin{titlepage}     \begin{center}          \includepdf[scale=1.0]{0_Title_Page/Voorkant.pdf}          \end{center}     \end{titlepage}      Final code:               \documentclass[a4paper,11pt,oneside]{scrbook}     \usepackage[monochrome]{xcolor}     \usepackage{geometry}       \geometry{a4paper}         \geometry{width=0.7\paperwidth,height=0.8\paperheight}     \usepackage{graphicx}     \usepackage{rotating}             % For sideways figures     \usepackage{subfig}     \usepackage{epsfig}     \usepackage{amsmath}     \usepackage{epstopdf}     \usepackage{fullpage}     \usepackage{url}                                    % URL package     \usepackage[parfill]{parskip}     \usepackage{float}     \usepackage{pdfpages}     %\usepackage{titlesec}                      % Change space between title and text, if needed     \usepackage{multirow}     \usepackage{eurosym}                            % Euro symbol     \usepackage{gensymb}                            % Degree symbol     \usepackage{appendix}                       % Appendix packages!!!     \usepackage{titlesec}     \usepackage{booktabs}                       % For toprule, middlerule & bottomrule     \usepackage{chngcntr}     \counterwithout{footnote}{chapter}     \usepackage{footnote}     \bibliographystyle{unsrt}           %\renewcommand\enoteformat{\noindent\theenmark.\hspace{0.06in}} % change superscript to 1.     %\let\footnote=\endnote % Trun footnotes to ENDnotes          %\usepackage{mcode}         %When adding matlab code!!!          %\titleformat{\chapter}[display]     %  {\bfseries\Huge}     %  {\filright\Large\chaptertitlename\ \thechapter}     %  {0mm}{\filright}     %\titlespacing*{\chapter}     %  {0pt}{-10pt}{0pt} % als je de 3de veranderd kun je de spacing tussen het hoofdstuk en tekst kleiner maken.          \DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}          \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}          \begin{document}          \input{0_Title_Page/PreTitle} % front cover          \cleardoublepage          \input{0_Title_Page/TitlePage} %'real' title page     \end{document}


title: How to get correct glossary links with frontmatter pages?

text: I'm using the `glossaries` and `hyperref` packages, and my document has 10 or so pages of frontmatter, in roman numerals. All the links in the glossary have the correct page numbers, but when you click them they go to the wrong page. They go to the side of that number, but they fail to include the frontmatter in the count, so are offset, E.g. an acronym used on page 20, in a document with 10 pages of frontmatter, will link to the side numbered 10 in the pdf. How can I fix this? I'm using MacTeX-2010. Edit:               \documentclass[twoside]{book}          \title{A LaTeX Article}     \author{Your name here}     \date{2011-06-27}          \usepackage{hyperref}     \usepackage[acronym]{glossaries}     \makeglossaries          \begin{document}         \newacronym{www}{WWW}{World Wide Web}         \newacronym{http}{HTTP}{HyperText Transfer Protocol}         \frontmatter              \maketitle              \tableofcontents              \printglossaries              \mainmatter              \chapter{Introduction}         The \gls{www} is big.              \chapter{Next}         The \gls{www} works over \gls{http}.     \end{document}


title: Linebreak in table cell at document margin

text: In order to allow line breaks within a table cell, I use `\parbox`. But when the cells I want to have line breaks in are in the last column of the table, the best thing would be to break them at the margin of the document. How can I specify the width of the `\parbox` that it does so automatically, without needing to specify it manually each time depending on the table I'm in?               \documentclass{article}     \newcommand{\breakcell}[1]{\parbox[t]{22em}{#1}}          \begin{document}     \hrule         \begin{tabular}{ll}             A short 1st column & \breakcell{A considerably longer second column where I write way too much stuff}\\             A short 1st column & Blah blah\\         \end{tabular}              \begin{tabular}{ll}             A considerably longer first column & \breakcell{A considerably longer second column where I write way too much stuff}\\             A considerably longer first column & Blah blah\\         \end{tabular}     \hrule     \end{document}      ![enter image description here](http://i.stack.imgur.com/Z8Wih.png)


title: Setting background colour for part of a page

text: I am designing a business card using the memoir class and hints given here and am trying out various background effects. Specifically, I would like to change the background for the last third of the card to another colour. Because the colour needs to bleed to the edge, an option involving tables is not suitable. Short of inserting an image and overwriting it, is there a more elegant way to achieve this?


title: LyX - Highlight a result in table

text: In LyX I am using this table as an ERT addition:               \begin{tabular}{l rlrl }          & \multicolumn{2}{c}{Model 1}     & \multicolumn{2}{c@{}}{Model 2}     \midrule     \midrule          Variable Variable Variable 1 (Variable) Variable & 17.122 & * &   3.481 &*      Variable Variable Variable 2 (Variable) Variable & 76.48 & * &   0.441 &*      Variable Variable Variable 3 (Variable) Variable & 117.132 & * &   9.216 &*           \end{tabular}      How can I put a box around the entire `Variable 1` row and a box just around the two results for `Variable 1`


title: Count the characters in a section and check against range

text: I want to count the number of characters within a section and then display if that value is below, in, or above the limit. I have grabbed the code from Dynamically count and return number of words in a section. And I have the following (compile it with `pdflatex --shell-escape mwe.tex`).               \documentclass{article}          \newcommand{\wordcount}{%         \immediate\write18{texcount -merge -sub=section \jobname.tex  | grep "Section" | sed -e 's/+.*//' | sed -n \thesection p > 'count.txt'} \input{count.txt}}          \usepackage{lipsum}          \begin{document}          \section{test1}     \wordcount     \ifnum\wordcount<1000 Below      \ifnum\worcount>2000 Above     \else Inside          foo bar               \section{test2}     \wordcount          foo bar          foo bar          foo bar          \end{document}      The code above doesn't work because `\wordcount` is not really a value in LaTeX sense. Is there a way that I can translate to a real value in order for the code to work? Other solution would be to use Environment that counts words inside, but on that case I would need to save the value of each counter and display it latter.


title: Harrowing missing $ inserted error with 'case'

text: I am a complete newbie to LaTeX. I am having a harrowing time with the missing `$` error. I have the following code:               \begin{cases}     soil(i, j) if min(soil(i, l)) $\geq$ 0\\      $k \notin nodes$ \\     soil(i, j) - min(soil(i, l)) else \\     $k\notin nodes$      \end{cases}      which seems to be generating the missing `$` error. I thought maybe the `$` sign was a problem. But despite removing that I got the same error. Could you please let me know what is the problem? P.S. I apologize if this has been asked before, but I couldn't seem to find the solution.