title: Is the current lualibs broken?

text: After the latest update to MiKTeX 2.9 it seems that my luatex installation is broken. I tried to track the error and I am not sure if it is a bug or something else strange. What happens is that the generated file `lualibs.lua` looks as follows:               --      --  This is file `lualibs.lua',     --  generated with the docstrip utility.     --      --  The original source files were:     --      --  lualibs.dtx  (with options: `lualibs')     --  This is a generated file.     --       --  Copyright (C) 2009 by PRAGMA ADE / ConTeXt Development Team     --       --  See ConTeXt's mreadme.pdf for the license.     --       --  This work consists of the main source file lualibs.dtx     --  and the derived file lualibs.lua.     --       -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%       By default, \identifier{lualibs} will not load the libraries individually.       Instead, it includes two \emphasis{merged packages} that have been compiled       from the original files.       This is achieved by means of \identifier{mtx-package}, a script for bundling       \LUA code shipped with \CONTEXT.       This concatenates the code of several \LUA files into a single file that is       both easier to distribute and loading (marginally) faster.       \identifier{mtx-package} ensures that the code from each file gets its       own closure and strips newlines and comments, resulting in a smaller payload.       Another package that relies on it heavily is the font loader as contained in       \identifier{luaotfload} and \identifier{luatex-fonts}.            If \CONTEXT is installed on the system, the merge files can be created       by running:            \begin{quote}\begin{verbatim}         mtxrun --script package --merge lualibs-basic.lua         mtxrun --script package --merge lualibs-extended.lua       \end{verbatim}\end{quote}            \noindent       Of course there is a make target for that:            \begin{quote}\begin{verbatim}         make merge       \end{verbatim}\end{quote}       \noindent       will take care of assembling the packages from the files distributed with       \identifier{lualibs}.            For this to work, the syntax of the \LUA file needs to be well-formed:       files that should be merged must be included via a function       \verb|loadmodule()|.       It doesn’t matter if the function actually does something; a dummy will       suffice.       Also, the argument to \verb|loadmodule()| must be wrapped in parentheses.       This rule is quite convenient, actually, since it allows excluding files       from the merge while still using \verb|loadmodule()| consistently.            \begin{quote}\begin{verbatim}         ...         loadmodule("my-lua-file.lua") -- <= will be merged         loadmodule('my-2nd-file.lua') -- <= will be merged         loadmodule "my-3rd-file.lua"  -- <= will be ignored         ...       \end{verbatim}\end{quote}            Note that there is one exception to the packaging:       \fileent{lualibs-util-jsn.lua} cannot be successfully packaged because       it follows a different coding convention, returning a \LUA table on exit.       Therefore, the file is loaded separately as part of the \identifier{extended}       set like any other \LUA module.          -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     lualibs = lualibs or { }          lualibs.module_info = {       name          = "lualibs",       version       = 2.00,       date          = "2013/04/30",       description   = "ConTeXt Lua standard libraries.",       author        = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",       copyright     = "PRAGMA ADE / ConTeXt Development Team",       license       = "See ConTeXt's mreadme.pdf for the license",     }               config           = config or { }     config.lualibs   = config.lualibs or { }          if config.lualibs.prefer_merged == nil then       lualibs.prefer_merged = true     end     if config.lualibs.load_extended == nil then       lualibs.load_extended = true     end     config.lualibs.verbose = config.lualibs.verbose == false               local dofile          = dofile     local kpsefind_file   = kpse.find_file     local stringformat    = string.format     local texiowrite_nl   = texio.write_nl          local find_file, error, warn, info     do       local _error, _warn, _info       if luatexbase and luatexbase.provides_module then         _error, _warn, _info = luatexbase.provides_module(lualibs.module_info)       else         _error, _warn, _info = texiowrite_nl, texiowrite_nl, texiowrite_nl       end            if lualibs.verbose then         error, warn, info = _error, _warn, _info       else         local dummylogger = function ( ) end         error, warn, info = _error, dummylogger, dummylogger       end       lualibs.error, lualibs.warn, lualibs.info = error, warn, info     end          if luatexbase and luatexbase.find_file then       find_file = luatexbase.find_file     else       kpse.set_program_name"luatex"       find_file = kpsefind_file     end               local loadmodule = loadmodule or function (name, t)       if not t then t = "library" end       local filepath  = find_file(name, "lua")       if not filepath or filepath == "" then         warn(stringformat("Could not locate %s “%s”.", t, name))         return false       end       dofile(filepath)       return true     end          lualibs.loadmodule = loadmodule               if lualibs.basic_loaded ~= true then       loadmodule"lualibs-basic.lua"       loadmodule"lualibs-compat.lua" --- restore stuff gone since v1.*     end          if  lualibs.load_extended   == true     and lualibs.extended_loaded ~= true then       loadmodule"lualibs-extended.lua"     end          --- This restores the default of loading everything should a package     --- have requested otherwise. Will be gone once there is a canonical     --- interface for parameterized loading of libraries.     lualibs.load_extended = true          -- vim:tw=71:sw=2:ts=2:expandtab          -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     --      --  End of File `lualibs.lua'.      As far as I can see this is not a valid lua file and therefore everything that depends on this, such as `mkluatexfontdb` fails. I tried grabbing the current version of `lualibs` from CTAN and started `tex lualibs.dtx` but ended up with the same `lualibs.lua` file. Is this a bug or something else?


title: LyX classicthesis bibliography reference style - "et al"

text: I am using the classicthesis LyX template (http://code.google.com/p/classicthesis/), and was wondering how to change the format of the references in the bibliography? At the moment, the bibliography uses the plainnat style. I want to use "et al." when there are more than 3 authors in a reference. For example, at the moment, a reference may look like: > [7] H R Dinse, K Krüger, A C Akhavan, F Spengler, G Schöner, and C E > Schreiner.... I want this to look like: > [7] H R Dinse, K Krüger, A C Akhavan, et al. ... Please can you help me make this change? Many thanks.


title: table inside table to force linebreak

text: I have a problem with a table. I want the first row to have a linebreak, so that the table doesn't get too wide. I tried, like I read somewhere, inserting another table in one cell, but it doesn't work. The text now flows over one another. Also the first cell is kind of too high. Does someone know, how to do it? Here is my code               \documentclass[ngerman,11pt,twoside,a4paper,final,titlepage,openany]{amsbook}     \usepackage[ngerman]{babel}     \begin{document}          \begin{tabular}{p{6cm}p{3cm}p{3cm}}      \textbf{     \begin{tabular}{@{}c@{}}     bla     \end{tabular}} &     \textbf{     \begin{tabular}{@{}c@{}}     here comes a lot of text     \end{tabular}} & \textbf{     \begin{tabular}{@{}c@{}}     and here also a lot of text     \end{tabular}}\\      \hline bla & yes &no\\     bla& yes & no\\     \end{tabular}     \end{document}


title: How can I adjust the column width of legend in PGFplots?

text: I would like to adjust the width of the legend lines (images) in PGFplots. Since legend is a TikZ matrix, I can adjust the separation between lines, space between text and lines by changing the matrix style. I tried to find a matrix style property to change the width of each cell (here the cell where legend lines are positioned in), but could not find any answer for that too. This is a sample code:               \documentclass{article}     \usepackage{pgfplots}          \pgfplotsset{         compat=newest,         plot coordinates/math parser=false,         every axis/.append style={             tick label style={font=\scriptsize}, % new bit             label style={font=\scriptsize}, % new bit             legend style={font=\scriptsize,row sep=-0.1cm,/tikz/every odd column/.append style={column sep=0.01cm}},% new bit             xlabel shift=0.5em,             ylabel shift=-0.5em         }     }     \begin{document}          \begin{tikzpicture}         \begin{axis}[%             xlabel={XLABEL},             ylabel={YLABEL},             axis lines*=left,             ylabel absolute, ylabel style={yshift=-1em}]             \addplot+[mark=none] plot {x^2};             \addlegendentry{a}             \addplot+[mark=none] plot {1};             \addlegendentry{b}             \addplot+[mark=none] plot {x};             \addlegendentry{c}         \end{axis}     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/4kGtp.png) So my question is how to adjust the lines (images) in a legend?


title: The list of symbols has the bibliography heading

text: I have a section in my thesis which includes some mathematical notations. This section is after Bibligraphy. My problem is that the second page of this list appears with bibliography heading. How can i solve this problem? This is my main file.               \documentclass[12pt]{report}     \usepackage{amsmath, amsthm, amscd, amsfonts, amssymb,graphicx, grffile, color, mathrsfs}     \usepackage[bookmarksnumbered,plainpages=false,pdfpagelabels]{hyperref}     %\usepackage[plainpages=false]{hyperref}     \usepackage{epstopdf}     \usepackage{nomencl}     \usepackage{xtocinc}     \renewcommand{\baselinestretch}{1.2}     \def\dis{\displaystyle}     %\renewcommand{\baselinestretch}{1.3}     \textwidth = 15.8 cm \textheight = 22.3 CM \oddsidemargin = 0.7 cm     \evensidemargin = 2.1 cm     \topmargin = -0.5 cm     \newtheorem{theorem}{Theorem}[section]     \newtheorem{lemma}[theorem]{Lemma}     \newtheorem{proposition}[theorem]{Proposition}     \newtheorem{corollary}[theorem]{Corollary}     \theoremstyle{defn}     \newtheorem{definition}[theorem]{Definition}     \newtheorem{example}[theorem]{Example}     \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark}     \numberwithin{equation}{section}     \renewcommand{\theequation}{\thesection.\arabic{equation}}     \begin{document}     \setcounter{page}{1}     \pagenumbering{roman}      \typeout{Declaration}     \include{declaration}     \include{abstract}     \input{introduction}     \baselineskip=0.9 cm     \newpage     \setcounter{page}{1} \pagestyle{headings}     \pagenumbering{arabic}     \tableofcontents     \input{ch1}     \input{ch2}     \input{ch3}     \input{ch4}          \cleardoublepage     \phantomsection     \addcontentsline{toc}{chapter}{Bibliography}     \bibliographystyle{amsplain}     \bibliography{XBib}     \cleardoublepage     \phantomsection     \addcontentsline{toc}{chapter}{Notation}     \input{sym}     \cleardoublepage     \phantomsection     \addcontentsline{toc}{chapter}{Subject index}     \input{ind2}     \end{document}


title: miktex 2.9, l3kernel installation fails

text: I freshly installed 2.9 I tried to compile a XeLatex document, which works fine on my work computer. I got the following error:               expl3.sty missing.      It tries to install l3kernel               starting package maintenance...     installation directory: "C:\Program Files (x86)\MiKTeX 2.9"     package repository: http://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/ctan/system/win32/miktex/tm/packages/     lightweight database digest: b641b9d295dbd4c2d5caa951cd9d95e3     going to download 6240193 bytes     going to install 44 file(s) (1 package(s))     downloading http://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/ctan/systems/win32/miktex/tm/packages/l3kernel.tar.lzma...     6177780 bytes, 227.61 KB/Sec     visiting repository http://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/ctan/systems/win32/miktex/tm/packages/...     repository type: remote package repository     loading lightweight database...     downloading http://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/ctan/systems/win32/miktex/tm/packages/miktex-zzdb1-2.9.tar.lzma...     130729 bytes, 141.07 KB/Sec     lightweight database digest: b641b9d295dbd4c2d5caa951cd9d95e3     xelatex.EXE: The operation could not be completed because the following file failed verification:     xelatex.EXE:      xelatex.EXE: C:\Users\y\AppData\Local\Temp\mikAB2F.tmp     ======================================================================               ! LaTeX Error: File `expl3.sty' not found.      I get the same error when I try to install the package via the package manager               The operation could not be completed because the following file failed verification:     C:\Users\y\AppData\Local\Temp\mikD002.tmp


