I have done a benchmark on the same machine for the same input file. I got surprised, the time needed by xelatex is almost 2.9 times as the time needed by latex-dvips-ps2pdf. For the sake of simplicity, I duplicated the input file: `xlx.tex` for xelatex and `ltx.tex` for latex-dvips-ps2pdf. See the following result. ## Results: ![enter image description here](http://i.stack.imgur.com/6OOpe.png) **Legends:**   * `xlx.tex` : input file for xelatex.   * `xlx.pdf` : pdf output without gs compression.   * `xlx-tiny.pdf` : pdf output with gs compression.   * `ltx.tex` : input file for latex.   * `ltx.pdf` : pdf output without gs compression.   * `ltx-tiny.pdf` : pdf output with gs compression. ![enter image description here](http://i.stack.imgur.com/ANtdg.png) Even if `ps2pdf` already compressed its output, it is still worth compressing the output again using gs. However, the compression ratio is too small. ## C# code for benchmarking: It is not a clean code that conforms to best practice. I will tidy it up.               using System;     using System.Collections.Generic;     using System.Diagnostics;     using System.IO;     using System.Linq;          namespace LaTeXAutomator     {         class Program         {             class Record             {                 public string Activity { get; set; }                 public double Elapsed { get; set; }                 public override string ToString()                 {                     return string.Format("{0}: {1} seconds", Activity, Elapsed);                 }             }             class Step             {                 public string FileName { get; set; }                 public string Arguments { get; set; }                 public bool UseShellExecute { get; set; }                 public void Start()                 {                     Process p = new Process();                     p.StartInfo.FileName = FileName;                     p.StartInfo.Arguments = Arguments;                     p.StartInfo.UseShellExecute = UseShellExecute;                          p.EnableRaisingEvents = true;                     p.Exited += (sender, e) => { Console.WriteLine("=== {0} FINISHED ===", FileName.ToUpper()); };                          p.Start();                     p.WaitForExit();                     //p.Close();                 }             }                  static void Main(string[] args)             {                 var records = new List<Record>();                           var filename = "xlx"; // for xelatex                 var xelatexSteps = new List<Step>()                 {                     new Step { FileName = "xelatex", Arguments = String.Format("-interaction=nonstopmode {0}.tex", filename), UseShellExecute = false },                     new Step { FileName = "xelatex", Arguments = String.Format("-interaction=nonstopmode {0}.tex", filename), UseShellExecute = false },                     new Step { FileName = "gswin64c", Arguments =  String.Format("-sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile={0}-tiny.pdf {0}.pdf", filename), UseShellExecute = false }//,                     //new Step { FileName = "AcroRd32", Arguments =  String.Format("{0}-tiny.pdf", filename), UseShellExecute = true }                 };                 DoBenchMark(xelatexSteps, records);                 CleanUp(filename);                           filename = "ltx"; // for latex                 var latexSteps = new List<Step>()                 {                     new Step { FileName = "latex", Arguments = String.Format("-interaction=nonstopmode {0}.tex", filename), UseShellExecute = false },                     new Step { FileName = "latex", Arguments = String.Format("-interaction=nonstopmode {0}.tex", filename), UseShellExecute = false },                     new Step { FileName = "dvips", Arguments =  String.Format("{0}.dvi", filename), UseShellExecute = false },                     new Step { FileName = "ps2pdf", Arguments =  String.Format("{0}.ps", filename), UseShellExecute = false },                     new Step { FileName = "gswin64c", Arguments =  String.Format("-sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile={0}-tiny.pdf {0}.pdf", filename), UseShellExecute = false }//,                     //new Step { FileName = "AcroRd32", Arguments =  String.Format("{0}-tiny.pdf", filename), UseShellExecute = true }                 };                 DoBenchMark(latexSteps, records);                 CleanUp(filename);                 Console.Clear();                      foreach (var x in records)                 {                     Console.WriteLine(x);                 }                      var totalXeTeX = records.Take(xelatexSteps.Count).Sum(x => x.Elapsed);                 var totalLaTeX = records.Skip(xelatexSteps.Count).Sum(x => x.Elapsed);                      Console.WriteLine("==========================");                 Console.WriteLine("Total time taken by XeLaTeX: {0} seconds.", totalXeTeX);                 Console.WriteLine("Total time taken by LaTeX: {0} seconds.", totalLaTeX);                      var ratio = totalXeTeX / totalLaTeX;                      Console.WriteLine("XeLaTeX runs {0} times slower than LaTeX.", ratio);                       }                  private static void DoBenchMark(List<Step> steps, List<Record> records)             {                 Stopwatch sw = new Stopwatch();                 foreach (var step in steps)                 {                     sw.Reset();                     sw.Start();                     step.Start();                     sw.Stop();                     records.Add(new Record { Activity = step.FileName, Elapsed = sw.Elapsed.TotalSeconds });                 }             }                  private static void CleanUp(string filename)             {                 foreach (var filepath in Directory.GetFiles(".", String.Format("{0}.*", filename), SearchOption.TopDirectoryOnly))                 {                     if (!(Path.GetExtension(filepath) == ".tex" || Path.GetExtension(filepath) == ".pdf"))                         File.Delete(filepath);                 }                  }         }     }      ## Question: Why does xelatex execute much much slower than latex-dvips-ps2pdf? Note: The speed is very crucial because my online TeX to PDF generator should execute as fast as possible. ## Comment from TH. and my response: > I don't think this is a very good question. What sort of answer would you be > looking for? "It's slower because it is." "It's slower because it implements > foo differently than pdfTeX." "It's slower because it uses feature bar." Are > any of those actually useful to you? All your assumptions above are very useful for me.


title: How to draw a polygon with height exactly equals to the text's height