title: Dice symbols for digits up to 9

text: I'm looking for symbols for dice faces. So far, I've found these two possibilities: The command `\Cube{n}` in the `ifsym` package, and the command `\dice{n}` in the `epsdice` package. However, both commands only allow the standard symbols for n = 1..6. What I'm looking for are dice symbols that include the digits 7, 8, 9 as they can be found in some extended versions of domino games. The number 7 should look like this:               * *     ***     * *      The number 8 like this:               ***     * *     ***      and the number 9 like this:               ***     ***     ***      For completeness, it would also be nice if there is a blank face symbol for the digit n=0. Is there any package allowing me to do this? If not, can anyone show me how to produce such symbols?


title: Properly align text in description

text: I need to illustrate cases, that is why I am using the description environment:               \begin{description}     \item[Caso 1] Esiste una computazione $s_1, s_2, \ldots, s_k$ di $\mathcal P$ che comincia con l'istantanea iniziale. Scriviamo allora $\psi^{(m)}_{\mathcal P}(r_1, r_2, \ldots, r_m)$ per indicare il valore della variabile $Y$ al raggiungimento dell'istantanea terminale $s_k$.     \item[Caso 2] Non esiste una tale computazione. Ad esempio esiste una sequenza non finita $s_1, s_2, s_3, \ldots$ che parte con l'istantanea iniziale, ed ogni $s_{i+1}$ è la successiva di $s_i$, inoltre in tali casi $\psi^{(m)}_{\mathcal P}(r_1, r_2, \ldots, r_m)$ è \emph{indefinita}.     \end{description}      but the thing is the text isn't properly aligned as my screenshot shows: ![enter image description here](http://i.stack.imgur.com/wORSa.png) so my question is: how do I fix this?


title: Why does spell check not work if the figure has a label?

text: In Texmaker, in the `caption` environment, why does spell check not work if the `figure` has a label? This is an example I made to show this 'feature': ![enter image description here](http://i.stack.imgur.com/7WYOm.png) From the first line, we see that the spell-checker is working as normal. This also follows in the `figure` environment, but _not_ in the `caption` environment. I tried playing around with it to see what exactly caused it... turns out it's the presence of a `label`. We see from the second `caption` that the spell- check is performed correctly.


title: Definition of the TEXINPUTS variable

text: I am using TeX Live 2012/Debian on Linux Mint 14. I am wondering what the right definition of the `TEXINPUTS` variable is.


title: How can I use thumbpdf (perltex) with arara?

text: Good evening, as to my knowledge there is no `arara-perltex`-rule, so I can not use `thumbpdf`-package with arara. My background Idea is: using individual thumbnails, like the "yellow thumnail" in the picture, in the pdf-viewer (AdobeReader) ;) ![enter image description here](http://i.stack.imgur.com/AhfRi.png)


title: Why does `\iid` macro in OPmac only support "," or "."

text: To create an index entry in OPmac one enters something like this: `Oh, how I like \ii figs figs.` Notice the repetition there? As a convenience OPmac provides `\iid`: `Oh, how I like \iid figs .` In this case, I didn't need to repeat the word "figs", though I did have to enter a space between the "s" and the "." in order for the sentence to be typeset correctly. Unfortunately, the following does not typeset correctly: `Oh, does anyone else like \iid figs ?` In this case, instead of "figs?" being typeset, we get "figs ?" - with that space. The culprit seems to be here: `\def\iiD{\ifx\tmp,\else\ifx\tmp.\else\space\fi\fi}` % comma and period handled I modified to include a question mark ("?") with `\def\iiD{\ifx\tmp,\else\ifx\tmp.\else\ifx\tmp?\else\space\fi\fi\fi}` but obviously other punctuation such as exclamation points, colons, semi- colons, etc are needed. Is there a better way to handle this perhaps?


title: How to add theorem number by the \qed mark at the end of proof environment

text: I use `amsthm`. All theorem-like environments use a common counter. As I have some very long proofs I want to add the theorem number to which the proof refers at the end of proof just next to the box/square/qed mark. Renewing command `\qedsymbol` like this: > `\renewcommand\qedsymbol{\ensuremath{\openbox}~\arabic{theorem}}` works almost fine. The only problem is that if there is some fact or lemma inside my proof,               \begin{theorem}     \end{theorem}     \begin{proof}       ...       \begin{fact}         ...       \end{fact}       ...     \end{proof}      then the number by `\qed` is this fact's number instead of the theorem number. I was disappointed because looking at the proof definition in `amsthm.sty` file               \newenvironment{proof}[1][\proofname]{\par       \pushQED{\qed}%       \normalfont \topsep6\p@\@plus6\p@\relax       \trivlist       \item[\hskip\labelsep              \itshape         #1\@addpunct{.}]\ignorespaces     }{%       \popQED\endtrivlist\@endpefalse     }     \providecommand{\proofname}{Proof}      I can see that the qed is handled somehow and put on some stack when the environment is being initialized, then it is just popped. So it could remember the original theorem number. I suspect that my problem is caused by fact that evaluation of my `\qedsymbol` is postponed until the proof environment is getting closed. Is there a way to force it to evaluate it somewhere around `\pushQED{\qed}%`? Or maybe someone could explain what is actually going on in these lines so that I could fiddle with it myself?:               \newcommand{\pushQED}[1]{%       \toks@{\qed@elt{#1}}\@temptokena\expandafter{\QED@stack}%       \xdef\QED@stack{\the\toks@\the\@temptokena}%     }     \newcommand{\popQED}{%       \begingroup\let\qed@elt\popQED@elt \QED@stack\relax\relax\endgroup     }      My most advanced idea was               \renewcommand{\qedsymbol}{\edef\qednow{\ensuremath{\openbox}~\arabic{theorem}}\qednow}      but it didn't work as well.


title: Verbatim, wrappable and Unicode text included from a file

text: I am trying to output several megabytes of UTF8 text into a printable format. As `enscript` and friends don't like Unicode, this Unix SE question soon turned to LaTeX. Summary of requirements: processing of several MB of Chinese, Latin and special chars (i.e. invalid LaTeX code), consisting of long and short lines, into a tightly packed, multi-column format. I know LaTeX has the ability to control font size, spacings, margins and so on, as well as headings and page numbers, so I am not too worried about that. The problem I am having so far is getting both wrappable and UTF8-capable verbatim input of the file. Is there a way to get both? With the `fancyvbr` package, for example, I get good rendition of the Chinese text, but no line breaking:               \documentclass{article}     \usepackage{CJKutf8}     \usepackage{ucs}     \usepackage{multicol}     \usepackage{verbatim}     \usepackage[encapsulated]{CJK}     \newcommand{\myfont}{bsmi} % or {stheiti}, etc          \begin{document}          \begin{CJK}{UTF8}{\myfont}              \begin{multicols}{2}             \VerbatimInput[fontfamily=cmr]{file.txt}         \end{multicols}     \end{CJK}     \end{document}       I have so far been unable to get a `listings`-type environment to deal with the Unicode in the file. Example of the type of thing I'm feeding it. This to to format thousands of lines of multi-lingual chat logs. Basically 100,000++ lines of this kind of thing:               ###### 2013-10-26.223938+0000GMT.html ######     **** user@example.com/ (jabber) ****     (00:00:00) Lorem ipsum     (00:00:01) 車檢作畫病得星定局而是作的所由次園又此對這一馬的生故他試……外由懷黃客建時常嚴在位以說其配場戲回有部結一自法就生機，定的被各世皮全空！也地傳現他重城，書照展商直起眾家不思政國林年八計出地口早體故失離際們層氣，簡他廣集義，四便入的只了極。     (00:00:02) odesset ullamcorper quo. Cu adipisci assentior eam, debet definiebas eos ad. Te eos nihil populo vivendum, vix iusto noster peri     (00:00:02) odesset ullamcorper quo. Cu adip     (02:00:02) odesset ullamcorper quo. Cu adipisci assentior eam, debet d     (02:00:01) 車檢作畫病得星定局而是作的所由次園又此對這一馬的生故他試……外由懷黃客建時常嚴在位以說其配場戲回有部結一自法就生機，定的被各     (02:00:02) ok     (00:01:02) 病     (00:00:02) ok     (00:01:02)           ###### 2013-10-26.223938+0000GMT.html ######     **** user@example.com/ (jabber) ****     (00:00:01) 車檢作畫病得星定局而是作展商直起眾家不思政國林年八計出地口早體故失離際們層氣，簡他廣集義，四便入的只了極。     (00:00:02) odesset ullamcorper quo. Cu adipisci assentior eam, debet definiebas eos ad. Te eos nihil populo vivendum, vix iusto noster peri     (00:00:02) odesset ullamcorper quo. Cu adip     (02:00:02) odesset ullamcorper quo.       I'm ideally looking for the most general solution possible, as the input text is not necessarily in a well-defined machine-readable format. **Edit** also tried the following using the plain `verbatim` package:               \usepackage{verbatim}          \makeatletter     \def\@xobeysp{ }     \makeatother      with this in the document body:               \verbatiminput{file.txt}      This works for normal text and Chinese, but fails to break lines containing very long words, URLs or long strings of letters, all of which occur in the file.


title: How to make the this brace bigger? "}"

text: here is my code:               \begin{equation*}         \left .         \substack{             2 \beta_{r,j}^{(l)} = \beta_{r,j}^{l-1} + \beta_{R+r,j}^{(l-1)} \epsilon_{m}^{j}             \\             2 \beta_{r,m+j}^{(l)} = \beta_{r,j}^{l-1} + \beta_{R+r,j}^{(l-1)} \epsilon_{m}^{j}         }         \right \}         \begin{array}{l l l}             r=0,\dots,R-1             \\             j=0,\dots,m-1             \\             \epsilon_m = e^{\frac{-2 \pi i}{2^m}}         \end{array}     \end{equation*}      it gives me this output: ![latex- output](http://latex.codecogs.com/gif.latex?%5Cleft%20.%20%5Csubstack%7B%202%20%5Cbeta_%7Br%2Cj%7D%5E%7B%28l%29%7D%20%3D%20%5Cbeta_%7Br%2Cj%7D%5E%7Bl-1%7D%20+%20%5Cbeta_%7BR+r%2Cj%7D%5E%7B%28l-1%29%7D%20%5Cepsilon_%7Bm%7D%5E%7Bj%7D%20%5C%5C%202%20%5Cbeta_%7Br%2Cm+j%7D%5E%7B%28l%29%7D%20%3D%20%5Cbeta_%7Br%2Cj%7D%5E%7Bl-1%7D%20+%20%5Cbeta_%7BR+r%2Cj%7D%5E%7B%28l-1%29%7D%20%5Cepsilon_%7Bm%7D%5E%7Bj%7D%20%7D%20%5Cright%20%5C%7D%20%5Cbegin%7Barray%7D%7Bl%20l%20l%7D%20r%3D0%2C%5Cdots%2CR-1%20%5C%5C%20j%3D0%2C%5Cdots%2Cm-1%20%5C%5C%20%5Cepsilon_m%20%3D%20e%5E%7B%5Cfrac%7B-2%20%5Cpi%20i%7D%7B2%5Em%7D%7D%20%5Cend%7Barray%7D) i would like to have it bigger, so that i can read the formular very well. How to do this? How to change the size of the brace ? Thanks.


title: Why does my Mathematica figure not work with PSFrag?

text: I created an image in _Mathematica_ with some labels that, for some reason, refuse to be substituted when using PSFrag. Specifically, the _Mathematica_ code               image = Plot[Sin[x], {x, 0, 2 π}, PlotLabel-> "label"]     Export[NotebookDirectory<>"image.eps",image]      will create the image ![enter image description here](http://i.stack.imgur.com/OOPUi.png) The following PSFrag code should, in principle, substitute the label `label` with a nicely formatted `$\sin(x)$`:               \documentclass{article}     \usepackage{graphicx}     \usepackage{psfrag}          \begin{document}            \psfrag{label}{$\sin(x)$}       \includegraphics[width=\textwidth]{image.eps}          \end{document}      Indeed, a very similar version will work on the `example.eps` image provided by the PSFrag package in its documentation. However, the label is not replaced by my `dvips` driver. What is going wrong?


title: Multiple-language document - babel - selectlanguage vs begin/end{otherlanguage}

text: What's the difference in babel package, between :               \selectlanguage{languageA}      and               \begin{otherlanguage}{languageB}     Text in language B.     \end{otherlanguage}      ? I'd like to write two langauge document, where I will have whole chapters in one or another language, each in separated included file. Which Method of language switching is more appropriate in my case?


title: How to put a framed box around text + math enviroment

text: I am looking for something like `\fbox` but it seems that you cannot use it when a math environment is included. However its not only a math environment (then you could use `\boxed` I know) but also text, I need to be in a frame. example:               \rdmframeboxaroundwhatever{          blablabla          \begin{align}     Formula of the universe     \end{align}               Hoaray          }


title: LyX Layout File for the SIAM book class

text: Is there a LyX layout file for the SIAM book (SIAM-GH-book.cls) class?


title: Orthographic projection in asymptote

text: I need assistance in understanding orthographic projection in asymptote.               currentprojection=orthographic(x,y,z);      Specifying `x`, `y` and `z`, one can rotate the figure in 3D but how do I decide on these numbers?


title: How can I add YAP to a TexLive installation?

text: I don't like TeXLive's DVIOUT; I do like MikTeX's YAP... unlike in this question, I don't want an independent YAP installation - I want to graft it onto TeXLive. Is that possible?


title: XeTeX problem compiling when I have a table

text: I'm trying to compile using XeTeX and I get this error                ...ab:Quizzes-open-times}Quizzes open times}          Your command was ignored.     Type  I <command> <return>  to replace it with another command,     or  <return>  to continue without it.      I know the problem is with the table I have at the end. If I remove it, I can compile the document. How can I solve this? LyX: https://www.dropbox.com/s/pmjfirn6qq9av5g/fancyhdr_question.lyx tex: https://www.dropbox.com/s/jko0wujfxybzxfx/fancyhdr_question.tex


title: Put numbers in legend using pgf pie

text: I would like to have the numbers that are inside the pie chart to be in the legend. How can I make that happen? Here is the MWE:               \documentclass{article}     \usepackage{pgf-pie}     \usepackage{tikz}     \usetikzlibrary{shadows}          \begin{document}     \begin{tikzpicture}     \pie[text=legend,style=drop shadow,radius=2]{51.3/Protestant, 23.9/Roman Catholic, 3.3/Other Christian, 1.7/Jewish, 0.7/Buddhist, 0.6/Muslim, 0.4/Hindu, 1.2/Other religions, 16.1/No religion }     \end{tikzpicture}     \end{document}      EDIT: I also have another pie chart, where the text is quite long. How can I set the width of the text so that it wraps around before the page ends? Here is what it looks like: ![enter image description here](http://i.stack.imgur.com/Qw0a1.png) I forgot that PGF-PIE was not on CTAN. Here is a link to the google source: http://code.google.com/p/pgf-pie/


title: Non-English identifiers in \label / \ref ("Missing \endcsname inserted")

text: I found that LaTeX chokes on certain non-ASCII identifiers in `\ref`. This works fine:               \documentclass{scrartcl}     \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \begin{document}          \section{Foobär}     \label{sec:Foobär}          See \ref{sec:Foobär}          \end{document}      The same thing with "Barbaß" instead of "Foobär" aborts with "Missing \endcsname inserted." (huh?). Now, the naive sollution would be "don't use non-ASCII identifiers", of course. But since I'm using some macro magic to get labels auto-defined by section headers / table captions, as well as generating some surrounding text for references, I would _really_ like to use native language in labels, instead of crimping them into ASCII-7. Any way to get this done?


title: How to gather (narrow) floats together horizontally?

text: I have a document with some narrow (less than half the `\textwidth`) images. Sometimes there's one such image on the page, and then the `figure` environment is what suffices. But sometimes there are two such floats on one page, and I'd like to have them put side by side. Does anybody know of a LaTeX package doing something like this? (A ConTeXt solution would be equally welcome.) Edit: to be more precise, this is my use case: the document is a problem set. Some problems have a graphic associated with them, usually rather narrow. If two problems with a graphic happen to fall on the same page, I'd like to have both figures combined (maybe on the top of the page, maybe near the first problem, this is not that important for me). And if I change the order of problems (which I do quite frequently), or even add some more of them anywhere in the middle, the configuration of images can become totally different, and that's why I'd like the solution to be at least semi-automatic).


title: expansion of loop macro

text: I have a macro that contains a loop using `\@for` and it works until I try to write its output to a file. The following document shows the problem.               \documentclass{article}     \makeatletter     \newwrite\my@out     \AtBeginDocument{\immediate\openout\my@out my.tmp}     \AtEndDocument{\immediate\closeout\my@out}          \def\plist#1{%       \@for\tmpkey:=#1\do{blah }     }     \def\mymacro{%       \plist{a,b,c}% this works, appears in document.       \immediate\write\my@out{hello}% make sure our file is okay       \immediate\write\my@out\plist{a,b,c}% does not work!     }     \makeatother     \begin{document}       \mymacro     \end{document}      When I comment out the last line of `\mymacro`, the code works and the words `blah blah blah' appear in the pdf. So the logic is not too far off. However, I must be running into an expansion timing problem when I write to the external file. I get the error message:               ! Missing number, treated as zero.     <to be read again>                      \def     l.21 \mymacro      I can use another package if I have to. I'm using the LaTeX2e standard `\@for` in an effort to minimize the number of dependencies the package will have. I've tried a lot of permutations using `\expandafter`s and `\edef`, but my understanding just doesn't go far enough.


title: Interval of x tick labels are to close

text: I have some trouble with the interval of the x tick labels. I have two much labels so the text overlap each other. My code is following:               \begin{figure}     \begin{tikzpicture}     \begin{axis}[         width=0.8\linewidth,         xlabel={Anzahl der Prozessoren},         ylabel={Speedup},         domain = 1:4096,         xmin=1, xmax=4096,         ymin=0, ymax=30,         xmode = log,         log basis x={2},         xticklabel=\pgfmathparse{2^\tick}\pgfmathprintnumber{\pgfmathresult},         legend pos = north west     ]     \addplot [black, very thick, dashed]{     1/((1-0.5) + 0.5/x)     };     \addplot [black, very thick, dotted]{     1/((1-0.8) + 0.8/x)     };     \addplot [black, very thick, loosely dotted]{     1/((1-0.9) + 0.9/x)     };     \addplot [black, very thick, solid]{     1/((1-0.95) + 0.95/x)     };;          \legend{%     P = 50\%,     P = 80\%,     P = 90\%,     P = 95\%,     }     \end{axis}     \end{tikzpicture}     \caption{Speedup nach Amdahla'sches Gesetz}     \label[figure]{fig:amdahls_law_speedup}     \end{figure}      Here is a result of it: ![enter image description here](http://i.stack.imgur.com/cbWOf.png) The ticks should automatically decrease if the interval is to close, shouldn't it? If the interval is decreased, will the accuracy of the plot worse?


title: biblatex is ignoring maxcitenames

text: I am using the following line in my document:               \usepackage[citestyle=apa,maxcitenames=2,bibstyle=authoryear,doi=true,url=true]{biblatex}      However, `biblatex` ignores `maxcitenames`, and prints out every name, every time. Is there are way to make `biblatex` stop ignoring `maxcitenames`?


title: How to conditionally control the width of a figure with minimal code duplication?

text: I am using `\iftoggle` to switch between a for-review (doublespaced, onecolumn) and photo-ready (singlespaced, twocolumn) layout. I want to change the width of figures to be optimal for both, depending on the toggle. I'd also like to do this without having two copies of all the markup for the figures. Essentially, I want the equivalent of this in CPP:               #define DRAFT 1     #if DRAFT     #define FIGWIDTH 0.45\columnwidth     #else     #define FIGWIDTH 0.9\columnwidth     #end          ... lots of complex figure/subfigure crap     \includegraphics[width=FIGWIDTH]{pretty-diagram.pdf}     ... etc      What's the best way to do this?


title: LaTeX: how to change indentation of chapter and sections in report document class?

text: It seems like relative to the paragraph text, the `chapter` and `section` titles have a default indentation that I'd like to manually set. Is there a way to do this using               \setlength{\...}{}      ? I'd rather not mess with `\titlesec` since I've got multiple files and using `titlesec` previously messed up with my formatting.


title: Short footcites beyond the text

text: I need help! How can I insert German footcites beyond the text with only author, year and pagenumber? I am using `jurabib` and the typical `\footcite` command and it gives me too big footcites with the whole title and everything in it...


title: Lyx View action not working (inactive)

text: I have created a very simple document in Lyx and want to preview it. But the "View" action (the one bound to Command+R) and its corresponding tool bar button (with the icon showing two large eyes) are inactive/disabled. Strangely, "View other Format" is working fine, for example for PDF. I am on Mac OS 10.9 with MacTex 2014 and Lyx 2.1.1 installed. I have already tried to re-compute my configuration (last item in "Tools" menu) and re- install Lyx but "View" remains disabled. Any ideas? Many thanks in advance!


title: Default paragraph headings with possible override

text: I am currently creating a new class for the reports that we do at work. All of our reports require that each paragraph have an in-line, non-numbered heading. Most of the time this heading is the same for all paragraphs in a given document. However, on occassion the heading does change. The way this is currently done is as follows:               \documentclass{article}     \begin{document}       \section{A Section}         \subsection{A SubSection}           (f) Para 1                (f) Para 2                (g) Para 3                (f) Para 4     \end{document}      In the above example, this document requires that most paragraphs begin with "f" but a few paragraphs begin with "g". What I would like to do is set up a preamble command that would set the default paragraph heading and then have a per paragraph command that would override this default, such as:               \documentclass{article}          \defaultHeading{f}          \begin{document}       \section{A Section}         \subsection{A SubSection}           Para 1                Para 2                \paraHead{g} Para 3                para 4     \end{document}      Using either method this should produce the a document like: 1 A Section 1.1 A SubSection (f) Para 1 (f) Para 2 (g) Para 3 (f) Para 4


title: Setting package option from the command line

text: I want to compile a document that uses the `tcolorbox` package in two different ways:   * with the option `/tcb/lowerbox` set to `visible`, so that the lower part of the `tcolorbox` environment is typeset   * with the option `/tcb/lowerbox` set to `ignored`, so that the lower part of the `tcolorbox` environment is not used. At the beginning of the document there is the command               \tcbset{lowerbox=ignored}      which should be commented for the first case only. Is it possible to control this behaviour from the command line when compiling the document, so that I do not have to edit the source explicitly in order to have the two versions of the document? Here is a minimal working example. Let's say it is saved as `test.tex`.               \documentclass{standalone}          \usepackage{tcolorbox}          %\tcbset{lowerbox=ignored}          \begin{document}          \begin{tcolorbox}       Upper part.       \tcblower       Lower part.     \end{tcolorbox}          \end{document}


title: Line spacing inside quote environment in amsart (removing extra white space)

text: This is a follow-up to Line spacing inside quote environment. I'm using the `amsart` document class, with a specifically defined line-spacing for the whole document. When I adjust the line-spacing within the `quote` environment, I get extra white space above the quoted material, as in the example below. Any idea how I can keep that from happening? Thanks. Edit: On closer inspection it looks like the quote environment standardly inserts a little extra space between the main text and the quote, in order to set off the quote a bit. I'm OK with that extra space, but I want it to be added to the spacing _of the main text_ rather than to that of the quote. If the extra margin is e, the main text is spaced at m, and the quote is spaced at q, I want the spacing between the main text and the quote to be m + e, not q + e.               \documentclass{amsart}     \usepackage{setspace}     \usepackage{lipsum}          \setstretch{1.5}          \begin{document}          \lipsum[2]     \begin{quote}     \singlespacing     \lipsum[1]     \end{quote}     \lipsum[2]          \end{document}


title: Define preamble to a default

text: I have               \begin{arab}[utf]     ... some text     \end{arab}      throughout entire document. Is there any way to get rid of this reoccurring `\begin` `\end` command so to have my document look like this:               \begin{document}          text1          \newpage          text 2          \newpage          \end{document}


title: First package for typesetting commutative diagrams

text: What was the first package for typesetting commutative diagrams in Latex and when was it made available?


title: How to change vertical and horizontal unit based on a fraction of width and height of an image?

text: I have to overlay some texts on a PDF form. As converting the PDF form to EPS with `pdftops` produces unsatisfying result, I will not use PSTricks code below.               \documentclass[pstricks,border=12pt]{standalone}          \def\M{4}% columns     \def\N{4}% rows     \def\scale{1}% scale     \def\filename{example-image-a}% filename               \usepackage{graphicx}     \newsavebox\IBox     \savebox\IBox{\includegraphics[scale=\scale]{\filename}}          \addtopsstyle{gridstyle}     {         gridcolor=yellow,         subgridcolor=gray,         subgriddiv=10,         griddots=0,         subgriddots=5,         gridwidth=0.4pt,         subgridwidth=0.2pt,     }          \psset     {        xunit=0.5\dimexpr\wd\IBox/\M,        yunit=0.5\dimexpr\ht\IBox/\N,     }          \begin{document}     \begin{pspicture}[showgrid=top](-\M,-\N)(\M,\N)         \rput(0,0){\usebox\IBox}         \rput[bl](1,1){This is a text.}     \end{pspicture}     \end{document}      The output I want to achieve looks like the following. ![enter image description here](http://i.stack.imgur.com/LsRby.png) Instead I will use TikZ. My problem is how to set the horizontal and vertical unit in TikZ. More precisely, how to do the following in TikZ?               \psset     {        xunit=0.5\dimexpr\wd\IBox/\M,        yunit=0.5\dimexpr\ht\IBox/\N,     }      ## MWE in TikZ               \documentclass[tikz,12pt,dvipsnames,border=12pt]{standalone}          \def\M{4}% columns     \def\N{4}% rows     \def\scale{1}% scale     \def\filename{example-image-a.pdf}% filename               \usepackage{graphicx}     \newsavebox\IBox     \savebox\IBox{\includegraphics[scale=\scale]{\filename}}               \begin{document}     \begin{tikzpicture}[inner sep=0,x=0.5\wd\IBox/\M\relax,y=0.5\ht\IBox/\N\relax]         \node (image) at (0,0) {\usebox\IBox};         \node at (1,1) {some text goes here};         \draw[help lines,red,step=1](-\M,-\N) grid (\M,\N);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/ogmhS.png) DONE! Problem solved!


title: Figure* span two columns only on new page for Bioinformatics Journal Template

text: I am using the Bioinformatics template from https://www.sharelatex.com/templates/52fb87a233621a613683ec81 Unfortunately, it is not possible to insert a spanning figure with the `figure*` environment on the first page such that the image is at the bottom. It always appears at the second, new page on top. I have googled a lot and the suggestion to use package `dblfloatfix` does not compile because the document class `already defined c@dblbotnumber`. The template uses a large document class file and styles, so I can not paste a simple code here. It would be great if someone could have a look at it and find a solution.


title: biblatex: How to ignore articles (an, the) when sorting the bibliography?

text: I have several .bib entries whose titles start with 'An' or 'The'. I'm using Chicago style and I have to ignore those words when sorting. Thus "A Critical Study" should come _after_ "Basic Theory," but the package places it before. I can't find anything in the package (biblatex-chicago) documentation about this. Is there some trick I can use, or some option I've missed in biblatex or biblatex-chicago? (Backend is Biber, by the way). MWE:               @book {book1,     author = {Tim Winton},     title = {An Open Swimmer},     }          @book {book2,     author = {Tim Winton},     title = {Breath},     }      When properly sorted, book1 should come _after_ book2, but the package takes the word "An" into account when sorting, and it shouldn't.


title: drawing points coordinates in a graph

text: I need to draw points coordinates in a graph. In my case, the problem is that the values of the x-axis and y-axis of each point can be very large. That is why I need to edit the code below in order to be able to draw the 2D points even for large coordinates values. For example the code below works well but only for small coordinates values, I need to use it for large coordinates values without increasing the graph. Let us consider a point A(300,200). Any help will be very appreciated! The code is:               \documentclass{report}     \usepackage{tikz}     %\usetikzlibrary{automata,topaths}% note neded for this.      \begin{document}      \begin{tikzpicture}[x=1cm,y=0.4cm]           \draw[latex-latex, thin, draw=gray] (-4,0)--(4,0) node [right] {$x$}; % l'axe des abscisses      \draw[latex-latex, thin, draw=gray] (0,-5)--(0,5) node [above] {$y$}; % l'axe des ordonnées          \foreach \Point in {(-2,1.5), (-1,1), (-2,3), (-1,2.5), (1,3)}{         \node at \Point {\textbullet};     }          \foreach \Point in {(2,-1.5), (1,-1), (2,-3), (1,-2.5), (1,-3)}{         \node at \Point {$\circ$};     }          % to ensure that the points are being properly centered:     \draw [dotted, gray] (-4,-6) grid (5,5);          \end{tikzpicture}     \end{document}


title: XeLaTeX, xindy, imakeidx "Could not find file "tex/inputenc/utf8.xdy"

text: I'm trying to use XeLaTeX, imakeidx and xindy for a german book with multiple indexes. Based on an answer on this page, (which works) I tried to switch to xelatex and imakeidx. Calling               xelatex --shell-escape test.tex      on this file test.tex:               \documentclass{article}     \usepackage{xltxtra}     \usepackage[xindy]{imakeidx}     \makeindex[options=-M texindy -L german-duden -C utf8]     \begin{document}     üäö     start      \index{a}\index{b}\index{ä}\index{ü}\index{ÖÖ}     end     \printindex     \end{document}      gives me the error message: > (require "tex/inputenc/utf8.xdy") ERROR: Could not find file > "tex/inputenc/utf8.xdy" ! Leaving out xindy option "-C utf8" gives me an index with alll umlauts sorted under "O". I just discovered that xindy does work when run separately, without being started from within xelatex per imakeidx, but from the command prompt:                $ xindy -M texindy -C utf8 -L german-duden test.idx      No nagging and no mention of "utf8.xdy" either.


title: subfigure undefined control sequence error in latex

text: I have been using LaTeX for years, but today on sigchi template I am getting undefined control sequence error. I want to place my figures spanning two columns or even in a single column, but none works. Here is a minimal example code:               \documentclass{sigchi}          % Remove or comment out these two lines for final version     \toappearbox{\Large Submitted to CHI'13. \\Do not cite, do not circulate.}     \pagenumbering{arabic}% Arabic page numbers for submission.           % Use \toappear{...} to override the default ACM copyright statement (e.g. for preprints).          % Load basic packages     \usepackage{balance}  % to better equalize the last page     \usepackage{graphicx} % for EPS, load graphicx instead     \usepackage{times}    % comment if you want LaTeX's default font     \usepackage{url}      % llt: nicely formatted URLs     \usepackage{soul}     \usepackage{color}     \usepackage{subfig}                    \newcommand{\hilight}[1]{\colorbox{yellow}{#1}}          % llt: Define a global style for URLs, rather that the default one     \makeatletter     \def\url@leostyle{%       \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\bf\ttfamily}}}     \makeatother     \urlstyle{leo}               % To make various LaTeX processors do the right thing with page size.     \def\pprw{8.5in}     \def\pprh{11in}     \special{papersize=\pprw,\pprh}     \setlength{\paperwidth}{\pprw}     \setlength{\paperheight}{\pprh}     \setlength{\pdfpagewidth}{\pprw}     \setlength{\pdfpageheight}{\pprh}          % Make sure hyperref comes last of your loaded packages,      % to give it a fighting chance of not being over-written,      % since its job is to redefine many LaTeX commands.     \usepackage[pdftex]{hyperref}     \hypersetup{     pdftitle={SIGCHI Conference Proceedings Format},     pdfauthor={LaTeX},     pdfkeywords={SIGCHI, proceedings, archival format},     bookmarksnumbered,     pdfstartview={FitH},     colorlinks,     citecolor=black,     filecolor=black,     linkcolor=black,     urlcolor=black,     breaklinks=true,     }          % create a shortcut to typeset table headings     \newcommand\tabhead[1]{\small\textbf{#1}}               % End of preamble. Here it comes the document.     \begin{document}          \title{title}          \maketitle          \begin{abstract}          Abstract     \end{abstract}     \section{Introduction}          Figure here      \begin{figure*}      \subfigure{\includegraphics{graph}}           \subfigure{\includegraphics{graph2}}           \subfigure{\includegraphics{graph3}}      \end{figure*}          \balance               \bibliographystyle{acm-sigchi}     \bibliography{IEEEabrv,mybibfile,sample}     \end{document}      '


title: Changing upper case & lower case letters

text: I just wrote 6 paragraphs of a report without really looking at the screen, and when I did, all of my upper case letters were lower case, and vice-versa. I had left the caps lock on. Is there a one-button solution to changing that? Highlite the whole page and hit "Sitch upper/lower case? Or do you always just have to start over?


title: When using the acronym package and the smaller option, how to avoid the tiny 's' in the plural acronym?

text: I'm using the acronym package, and using the smaller option because that is a typographic convention.               \documentclass[a4paper]{article}     \usepackage[smaller]{acronym}     \acrodef{DLL}{Dynamically Linked Library}     \begin{document}     The plural of \ac{DLL} is \acp{DLL} but that `s' just looks way too tiny.     \end{document}      Compiled with pdflatex: ![PDF result](http://i.stack.imgur.com/GNzri.png) But the plural form of the acronym (`\acp`) appends an s but this is much to small in my opinion, and looks off. Should I try to fix this or this typographically accepted? I was thinking about a new command `\DLLs` (and `\DLL`) which added a normal 's' but that just feels dirty.


title: Is TeX necessary if using LaTeX?

text: I have been using LaTeX for a little over two years now. I mostly use it to prepare homework solutions in mathematics and engineering coursework. I also use it to document my research and writing some reports. Recently I have started to use it for my resume, because I find the formatting to be significantly more stable than anything I can get using Microsoft Word. However, I have not been able to find a satisfactory resume class, so I am now modifying a resume class to suit my needs. To improve the resume class, I am now trying to make some new environments and commands to make the construction more intuitive. The class file that I am modifying appears to be in Plain TeX, which inspires my question. Are there certain layout and design problems that can only be solved using Plain TeX, or can everything be done using LaTeX?


title: Fonts with small degree of "randomness" in their shape?

text: Are there fonts out there, that have small degree of variation from letter to letter? In some older books, some letters were corrected by hand, and that produced a rather curious effect, and added a human touch to the work. I was wandering if there is anything like this? It would be great if it was an open type font like Linux Libertine, but that is a separate question.


title: How to allow correct environment nesting when the environment definition involves labels?

text: The code below shows an improved version of the code provided in `this answer` to Mark (highlight) a paragraph (\item{...}) with a squiggly line for later attention. The environment `tikzborder` uses a TikZ decoration to draw a squiggly line to the right of the text (even if page breaks occur); the optional argument controls the separation between the text and the line (the document has to be processed three times). The idea is simple: marks are placed at the beginning and at the end of the environment and then the decoration is drawn between the marks; labels are used at the beginning and at the end, to decide if the marks are in the same page or not and act accordingly.               \documentclass{article}     \usepackage{atbegshi}     \usepackage{refcount}     \usepackage{tikz}     \usetikzlibrary{decorations.pathmorphing,calc}     \usepackage{lipsum}          \newcounter{bordercntr}     \newcounter{borderpages}          \newcommand\tikzmark[1]{%       \tikz[overlay,remember picture] \node (#1) {};}          \newenvironment{tikzborder}[1][0pt]     {%       \gdef\borderspacing{#1}       \stepcounter{bordercntr}%       \tikzmark{start-border}\label{start-border\thebordercntr}%       % if the marks are in the same page, nothing is done       % otherwise, the decoration is drawn from the starting point to the page bottom       % and, if necessary, intermediate pages will also receive the decoration       \ifnum\getpagerefnumber{start-border\thebordercntr}=\getpagerefnumber{end-border\thebordercntr} \else         \begin{tikzpicture}[overlay, remember picture]         \draw [decoration={coil,aspect=0},decorate,ultra thick,gray]           let \p1 = (start-border.north), \p2 = (end-border), \p3 = (current page.center) in%              ( $ (\x3,\y1) + (.55\textwidth+#1,2pt) $ ) --  ( $ (\x3,\y3) + (0.55\textwidth+#1,-0.5\textheight) $ );         \end{tikzpicture}%         \setcounter{borderpages} {\numexpr\getpagerefnumber{end-border\thebordercntr}-\getpagerefnumber{start-border\thebordercntr}}\theborderpages         \ifnum\value{borderpages}>1           \AtBeginShipoutNext{\tikzborderpage[#1]}%         \fi       \fi%     }     {\tikzmark{end-border}\label{end-border\thebordercntr}       % if the marks are in the same page, the decoration is drawn       % otherwise, the decoration is drawn from the top of the page to the end mark       \ifnum\getpagerefnumber{start-border\thebordercntr}=\getpagerefnumber{end-border\thebordercntr}         \begin{tikzpicture}[overlay, remember picture]         \draw [decoration={coil,aspect=0},decorate,ultra thick,gray]           let \p1 = (start-border.north), \p2 = (end-border), \p3 = (current page.center) in           ( $ (\x3,\y1) + (.55\textwidth+\borderspacing,2pt) $ ) --  ( $ (\x3,\y2) + (.55\textwidth+\borderspacing,10pt) $ );         \end{tikzpicture}%       \else         \begin{tikzpicture}[overlay, remember picture]         \draw [decoration={coil,aspect=0},decorate,ultra thick,gray]           let \p1 = (start-border.north), \p2 = (end-border), \p3 = (current page.center) in           ( $ (\x3,\y3) + (.55\textwidth+\borderspacing,.5\textheight-6pt) $ ) -- ( $ (\x3,\y2) + (.55\textwidth+\borderspacing,10pt) $ );         \end{tikzpicture}%       \fi%     }          % the command to draw the decoration in intermediate pages from the top     % to the bottom of the page     \newcommand\tikzborderpage[1][0pt]{%       \begin{tikzpicture}[overlay, remember picture]         \draw [decoration={coil,aspect=0},decorate,ultra thick,gray]           let \p1 = (current page.center) in           ( $ (\x1,\y1) + (.55\textwidth+#1,0.5\textheight-15pt) $ ) -- ( $ (\x1,\y1) + (.55\textwidth+#1,-0.5\textheight) $ );       \end{tikzpicture}       \addtocounter{borderpages}{-1}%       \ifnum\value{borderpages}>1         \AtBeginShipoutNext{\tikzborderpage[#1]}%       \fi%     }          \begin{document}          \begin{tikzborder}     \lipsum[2]     \end{tikzborder}          \begin{tikzborder}[-5pt]     \lipsum[2]     %\begin{tikzborder}     \lipsum[2]     %\end{tikzborder}     \end{tikzborder}          \end{document}      The problem is that now I want to nest `tikzborder` environments and this is not working, as can be seen by uncommenting out the inner environment in the code above and reprocessing the document. I think I need some mechanism to stack the marks, but I don't know how to implement this kind of mechanism. Of course, perhaps another approach allowing correct nesting of the environment could be better, and I would also be willing to hear about it.


title: Doublespacing is moving my page number

text: I'm using the KOMA-Script report `scrreprt` to typeset my PhD thesis and the graduate school requires that the main text be double spaced and that the page number be in the top right. When I enable double spacing the page number moves down a little bit. How can I solve this? Here is a MWE that reproduces the problem:               \documentclass[12pt, letterpaper]{scrreprt}          \usepackage{setspace}          \usepackage{scrpage2}     \pagestyle{scrheadings}     %this code clears the header/footer     \clearscrheadfoot     %then puts the page number in the top right     \rohead[\pagemark]{\pagemark}          \begin{document}     \chapter{ch1}     hello     \chapter{ch2}     \doublespacing     hello     \end{document}


title: Make xelatex cache font families in Windows 7?

text: I'm using TeXLive + TeXMaker to write a paper and I need to include the font Scala Sans Pro, which I have as a set of otf files in the local directory as part of the file. After much wrangling with lcdftools I was only able to install the Regular version of the font, and then I finally gave up and started using xelatex. Now I can get it to work, but it's _slooooow_ , every single time, and much slower since I switched to importing it like this (which is necessary to get BoldItalics to work):               \usepackage{xltxtra}     \setsansfont[     Extension       = .otf,     Path            = Fonts/ScalaSansPro/,     UprightFont     = *-Regular,     BoldFont        = *-Bold,     ItalicFont      = *-Italic,     BoldItalicFont  = *-BoldItalic]{ScalaSansPro}      It's taking like 5+ minutes for every single build. I don't mind waiting 5-10 minutes to build the document once, but is there some way to have TeXLive or TexMaker cache the font so I don't have to build it every time? Otherwise this would be intolerable. (The way I used to do it it would take 30-60 second to build, and that was by using `\setsansfont(ScalaSansPro)`, but for whatever reason ScalaSansPro- BoldItalic installed as a separate font, so bold-italics weren't detected by xelatex **Edit:** The 5-10 minute thing has stopped, so maybe it's already cache-ing - but it's still pretty slow (30-60 second build times, significantly slower than pdflatex was). I'll leave this question up and hopefully someone can explain if this is a font problem or what.


title: how to change colours in predefinite theme

text: Bonjour, I desesperately try to change the colour of `\insert(short)part` in CambridgeUS theme. Here is what I want:               \setbeamertemplate{headline}{%       \leavevmode%       \hbox{%         \begin{beamercolorbox}[%           wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{%             author in head/foot}%           \usebeamerfont{%             section in head/foot}%           \insertpart%         \end{beamercolorbox}%         \begin{beamercolorbox}[%           wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{%             part in head/foot}%           \usebeamerfont{%             date in head/foot}%           \insertsubsection%         \end{beamercolorbox}}%       \vskip0pt%     }      But whatever the `\setbeamercolor` I use, the fg colour for `\insertpart` (or `\insertsection`...) remains red! For instance, I can change the bg colour:               \setbeamercolor*{palette tertiary}{fg=green,bg=black}      the background becomes black the the foreground (for `\insertpart`) remains red and is not turned into green! Does anybody have an answer and a reference where this is documented?


title: size of barcode in pspicture

text: I´m on a way to create a barcode with `pst-barcode`. How can I get a suitable pspicture environment in a standalone class? In the following example the top and right borders are too big.               % run with XeLaTeX => PDF     \documentclass[border = 1pt]{standalone}          \usepackage{pst-barcode}          \begin{document}          \begin{pspicture}(1in, 1in)         \psbarcode{http://www.dante.de}{}{qrcode}     \end{pspicture}          \end{document}


title: How to change indentation/margin of table in Context?

text: This is the code I use to create a simple table in Context:               \starttable[|lw(43mm)|lw(43mm)|]          \NC {\em Mer uttalade} \NC {\em Mindre uttalade} \NC\AR     \NC {\em bearbetningsegenskaper} \NC {\em bearbetningsegenskaper} \NC\AR     \HL     \NC svetsad metall \NC gjuten metall \NC\AR     \NC handformad gips \NC gjuten gips \NC\AR          \stoptable      Please see this image of what it looks like! Note the difference in the level of indentation of the table (or call it margin if you will) -- this is marked with red pencil. How do I affect the size of this indentation? I would like it to be smaller. I've been trying different things like `\setupindenting`, but can't affect this space in any way. Would be thankful for any suggestions!


title: Animation with Latex Beamer

text: I'd like to produce a sort of animation effect in my presentation. I have an image:               \begin{figure}     \centering     \includegraphics[width=0.8\textwidth]{./images/avatar-landscape.jpg}     \end{figure}      and many bullets describing it:               \begin{itemize}     \item This is the first bullet item of the slide     \item This is the second bullet item of the slide     \item This is the third bullet item of the slide     \end{itemize}      Unfortunately the image is very big, and both elements do not fit in a single frame. Therefore I wanted to add a sort of animation in which I have the following visual effect: ![enter image description here](http://i.stack.imgur.com/ATQsC.png) And going to the next slide should maintain the image but skip to the next bullet of the list I posted before. I surely can imagine of a simple way to do it (adding a number of frames for each bullet item with the same figure), but was wondering if there was some particular way to produce such an effect without increasing the number of frames (which would avoid the number of page to increase). Can you help me?


title: What is the difference between \fontsize{...}{some length} and \linespread{some length}?

text: I notice that the second argument to `\fontsize` and the first argument to `\linespread` both seem to change the spacing between lines of text. What is the difference between these? Is there one I should favor using?


title: Why Glossaries with Xindy unable to execute（cannot find the correct PATH)?

text: # After I compiled a tex file by xelatex, I use Glosarries with Xindy to make a index, it reported:                   $ makeglossaries test     makeglossaries version 2.04 (2012-05-19)     added glossary type 'main' (glg,gls,glo)     xindy  -L english  -I xindy -M "test" -t "test.glg" -o "test.gls" "test.glo"     Opening logfile "test.glg"      ERROR: Opening logfile "test.glg" failed!          ***Call to xindy failed***          Check 'test.glg' for details      And in test.glg, there are:               *** Unable to execute: 'xindy  -L english  -I xindy -M "test" -t "test.glg" -o "test.gls" "test.glo"' ***  Status report:     Opening logfile "test.glg"     ERROR: Opening logfile "test.glg" failed!      But I can use xindy on my Mac in my terminal:                   Jing@Jing2MacBook-Pro ~$ xindy         You need to specify --out-file if the raw index is read from standard input.         usage: xindy [-V?h] [-qv] [-d magic] [-o outfile.ind] [-t log] \         ................      What's the problem? # There is a similar problem and provided me an useful idea: Makeindex fails when called from a script # There is the true problem same as my question: xindy cannot open the temp file For 'glossaries' when it doesn't use Xindy, we have to use 'makeglossaries test.tex' in the folder where .tex is. For 'glossaries' when it's with Xindy, Xindy also has the path problem, but we must copy the tex file to xindy's Temp folders, then xindy can only work. # The keypoint is: 'makeglossaries' or xindy can not use the folder where .tex file(and some other files came from .tex after compiled by xelatex ) as the TMPDIR, it uses the system default TMPDIR, so 'makeglossaries' can not find .glg, then 'makeglossaries' can't make a index. You can use command 'env' in Terminal to find out what is your default TMPDIR of system. My default TMPDIR in system is:               TMPDIR=/var/folders/9h/71txqqf572x998x6sm4c6l440000gn/T/      So I must copy all the tex file I want to make index in /var/folders/9h/71txqqf572x998x6sm4c6l440000gn/T/, compile tex file there, then xindy can only work. Otherwise, we have to manully change the TMPDIR in Terminal to the folder where .tex file is after xelatex test.tex in current session. If your tex file are in /Users/Jhering/mynewbook/,in Mac/Linux/Unix-like, to change TMPDIR looks like:               export TMPDIR=/Users/Jhering/mynewbook/      In windows ,eg:               set TEMP=C:\Users\Jhering\mynewbook      Then you can               makeglossaries test          xelatex test.tex       # But how can we don't need change the TMPDIR to the folder where .tex file is every time? Sample Code (originally came from the package glossaries, none was edited): Make sure you have had the parameter 'xindy' as follows:                     \usepackage[xindy]{glossaries}      The test.tex file is:               % This file is public domain.      %      % This is a sample document illustrating how to use the      % glossaries package with xindy. To create the document:      %      %   latex samplexdy      %   makeglossaries samplexdy      %   latex samplexdy      %      % If you don't have Perl installed, then use one of the      % following instead of makeglossaries:      %      % If you want to have a separate "Mc" letter group do:      %      %    xindy -I xindy -M samplexdy-mc -t samplexdy.glg -o samplexdy.gls samplexdy.glo      %      % Otherwise do:      %      %  xindy -L english -C utf8 -I xindy -M samplexdy -t samplexdy.glg -o samplexdy.gls samplexdy.glo      %     \documentclass{article}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{fmtcount}          \usepackage[colorlinks,plainpages]{hyperref}     \usepackage[xindy,style=altlistgroup]{glossaries}           % Define a new command to do bold italic:          \newcommand*{\hyperbfit}[1]{\textit{\hyperbf{#1}}}           % Need to add this to the list of attributes in order      % to use it with xindy:      % (This command will have no effect if \noist is used)          \GlsAddXdyAttribute{hyperbfit}           % Redefine the page numbers so that they appear as a word:           \renewcommand*{\thepage}{\Numberstring{page}}           % Need to add this to the list of location styles.      % \Numberstring{page} gets expanded to      % \protect \Numberstringnum {<n>} (where <n> is the page number)      % so need to define the location in that format:      % (This command will have no effect if \noist is used)          \GlsAddXdyLocation{Numberstring}{:sep "\string\protect\space       \string\Numberstringnum\space\glsopenbrace"       "arabic-numbers" :sep "\glsclosebrace"}           % (Need to redefine \glsXpageXhyperbfit and      % \glsXpageXglsnumberformat after \makeglossaries to get the      % hyperlinks working correctly.)           % To have Mc as a separate group uncomment the following three      % lines:           %\setStyleFile{samplexdy-mc} % note no extension      %\noist      %\GlsSetXdyLanguage{}           % The above three lines specify to use samplexdy-mc.xdy (supplied      % with this file) and don't overwrite it. The language is      % unset using \GlsSetXdyLanguage{} as all the language      % dependent information is contained in samplexdy-mc.xdy      % Note that using \noist means that commands like      % \GlsAddXdyAttribute and \GlsAddXdyLocation will no longer have      % an effect.           % Write the style file (if \noist isn't used)      % and activate glossary entries          \makeglossaries           % Each page location will be specified in the form:      %      % "\glsXpageXglsnumberformat{}{\protect \Numberstringnum "\marg{n}"}"      % or      % "\glsXpageXhyperbfit{}{\protect \Numberstringnum "\marg{n}"}"      %      % Redefine to allow hyperlinks:          \renewcommand{\glsXpageXglsnumberformat}[2]{%      \linkpagenumber#2%     }          \renewcommand{\glsXpageXhyperbfit}[2]{%      \textbf{\em\linkpagenumber#2}%     }          \newcommand{\linkpagenumber}[3]{\hyperlink{page.#3}{#1#2{#3}}}           % Define glossary entries      % \glshyperlink is used instead of \gls to prevent the glossary      % page numbers also appear in the locations, however I need      % to ensure that the referenced entries are added to the      % glossary via commands that use \glslink, \glsadd or \glssee          \newglossaryentry{mcadam}{name={McAdam, John Loudon},     first={John Loudon McAdam},text={McAdam},     description={Scottish engineer}}          \newglossaryentry{maclaurin}{name={Maclaurin, Colin},     first={Colin Maclaurin},text={Maclaurin},     description={Scottish mathematician best known for the     \gls{maclaurinseries}}}          \newglossaryentry{maclaurinseries}{name={Maclaurin series},     description={Series expansion},see={taylorstheorem}}          \newglossaryentry{taylorstheorem}{name={Taylor's theorem},     description={Theorem expressing a function $f(x)$ as the sum of     a polynomial and a remainder:     \[f(x) = f(a)+f'(a)(x-a)+f''(a)(x-a^2)/2!+\cdots+R_n\]     If $n\to\infty$ the expansion is a \glshyperlink{taylorseries}     and if $a=0$, the series is called a     \gls{maclaurinseries}}}          \newglossaryentry{taylorseries}{name={Taylor series},     description={Series expansion},see={taylorstheorem}}          \newglossaryentry{taylor}{name={Taylor, Brook},     first={Brook Taylor},text={Taylor},     description={English mathematician}}          \newglossaryentry{mcnemar}{name={McNemar, Quinn},     first={Quinn McNemar},text={McNemar},     description={Mathematician who introduced     \gls{mcnemarstest}. This entry has the number list     suppressed},nonumberlist}          \newglossaryentry{mcnemarstest}{name={McNemar's test},     description={A nonparametric test introduced by     \gls{mcnemar} in 1947}}          \newglossaryentry{mach}{name={Mach, Ernst},     first={Ernst Mach},text={Mach},      % if using samplexdy-mc.xdy, the following line is needed      % to prevent this entry being put in the "Mc" group     sort={mach, Ernst},     description={Czech/Austrian physicist and philosopher}}          \newglossaryentry{machnumber}{name={Mach number},      % if using samplexdy-mc.xdy, the following line is needed      % to prevent this entry being put in the "Mc" group     sort={mach number},     description={Ratio of the speed of a body in a fluid to the     speed of sound in that fluid named after \gls{mach}}}          \newglossaryentry{malthus}{name={Malthus, Thomas Robert},     first={Thomas Robert Malthus},text={Malthus},     description={English mathematician, sociologist and classicist}}          \newglossaryentry{ampereandre}{name={Ampère, André-Marie},     first={André-Marie Ampère},text={Ampère},     description={French mathematician and physicist}}          \newglossaryentry{ampere}{name={ampere},     description={SI unit of electric current named after     \gls{ampereandre}}}          \newglossaryentry{archimedes}{name={Archimedes of Syracuse},     first={Archimedes of Syracuse},text={Archimedes},     description={Greek mathematician}}          \newglossaryentry{archimedesprinciple}{name={Archemedes' principle},     description={Principle that if a body is submerged in a fluid     it experiences upthrust equal to the weight of the displaced     fluid. Named after \gls{archimedes}}}          \newglossaryentry{galton}{name={Galton, Sir Francis},     first={Sir Francis Galton},text={Galton},     description={English anthropologist}}          \newglossaryentry{gauss}{name={Gauss, Karl Friedrich},     first={Karl Friedrich Gauss},text={Gauss},     description={German mathematician}}          \newglossaryentry{gaussianint}{name={Gaussian integer},     description={Complex number where both real and imaginary     parts are integers}}          \newglossaryentry{peano}{name={Peano, Giuseppe},     first={Giuseppe Peano},text={Peano},     description={Italian mathematician}}          \newglossaryentry{peanoscurve}{name={Peano's curve},     description={A space-filling curve discovered by     \gls{peano}}}          \newglossaryentry{pearson}{name={Pearson, Karl},     first={Karl Pearson},text={Pearson},     description={English mathematician}}          \newglossaryentry{pearspmcc}{name={Pearson's product moment     correlation coefficient},description={Product moment correlation     coefficient named after \gls{pearson}}}          \begin{document}     \title{Sample Document Using the Glossaries Package With Xindy}     \author{Nicola Talbot}     \maketitle          \section{\glsentryfirst{gauss}}          This is a section on \gls[format=(]{gauss}. This section spans     several pages.          \newpage          This page talks about \glspl[format=hyperbfit]{gaussianint}. Since     it's the principle definition, the user-defined hyperbfit format is     used.          \newpage          The section on \gls[format=)]{gauss} ends here.          \section{Series Expansions}          This section is about series expansions. It mentions     \gls{maclaurin} and \gls{taylor}. It also discusses     \gls{taylorstheorem} which is related to the \gls{taylorseries}.     The \gls{maclaurinseries} is a special case of the     \gls{taylorseries}.          \section{\glsentryname{archimedesprinciple}}          This section discusses \gls{archimedesprinciple} which was     introduced by \gls{archimedes}.          \section{Another section}          This section covers \gls{mach} who introduced the \gls{machnumber}.     It also mentions \gls{ampereandre} after whom the     SI unit \gls{ampere} is named. It then discusses \gls{galton}     and \gls{malthus}. Finally it mentions \gls{mcadam}.          \newpage     This page discusses \gls{mcnemar} who introduced     \gls{mcnemarstest} and \gls{peano} who discovered \gls{peanoscurve}.          \printglossaries     \end{document}      # It works when the folders' names and .tex files' names in PATH are not CJK characters. I have to change all my CJK files' names and folders' names in order to use xindy! # What an issue now in 21 century!


title: Create a custom heading in scrreprt (normal fontsize, boldface)

text: I finally managed to make an account here, but I have asked 2 questions before without making an account :) Ok my next question is the following: I am using the class `scrreprt` and the usual commands provided to create headings like `\chapter` etc. But now I would like to include custom headings within the text, actually very simple, but in form of a macro or predefined command because I will use it a lot. (Maybe I will need more complicated ones later on as well) So I want it to look like the following:               text...then some space               heading in boldface          some space...then text...     even more text...      Sorry if this question is trivial, but I am still very new to TeX. Also in the same context, I'd like to customize the looks of enumerate and itemize. I need to ask: Should I create a new command to make it look the way I like, or is it better to change the existing one? If the latter one is correct where should I look? For example I'd like to know how to change indentation, spaces before and after the environment etc.


title: Biber: Cannot decode string with wide characters (encode.pm)

text: I have ran into problems with biber and Xelatex, so I decided to test a working example and see what's up. I used the test files from this question, but the result I got was:               INFO - This is Biber 1.7     INFO - Logfile is 'biber-test.blg'     INFO - Reading 'biber-test.bcf'     Cannot decode string with wide characters at /usr/lib64/perl5/vendor_perl/5.16.3/x86_64-linux/Encode.pm line 215.      The references file is UTF-8, as is the tex file and the bcf file; the system is Gentoo with the most up-to-date TeX Live (2013), Biber 1.7 and BibLaTeX 2.7. What could be wrong?


title: vertically align text in table in LaTeX

text: Probably a straightforward problem. Why is the final column not center aligned vertically? ![enter image description here](http://i.stack.imgur.com/bxcmg.png) Here is the code I'm using:               \documentclass{article}     \usepackage{array}          \begin{document}          \begin{table}[h]         \begin{center}           \caption{Data Units, Sources, and Dates}              \begin{tabular}{| >{\centering\arraybackslash}m{1in} | >{\centering\arraybackslash}m{1in} | >{\centering\arraybackslash}m{1in} | >{\centering\arraybackslash}m{1in} |}              \hline              {\bf Variable} & {\bf Dates} & {\bf Units} & {\bf Source}  \\[2ex] \hline         {\bf Nominal Physical Capital Stock} & 1950-1990 & Billions  US\$ & Nehru and Dhareshwar (1993) \\[0ex] \hline         {\bf Total Population} & 1950-1990 & Billions & Nehru and Dhareshwar (1993) \\[0ex] \hline         {\bf Nominal GDP} & 1950-1990 & Billions  US\$ & PWT \\[5ex] \hline         {\bf Real GDP per capita} & 1950-1990 & 2005 US\$ per capita & PWT \\[5ex] \hline            \end{tabular}            \label{tabular:UKJPNdata}       \end{center}     \end{table}               \end{document}


title: PDF output showing blank spaces instead of math

text: I have a big problem now. I need to print my thesis tomorrow, but I learned that for mysterious reasons my supervisor most of the time sees blank spaces instead of math symbols in the pdf I send her (and her printer's output looks the same). The symbols she cannot see are latin letters and numbers --- greek letters and other symbols look right. I cannot test this more thoroughly and I do not know what computer she uses, but I am afraid that a problem like this could happen at the print shop. What scares me the most is that I don't have any idea of what's happening so if there will be a problem I won't know how to solve it. I attach my preamble               \documentclass[12pt, openright,twoside]{report}     \usepackage{geometry}                     \geometry{a4paper}              \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{mathtools}     \usepackage{pgfplots}        \pgfplotsset{%             /pgf/number format/use comma,%     }     \usepackage{fontspec,xltxtra,xunicode}     \usepackage{siunitx}     \sisetup{output-decimal-marker = {,}}          \setromanfont[Mapping=tex-text]{Hoefler Text}     \setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}     \setmonofont[Scale=MatchLowercase]{Andale Mono}          \newcommand{\rttensor}[1]{\overline{\overline{#1}}}     \usepackage{bm}          \DeclareGraphicsExtensions{.pdf,.eps,.jpg}          \usepackage[italian]{babel}          \usepackage{booktabs}     \usepackage[fixlanguage]{babelbib}     \usepackage{hyperref}     \usepackage[ddmmyyyy,hhmmss]{datetime}          \usepackage{subcaption}     \usepackage{chemfig}     \begin{document}     $p$     \end{document}        I am using xelatex for the output and I make extensive use of Unicode for accents, symbols,... so I cannot switch to a dvi->ps->pdf workflow I am asking you if you know of what maybe causing this problem and what would be some safe method to print out everything, even if not at the best quality, since it is more important to have content. EDIT: Now it is a MWE. My supervisor wouldn't see the p in math style that is in the document


title: Citations when importing a .tex file into Lyx

text: I relatively new to LaTeX and Lyx. I am using the Scrivener -> MMD -> LaTeX workflow. For citations, I used Papers2, as it allows me to insert MMD-style citations into Scrivener. When compiling, the MMD-citations turn into \citep (this sucks, but I will have to deal with it later). Now when I import this .tex file into Lyx, the \citep commands are not translated into the Lyx citation thingy. Instead, they are placed into ERT- boxes. When trying to typeset this, I get a bunch of errors. I put \bibliography(mathesis) in the preamble, it is in the same folder as the now imported file. Am I forgetting something? It shouldn't matter whether the I am citing using the Lyx-specific process or ERT-boxes, right? Edit: the errors I get now look like this               Package natbib Warning: Citation `Guicciardi:2009km' on page 7 undefined on input line 345.      This is how my preamble looks like:               \usepackage[numbers]{natbib}     \bibliography{mathesis}


title: Change order in bibtex

text: I would like to change the naming of some references and perhaps gain an understanding on how bibtex orders references. These are my references               @article{nitaj06a,       author    = {Abderrahmane Nitaj},       title     = {Cryptanalysis of {RSA} with constrained keys},       journal   = {IACR Cryptology ePrint Archive},       volume    = {2006},       year      = {2006},       pages     = {92},       ee        = {http://eprint.iacr.org/2006/092},       bibsource = {DBLP, http://dblp.uni-trier.de}     }     @article{nitaj06b,       author    = {Abderrahmane Nitaj},       title     = {Application of {ECM} to a {C}lass of {RSA} keys},       journal   = {IACR Cryptology ePrint Archive},       volume    = {2006},       year      = {2006},       pages     = {235},       ee        = {http://eprint.iacr.org/2006/235},       bibsource = {DBLP, http://dblp.uni-trier.de}     }     @article{nitaj06c,       author    = {Abderrahmane Nitaj},       title     = {{RSA} and a higher degree {D}iophantine {E}quation},       journal   = {IACR Cryptology ePrint Archive},       volume    = {2006},       year      = {2006},       pages     = {93},       ee        = {http://eprint.iacr.org/2006/093},       bibsource = {DBLP, http://dblp.uni-trier.de}     }      In the document produced by latex, nitaj06a, nitaj06b, nitaj06c are named as [Nit06b], [Nit06a], [Nit06c] respectively. Is there a way to change the naming such that the referencing would correspond to nitaj06a, nitaj06b, nitaj06c for [Nit06a], [Nit06b], [Nit06c] respectively? P.S. I think the alphabetical ordering of the title has something to do with this.


title: Eliminate Vertical Space in $$ $$

text: Im having problems with the vertical space that the `$$ $$` command creates. For example:               \begin{multicols}{2}     \begin{enumerate}     \item  \[\sum\limits_{k=1}^{\infty}\frac{k^2e^{-2k}}{k^2+1}\]     \item $$\sum\limits_{k=1}^{\infty}\frac{\left|\sin{k^4}\right|}{\sqrt{k^4+1}}$$     \end{enumerate}     \end{multicols}      This creates a vertical space between the `\item` and the object in the `$$ $$` command. I just want to eliminate this effect. One possible solution is to use the fast math mode: `$object$`. But, this doesn't satisfy me.


title: Has anyone combined marginfix and tikzmark yet?

text: I am working on a big book project, and up until today I refrained from using glue. But now I had to, and, lo and behold, suddenly my margin notes' position is broken :( The reason is that `marginfix` doesn't work with glue because it positions the notes before the glue is calculated (or so it seems to me). The `marginfix` author promised to use pdfsavepos somewhen in the future, but unfortunately I need it now. I have now had a look at many other questions and packages, but I could not find an adequate replacement for `marginfix` - or did I miss something? I did, however, find `tikzmark`, which is cool. But I didn't find a package that uses `tikzmark` to position simple, plain margin notes exactly next to the call-out line, rearranging them nicely if there are too many. Before I will write my own code or try to understand marginfix, I would like to know if there are some solutions available already? _**UPDATE:_** I have been trying to use `\pdfsavepos` using David's example... I do get the data, but I really don't understand the values. If they are `sp`, what is the reference point, what the coordinate system? Even when I convert them to pt by diving by 65536, the values are totally different than what `marginfix` calculated. I replaced the `\MFX@getypos` of marginfix with this:               \newcounter{mfixcnt}          \def\MFX@getypos{%         \refstepcounter{mfixcnt}%              \pdfsavepos         \edef\tmp{%             \write\noexpand\@auxout{%                 \string\mfixdata{\the\c@mfixcnt}{\noexpand\thepage}{\noexpand\the\noexpand\pdflastypos}}%         }\tmp                   \expandafter\ifx\csname mfixins@\the\c@mfixcnt\endcsname\relax             \dimen@\dimexpr\@pageht+\@pagedp+\marginposadjustment+\Mfx@mparshift\relax     \typeout{NOT YET: \the\c@mfixcnt -- \the\dimen@ -- \the\@pageht -- \the\@pagedp -- \the\Mfx@mparshift}         \else             \dimen@\dimexpr\csname mfixins@\the\c@mfixcnt\endcsname+\marginposadjustment+\Mfx@mparshift\relax         \fi              \ifnum\outputpenalty=-10002\relax             \advance\dimen@-\Mfx@strutheight         \fi         \edef\mfx@ypos{\the\dimen@}%         \global\Mfx@mparshift\z@     }          \def\mfixdata#1#2#3{%         \typeout{XXXXXXXX mpardata called: #1 -- #2 -- #3}%         \expandafter\gdef\csname mfixins@#1\endcsname{#3sp}%     }      The output is               XXXXXXXX mpardata called: 1 -- 1 -- 42094230     XXXXXXXX mpardata called: 2 -- 1 -- 29740694     XXXXXXXX mpardata called: 3 -- 1 -- 11685526      How come the values decrease for margin notes that (should) be further down on the page? This could only be if the pdf coordinates have the origin on the bottom of the page. Is that so? The MWE:               \documentclass[12pt]{scrartcl}          \usepackage{geometry}               \geometry{left=2.5cm,textwidth=130mm}          \setlength{\marginparwidth}{4cm}     \setlength{\marginparsep}{2em}          \usepackage{marginfix}          \begin{document}          Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,     vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum     gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulpu-     tate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi     tristique senectus et netus et malesuada fames ac turpis egestas. Mauris     ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibu- lum urna     fringilla ultrices.XX\marginpar{\textbf{This note is centered because     there is enough space below and it is in the middle of a paragraph.}} Erat     ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et nisl     hendrerit mollis.     Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Nam arcu     libero, nonummy eget, consectetuer id, vulpu- tate a, magna. Donec     vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et     netus et malesuada fames ac turpis egestas.          Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi.     Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis     vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum,     erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et     nisl hendrerit mollis.Suspendisse ut massa. Cras nec ante. Pellen- tesque     a nulla. Cum sociis natoque penatibus et magnis dis parturient montes,     nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullam- corper     vestibulum turpis. Pellentesque cursus luctus     mauris.XX\marginpar{\textbf{This note is pushed upwards because it is at     the end of a pragraph}}          Nulla malesuada porttitor diam. Donec felis erat, congue non, volutpat at,     tincidunt tristique, libero. Vivamus viverra fermentum felis. Donec     nonummy pellentesque ante. Phasellus adipiscing semper elit. Proin     fermentum massa ac quam. Sed diam turpis, molestie vitae, placerat a,     molestie nec, leo. Maecenas lacinia. Nam ipsum ligula, eleifend at,     accumsan nec, suscipit a, ipsum. Morbi blandit ligula feugiat magna. Nunc     eleifend consequat lorem. Sed lacinia nulla vitae enim. Pellentesque     tincidunt purus vel magna. Integer non enim. Praesent euismod nunc eu     purus. Donec bibendum quam in tellus. Nullam cursus pulvinar lectus. Donec     et mi. Nam vulputate metus eu enim. Vestibulum pellentesque felis eu     massa.          Quisque ullamcorper placerat ipsum. Cras nibh. Morbi vel justo vi- tae     lacus tincidunt ultrices. Lorem ipsum dolor sit amet, consectetuer     adipiscing elit. In hac habitasse platea dictumst. Integer tempus con-     vallis augue. Etiam facilisis. Nunc elementum fermentum wisi. Aenean     placerat. Ut imperdiet, enim sed gravida sollicitudin, felis odio placerat     quam, ac pulvinar elit purus eget enim. Nunc vitae tortor. Proin tempus     nibh sit amet nisl. Vivamus quis tortor vitae risus porta     vehicula.XX\marginpar{\textbf{This note is automatically adjusted by     `marginfix'.}} Phasellus adipiscing semper elit. Proin fermentum massa ac     quam. Sed diam turpis, molestie vitae, placerat a, molestie nec, leo.     Maecenas lacinia. Nam ipsum ligula, eleifend at, accumsan nec, suscipit a,     ipsum. make ot just a bit longer to show it moving better.     bibendum,     nulla a vel justo vi- tae lacus tinci dunt ultrices. Lorem ipsum dolor sit     amet. Maecenas lacinia. Nam ipsum ligula, eleifend at, accumsan nec,     suscipit a, ipsum. Morbi blandit ligula feugiat magna. Nunc eleifend     consequat lorem. Sed lacinia nulla vitae enim. Pellentesque tincidunt     purus vel magna. Integer non enim. Praesent euismod nunc eu purus. Donec     bibendum quam in tellus. Nullam cursus pulvinar lectus. Donec et mi. Nam     vulputate metus eu enim. Vestibulum pellentesque felis eu massa.          \end{document}


title: Line breaking of URLs in bibliographies

text: I have a problem with the line break of an URL. The URL can´t break correct and extends into the border. I´ve tried some things. Amongst others I loaded the package `breakurl`, but without any success. When I set the bibliography left-aligned there isn´t a problem. But I need it justified. Here is an example:               \documentclass[     a4paper,                              fontsize=11,                         BCOR=10mm,     DIV=11     ]{scrreprt}          \usepackage[ngerman]{babel}                         \usepackage[latin1]{inputenc}                     \usepackage[T1]{fontenc}     \usepackage{lmodern}                             \usepackage{microtype}         \usepackage[         style=numeric,          maxnames=1,         bibencoding=latin1,         backend=bibtex8,         defernumbers=true,         hyperref=true,         alldates=long     ]{biblatex}     \usepackage{hyperref}     \usepackage[hyphenbreaks]{breakurl}          \begin{filecontents}{bachelorarbeit_lit.bib}     @ONLINE{java96,         author = {{Sun Microsystems}},         title = {JavaSoft ships Java 1.0},         year = {1996},         month = {1},         url = {http://findarticles.com/p/articles/mi_m0EIN/is_1996_Jan_23/ai_17853565/?tag=content;col1},         urldate = {2011-03-02},         sortname = {Sun},         keywords = {www}     }          @ONLINE{java02,         author = {{Computer Weekly}},         title = {Write once, run anywhere?},         year = {2002},         month = {5},         url = {http://www.computerweekly.com/Articles/2002/05/02/186793/Write-once-runanywhere1.htm},         urldate = {2011-03-02},         sortname = {Computer},         keywords = {www}     }     \end{filecontents}          \bibliography{bachelorarbeit_lit}          \begin{document}     \chapter{Test}     Test \cite{java02}     Test \cite{java96}          %\raggedright     \printbibliography     \end{document}      Does anyone have an idea?


title: Is it possible to tweak the alignment of an equation when it is broken using breqn?

text: I have a looooooooong `displaymath` that I'm using breqn to break into smaller chunks. As there are no actual relation symbols, I've manually added `\allowbreak` everywhere I'd be happy for one to occur (if I get this to look right, I'll trim the code a bit). But the resulting display is not quite how I would like it, and I can't see in the documentation how one can tell the `dmath` environment about how it should look. Specifically, the lines seem to be left-justified _except_ the first which has an overhand. I think it would look best if this overhand were eliminated and the whole lot were left- justified. Centring would be an acceptable alternative. Of course, I could do the whole thing manually - now that I know where `breqn` _would_ put the breaks, I can put them in by hand. But that just _feels wrong_! Here's the code:               \documentclass{standalone}     \usepackage{breqn}          \begin{document}          \begin{dmath*}     d_1 c_4 d_1^{-1} c_1^{-1},\;\allowbreak     d_1 c_3^{-1} d_2^{-1} c_3,\;\allowbreak     d_2 a_2 d_2^{-1} a_3^{-1},\;\allowbreak     d_2 a_3^{-1} d_3^{-1} a_3,\;\allowbreak     d_3 c_2 d_3^{-1} c_3^{-1},\;\allowbreak     d_3 c_1^{-1} d_4^{-1} c_1,\;\allowbreak     d_4 b_3 d_4^{-1} b_4^{-1},\;\allowbreak     d_4 b_3^{-1} d_5^{-1} b_3,\;\allowbreak     d_5 c_1 d_6^{-1} c_1^{-1},\;\allowbreak     d_6 c_2^{-1} d_6^{-1} c_1,\;\allowbreak     d_6 a_3 d_7^{-1} a_3^{-1},\;\allowbreak     d_7 a_2^{-1} d_7^{-1} a_1,\;\allowbreak     d_7 c_3 d_8^{-1} c_3^{-1},\;\allowbreak     d_8 c_4^{-1} d_8^{-1} c_3,\;\allowbreak     d_8 b_1 d_8^{-1} b_2^{-1},\;\allowbreak     d_8 b_1^{-1} d_1^{-1} b_1,\;\allowbreak     b_2 a_4 b_2^{-1} a_1^{-1},\;\allowbreak     b_2 a_3^{-1} b_3^{-1} a_3,\;\allowbreak     b_4 a_3 b_1^{-1} a_3^{-1},\;\allowbreak     b_1 a_4^{-1} b_1^{-1} a_3     \end{dmath*}     \end{document}      And here's the result: ![misaligned mathematics](http://i.stack.imgur.com/ZDbnX.png)


title: sidewaysfigure does not work

text: I am having trouble with 'sidewaysfigure'. It simply isn't recognized and says ' Missing number, treated as zero' my code is               \begin{sidewaysfigure}[hbtp]     \setlength{\abovecaptionskip}{0.01pt} % Chosen fairly arbitrarily     \centering      \includegraphics[width=\paperwidth-3cm,height=\paperheight-3cm]{cd4neutral.eps}     \caption{Variables in \textbf{CD4}-dataset}     \label{cd4neutral}     \end{sidewaysfigure}      and my preamble               \usepackage{latexsym}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{fancyhdr}     \usepackage{setspace}     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage{tabularx}     \usepackage{multirow}     \usepackage[version=3]{mhchem}     %   \usepackage{chemarrow}     %   \usepackage{array}     \usepackage{float}     \usepackage{subfigure}     \usepackage{subfloat}     \usepackage{listings}     \usepackage{dsfont}     % indexing     \usepackage{makeidx}     \usepackage{nomencl}     \usepackage{float} % needs to be "fixed" by hyperref     \usepackage{placeins} % float placement, defines \FloatBarrier     \usepackage{setspace}     \usepackage{txfonts}       \usepackage{booktabs}     \usepackage[toc,page]{appendix}     \usepackage[T1]{fontenc}     \usepackage{titlesec, blindtext, color}     \usepackage{pdflscape}     \usepackage{lscape}     \usepackage{rotating}     \usepackage{epsfig}      \definecolor{gray75}{gray}{0.75}      does anyone see why this isn't working for me??


title: mdframed: how to manage footnotes in the case of two embedded mdframes environments?

text: ## Question My question is about the behavior of `mdframed` with footnotes. I have two embedded `mdframed` environments and one footnote in the first one, it will be displayed in the second one. I would like the footnote to be displayed in the `mdframed` environment it belongs to. Is it possible? Furthermore, there are inconstancies on the width of the second environment. Can anyone explain these strange facts? ## Code and picture               \documentclass{article}     \usepackage{mdframed}     \begin{document}               \begin{mdframed}[     innerrightmargin = 0.5cm,      innertopmargin = 0.5cm,      skipbelow = 135mm,      backgroundcolor = red,      skipabove = 35mm,      linewidth = 0pt,      userdefinedwidth = 11cm,      innerbottommargin = 0.5cm,      splitbottomskip = 10mm,      splittopskip = 10mm,      roundcorner = 5pt,      innerleftmargin = 0.5cm,      align = center]               Vestibulum\footnote{lectus metus} lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.                    \begin{mdframed}[     innerrightmargin = 0.5cm,      innertopmargin = 0.5cm,      skipbelow = 135mm,      backgroundcolor = blue,      skipabove = 35mm,      linewidth = 0pt,      userdefinedwidth = 9cm,      innerbottommargin = 0.5cm,      splitbottomskip = 10mm,      splittopskip = 10mm,      roundcorner = 5pt,      innerleftmargin = 0.5cm,      align = center]               Vestibulum lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.          \end{mdframed}     \end{mdframed}          \end{document}      ![enter image description here](http://i.stack.imgur.com/KdvFF.png)


title: How to write text within \begin{verbatim} and \end{verbatim} in same line?

text: I am stuck on the following problem and don't know how to solve it. Here is my problem :               \documentclass{article}     \begin{document}           \begin{verbatim}'\hfill\end{verbatim} MKS' which puts the word 'MKS' at the far right of the page where as  \begin{verbatim}'\noindent \end{verbatim}MKS' which      puts  'MKS ' at the far left  of  the page in the same line.          \end{document}      Produces : ![enter image description here](http://i.stack.imgur.com/wT48z.png)   But I,d like to produce :   ![enter image description here](http://i.stack.imgur.com/qNOSq.png) The text within `\begin{verbatim}` and `\end{verbatim}` makes a new line and takes a whole line for this text only within in it. This looks ugly. I want to get it with the other text. How can I do this?