text: I am using MiKTeX 2.9 and XeLaTeX. I have a minipage with some formatted text:               \centering     \begin{minipage}{\quotewidth}%         \centering\small\textit{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse elementum luctus odio sit amet mollis.}%     \end{minipage}      This is how it looks like: ![enter image description here](http://i.stack.imgur.com/xfLoF.png) And this is what I want: ![enter image description here](http://i.stack.imgur.com/tYuAV.png) How can I draw a polygon with exactly the same height as a text's height and with same y-coordinate?


title: niceframe border gets cut when the content spans multiple pages

text: I am trying to dress up my pages with curlyframe of `niceframe` but is seems that it cannot support multiple pages. Am I missing some option for that? Can I place the curly lines at the edges of every page without having to wrap it around the content? Where can I find the `niceframe` documentation, so I can figure out the rest frames it supports?               \documentclass[a5paper,pagesize,10pt,bibtotoc,pointlessnumbers,     normalheadings,DIV=9,twoside=false]{scrbook}          % twoside, openright     \KOMAoptions{DIV=last}          \usepackage{titlesec}     \setcounter{secnumdepth}{-1}% removes numbering of sectioning units          \usepackage[georgian]{babel}     \usepackage{fontspec}          \usepackage{niceframe}               \usepackage{calc}     \usepackage{verse}               \setmainfont{DejaVu Serif}     \linespread{1.05}           \title{A book title}        \author{xxx}      \date{\today}           \begin{document}     \thispagestyle {empty}          \curlyframe{         \begin{center}         \Huge დედის  ამაგს         \end{center}              \settowidth{\versewidth}{ბოროტსა  სძლევს.}         \begin{verse}[\versewidth]         დედის  ამაგს,\\         დედის  ვარამს.\\         ვერ  გაიგებს,\\         შვილი  მანამ,\\         სანამ  დედა\\         ცოცხალია,\\         თავის  გრძნობებს,\\         გულში  მალავს.\\         ვით  მებაღე\\         ნერგის  ნაზარდს,\\         შეჰხარის  და\\         აწევს  ჯაფას.\\         დედის  გულიც\\         ასე  არის,\\         ელოდება,\\         შვილის  გაზრდას.\\         რა  წვალებით,\\         გაგვზრდის  დედა.\\         ვით  მერცხალი,\\         თავის  ბარტყებს.\\         შემოგვისხავს,\\         ცივ  ზამთარში.\\         თბილ  ბუხართან,\\         თავის  ანცებს.\\         მოგვიყვება,\\         წითელქუდას.\\         ამირანის,\\         გმირულ  ამბებს.\\         რომ   კეთილი,\\         ბოროტსა  სძლევს.\\         და  სიკეთე,\\         გულს  არ  ავნებს.\\         იქ  ბუნება,\\         ვერ  უშველის.\\         თუ  მშობელი,\\         აღზრდას  აკლებს.\\         თუ  პატარა,\\         ვერ  გაზარდე.\\         დიდობაში,\\         შენვე  გავნებს.\\                  \vspace{.5cm}\hfill{---ვუძღვნი  ყველა  დედას,  პირველ  რიგში  ჩემ  საკუთარ  დედას.}         \end{verse}          }     \end{document}


title: comma separated Lyx Ieeetran bibliography citations

text: How do you setup Lyx with the ieeetran template to produce citations that are comma separated? for instance: "foo is reported to be bar percent in [1,2,3]". or equivalently: "foo is reported to be bar percent in [1-3]". I have done what is recommended in this forum posting: http://latex-community.org/forum/viewtopic.php?f=19&t=8763 Also, I am able to get comma separated citations when I select: Document>settings>bibliography: natbib and with natbib style set to "numerical". However, other issues creep up using natbib that display an awful "(author?)" tag right before the citation as was reported in: http://comments.gmane.org/gmane.editors.lyx.general/70862 http://osdir.com/ml/editors.lyx.general/2003-12/msg00015.html This isn't resolved by changing the bibliography style from ieeetran to ieeetranN or ieeetranSN, ect.. Does anyone have a general crash course for how to set this up?


title: What causes two identical instances to produce different result?

text: \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pstricks-add}          \pstVerb     {         /updateCP {2 copy CPy add /CPy ED CPx add /CPx ED} bind def         /updateA  {1 sub sqrt 1 exch atan Angles add /Angles ED} bind def     }          \def\Atom{%         \pstVerb{/Angles 0 def /CPx 1 def /CPy 0 def}% reset         \def\points{(0,0)(1,0)}% reset         \multido{\ii=1+1}{3}{\xdef\points{\points(!1 \ii\space updateA Angles PtoC updateCP)}}%         \expandafter\psrline\points}          \begin{document}              % one instance     \begin{pspicture}[showgrid](-3,-3)(3,3)     \Atom     \end{pspicture}          % two instances     \begin{pspicture}[showgrid](-3,-3)(3,3)     \Atom     \Atom     \end{pspicture}          \end{document}      **One instance** ![enter image description here](http://i.stack.imgur.com/ALHwG.png) **Two instances** ![enter image description here](http://i.stack.imgur.com/ojNUT.png) ## Question Why does a single instance of `\Atom` produce correct result while 2 identical instances of `\Atom` produce wrong result? ## Real Scenario I want to mimic the behavior of               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pstricks-add}          \begin{document}     \begin{pspicture}[showgrid](-5,-5)(5,5)        \psset{linecolor=blue}       \pstVerb{/Angles 0 def}       \psStartPoint(0,0)       \psVector[arrows=-](1,0)       \multido{\i=1+1}{15}       {% why is % needed here?          \pstVerb{Angles 1 \i\space 1 sub sqrt atan add /Angles exch def}          \psVector[arrows=-](!1 Angles PtoC)          \psline(!cp.X cp.Y)       }     \end{pspicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/MraOo.png) with the following but it produces a wrong output.               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pstricks-add}     \psset{linecolor=red}     \pstVerb     {         /updateCP {2 copy CPy add /CPy ED CPx add /CPx ED} bind def %         /updateA  {1 sub sqrt 1 exch atan Angles add /Angles ED} bind def %     }     \begin{document}     \begin{pspicture}[showgrid](-5,-5)(5,5)     \multido{\io=1+1}{15}{%         \pstVerb{/Angles 0 def /CPx 1 def /CPy 0 def}% reset         \def\points{(0,0)(1,0)}% reset         \multido{\ii=1+1}{\io}{\xdef\points{\points(!1 \ii\space updateA Angles PtoC updateCP)}}%         \expandafter\psrline\points         \psline(!CPx CPy)%     }     \end{pspicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/yksYe.png)


title: arara - How to see errors and pdf with in Texmaker Windows

text: How could we check the errors in texmaker and also generate the pdf automatically. I am unable to do it for the moment. Using the following as comments i followed the installation process correctly as explained in the manual. However, I do not have any configuration file. Maybe thats a problem, I am not sure how could i build a configuration file within Windows.Below is the order or arara commands that i am adding to my source file. Installation procedure               % arara: pdflatex     % arara: bibtex     % arara: makeindex     % arara: pdflatex     % arara: pdflatex


title: Which is better: a dimension or a macro?

text: When messing around with TikZ/PGF then I frequently find myself wanting to store a length for later use. By "length" here, I mean the word in its non-TeX meaning. As I'm doing stuff in TikZ/PGF then I tend to use `\pgfmath` for the later processing so it doesn't matter _for usage_ whether I store that length as a TeX-length or as a macro (providing I remember which I've done!). So which is the better option? The considerations that occur to me are: number of registers of each type, speed of look-up, speed of parsing, robustness of code (I feel that for a _Cargo Cult Programmer_ such as myself then `\edef\savedlength{\oldlength}` or `\let\savedlength=\oldlength` is safer than `\savedlength=\oldlength` when `\oldlength` might not itself be a TeX-length). But I'm sure that there are others that I haven't thought of (being a humble CCP!).


title: Conflict between mindmap and tikz-qtree

text: I have some trouble trying to put a mindmap graph and a tikz-qtree graph together in the same document. With the example below, the mindmap is all scrunched up. But if you comment out the `\usepackage{tikz-qtree}` line and the first tikzpicture which contains the tikz-qtree code, then the mindmap looks just fine. Is there a way to put them together? Thanks. Btw, not sure if this is relevant, I will also use this in with beamer.               \documentclass{article}     \usepackage{tikz}     \usepackage{tikz-qtree}     \usetikzlibrary{arrows,backgrounds,calc,fit,mindmap,positioning,trees,shapes}          \begin{document}          \begin{tikzpicture}         \Tree       % space is REQUIRED after every node!!!         [.S         [.A             [.B [.C D ]                 [.E false ] ]         ]         ]     \end{tikzpicture}               \begin{tikzpicture}{mindmap}     \path[mindmap,concept color=black,text=white]         node[concept] {Start}         [clockwise from=0]         child[concept color=green] {             node[concept] (A) {A}             [clockwise from=0]             child { node[concept] {C} }         }            child[concept color=blue] {             node[concept] (B) {B}         };         \begin{pgfonlayer}{background}             \draw [circle connection bar] (A) edge (B);         \end{pgfonlayer}     \end{tikzpicture}          \end{document}


title: How do I use the etoolbox package to check if an argument to a macro was defined?

text: I saw this answer, which uses the `etoolbox` package to create a macro with an optional argument. Unfortunately, I can't get it to work. Here is a minimal working example:               \documentclass[12pt]{article}     \usepackage{etoolbox}          \newcommand\mymacrotwo[2][]{       \ifstrempty{#2}{         #1: none       }{         #1: #2       }     }          \begin{document}     \mymacrotwo{hello}          \mymacrotwo{hello}{world}     \end{document}      This outputs:               : hello     : hello world      Not only are the colons in the wrong place, but it doesn't display the `none` if the second argument isn't defined. What's the problem? I also tried this variant:               \documentclass[12pt]{article}     \usepackage{etoolbox}          \newcommand{\mymacro}[2]{#1 \ifboolexpr{ test {\ifdef{#2}} } {#2} {none}}          \begin{document}     \mymacro{hello}          \mymacro{hello}{world}     \end{document}      but this outputs:               hello     hello orldworld      which clearly isn't right either.


title: Tikz plot polar equation with foreach

text: Im trying to animate a polar equation using beamer, i couldnt find anything related to my problem here or on Google so my last chance is to request some help. I tried to take out the `domain` command out of the equation so the plot could read the x variable value (that ranges from 0 to 20). But well that dont work at all... after that i tried to make `domain=\x` but well that didnt worked either. Does anyone have any solution (or even an hint) to my problem? Ps.: I need to use Tikz package. Thanks in advance!               \documentclass{beamer}              \usepackage{tikz}              \begin{document}                  \foreach \x in {0,1,...,20}{           \begin{frame}             \begin{tikzpicture}                  \draw[align=center,color=orange,smooth] plot (canvas polar cs:angle=\x r,radius= {\x});             \end{tikzpicture}             \end{frame}             }         \end{document}


title: How to do single quotes in Latex Suite

text: In Latex Suite the back quote (`) is mapped to provide a host of symbols (see here). Problem is that I use the backquote-forwardquote duo as my opening and closing quotes. So now if I want to quote someone I have to write it down, then later come and prepend the backquote to it. In the above link it does describe one way to get around this > Smart Quotes. Pressing " (English double quote) will insert `` or '' by > making an intelligent guess about whether we intended to open or close a > quote. But I don't like double quotes, I much prefer single quotes. About the only thing I can think of write now is to use the above work around, then when down go through and change all double back or forward quotes to single quote. Can anyone suggest an easier way to get around this?


title: glossaries issue: wrong pagenumber for book and memoir

text: I am writing happily on my thesis with latex but found a problem with **glossaries package returning wrong page number reference links** in the glossaries index. Instead of referencing page 5, the glossary index points to page 3 with memoir, with book class, the difference is only one page. After quite some tests and trials I found the minimum requirements for reproduction on my system - hope you can reproduce them, too. Please excuse the large number of chapters and sections but it seems **necessary** that the **TOC spans more than one page** for the number issue to show up. The problem both shows up with standard **book class** as well as **memoir class**. Both need the a4paper option enabled for this problem to occur. Here you find the MWE together with notes on the requirements. Here a link to the pdf file I created using texstudio: pdf file using memoir class and the tex file.               %\documentclass[12pt,a4paper,openany]{book} % for book class, both a4paper and openany must be given as parameters for the bug to show up     \documentclass[12pt,a4paper]{memoir} % for memoir, only a4paper is necessary; but the bug only shows up, when a title page is there with a pagebreak afterwards      \usepackage[latin1]{inputenc}     \usepackage[bookmarks, colorlinks]{hyperref}     \usepackage[toc]{glossaries}     \makeglossaries          \newglossaryentry{test}{name={Testing test},description={test description},first={Test (test)}}          \begin{document}     \title{Test} % titepage and pagebreak are only necessary for reproducing the bug with memoir class     \maketitle     \pagebreak          \tableofcontents{} % needed lots of chapter because the wrong number only shows up when the toc is longer than one page          \chapter{chapter 1}     \gls{test}     \section{title 2 - possibly with a very very long title creating a new line indeed}     \section{title 3}     \chapter{chapter inbetween}     \section{title 5}     \section{title 6}     \section{title 8}     \chapter{chapter 2}     \section{title 10 - possibly with a very very long title creating a new line indeed}     \section{title 11}     \section{title 12 - possibly with a very very long title creating a new line indeed}     \section{title 13}     \chapter{chapter 3}     \section{title 15}     \chapter{chapter 4}     \section{title 17}     \section{title 18 - possibly with a long title creating a new line}     \chapter{chapter 5}     \chapter{chapter 6}     \section{title 21}     \section{title 22}     \section{title 23}     \printglossaries     \end{document}      In TexStudio I use the following build sequence, in case that is relevant: > txs:///latex | txs:///latex | txs:///latex | txs:///makeglossary | > txs:///latex | txs:///bibtex | txs:///latex | txs:///quick Probably a bit too often running latex but as far as I understand that can only help, no? Hope you can help me with this problem, since I love the ease of using LaTeX otherwise :) If you need anything else, tell me please!


title: tikz externalization and multiple axis using \ref and \label for legendentry

text: I have a plot consisting of two y-axis. When I'm adding the legendentries in each axis environment, the first legendentry will be plotted "behind" the plot of the second axis. Thus I thought a solution might be the \ref \label to plot both legendentries at the end of the document, that they will appear in the very front of all plots and not hidden. Unfortunately using the tikz externalization gives the error "undefined references ...." and the legendentries are given with "??" only. I checked the manual for using \legend \ref with externalization, but it doesn't help. I tried to compile several times.               \documentclass[fontsize=12pt,openright,oneside,DIV11,a4paper,numbers=noenddot,headsepline,parskip=half]{scrbook}     \usepackage[latin1]{inputenc}     \usepackage[cmex10]{amsmath}     \usepackage{siunitx}     \usepackage{tikz}     \usetikzlibrary[shapes.arrows]     \usepackage{pgfplots}     \pgfplotsset{compat=1.3}          % set up externalization     \usetikzlibrary{pgfplots.external}     \tikzset{external/system call={lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}}     \tikzexternalize               \begin{document}     \thispagestyle{empty}         \begin{tikzpicture}             \begin{axis}[                     legend cell align=left,                 bar width=7pt,                 xmin=-3, xmax=30,                 axis y line*=left,                 xlabel=Laser current / \si{\milli\ampere},                 ylabel=Tuning range / \si{\nano\metre},                 nodes near coords align=left,                 nodes near coords,]             \addplot[ybar, ybar legend, draw=gray, fill=gray, color=gray] table[x=current,y=tuning] {Tun_SMSR.txt};          %          \addlegendentry{Abstimmbereich};            \label{Abstimmbereich};         \end{axis}              \begin{axis}[                 every axis legend/.append style={fill=white, anchor=north west, at={(0.35,0.18)}},                 legend cell align=left,                 ybar=5pt,                 ybar interval=0.6,                 bar width=7pt,                 xmin=-3, xmax=30,                 ymin=30, ymax=60,                 axis y line*=right,                 axis x line=none,                 ylabel=SMSR / \si{\deci\bel},                 nodes near coords align=left,                 nodes near coords,]             \addplot[ybar, ybar legend, draw=black, color=black] table[x=current,y=SMSR] {Tun_SMSR.txt};            \label{SMSR};     %          \addlegendentry{SMSR};              \end{axis}          \node [draw,fill=white] at (rel axis cs: 0.7,0.15) {\shortstack[l]{     \ref{Abstimmbereich} Abstimmbereich\\     \ref{SMSR} SMSR     }};              \end{tikzpicture}     \end{document}      I'm compiling with the command               lualatex -shell-escape "document name".tex      The resulting figure shows the legends but with no symbols and "??" instead.


title: How can I add a legend in aligned subplots

text: I want to have two subplots with the same x axis aligned above one another. In the manual I read, that I should use `\matrix{}` to achieve this. Now I want to have legends in both plots. But since the legend box itself seems to use the matrix environment, this gives me the error "You cannot nest pgfmatrix environments, yet." Here is a reduced example of what does not work:               \begin{tikzpicture}         \matrix{         \begin{axis}             \addplot {x} ;             \addlegendentry{x};         \end{axis}\\         };     \end{tikzpicture}      Any ideas?


title: mdframed undefined sequence

text: I implemented the `mdframed` package and I wanted to create a new envrionment, but I get the following error message:               Writing index file book.idx     ! Undefined control sequence.     l.80 \newmdtheoremenv                          [hidealllines=true,backgroundcolor=shadethmcolor,skipab...      here is my code:               \documentclass{book}     \usepackage{geometry}          \geometry{left=4cm,right=3cm, top=2cm, bottom=2cm}           \usepackage{titlesec}     \titlespacing*{\chapter}{0pt}{-30pt}{20pt}     \titleformat{\chapter}[display]{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}          % choose options for [] as required from the list     % in the Reference Guide     \usepackage[ngerman]{babel}     \usepackage{mathptmx}     \usepackage{helvet}     \usepackage{wallpaper}     \usepackage{color}     \usepackage[final]{pdfpages}      %,bookmarksopenlevel={1}     %\usepackage[hidelinks,bookmarks=true,bookmarksopen=true,bookmarksnumbered=true,colorlinks=true,linkcolor=black,]{hyperref}     \usepackage[colorlinks,linkcolor=black,bookmarksopen=false,     hypertexnames=TRUE,pdfpagelabels=true]{hyperref}[2011/02/05]     \hypersetup{        pdftitle={Statistik},       pdfauthor={\textcopyright test test},       pdfsubject={},        pdfkeywords={},        }          \usepackage{xcolor,bookmark}     \usepackage{scrextend}     \usepackage{titlepic}     \usepackage{shorttoc}     \usepackage{courier}               \usepackage{type1cm}              \usepackage{zref-abspage}                    \usepackage{makeidx}         % allows index generation          \usepackage{graphicx}        % standard LaTeX graphics tool                                  % when including figure files     \usepackage{multicol}        % used for the two-column index     \usepackage[bottom]{footmisc}% places footnotes at page bottom     \usepackage{tocstyle}     \usetocstyle{allwithdot}      %\usepackage{thmbox}     %\usepackage{shadethm}     \usepackage{amsthm}     \usepackage{xcolor}     \usepackage{marginnote}     %\usetocstyle{KOMAlike}          \usepackage{mdframed}     \makeindex             % used for the subject index                            % please use the style svind.ist with                            % your makeindex program          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \setcounter{tocdepth}{4}     \setcounter{secnumdepth}{4}          %%%%%Umgebungen%%%%%     %\theoremstyle{plain}     %\theoremstyle{remark}     %\newtheorem{beispiel}{Beispiel}[chapter]          \definecolor{shadethmcolor}{rgb}{.9,.9,.95}%     \definecolor{shadethmcolor2}{rgb}{1,.925,.545}%          \newtheoremstyle{mystyle}       {\topsep}{\topsep}{}{}%       {\bfseries}{:}{.5em}{}%          \theoremstyle{mystyle}          \newmdtheoremenv[hidealllines=true,backgroundcolor=shadethmcolor,skipabove=\topsep,     skipbelow=\topsep]{beispiel}{Beispiel}          \begin{document}     \begin{beispiel}     test test     \end{beispiel}     \end{document}      * * *               *File List*         book.cls    2007/10/19 v1.4h Standard LaTeX document class         bk10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)     geometry.sty    2010/09/12 v5.6 Page Geometry       keyval.sty    1999/03/16 v1.13 key=value parser (DPC)        ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)       ifvtex.sty    2010/03/01 v1.5 Switches for detecting VTeX and its modes (HO)      ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional     geometry.cfg     titlesec.sty    2007/08/12 v2.8 Sectioning titles        babel.sty    2008/07/06 v3.8l The Babel package      bblopts.cfg    2006/07/31 v1.0 MiKTeX 'babel' configuration     ngermanb.ldf    2008/07/06 v2.6n new German support from the babel system     mathptmx.sty    2005/04/12 PSNFSS-v9.2a Times w/ Math, improved (SPQR, WaS)        helvet.sty    2005/04/12 PSNFSS-v9.2a (WaS)      wallpaper.sty    2005/01/18, v1.01 easy wallpaper formatting (MHFW)       ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)         calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)      eso-pic.sty    2010/10/06 v2.0c eso-pic (RN)     atbegshi.sty    2011/01/30 v1.15 At begin shipout hook (HO)     infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)      ltxcmds.sty    2011/04/18 v1.20 LaTeX kernel commands for general use (HO)       xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)        color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive       pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX     graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)         trig.sty    1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2007/01/18 v1.5 graphics configuration of teTeX/TeXLive     pdfpages.sty    2011/03/10 v0.4n Insert pages of external PDF documents (AM)     pppdftex.def    2011/03/10 v0.4n Pdfpages driver for pdfTeX (AM)     hyperref.sty    2011/04/17 v6.82g Hypertext links for LaTeX     hobsub-hyperref.sty    2011/04/23 v1.4 Bundle oberdiek, subset hyperref (HO)     hobsub-generic.sty    2011/04/23 v1.4 Bundle oberdiek, subset generic (HO)       hobsub.sty    2011/04/23 v1.4 Subsetting bundle oberdiek (HO)     ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)      intcalc.sty    2007/09/27 v1.1 Expandable integer calculations (HO)     etexcmds.sty    2011/02/16 v1.5 Prefix for e-TeX command names (HO)     kvsetkeys.sty    2011/04/07 v1.13 Key value parser (HO)     kvdefinekeys.sty    2011/04/07 v1.3 Defining keys (HO)     pdftexcmds.sty    2011/04/22 v0.16 Utilities of pdfTeX for LuaTeX (HO)     pdfescape.sty    2011/04/04 v1.12 Provides string conversions (HO)     bigintcalc.sty    2011/01/30 v1.2 Expandable big integer calculations (HO)       bitset.sty    2011/01/30 v1.1 Data type bit set (HO)     uniquecounter.sty    2011/01/30 v1.2 Provides unlimited unique counter (HO)     letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)      hopatch.sty    2011/01/30 v1.0 Wrapper for package hooks (HO)     xcolor-patch.sty    2011/01/30 xcolor patch     atveryend.sty    2011/04/23 v1.7 Hooks at very end of document (HO)     refcount.sty    2010/12/01 v3.2 Data extraction from references (HO)      hycolor.sty    2011/01/30 v1.7 Color options of hyperref/bookmark (HO)     kvoptions.sty    2010/12/23 v3.10 Keyval support for LaTeX options (HO)       pd1enc.def    2011/04/17 v6.82g Hyperref: PDFDocEncoding definition (HO)     hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive          url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.      hpdftex.def    2011/04/17 v6.82g Hyperref driver for pdfTeX     rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)     bookmark.sty    2011/04/21 v1.21 PDF bookmarks (HO)      auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)     bkm-pdftex.def    2011/04/21 v1.21 bookmark driver for pdfTeX (HO)     scrextend.sty    2011/04/02 v3.09 KOMA-Script KOMA-Script package (extend other      classes with features of KOMA-Script classes)     scrkbase.sty    2011/04/02 v3.09 KOMA-Script package (KOMA-Script-dependent bas     ics and keyval usage)      scrbase.sty    2011/04/02 v3.09 KOMA-Script package (KOMA-Script-independent b     asics and keyval usage)     scrlfile.sty    2011/03/09 v3.09 KOMA-Script package (loading files)     titlepic.sty    2009/08/03 1.1 Package to display a picture on the title page     shorttoc.sty    2002/08/20 v1.3 Short table of contents (JPFD)      courier.sty    2005/04/12 PSNFSS-v9.2a (WaS)       type1cm.sty    2002/09/05 v0.04 BlueSky/Y&Y Type1 CM font definitions (DPC, pa     tched RF)     zref-abspage.sty    2011/03/18 v2.21 Module abspage for zref (HO)     zref-base.sty    2011/03/18 v2.21 Module base for zref (HO)      makeidx.sty    2000/03/29 v1.0m Standard LaTeX package     multicol.sty    2008/12/05 v1.6h multicolumn formatting (FMi)     footmisc.sty    2009/09/15 v5.5a a miscellany of footnote facilities     tocstyle.sty    2009/11/09 v0.2d-alpha LaTeX2e KOMA-Script package (versatile t     oc styles)     shadethm.sty    1999/11/23       amsthm.sty    2004/08/06 v2.20      amsmath.sty    2000/07/18 v2.13 AMS math features      amstext.sty    2000/06/29 v2.01       amsgen.sty    1999/11/30 v2.0       amsbsy.sty    1999/11/29 v1.2d       amsopn.sty    1999/12/14 v2.01 operator names     marginnote.sty    2010/01/05 v1.1f non floating margin notes for LaTeX     mdframed.sty    2010/12/22  v0.6a: mdframed         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)     etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX     md-frame-0.mdf       ot1ptm.fd    2001/06/04 font definitions for OT1/ptm.     supp-pdf.mkii      nameref.sty    2010/04/30 v2.40 Cross-referencing by name of section     gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)     ot1ztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OT1/ztmcm.     omlztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OML/ztmcm.     omsztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMS/ztmcm.     omxztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMX/ztmcm.        cover.pdf    Graphic file (type pdf)        cover.pdf    Graphic file (type pdf)       omsptm.fd            dedic.tex     foreword.tex      preface.tex       acknow.tex      acronym.tex       ot1phv.fd    2001/06/04 scalable font definitions for OT1/phv.        part1.tex     chapter1.tex     ausrufezeichen.png    Graphic file (type png)     chapter2.tex        part2.tex     chapter3.tex     chapter4.tex     appendix.tex       ot1pcr.fd    2001/06/04 font definitions for OT1/pcr.         book.ind     ueberautor.pdf    Graphic file (type pdf)     ueberautor.pdf    Graphic file (type pdf)         back.pdf    Graphic file (type pdf)         back.pdf    Graphic file (type pdf)      ***********      * * * ok, its me again: here we go: ok, so here is my code:               \documentclass{book}     \usepackage{geometry}          \geometry{left=4cm,right=3cm, top=2cm, bottom=2cm}           \usepackage{titlesec}     \titlespacing*{\chapter}{0pt}{-30pt}{20pt}     \titleformat{\chapter}[display]{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}          % choose options for [] as required from the list     % in the Reference Guide     \usepackage[ngerman]{babel}     \usepackage{mathptmx}     \usepackage{helvet}     \usepackage{wallpaper}     \usepackage{color}     \usepackage[final]{pdfpages}      %,bookmarksopenlevel={1}     %\usepackage[hidelinks,bookmarks=true,bookmarksopen=true,bookmarksnumbered=true,colorlinks=true,linkcolor=black,]{hyperref}     \usepackage[colorlinks,linkcolor=black,bookmarksopen=false,     hypertexnames=TRUE,pdfpagelabels=true]{hyperref}[2011/02/05]     \hypersetup{        pdftitle={test},       pdfauthor={\textcopyright test test},       pdfsubject={test test},        pdfkeywords={test},        }          \usepackage{xcolor,bookmark}     \usepackage{scrextend}     \usepackage{titlepic}     \usepackage{shorttoc}     \usepackage{courier}               \usepackage{type1cm}              \usepackage{zref-abspage}                    \usepackage{makeidx}         % allows index generation          \usepackage{graphicx}        % standard LaTeX graphics tool                                  % when including figure files     \usepackage{multicol}        % used for the two-column index     \usepackage[bottom]{footmisc}% places footnotes at page bottom     \usepackage{tocstyle}     \usetocstyle{allwithdot}      %\usepackage{thmbox}     \usepackage{shadethm}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{xcolor}     \usepackage{marginnote}     %\usetocstyle{KOMAlike}          \usepackage{mdframed}     \makeindex             % used for the subject index                            % please use the style svind.ist with                            % your makeindex program     \listfiles     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \setcounter{tocdepth}{4}     \setcounter{secnumdepth}{4}          %%%%%Umgebungen%%%%%     %\theoremstyle{plain}     %\theoremstyle{remark}     %\newtheorem{beispiel}{Beispiel}[chapter]          %\definecolor{shadethmcolor}{rgb}{.9,.9,.95}%     %\definecolor{shadethmcolor2}{rgb}{1,.925,.545}%     %     %\newtheoremstyle{mystyle}     %  {\topsep}{\topsep}{}{}%     %  {\bfseries}{:}{.5em}{}%     %     %\theoremstyle{mystyle}          %\newmdtheoremenv[hidealllines=true,backgroundcolor=shadethmcolor,skipabove=\topsep,     %skipbelow=\topsep]{beispiel}{Beispiel}     %     %\newmdtheoremenv[hidealllines=true,     %backgroundcolor=shadethmcolor2,skipabove=\topsep,     %skipbelow=\topsep]{formel}{Formel}     %                    \newtheoremstyle{mystyle}       {\topsep}{\topsep}{}{}%       {\bfseries}{:}{.5em}{}%          \theoremstyle{mystyle}          \newshadetheorem{beispiele}{Beispiel}          \newenvironment{beispiel}[1][]{%     \par\vspace*{0cm}       \definecolor{shadethmcolor}{rgb}{.9,.9,.95}%       \definecolor{shaderulecolor}{rgb}{1,1,1}%       \setlength{\shadeboxrule}{1.5pt}%       \begin{beispiele}[#1]\hspace*{1mm}%     }{\end{beispiele}}          \newshadetheorem{formeln}{Formel}     \newenvironment{formel}[1][]{%     \par\vspace*{0cm}       \definecolor{shadethmcolor}{rgb}{1,.925,.545}%       \definecolor{shaderulecolor}{rgb}{1,1,1}%       \setlength{\shadeboxrule}{1.5pt}%       \begin{formeln}[#1]\hspace*{1mm}%     }{\end{formeln}}               \begin{document}     test test     \begin{beispiel}     test test     \end{beispiel}     \end{document}      and here is the list of all package versions in the log-file               *File List*         book.cls    2007/10/19 v1.4h Standard LaTeX document class         bk10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)     geometry.sty    2010/09/12 v5.6 Page Geometry       keyval.sty    1999/03/16 v1.13 key=value parser (DPC)        ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)       ifvtex.sty    2010/03/01 v1.5 Switches for detecting VTeX and its modes (HO)      ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional     geometry.cfg     titlesec.sty    2007/08/12 v2.8 Sectioning titles        babel.sty    2008/07/06 v3.8l The Babel package      bblopts.cfg    2006/07/31 v1.0 MiKTeX 'babel' configuration     ngermanb.ldf    2008/07/06 v2.6n new German support from the babel system     mathptmx.sty    2005/04/12 PSNFSS-v9.2a Times w/ Math, improved (SPQR, WaS)        helvet.sty    2005/04/12 PSNFSS-v9.2a (WaS)      wallpaper.sty    2005/01/18, v1.01 easy wallpaper formatting (MHFW)       ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)         calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)      eso-pic.sty    2010/10/06 v2.0c eso-pic (RN)     atbegshi.sty    2011/01/30 v1.15 At begin shipout hook (HO)     infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)      ltxcmds.sty    2011/04/18 v1.20 LaTeX kernel commands for general use (HO)       xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)        color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive       pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX     graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)         trig.sty    1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2007/01/18 v1.5 graphics configuration of teTeX/TeXLive     pdfpages.sty    2011/03/10 v0.4n Insert pages of external PDF documents (AM)     pppdftex.def    2011/03/10 v0.4n Pdfpages driver for pdfTeX (AM)     hyperref.sty    2011/04/17 v6.82g Hypertext links for LaTeX     hobsub-hyperref.sty    2011/04/23 v1.4 Bundle oberdiek, subset hyperref (HO)     hobsub-generic.sty    2011/04/23 v1.4 Bundle oberdiek, subset generic (HO)       hobsub.sty    2011/04/23 v1.4 Subsetting bundle oberdiek (HO)     ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)      intcalc.sty    2007/09/27 v1.1 Expandable integer calculations (HO)     etexcmds.sty    2011/02/16 v1.5 Prefix for e-TeX command names (HO)     kvsetkeys.sty    2011/04/07 v1.13 Key value parser (HO)     kvdefinekeys.sty    2011/04/07 v1.3 Defining keys (HO)     pdftexcmds.sty    2011/04/22 v0.16 Utilities of pdfTeX for LuaTeX (HO)     pdfescape.sty    2011/04/04 v1.12 Provides string conversions (HO)     bigintcalc.sty    2011/01/30 v1.2 Expandable big integer calculations (HO)       bitset.sty    2011/01/30 v1.1 Data type bit set (HO)     uniquecounter.sty    2011/01/30 v1.2 Provides unlimited unique counter (HO)     letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)      hopatch.sty    2011/01/30 v1.0 Wrapper for package hooks (HO)     xcolor-patch.sty    2011/01/30 xcolor patch     atveryend.sty    2011/04/23 v1.7 Hooks at very end of document (HO)     refcount.sty    2010/12/01 v3.2 Data extraction from references (HO)      hycolor.sty    2011/01/30 v1.7 Color options of hyperref/bookmark (HO)     kvoptions.sty    2010/12/23 v3.10 Keyval support for LaTeX options (HO)       pd1enc.def    2011/04/17 v6.82g Hyperref: PDFDocEncoding definition (HO)     hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive          url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.      hpdftex.def    2011/04/17 v6.82g Hyperref driver for pdfTeX     rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)     bookmark.sty    2011/04/21 v1.21 PDF bookmarks (HO)      auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)     bkm-pdftex.def    2011/04/21 v1.21 bookmark driver for pdfTeX (HO)     scrextend.sty    2011/04/02 v3.09 KOMA-Script KOMA-Script package (extend other      classes with features of KOMA-Script classes)     scrkbase.sty    2011/04/02 v3.09 KOMA-Script package (KOMA-Script-dependent bas     ics and keyval usage)      scrbase.sty    2011/04/02 v3.09 KOMA-Script package (KOMA-Script-independent b     asics and keyval usage)     scrlfile.sty    2011/03/09 v3.09 KOMA-Script package (loading files)     titlepic.sty    2009/08/03 1.1 Package to display a picture on the title page     shorttoc.sty    2002/08/20 v1.3 Short table of contents (JPFD)      courier.sty    2005/04/12 PSNFSS-v9.2a (WaS)       type1cm.sty    2002/09/05 v0.04 BlueSky/Y&Y Type1 CM font definitions (DPC, pa     tched RF)     zref-abspage.sty    2011/03/18 v2.21 Module abspage for zref (HO)     zref-base.sty    2011/03/18 v2.21 Module base for zref (HO)      makeidx.sty    2000/03/29 v1.0m Standard LaTeX package     multicol.sty    2008/12/05 v1.6h multicolumn formatting (FMi)     footmisc.sty    2009/09/15 v5.5a a miscellany of footnote facilities     tocstyle.sty    2009/11/09 v0.2d-alpha LaTeX2e KOMA-Script package (versatile t     oc styles)     shadethm.sty    1999/11/23       amsthm.sty    2004/08/06 v2.20      amsmath.sty    2000/07/18 v2.13 AMS math features      amstext.sty    2000/06/29 v2.01       amsgen.sty    1999/11/30 v2.0       amsbsy.sty    1999/11/29 v1.2d       amsopn.sty    1999/12/14 v2.01 operator names     marginnote.sty    2010/01/05 v1.1f non floating margin notes for LaTeX     mdframed.sty    2010/12/22  v0.6a: mdframed         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)     etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX     md-frame-0.mdf       ot1ptm.fd    2001/06/04 font definitions for OT1/ptm.     supp-pdf.mkii      nameref.sty    2010/04/30 v2.40 Cross-referencing by name of section     gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)     ot1ztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OT1/ztmcm.     omlztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OML/ztmcm.     omsztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMS/ztmcm.     omxztmcm.fd    2000/01/03 Fontinst v1.801 font definitions for OMX/ztmcm.        cover.pdf    Graphic file (type pdf)        cover.pdf    Graphic file (type pdf)       omsptm.fd            dedic.tex     foreword.tex      preface.tex       acknow.tex      acronym.tex       ot1phv.fd    2001/06/04 scalable font definitions for OT1/phv.        part1.tex     chapter1.tex     ausrufezeichen.png    Graphic file (type png)     chapter2.tex        part2.tex     chapter3.tex     chapter4.tex     appendix.tex       ot1pcr.fd    2001/06/04 font definitions for OT1/pcr.         book.ind     ueberautor.pdf    Graphic file (type pdf)     ueberautor.pdf    Graphic file (type pdf)         back.pdf    Graphic file (type pdf)         back.pdf    Graphic file (type pdf)      ***********      Package atveryend Info: Empty hook `AtEndAfterFileList' on input line 198. LaTeX Warning: There were multiply-defined labels. well, I don't know which version of mdframed I am using? I just said \usepackage{mdframed} ? I heard about it from someone here, I used shade before for the environments but he said, I could get problems with page breaks and I should use mdframed...... Thanks a lot for your help


title: cropping problem with includegraphics and trim in beamer

text: I am including figures from a paper I'm writing into the associated presentation slides written in beamer. Both the paper and the slides are pdf and I'm typesetting using pdflatex. I'm using \includegraphics[page=1, trim=1 2 3 4,clip=true]{paper.pdf} to include chunks of the paper.pdf into the beamer presentation. However, I've found that the trim command seems to include the _entire_ page, but renders everything outside the trim'd area transparent. If I drag my mouse cursor over the areas outside the included figure in the presentation slides, I can still see and select the text surrounding the figure which has also been inserted into my slides (it's just invisible). This has the side effect of making the size of slides.pdf very large because all this extraneous information around the figure is dragged along, but rendered transparent. Is there anyway to not include or remove this extraneous information from my slides.pdf somehow?


title: Custom title font in LyX

text: (My first problem of compiling at all is solved, so I'm now posing a slightly different question). Hi, I'd like some help with producing handouts for my students. I'm using LyX as I'm far from fluent in LaTeX. I find the default fonts very serious, and would prefer to use something unusual on the title and footer, to make the document a little friendlier. I followed these instructions for installing XeTeX: http://wiki.lyx.org/LyX/XeTeX , and for changing the fonts manually with \fontspec in ERT. I checked that the installation is fine: if I don't use any \fontspec commands, it doesn't compile within LyX but does work if I use the command line. But when I try it with the \fontspec, I don't get a pdf. My LyX file: http://math.stanford.edu/~amyp/test2.lyx The .tex file that LyX generated: http://math.stanford.edu/~amyp/test2.tex My log: http://math.stanford.edu/~amyp/test2.log The font I tried here is located at C:\Windows\Fonts\PRISTINA.TTF on my computer, Windows tells me it's an Open Type font. I'm not too particular about the font (just that it's non-standard and readable).


title: Weird spacing issue using listings delimiters

text: I'm using `moredelim` (with prefix `il`) to typeset one-line "comments" in a very specific way:   * delimiter `%%` in red,   * rest of the line in blue. My approach works mostly as expected, aside from some very weird spacing issue, which I can't explain. For instance, on the second line of the listing below, even though there is only one space character between `%%` and the following word (in the input file), that line gets typeset in a completely different way; more specifically, the spacing **before** my delimiter in the input file seems to end up **after** it in the output file. I'm pretty sure this isn't a problem related to spurrious spaces left in my code. What the hell...? ![enter image description here](http://i.stack.imgur.com/CRyPv.png)               \documentclass{article}          \usepackage{xcolor}     \usepackage{listings}          \lstset     {%         basicstyle  = \ttfamily,         commentstyle= \color{blue},         moredelim   =**[il][\processDelimiter]{\%\%},     }          \makeatletter     \def\processDelimiter% auxiliary macro for delimiters     {%         \textcolor{red}{\%\%}%     % Typeset the delimiter          \lst@commentstyle%         % Apply the comment style.     }     \makeatother          \begin{document}          \begin{lstlisting}     x:=1000; %% a first comment     x:=x/2;        %% why so much space on this side?     \end{lstlisting}          \end{document}


title: How do I create unadorned color bars without a plot?

text: I want to create color bars of the type used by Kenneth Moreland in his excellent paper, "Diverging Color Maps for Scientific Visualization". They are unadorned and look like this: ![color bars](http://i.stack.imgur.com/7m2pH.png) Any idea how he did this?


title: Defining a LaTeX macro with optional arguments as keywords inside square brackets

text: I want to define a macro to insert pictures in figures, called `\centeredfigure`, which I am hoping to use the same way as `\includegraphics`. In `\includegraphics`, all optional arguments are given in the form               \includegraphics[scale=, width=, height=, ...]{path_to_graphics}      What I want to define is is:               \centeredfigure[scale=, width=, height=, caption=, ref=, placing=]{path_to_graphics}      In contrast, the optional argument functionality LateX's `\newcommand` provides is like this:               \somecommanddefinedbynewcommand[value1][value2]{value3}      So `\newcommand` cannot be used to obtain what I want. I have previously defined plain TeX macros before, but none with optional arguments of such kind. I am currently looking at the definition of `\includegraphics` defined in `combinedgraphics.sty` and am a bit baffled. I am trying to discover an underlying pattern. I would appreciate any help, like a minimal example that demonstrates a single optional argument. The macro is going to be used in LaTeX, but is going to be defined plain TeX style. **Edit - the original macro using`\newcommand`**               \newcommand{\centeredfigure}[4]{       \begin{figure}[htbp]          \begin{center}            \includegraphics[width=#1\textwidth]{#2}            \caption{#3}            \label{#4}         \end{center}        \end{figure}     }


title: Overwrite pdfbookmarks created by \addcontentsline

text: I want a bookmark called "Frontmatter" at level=0 and bookmarks for "Preface", "Acknowledgements" and "Contents" at level=1. My problem is that `\addcontentsline{toc}{chapter}{<x>}` automatically creates bookmarks at chapter level (level=0) and I don't how to overwrite them with bookmarks at level=1. The lines I commented out in the below MWE indicate the structure of the bookmarks I would like to have. The `bookmark` package seems not be provide a solution either, hence I didn't load it in the MWE.               \documentclass{book}          \usepackage{lipsum}     \usepackage{hyperref}          \begin{document}          \frontmatter          %\pdfbookmark[0]{Frontmatter}{frontmatter}     \chapter*{Preface}     %\pdfbookmark[1]{Preface}{preface}     \addcontentsline{toc}{chapter}{Preface}     \lipsum[1]          \chapter*{Acknowledgements}     %\pdfbookmark[1]{Acknowledgements}{acknowledgements}     \addcontentsline{toc}{chapter}{Acknowledgements}     Thanks to everyone for everything.          \cleardoublepage     \pdfbookmark[0]{Contents}{toc}     %\pdfbookmark[1]{Contents}{toc}     \tableofcontents          \mainmatter          \chapter{Lipsum 2}     \lipsum[2]          \end{document}


title: Color Management with a Family of Curves

text: I am struggling with following fairly simple looking problem of plotting a family of curves.               \documentclass[border=1mm]{standalone}     \usepackage{pgfplotstable}     \pgfplotsset{compat=1.8}          \pgfplotstableread{     1   1     2   4     3   9     4   16     5   25     }\dataQuad          \begin{document}     \begin{tikzpicture}     \begin{axis}[%         legend pos=north west,         domain=0:5,         xlabel=${x}$,         ylabel=${y}$]         \foreach \y/\c in {2/black,3/green,4/red,5/brown}{%             \edef\temp{\noexpand\addplot[color=\c,line width=1pt] {x^\y};}             \temp             \addlegendentryexpanded{$y=x^\y$}         }     \end{axis}     \end{tikzpicture}          \begin{tikzpicture}     \begin{axis}[%         legend pos=north west,         domain=0:5,         cycle list name=color,         xlabel=${x}$,         ylabel=${y}$]         \addplot [smooth] table[x index=0, y index=1] {\dataQuad};         \legend{$y=x^2$}         \foreach \y in {3, 4, 5} {%     %       \foreach \y/\c in {3/green,4/red,5/brown}{%             \addplot [smooth] table[x index=0, y expr=\thisrowno{0}^\y] {\dataQuad};     %           \edef\temp{\noexpand\addplot [smooth] table[x index=0, y expr=\thisrowno{0}^\y] {\dataQuad};}     %           \temp             \addlegendentryexpanded{$y=x^\y$}         }        \end{axis}     \end{tikzpicture}     \end{document}      I'd like to have the same result shown on the left when using a table with some math expressions. One problem is to handle the color management when uncomment the lines within second tikzpicture (by changing the _foreach_ -loop). I can't get it to work. Seems to be a problem with expansion. Any advice is much appreciated! Thanks Paul


title: How can I filter/select data (float, text) from a table and plot it?

text: **Note** I post this question in addition to a recent question (see below) with a more detailed description of the problem: This was the original question: How can I filter/select data from a table and plot it? **Description** Now, this is the specific problem: I have a table with data and before anything I sort the data by one of the columns. Then I would like to do the following   * filter only the rows that contain a specific **text**   * filter again, but now only the rows that contain a specific value (which may also be a **float** number or an **empty cell** )   * plot the filtered data as a table   * plot one of the columns with the filtered data as x and another one as y in a diagram. Here is an example of my table and the code to sort it:               \documentclass{minimal}     \usepackage{pgfplotstable}      \usepackage{pgfplots}             \begin{document}     %table with data, empty cells contain 'nan'     \pgfplotstableread{     L   C   T   D   V     A   0   20  1.00346 205     A   0   23  1.00118 177     A   0   25  0.99964 155     A   0   30  0.99579 115     A   0   40  0.98807 69.5     A   9.2 20  0.98444 nan     A   9.2 30  0.97664 66     A   9.2 40  0.96862 43     A   30  20  0.96936 nan     A   30  23  0.96622 16.1     A   30  30  0.964   15.3     B   0   20  1.05104 535     B   0   23  1.04876 439     B   0   25  1.0472  373     B   0   30  1.04327 234     B   0   40  1.03555 115     B   9.6 20  1.02981 nan     B   9.6 23  1.02749 152     B   9.6 25  1.0259  134     }\data          \pgfplotstablesort[sort key={T}]{\sorted}{\data} %get the data and sort by column 'T'          \end{document}          Now I want to **filter** the first column _L_ to select the desired sample. Then I want to **filter again** the remaining data by column _C_ to get the desired property. In the question that I posted recently this turned out to be a problem because I simplified the problem too much as it is important if the column contains text, integer or float values. The generated code for filtering one column with float values (here: column _C_ ) while plotting the diagram looked like that:               \begin{tikzpicture}         \begin{axis}[          xlabel=T,          ylabel=D,         x filter/.code={\pgfplotstablegetelem{\coordindex}{C}\of{\sorted}                         \pgfmathtruncatemacro{\tempva}{abs(\pgfplotsretval - 9.2) == 0 ? 1: 0}                         \ifnum\tempva>0%true                         \else%false                         \def\pgfmathresult{}                         \fi                        },         ]        \addplot[only marks] table[x=T,y=C] {\sorted};        \end{axis}        \end{tikzpicture}      **Note:** In my original question I erased the first column _L_ to simplify the problem as it contains `text`. So now, sorting works fine but filtering seems to be my problem. **The question is:** How can I set 2 filters and finally plot the remaining data as a table to have a whole overview and then plot a diagram by chosing my desired columns with the data.


title: Removing space between open bracket "(" and reference

text: I am writting a paper in IEEE format. For one sentence, i have two references and therefore i want to show them in a bracket e.g. `([1], [2])` but i am not able to get that format. Instead of `([1], [2])` , i am getting `( [1], [2])`. So, how can i remove the extra space between "(" and first "[" as depicted in the screenshot below. **_My code:_** **Main.tex**               \documentclass[12pt,ieeeconf]{IEEEtran}          \usepackage{lipsum}     \usepackage{fancyhdr}     \pagestyle{fancy}     \usepackage{gensymb}     \usepackage{cite}      \usepackage[cmex10]{amsmath}     \usepackage{graphicx}     \usepackage[caption=false,font=footnotesize]{subfig}     \graphicspath{{../pdf/}{/home/xyz/Desktop/rightwards}}     \usepackage{epstopdf}      \usepackage{url}     %\usepackage{subfigure}     \usepackage{url}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage[all,graph]{xy}     \usepackage{booktabs}     \usepackage{multirow}     \usepackage{array}     \usepackage{comment}     \usepackage{tabularx}          \title{Effect of the Position}     \author     {\IEEEauthorblockN{Xyz}\\     \IEEEauthorblockA{Lab, Faculty of Electrical Engineering \\     University of ABC\\     xyz@mail.de}     }     \markboth{Engineering Paper}{}          \begin{document}     \maketitle          \input{introduction}          \bibliography{refer.bib}     \bibliographystyle{plain}          \end{document}      **introduction.tex** this is introduction of a paper (\cite{firstPaper}, \cite{secondPaper}). ![image](http://i.imgur.com/V2cnEaS.png)


title: "below of=" ? more than one block?

text: I want to make a block `c` under two blocks `a & b`. So far I'm able to do it for only one block               \node [block, below of=a]    (c)    {filter};


title: How to keep last n lines together in listing?

text: I have a large listing defined with lstlisting (listins-package). Now the listing reaches over three pages. On the last page there is only one line (the last line) of the listing. I looks not very nice because the line only contains a bracket. Is there a way to ensure that at least n (i.e. three) lines appears on the end of the listing, if the listing ends on a new page?


title: How to get capital letters in the titles of a biblatex bibliography

text: I am using `biblatex` together with biber and the `biblatex-fiwi` package. Each word in the title data entry of the items in my bibliography should have an initial capital letter. Is there any easy way to force `biblatex` to display all the entries in my bibliography this way? Which file(s) do I have to edit and which line of code do I have to add? The `biblatex`-command in my `.tex` document looks like this:               \usepackage[style=fiwi2,backend=biber]{biblatex}      `fiwi 2` is my current bib-style. I guess I have to change/add something in the `.bbx` or `.cbx` files of the `fiwi` package?


title: Showing line number in glossaries

text: In the glossary, I need to show the "page/line" of each occurrence of a term, e.g.:               Glossary            clamour         1) plainte, cri. 24/10, 40/5         2) requête. 50/24, 50/28      Would this be possible using the _glossaries_ package (or any other package)?


title: Necessity of nested \text within math mode for proper \mathchoice-based scaling

text: **Quick summary:** `\text` can be used to ensure proper scaling with respect to the correct math style. When exactly should one use it for that purpose? What need is there for nested invocations of `\text` for that purpose? * * * `amsmath`'s `\text` includes `\mathchoice`, which people may have encountered in the form of `\mathpalette`. When one might want to use `\text` is explained here. An advanced use case for `\text` is to make sure that text within some sort of text box embedded within math mode scales correctly. A concrete example is my definition of a 180°-rotated iota (`℩`), which one can use to denote a uniqueness selector (here `\trnupiota`):               \documentclass{article}     \usepackage{upgreek} % for \upiota     \usepackage{rotating} % for \rotatebox     \usepackage{amsmath} % for \text     \usepackage{accsupp} % for the right Unicode codepoint          \newcommand*{\trnupiota}{\mathord{%       \BeginAccSupp{method=hex,unicode,ActualText=2129}%         \text{\raisebox{\depth}{\rotatebox{180}{\(\upiota\)}}}% % with \text       \EndAccSupp{}}}     \newcommand*{\trnupiotaNoText}{\mathord{%       \BeginAccSupp{method=hex,unicode,ActualText=2129}%         \raisebox{\depth}{\rotatebox{180}{\(\upiota\)}}}% % without \text       \EndAccSupp{}}               \begin{document}          \(\trnupiota x \,(x \ge 0 \wedge x^{2} = 2)\)       % denotes the square root of 2, which is by convention non-negative          \(\trnupiota + a_{\trnupiota + a_{\trnupiota}}\)       % scales correctly          \(\trnupiotaNoText + a_{\trnupiotaNoText + a_{\trnupiotaNoText}}\)       % doesn't scale correctly          \end{document}      (One may also use an ordinary iota: `ι`; conventions differ.) The entire first line denotes "the unique `x` which is non-negative and equals `2` if squared": ![uniqueness selector](http://i.stack.imgur.com/14BSo.png) As one can see, the `\trnupiota` scales correctly in the different math styles, while the `\text`-less `\trnupiotaNoText` doesn't. As explained in the comment thread to the answer linked above, `\text` can be slow, especially when it is nested: the relevant material is typeset 4 times (so the time for that material is quadrupled). The 4-fold increase in compilation time normally affects only tiny formula chunks, but it would be good to know a few rules about when we can safely _not_ use `\text`. We also know (this is explained in the same comment thread) that, when `amstext` or `amsmath` is loaded, the following text macros already include the mechanics of `\text`: `\textrm`, `\textsf`, `\texttt`, `\textnormal`, `\textbf`, `\textmd`, `\textit`, `\textsl`, `\textsc`, `\textup`, `\emph`. That is, for those we don't need an additional `\text` around their invocations. Let's figure out when we truly need `\text` within math mode. In my example, `\rotatebox` necessitates `\text`. The frequent box `\raisebox` necessitates `\text`. The text macros in the previous paragraph already include `\text`; an additional `\text` would be a waste of computing resources. But what about constructs like the following?   * `\raise0.5ex\hbox{MATERIAL}`   * I have a macro defined as `\mathbin{\text{\ooalign{...\raise0.1ex\hbox{\(...\raisebox{...}{\scalebox{...}{\(MATERIAL\)}}...\)}...}}}`. (Don't ask why; it's about my use of `\ooalign` and also consistency in between definitions.) The first use of `\(...\)` in my macro effectively creates a `\textstyle` (independent of what the outermost math style in which the macro is called is in; is that right?), and therefore the following `\raisebox` causes no problems and doesn't necessitate another `\text`? **How can one characterize the contexts in which such use of`\text` within math mode is needed?** I'm looking for an answer along the lines of "all boxes which are based on the TeX primitives X, Y, Z, if they are within non-`\textstyle` math mode"? What else is there to know?


title: How to I get linguex to give me (i)-numbered footnotes when using endnotes?

text: I need to convert all footnotes to endnotes, but I want numbered examples internal to the notes to be numbered with lowercase roman numerals, as is standard with linguex footnotes. The linguex document has a note which says > Such style files must be accommodated to linguex.sty by making sure that > \if@noftnote is set false at the beginning of each footnote (by saying > \@noftnotefalse in the modified footnote definition); otherwise you will get > the arabic style of example numberings (as being used in the main text) > rather than the roman numbers (being used inside footnotes). But I'm not sure exactly how to do that. I tried:               \usepackage{endnotes}          \makeatletter     \let\footnote=\@noftnotefalse\footnote     \makeatother          \let\footnote=\endnote      Which indeed made the numbered examples in the endnotes have lowercase roman numerals, but it also made all of the examples in the main text have lowercase roman numerals as well (and seemed to create some weirdness with the actual numerical ordering in the main text).


title: TXC not reading in project file

text: I have been working on my thesis report and use TXC as my editor. Everything was fine until there was a BSOD on my computer for unknown reason. After restarting the computer I realised that the TXC is no longer able to read my project file. Here is the screenshot of the error. ![1](http://i.stack.imgur.com/6pGS8.png) Is there any reason why this happens and how can I possibly fix this issue ?


title: Trying to add the cbgreek package causes TeXstudio and/or MiKTeX to hang (large package download issue)

text: I am using TeXstudio 2.6.6 and MiKTeX 2.9 on Windows 7. I have recently tried adding the `textgreek` package to one of my files; this package was not installed, so when I tried to compile my document I got the automatic prompt asking to silently download and install the package. I click install and confirm the UAC elevation request, but my computer only goes into "busy" mode (the mouse cursor shows the spinning blue circle) seemingly indefinitely. Notably, the last package that MiKTeX asks to install before this problem happens is `cbgreek`. When this happens, TeXstudio still responds to most commands (despite the mouse cursor being in the "busy" state). However, it will refuse to compile unless I comment out the `textgreek` package. This lasts until I forcibly close TeXstudio and restart it, but happens again when I try to compile a file which uses `textgreek`. Terminating `pdflatex.exe` also resolves the problem, but because compilation fails, the PDF preview window shows an empty gray box. Why is this happening and how can I compile a document using `textgreek`?


title: How to create a wavy lines with MetaPost?

text: I am looking for a macro or whatever code that can draw a wavy curves with MetaPost. In other words, I need a wavy/spring version of what follows:               beginfig(1);     z1 = (0,0);     z2 = (3,2);     z3 = (6,0);     draw z1 .. z2 .. z3;     endfig;      This would produce a curve from `z1` to `z3`. What I need is how to make this curve wavy? What I need is a curve with spring like the following spring but being curved... ![enter image description here](http://i.stack.imgur.com/ohDIw.png)


title: How to increase perpendicular distance of labels from arrow in XYPic?

text: How do I move a label further away from an arrow in XYPic? Example               \xymatrix{     g_0 + \beta_1)(n + n') \ar[r]_-{(g_0 + \beta_1)^+(n,n')} & (g_0 + \beta_1)(n) + (g_0 + \beta_1)(n')     }      I want to move the label further down.


title: Carrying counters over to another file

text: I have two files, say `file1.tex` and `file2.tex`. `file1.tex` is the first of a series of files, and it begins with counters (say chapter 1 for instance, although my counters are not used for chapters). Then at the end of `file1`, the counter for chapters is at say 7 ; I want to carry the value of the counter to `file2.tex` so that I can use a counter which will have the value 7 in `file2.tex`. In this way I could possibly carry on the counter in `file2.tex` to a counter in some `file3.tex` and so on. I assume I would need to compile `file1.tex` first, and then `file2.tex`, and then `file3.tex`... of course. Is that possible? And if so, how? I couldn't think of anything.


title: No tick labels and adding title to groupplot generated plots

text: I am generating an array of plots using `pgfplots` and more specifically the `groupplot` environment. Here is an example:               \begin{tikzpicture}           \begin{groupplot}[group style={group size=2 by 2,horizontal sep=0.2cm,vertical sep=0.2cm},height=3cm,width=3cm]      \nextgroupplot \addplot coordinates {(0,2) (1,1) (2,1)};     \nextgroupplot \addplot coordinates {(0,2) (1,1) (1,0)};      \nextgroupplot \addplot coordinates {(0,0) (1,1) (2,2)};     \nextgroupplot \addplot coordinates {(0,2) (1,1) (2,0)};     \end{groupplot}          \end{tikzpicture}      I would like to be able to eliminate either the x or the y tick labels or both. I also want to add a different title to each plot. I have not found a way to do this in the documentation. Any ideas?


title: How to make ligatures searchable and copiable in LuaTeX?

text: I have a problem with ligatures in LuaLaTeX when using the font Adobe Minion Pro. The fi ligature displays fine but is neither searchable nor copiable. If I copy it, I get some Asian character. Minimal example:               \documentclass[]{scrartcl}          \usepackage{fontspec}     \usepackage{xunicode}          \setmainfont[]{Minion Pro}          \begin{document}     fi ff tt     \end{document}      Any idea on how to fix this? **Edit:** This seems to be a persistent Windows problem. Fonts seems to get mixed-up for an unkown reason and it seems that this is not only happening on my machine. See my last comments to egreg's answer. **Edit2:** No Windows problem as it also happens on Kubuntu 13.10. This problem might be reproducible with the 4 Minion Pro OTFs from the Adobe Reader package (Linux .deb version but other versions should be concerned too) and using TeXLive 2013 from DVD (not updated). Can anybody try this out? I suspect it's a TeX bug, possibly something with LuaTeX. **Edit3:** It's the TeXLive 2013 version from DVD without update. I updated it and the problem is gone.


title: Title Page with LaTeX

text: **Output** I obtained the following output with code given below: ![enter image description here](http://i.stack.imgur.com/Bl8V9.png)               \documentclass[oneside,english,a4paper, 12pt]{book}     \usepackage{a4wide, fullpage, color, fancyhdr, lastpage, changepage, multirow, calligra, graphicx}         \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{geometry}     \geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}          \makeatletter     \let\ps@plain\ps@fancy% Plain page style = fancy page style     \makeatother          \providecommand*{\wb}[2]{\fontsize{#1}{#2}\usefont{U}{webo}{xl}{n}}     \newcommand*{\cdiam}{\prec\kern-2pt\succ}     \IfFileExists{upquote.sty}{\usepackage{upquote}}{}          \begin{document}     \begin{titlepage}     \fontfamily{pbk}\selectfont       \begin{adjustwidth*}{1.5cm}{2cm}         \vspace*{4.5\baselineskip}         \centering         \begin{picture}(600, 0)           \multiput(0, 110)(20, 0){20}{{\wb{10}{12}4}}                    % Top Line           \multiput(-5, 90)(0,-21){35}{\rotatebox{90}{{\wb{10}{12}4}}}    % Left Line           \multiput(0,-630)(20, 0){20}{{\wb{10}{12}4}}                    % Bottom Line           \multiput(400,90)(0,-21){35}{\rotatebox{90}{{\wb{10}{12}4}}}    % Right Line         \end{picture}         \end{adjustwidth*}         \end{titlepage}     \end{document}      I want to move the left border to more left and right border to more right. Also the bottom border is not joining with right and left border. Any help will be highly appreciated. Thanks


title: What is the meaning of \+ in doxygen-generated latex?

text: When compiling a software reference manual with doxygen and latex output, I get the following error:               ! Undefined control sequence.     l.2 ... Modular System for Shelves and Coasts (M\+                                                                              O\+S\+S\+C\+O, \href{http:...      (note that here the line break indicates the position of the error)   1. Latex does not know how to expand '\\+'. Any ideas what this means?   2. Doxygen introduced this '\\+' before any intra-word capital letter. Why and how to get rid of this behavior?   3. How to you search a search machine for that kind of problem (a special escaped character combination like "Latex \\+"? Thank you for any ideas. (especially on point 2.)


title: remove drop shadow from one node

text: I have a beamer document with many complex trees, so I set defaults for colors, shadows, and so on. Is there a way to remove the drop shadow from a single node? E.g., in the following tree, suppose that Winesap apples should have no shadow. The closest I’ve come is with `[drop shadow={fill=white,opacity=1}]`, but there’s still a faint gray outline of the shadow. And that outline is visible in xpdf, evince, mupdf, zathura, acroread, and even ImageMagick.               \documentclass{beamer}     \usecolortheme[named=teal]{structure}     \usepackage{tikz}     \usetikzlibrary{shadows,trees}     \begin{document}          \tikzset{edge from parent fork right,grow'=right,     every node/.style={rectangle,rounded corners,thick,draw=structure,fill=white,drop shadow},     edge from parent/.style={thick,draw=structure}}          \begin{frame}     \begin{tikzpicture}[level 1/.style={level distance=7em,sibling distance=9em},             level 2/.style={level distance=7em,sibling distance=6em},             level 3/.style={level distance=7em,sibling distance=3em}]     \node {food}     child {node {fruit}     child {node {apples}     child {node {Granny Smith}}     child {node[drop shadow={fill=white,opacity=1}] {Winesap}}}     child {node {pears}}}     child {node {veggies}     child {node {beets}}     child {node {Swiss chard}}};     \end{tikzpicture}     \end{frame}     \end{document}      ![enter image description here](http://i.stack.imgur.com/qhcLH.png)


title: Factorial (or, even better, binomial coefficient) function

text: Is there a function in `l3fp` for calculating factorials or, even better, binomial coefficients directly?


title: Font zgmr-digits at 600 not found

text: I'm trying to write a document using GaramondX and I keep getting the error `Font zgmr-digits at 600 not found'. I have tried reinstalling Garamond x, running upmap-sys in terminal and reconfiguring lyx. I am running Mac OSX and Lyx v 2.1.0 Coco.


title: How to correctly use siunitx to align number in the center of a table for number with preamble

text: I would like to have my numbers aligned left but centered in a table as in this solution, which I also tried to apply. Now my numbers are of the form `~24%`. For a correct alignment I tried to protect the non-number parts by writing it as `{$\sim$}24{ \%}`. The `%` is well behind the number, however the `~` is centered in the column and overlapping the numbers. Same thing happens when using something like `{xx}60{ \%}` where now the `xx` and the numbers overlap. How to protect the `~` to stay left of the number?               \documentclass{article}     \usepackage{booktabs,siunitx}          \begin{document}            \begin{tabular}{lS[table-format=2.0]S[table-format=2.0]}          \toprule           & {Before treatment} & {After treatment} \\           \midrule          component1 & {$\sim$}60{ \%} & {$\sim$}15{ \%} \\          component2 & {$\sim$}14{ \%} & {$\sim$}4{ \%} \\          component3 & {$\sim$}26{ \%} & {$\sim$}81{ \%} \\          \bottomrule        \end{tabular}               \end{document}


title: Fixing ordering of nodes and color (TikZ)

text: This is my first time using TikZ. I can't figure out how to change the ordering of the nodes from bottom up starting from the bottom left corner? Also, when I try to use package `xcolor` midnightblue doesn't work. Why is this? How can I get it to work?               \documentclass{minimal}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}[darkstyle/.style={circle,draw,fill=midnightblue!25,minimum size=4}]       \foreach \x in {0,...,4}         \foreach \y in {0,...,4}             {\pgfmathtruncatemacro{\label}{\x - 5 *  \y +21}            \node [darkstyle]  (\x\y) at (1.5*\x,1.5*\y) {\label};}             \foreach \x in {0,...,4}         \foreach \y [count=\yi] in {0,...,3}             \draw (\x\y)--(\x\yi) (\y\x)--(\yi\x) ;          \end{tikzpicture}     \end{document}


title: Looping and linking with TikZ

text: How would you build a grid using a nested foreach, defining one node for each iteration? If I were coding in Python, I would write:               nodes = {}     for i in range(10):         for j in range(5):              node = nodes[(i, j)] = create_node(location=(i, j), text="node text")              if (i-1, j) in nodes:                  add_path(nodes[(i-1, j)], node, style=hstyle)              if (i, j-1) in nodes:                  add_path(nodes[(i, j-1)], node, style=vstyle)      My code needs to be more complicated than this (it's not a simple grid), but doing this would be a great start.


title: Forcing new line after item number in enumerate environment

text: How can I force the text of an `enumerate` item to start on a new line below the item number?


I want to use `\tag` in my LaTex file at https://www.sharelatex.com/. For example, I want to do:               If $x \equiv x' \pmod{N}$ and $y \equiv y' \pmod{N}$, then: $xy \equiv x'y' \pmod{N}\tag{Substitution rule}$.      I look at a previous question on this website, \numcases with \tag, and found the answer insufficient for my problem. I still get the `! Package amsmath Error: \tag not allowed here.` error even though I am only importing the following:               \usepackage{textcomp,geometry,graphicx,hyperref,empheq}      I have two questions: (1) Why does the `amsmath` package cause an error when `\tag` is used?   (2) How do I add customized tags to my equations without causing errors? Thank you for any help you can provide on this! EDIT: This is a made-up example as requested:               Now solve for $E[X]$:\newline              \hspace{30pt} $E[X] = 1 + E[X] - p \cdot E[X]$\newline              \hspace{30pt} $0 = 1 - p \cdot E[X]\tag{"xyz"}$\newline              \hspace{30pt} $p \cdot E[X] = 1\tag{"xyy"}$\newline              \hspace{30pt} $E[X] = \frac{1}{p}\tag{"xzy"}$\newline\newline      ![image](http://i.imgur.com/pt1DetC.png) Note the `\tag` parts were added in afterwards because they caused errors. Then I want to say, based on "xyz" and "xyy", I can prove "abc".


title: Enumerate environment with tabular layout

text: I'm new to Latex. I'm familiar with the enumerate environment as well as the tabular environment, but I am trying to combine the two; that is to say, I want the items in the list to be broken up into several columns rather than one long column. Any tips?


title: How is the effect (swash) achieved?

text: Sorry, I don't know the name of this typographic effect, it's been years since I read _The Elements of Typographic Style_. This is more than kerning. I'm referring to the "tail" of the N going under the following letters. Or is it a particular font with this feature? ![alt text](http://imgur.com/SxjVK.png) The image is from page 2 of http://www.tsengbooks.com/images/6176s.pdf I'll update the question if I learn the proper typographical term. Thank you. **Update** : as Lev Bishop indicated, the effect is called swash (wikipedia)


title: Same name for all appendices

text: I have a problem with Appendices. I include them all in one big file. Here I include chapters and after including chapters, I include appendices as follows:               \begin{appendices}     \include{appendixA}     \clearpage{\pagestyle{empty}\cleardoublepage}     \include{appendixB}     \clearpage{\pagestyle{empty}\cleardoublepage}     \include{appendixC}     \clearpage{\pagestyle{empty}\cleardoublepage}     \end{appendices}      at the beginning of a file `appendixA` I have:               \appendix     \chapter{Computation of thickness}     \label{sec:ComputationOfThickness}     %\addcontentsline{toc}{section}{Computation of thickness}     %\addtocontents{toc}{\protect\contentsline{chapter}{Appendix:}{}}     bla bla bla     at the beginning of file appendixB I have:     \appendix     \chapter{Computation of surface tension of glass}     \label{sec:ComputationOfSurfaceTensionOfGlass}     %\addcontentsline{toc}{chapter}{Computation of surface tension of glass}     bla bla bla      the problem is that in the whole file, all appendices are labeled as A and not A, B and C. Could you tell me, where I have a mistake? The numbering is working very well for all chapter I have in the previous text, but once I change into appendices it stops and all is numbered as A.


title: Aligning arrows

text: I have a question. My code looks like this:               \documentclass[12pt,a4paper]{report}     \usepackage[Glenn]{fncychap}     \usepackage[latin1]{inputenc}     \usepackage{mathtools}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{amsthm}          \begin{document}     \begin{center}       $\left\{ \begin{array}{cl}        \textrm{math stuff} & \\       \textrm{in}&\\       \textrm{here} &       \end{array}\right\}\leftrightarrow        \left\{\begin{array}{cl}         \textrm{and} & \\       \textrm{some stuff in here} &\\       \end{array}\right\}.$     \end{center}     \begin{center}       $\left\{\begin{array}{cl}  %       \textrm{other stuff} & \\       \textrm{in} &\\       \textrm{right here} &       \end{array}\right\}\leftrightarrow        \left\{\begin{array}{cl}       \textrm{and} & \\       \textrm{finally} &\\       \textrm{here}\\       \end{array}\right\}.$     \end{center}     \end{document}      What I'd like to have is, that the arrows are aligned. How do I do that?


title: Using latexdiff with git

text: I'd like to be able to use `latexdiff` with git. At the moment I have an alias in my `.gitconfig` file for a word-based diff:               [alias]      wdiff = diff --color-words      but is it possible to make an alias that will use `latexdiff` then compile the output and open the created dvi/pdf file? Probably the best approach to this is using `git difftool`, but has anyone already made an appropriate script?


title: A centered plus-minus symbol

text: I'm using the `amsbook` document class with the `psamsfonts` and `mathpazo` packages. The minus sign touches the bottom of the text line. Is there a way to slightly miniaturize and vertically center the `\pm` symbol with the number?               \documentclass[psamsfonts]{amsbook}     \usepackage{mathpazo}          \begin{document}     $\pm 1$     \end{document}


title: Testing for multi-line paragraphs

text: I'm running into a situation where I need to insert some code (specifically, `\hfill`) only if my paragraph runs more than one line. This isn't a simple alignment thing, as I'm working with right-to-left text interaction with left- to-right text on the same line, and anyway, this is what it's come to. Does anyone know if there's an internal variable LaTeX sets when it moves text onto the next line, and how I might use that to do something like (note, I don't know how to use conditional code in LaTeX, so this is heuristic):               \if\multiline\then{ \hfill}.      EDIT: I need an \hfill in a right-to-left environment, which TeX doesn't automatically provide. I have something like:                   \newcommand{\hangparag}[2]{\hangindent#1 \hangafter#2 \leftskip 0.5em \parindent -0.5em}         \newcommand{\entry}[2]{\hangparag{-0.5em}{1}{\textbf{#1} #2}\par}         \newcommand{\h}[1]{\hspace{0.5cm}\RL{\texthebrew{#1}\hfill}}              \flushright         \entry{Z}{\h{דער זעט, ־ן}}      I was having trouble with the double-sided indents when the translation was on a second line, but \hfill fixed that, but now if I want to add English text next to the translation, with one-line translations, I have an \hfill pushing my English over to the side of my definition. For example:                   \entry{zany}{[MEShÚGE] \h{משוגע}}      ends up with with the transcription somewhere in between "zany" and "משוגע", when I actually want it next to "משוגע". MINIMAL EXAMPLE:               \documentclass[10pt]{book}     \usepackage{polyglossia}     \usepackage{multicol}     \newcommand{\hangparag}[2]{\hangindent#1 \hangafter#2 \leftskip 0.5em \parindent -0.5em}     \setdefaultlanguage{english}     \setotherlanguages{hebrew}     \newfontfamily\hebrewfont[Script=Hebrew]{Microsoft Sans Serif}     \newcommand{\entry}[2]{\hangparag{-0.5em}{1}{\textbf{#1}\hspace{0.5cm}\hfill #2}\par}     \newcommand{\h}[1]{\RL{\texthebrew{#1}\hfill}}     \begin{document}     \flushright     \setlength{\columnseprule}{0.4pt}     \begin{multicols*}{2}     \entry{Z, n. (letter)}{\h{דער זעט, ־ן}}     \entry{zany}{[MEShÚGE] \h{משוגע}}     \entry{zeal}{\h{דאָס התלהבֿות; דער ברען; די התמדה; דער אײפֿער; דאָס/די פֿאַרברענטקײט}}     \end{multicols*}     \end{document}


title: How to vertically align multiline column

text: I am trying to set up a table with the tabularx package (although the used package does not really matter to me). The table should stretch across the entire line. I am trying to get both columns centered vertically. This works fine for the first column, but the second column is aligned (as it seems to me) at the same height as the text in the first column, which renders the second line of text being below the desired "middle" of the cell (The "middle" being somewhere in between the two lines of text). Oddly enough, if i shorten the text in the second column to fit into one line, neither of the columns is aligned correctly (or maybe it is, though not in the fashion i desire...). Here's what i have so far:               \documentclass[a4paper,12pt,headsepline]{scrartcl}     \usepackage{tabularx}     \begin{document}     \begin{tabularx}{\linewidth}{| p{0.25\linewidth}| X |}       \hline     \LaTeX & Is a document markup language and document preparation system for     the \TeX typesetting program.\\     \hline     \end{tabularx}     \end{document}      I am aware that vertical alignment in tables is discussed fairly often, although so far i was unable to find any solution that would work for me (including defining new column types). Any hint or suggestion is greatly appreciated, i've been stuck on this for quite some time now...


title: Changing left and right margins for specific pages

text: In my document I have couple of tables which are too wide to fit between margins – that is why my tables go beyond the text. I think that it looks quite ugly so I was wondering if it is possible to change margins only for specific pages in a document? Thanks to this my tables would be able to fit between margins and the text and tables' length would be the same


title: How can I insert a newline in a framebox?

text: I have several frameboxes in my document, using the following command:               \framebox(115,115){ R-Sq: \newline For example}       I want to force a new line, but neither `\newline` or `\\` appear to work. Is there any other way of doing this?


title: XeTex on ubuntu

text: I got an error                (/usr/share/texmf/tex/latex/beamer/base/themes/o/beamerouterthemedefault.st      y))) (/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.sty      !       ********************************************      * XeTeX is required to compile this document.      * Sorry!      ********************************************.      \RequireXeTeX ...********************************}                                                   \endgroup \fi       l.18 \RequireXeTeX      But in the command line I can call `xelatex` and `xetex`. It looks like the problem is with `lexlive`, but I have installed it. What can be the problem?


title: Indenting multiple paragraphs in description

text: I am trying to put multiple paragraphs in a description, where the body text is indented by one `\parindent`, and I want to indent the second paragraph by one `\parindent` relative to the body text indentation. Example of desired result               MY ITEM: Here is some text, and it is a paragraph. When it breaks         to the next line, it is indented.             This is my second paragraph. Notice how it has a leading indent, which         is one \parindent relative to the rest of the description text, and a total         of 2\parindent from the left margin.      This is my current result:               MY ITEM: Here is some text, and it is a paragraph. When it breaks         to the next line, it is indented.         This is my second paragraph. This result, however, does not indent         my second paragraph relative to the body text in the \item.      Here is my code:               \usepackage{enumitem}     ...     \begin{description}[leftmargin=\parindent,topsep=0pt,partopsep=3pt,parsep=0pt,itemsep=3pt]     \item[MY ITEM] Here is some text, and it is a paragraph. When it breaks         to the next line, it is indented.         This is my second paragraph. This result, however, does not indent         my second paragraph relative to the body text in the \item.     \end{description}


title: footnotes and floats

text: I'm having some troubles with using footnotes inside floats. I use `\footnotemark` and `\footnotetext`, but then the float is pushed to the next page, and the footnote remains in the previous one. As a remedy, I've moved the `\footnotetext` couple of paragraphs later so now the footnote is located at the right place. BUT, now the numbering is incorrect -- in those "in between" paragraphs there was another `\footnote` which have advanced the counter. Since the float was pushed - the numbering is reverted now: the footnote in the float (that got the number n) appears after the next footnote (that was assigned to the number n+1, obviously). Is there any way to fix that, other than manually changing the counters?


title: written tab (not only a non-copyable space) in listings enviroment (LaTeX)

text: I am trying to put python code in the appendix of report using listings package. Visually it works fine, but there are not tab symbols in the pdf file, only space without symbol in background. The point is, to have code, which is possible to copy-paste out with tabs (essential for python). This is style I used.               \lstdefinestyle{customc}{       breaklines=true,       frame=l,       language=python,       basicstyle=\footnotesize\rmfamily,       keywordstyle=\bfseries\color{green!40!black},       commentstyle=\itshape\color{purple!40!black},       stringstyle=\color{orange},       tabsize=2,      }          \lstset{       style=customc     }


title: Tikz Axis with colormap bounding box does not align with other bounding boxes

text: _My last question here was concerning tikz-axis aligned with centered other pictures. I received a very good answer. This question is similar but extends the question by a colormap as in the given example._ I want to have combined tikz-pgf-Graphs like the one shown below to be aligned at the main graph (in this case, the left one). I am using an external plot as described in the pgfplot-Manual in Chapter "4.2.8 Using External Graphics as Plot Sources". For simplicity I removed the pictures in my minimal example. I my last post, I learned, that I can use "trim axis left, trim axis right" to have the graph aligned with other centered pictures. Of course, this does not work with a colormap as in my example. I have to use the external created colormap, because the tikz-version produces too large files because of to my points. How do I reduce the bounding box to the left plot? By the way, is this the correct way for positioning this, or what do you recommend? **Example:**               \documentclass{scrartcl} % Dokumentenklasse     \usepackage[decimalsymbol=comma]{siunitx} % SI-Einheiten einheitlich setzen          \usepackage{pgfplots} % Import der Plots aus Matlab     \usepackage{tikz} % Import der Plots aus Matlab     \usetikzlibrary{plotmarks} % Import der Plots aus Matlab          \newlength\fheight % Plots aus Matlab immer gleich gross     \newlength\fwidth % Plots aus Matlab immer gleich gross     \setlength\fheight{6cm} % Plots aus Matlab immer gleich gross     \setlength\fwidth{8cm} % Plots aus Matlab immer gleich gross          \pgfplotsset{ % Komma statt Punkt als Dezimaltrennzeichen       x tick label style={/pgf/number format/use comma},       y tick label style={/pgf/number format/use comma}}          \listfiles          \begin{document}     My pgf version is: \pgfversion           \begin{figure}[!htb]     \begin{center}     \begin{tikzpicture}[]     \begin{axis}[     name=plot1,     scale only axis,     width=\fwidth,     height=\fheight,     xmin=0, xmax=2,     ymin=0, ymax=2,     xlabel={$x/\SI{}{\micro\meter}$},     ylabel={$y/\SI{}{\micro\meter}$},     axis on top]     % \addplot graphics [xmin=0, xmax=22,     % ymin=0, ymax=2] {../versuche/b_v610/step36_ende/ende_afm/detail_afm.eps};     \end{axis}     \hspace{10mm}          \begin{axis}[     axis on top,     at=(plot1.right of south east), anchor=left of south west,     width=0.0675676\fwidth, height=1\fheight,     scale only axis,     xmin=0, xmax=1,     ymin=-30, ymax=50,     xtick=\empty, yticklabel pos=left,     ylabel={$h(x,y)/\SI{}{\nano\meter}$}]      % \addplot graphics [xmin=0, xmax=1, ymin=-30, ymax=50]     % {../versuche/b_v610/step36_ende/ende_afm/detail_afm-colorbar1.eps};     \end{axis}     \end{tikzpicture}     \end{center}     \end{figure}          \begin{figure}[!htb]     \begin{center}     \begin{tikzpicture}     \begin{axis}[     name=plot1,     scale only axis,     width=\fwidth,     height=\fheight,     xmin=0, xmax=5,     ymin=0, ymax=5,     xlabel={$x$},     ylabel={$\sum_i x^2$},     axis on top]     % \addplot graphics [xmin=0, xmax=22,     % ymin=0, ymax=2] {../versuche/b_v610/step36_ende/ende_afm/detail_afm.eps};     \end{axis}     \end{tikzpicture}     \end{center}     \end{figure}          \end{document}


title: Address and email in article class

text: How can I typesetting email and address at the end of text(after References) in article class just like amsart class? Does anyone know a macro for doing this work?


title: \thanks creates an empty first page

text: # Problem As I am using the `\thanks` for the `\maketitle` command, the `\thanks` creates an empty first page, with only a footnote reference number 1 in it. I am using maxTeX XeLaTeX to compile. # Code               \documentclass[a4,12pt]{article}          \begin{document}     \author{Chenlin \\ l.wind.wang@gmail.com}     \date{2013.12.21}     \thanks{This is a test!}          \title{A Experiment on \LaTeX \\ The Maketitle Experiement}          \maketitle     \end{document}


title: How to add a description ("precis") to a toc entry with KOMA-Script class?

text: Using the KOMA-Script class I'ld like to add chapter descriptions to the table of contents to provide a short description of this chapter right in the TOC. I've already found the "memoir" document class with the \chapterprecis{...} command, but this would make it impossible to use KOMA-Script, as it is a class, too. The "tocloft" package provides a similar command, but forces to print the precis under the chapter title in the text with a quite bad positioning. Is there any package around that works with KOMA-Script or a solution in the KOMA-Script class itself to provide this behaviour?


title: Does \foreach \x in {1,2,3...} have a limit for the {1,2...} number of elements?

text: I have the following code which prints some images labelled by `_{1,3,5...,37}.png`. The following code works just fine.               \usepackage{tikz}       \foreach \x in {1,3,5,7,9,11,13,15,17,19,21,23,25}     {      \begin{figure}[h]         \begin{center}$         \begin{array}{cc}         \includegraphics[width=.99\textwidth,keepaspectratio]{./graficas/histograms/firstNeighboursDistribution_strength_0.0bosons_13window_\x.png}         \end{array}$         \end{center}         \caption{First Neighbours Distribution}         \label{fig:histogram0.0}     \end{figure}     }      However, if I extend the `\x` range, let's say `{1,3,5,7,9,11,13,15,17,19,21,23,25,27}`, then I get a bunch of errors:               ! LaTeX Error: Too many unprocessed floats.      Where's is the error?


title: ACM Bibliography Style Natbib Error: 'Author undefined for citation'

text: I was writing an academic paper and the following method of citing an author was working until I had to switch to the `acm` bibliography style and I started getting the following error:               Package natbib Warning: Author undefined for citation 'bib01'      This is the MWE: **testTex.tex**               \documentclass{journal}     \bibliographystyle{acm}          \usepackage[numbers]{natbib}          \begin{document}          \citeauthor{bib01}          \bibliography{testBib}          \end{document}      **testBib.bib**               @article{bib01,     author = {Author},     title = {Bib Item},     booktitle = {Bib Book},     publisher = {Foo Publishing},     year = {2013},     pages = {75-88}     }      Using: Texmaker 4.0 MiKTeX-TeX 2.9.3759 (3.1415926) (MiKTeX 2.9)