title: How combine make diagonal column heads in table with multicolumn headers

text: 1. I want to fit this table on a portrait format page    2. and make the columns that show numbers to be of equal width  however, type 3 has a longer name than the others, hence   3. setting the column heads diagonally might help me fit the longer name in   so that condition 1. can be fulfilled this example **does not work** and I seem to need some advice on how to combine `\rotatebox` with `\multicolumn` or maybe you have a different idea altogether how I can solve this with conditions 1. and 2.               \documentclass[a4paper,10pt]{scrartcl} \usepackage[latin1]{inputenc} \usepackage{babel} \usepackage[T1]{fontenc} \usepackage{booktabs} \usepackage{array} \usepackage{dcolumn} \usepackage{graphicx}       \begin{document}       \begin{table}       \centering       \caption{Caption text}       \begin{tabular}{ | l | p{0.45cm} | p{0.45cm} | p{0.45cm} | p{0.45cm} | p{0.45cm} | p{0.45cm} | p{0.45cm} | p{0.45cm} | p{0.45cm} | p{0.45cm} | p{0.45cm} | p{0.45cm} |}       \hline        & \multicolumn{2}{*}{\rotatebox{60}{Type 1}} & \multicolumn{2}{*}{\rotatebox{60}{Type 2}} & \multicolumn{2}{*}{\rotatebox{60}{Type 3 longer text}} & \multicolumn{2}{*}{\rotatebox{60}{Type 4}} & \multicolumn{2}{*}{\rotatebox{60}{Type 5}} & \multicolumn{2}{*}{\rotatebox{60}{Type 6}}\\\hline       \multicolumn{13}{|l|}{\textsc{\textbf{row title bold}}} \\ \hline       Criterium 1 & 5 & 10 & 3 & 6 & 1 & 2 & 5 & 10 & 5 & 10 & 5 & 10 \\ \hline       Criterium 2 & 4 & 8 & 3 & 6 & 2 & 4 & 3 & 6 & 4 & 8 & 4 & 8 \\ \hline       \multicolumn{13}{|l|}{\textsc{\textbf{row title bold}}} \\ \hline       Criterium 3 & 5 & 5 & 5 & 5 & 4 & 4 & 5 & 5 & 5 & 5 & 5 & 5 \\ \hline       Criterium 4 & 5 & 5 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ \hline       \textbf{\textsc {Sum}} &  & \textbf{84} & & \textbf{56} & & \textbf{50}& &  \textbf{53}& & \textbf{51}& & \textbf{51} \\ \hline       \end{tabular}       \label{tab:Label text}       \end{table}       \end{document}


title: Beamer section titles with a shorten title in top bar of slides

text: I would like to have multiple slides with a titles for sections that place the title of the section in a box similar to the main title for the slides. @gonzalomedina helped by recommending the code:               \documentclass{beamer}     \usetheme{Madrid}          \AtBeginSection[]{       \begin{frame}       \vfill       \centering       \begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}         \usebeamerfont{title}\insertsectionhead\par%       \end{beamercolorbox}       \vfill       \end{frame}     }          \title{The Title}     \author{The Author}     \institute{The Institute}          \begin{document}          \begin{frame}     \maketitle     \end{frame}          \section{Test section one}     \begin{frame}     test frame for section one     \end{frame}          \section{Test section two}     \begin{frame}     test frame for section two     \end{frame}          \end{document}      This is great except that I am using the `Frankfurt` theme, so the title of each section is going into the top bar. My question: How do I get the long titles in the boxes at the start of each section but have a shortened phrase as the top bar "title"? Thanks. This question is a follow-up to: Creating sections each with title pages in beamers slides


title: Adding custom footer in title page using latex without using any package

text: I am trying to add a footer to every page. The following code is working except the title page. I do not want to use any package. So, how can i do that?               \makeatletter     \newcommand{\ps@edbfooter}{        \renewcommand{\@oddfoot}{my footer\hfill}%             \renewcommand{\@evenfoot}{my footer}%          }     \makeatother


title: Format the date from vc bundle as \today

text: I'm using the vc bundle to feed `\date` with the date from the latest git commit. Is there a way to format this date in the same format as the output from `\today`? I know of the different date formats in the vc bundle manual but none correspond to the format of `today`. Here's an example to work with:               \immediate\write18{./vc}     \input{vc}     \documentclass{article}     \usepackage[utf8]{inputenc}          \title{[Title]}     \date{\VCDateISO}% I want to format this date...          \begin{document}          \maketitle          \today% ... like this date.          \end{document}


title: Centering in matrices

text: I am building a big matrix within the which I have block matrices, which I want to indicate by boxes. My current state looks like this:                $$\begin{matrix} \framebox[3.\width]{J}& \begin{matrix} 0&0&\\0&0&\end{matrix}&\\         \begin{matrix} 0&0&\\0&0&\end{matrix}& \framebox[3.\width]{J}&\end{matrix}$$      but this makes the frameboxes aligned to the right. I want them centered in their matrix-cell. How can I solve this?


title: Listings package for C#

text: I intend to use the package `listings` for including C# code in a LaTeX document. There are a lot of languages supported by this package, but C# lacks at all. Is there an extension for adding support for this language? or where should I add the C# (ver 4.0) keywords to see them highlighted? Note that the support for Java/C++ does not suffice, as there are some keywords not introduced in these languages: ref, out, var etc.


title: Specifying percent of font size (as normalsize)

text: I'm trying to replicate the format/style of a document, and I got somewhat stuck at specifying font size, which it turns out, isn't all that easy (if you want to keep `\normalsize`, `\large` etc for font sizes different from 10, 11, or 12 - or if you mess with margins):   * Re: Changing default font size (on LaTeX-Community.org)   * How can I redefine the base font size and change the size of the page number on chapter pages?   * Specifying font sizes   * How to specify font size less than 10pt For me, the problem is that it seems I need to have the Palatino font between sizes 8pt and 9pt; but since specific files are being loaded (and `lineskip`s calculated) from specific files related to these sizes (e.g. `latex/extsizes/size8.clo`), I can't just put in "8.5pt". Here's my example so far:               \documentclass[8pt]{extarticle}          \usepackage{geometry}          % specify new page size - ripped from geometry package:     \makeatletter     \@namedef{Gm@envelope6x9paper}#1{\Gm@setsize{#1}(6,9){in}}%     % % ‘paper' = paper takes a paper name as its value.     \define@key{Gm}{paper}{\setkeys{Gm}{#1}}%     \let\KV@Gm@papername\KV@Gm@paper     % The following paper names are available.     \define@key{Gm}{envelope6x9paper}[true]{\Gm@setpaper@ifpre{envelope6x9paper}}%     \makeatother          \geometry{envelope6x9paper, inner=0.6in, outer=1in, twoside=true, top=1in, bottom=1in}          \usepackage{mathpazo} % palatino; no [scaled=0.92]     \usepackage{lipsum}          \usepackage{titlesec}     \titleformat{\section}{\large\bfseries}{\thesection}{1em}{}     \titlespacing{\section}{0pt}{\baselineskip}{*0}          \title{My New Document Class Test}     \author{Testus}          \begin{document}          % to match comparison PDF:     % increase page counter once, so we start on even page (that would be open left, presumably)     \stepcounter{page}          \maketitle% Actually makes a title page          \section{Intro}     \lipsum[1-4]          \section{More stuff}     \lipsum[5-9]          \end{document}      I was thinking - if I could "scale" the "default" font size; presumably that would "propagate" to all the line spacings too; but unfortunately, `mathpazo` doesn't have a `[scaled]` option (like `helvet`, I guess). So is there a LaTeX way (for the time being, I'd like to avoid switching to KOMA-Script), so that the above example can be modified in the preamble, such that the normal size of the used font becomes 150% bigger than the originally loaded font ( _with which, I expect, I would get approximately something like 8.5 pt - if I load 8pt_ )? EDIT: Just found Continuously-sizable fonts?, and tried to use `scalefnt`:               \usepackage{scalefnt}     \scalefont{1.5}      ... but it seems to have no effect above...


title: Can luaLaTeX convert xlsx tables into LaTeX code?

text: Inspired by this question: Using external tables in TikZ, I would like to know whether it is technically possible to use a `xlsx` (Office Open XML) file directly with luaLaTeX, i.e. can luaLaTeX call some external unzip program and then parse the extracted XML file? Or is that pushing the envelope too hard?


title: List of Appendices

text: My document guidelines for a multi-chapter thesis requires that any appendices be pulled out of the TOC and dropped into a separate List Of Appendices (LOA). The latex package put together for my University has a method in place for accomplishing this, but it requires the user to manually edit the TOC file and LOA files to populate them with content. I pieced together a more automated way to pull the individual Appendix entries from the TOC (instead of editing thesis.toc and manually deleting the lines):               \newcommand{\nocontentsline}[3]{}     \newcommand{\tocless}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}      Followed by (when declaring the first Appendix):               \tocless\chapter{The First Appendix}     \addcontentsline{toc}{chapter}{Appendices}      All other appendices use the \tocless command. This seems to work, the TOC has an entry at the end for "Appendices," and the page number associated with it corresponds to the first page of the first Appendix. Exactly what the Grad School requires for formatting. Getting a List of Appendices to work out, in a style that matches the rest of the document, that doesn't require manually editing multiple files seems to be beyond my grasp. Any help here would be greatly appreciated.


title: Preserve spacing while using align with amsmath

text: While               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{align}     &   A \\     & = B     \end{align}     \end{document}      preserves the horizontal space after the equals sign,               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{align}       & A \\     = & B     \end{align}     \end{document}      gobbles this. Is there a way to preserve the space? (OK, in the MWE alignment could be placed behind A and B, but it is just a _minimal_ example.) If it is not: How wide _is_ the space (as to use `\hspace{ something }`)?


title: Cleaning up a .bib file

text: I have a large `.bib` file which is in a mess. In particular:   1. Entries are not in any particular order.   2. Some entries may be duplicates (albeit with different keys).   3. Some entries may not be used in the relevant book. (1 is an issue because I'm working through the `.bib` file fixing up items one by one and examining the corresponding changes in the book; at the moment I'm having to dart back and forth a lot. 3 is an issue because I need to check the correctness of each entry manually, which can take a while; thus unused entries mean a lot of wasted time.) Is there a way of taking a `.bib` file and cleaning it up? In particular, I'd like to a) create a `.bib` file which is sorted by author, and b) delete or, better, comment out unused entries.


title: An explanation of LaTeX's output routine

text: Is there a good reference for LaTeX's output routine? The documented source is confused and confusing. The authors seem confused as to why parts are the way they are and wonder if maybe things should be changed: > Not sure about these: two questions. Should things which must apply to a > whole doument be local or global (they probably should be ‘preamble only’ > commands)? Are these three such things? My favorite quotes so far are the following gems. > This is a very much an emergency action, just dumping everything: footnotes > first then floats. A more sophisticated version is needed; but even more > urgent is a bug-free version (see, for example, pr/3528). and > We empty any left over kludge insert box here; this is a temporary fix. It > should perhaps be applied to one page of cleared floats, but who cares? The > whole of this stuff needs completely redoing for many such reasons. I suspect that tex.stackexchange is not the right place for explaining what the entire output routine is doing, but I'd appreciate any pointers to a clear explanation. I'm especially interested in why the float mechanism invokes the output routine (with large negative penalties), sometimes multiple times; how pages of floats are processed; what these kludge insert boxes are; and what hooks class authors can use.


title: Image Cover with LaTeX (on WinEdt)

text: Any thoughts on how to put a full image (covering whole page) as a cover for a book I am writing on WinEdt (LaTeX)?


title: Tikz node and nonalphanumeric characters

text: I cannibalised some code from the thread Simple speech bubbles, arrows or balloon like shapes in beamer. It works really well, but crashes whenever non- alphanumeric characters are used in the node. Here's the code               \newcommand{\callouts}[3]{\tikz[remember picture,baseline]{\node[anchor=base,inner sep=0,outer sep=0]%         (#3){\colorbox{#1!20}{#3}};\node[overlay,rectangle callout,%         callout relative pointer={(0cm,0.5cm)},fill=#1!20] at ($(#3.south)+(-0cm,-0.7cm)$){#2};}%         }%      And this is what it creates; ![enter image description here](http://i.stack.imgur.com/ucWY6.jpg) However, when I try to highlight and label a string with a non-alphanumeric character, e.g. comma or a mathematical symbol, the command crashes. I've tried using math mode and the `\text{}` command, but neither of these work. Any pointers appreciated.


title: How to make tabsize also affect lstinputlisting?

text: I noticed that `tabsize` only affects `lstlisting` and `lstinline` macros. Here is the output. The top figure is displayed using `lstinputlisting` and the bottom one is displayed using `lstlisting`. The `tabsize` does not affect the top one. But it does for the bottom one. ![alt text](http://i.stack.imgur.com/iajui.png) How to make it works for all macros?               \documentclass[dvips,dvipsnames,rgb,table]{article}     \usepackage[a4paper,hmargin=20mm,vmargin=20mm]{geometry}     \usepackage{xcolor}          \usepackage{listings}     \lstset%     {%         literate={ï}{}0                {»}{}0                {¿}{}0,         language={[Sharp]C},         breaklines=true,         breakindent=0pt,         tabsize=2,         basicstyle=\color{White}\ttfamily\scriptsize,         keywordstyle=\color{Orange}\sffamily\bfseries,         commentstyle=\color{Green}\itshape,         stringstyle=\color{Cyan}\rmfamily,         showstringspaces=true,         aboveskip=0pt,         belowskip=0pt,         backgroundcolor=\color{Black}%,         %rangeprefix=\%,         %rangesuffix=\%,         %includerangemarker=false,         %linerange=start-stop%     }               \usepackage{fancyvrb}     \def\MyOwn%     {%                 \VerbatimEnvironment%       \begin{VerbatimOut}{\jobname.tmp}%     }     \def\endMyOwn%     {%         \end{VerbatimOut}%          \lstinputlisting{\jobname.tmp}%          }               \begin{document}     \begin{MyOwn}     using System;     class Foo     {         void Main()         {             Console.WriteLine("using lstinputlisting");         }     }     \end{MyOwn}          \vspace{1cm}          \begin{lstlisting}     using System;     class Foo     {         void Main()         {             Console.WriteLine("using lstlisting");         }     }     \end{lstlisting}     \end{document}      * * * Does the `\VerbatimEnvironment` cause this problem?


title: How can I get vdots align horizontally in my equations?

text: I'm trying to make vertical dots align as in the following picture: ![enter image description here](http://i.stack.imgur.com/s92lM.png) But the best one I could get is this: ![enter image description here](http://i.stack.imgur.com/3zexy.png) Here is my LaTex code:               \begin{align*}     x_{t} &= \phi x_{t-1} + \epsilon_{t} = \phi(\phi x_{t-2} + \epsilon_{t-1}) + \epsilon_{t}\\     &= \phi^2x_{t-2} + \phi\epsilon_{t-1} + \epsilon_{t}\\     \vdots\\     &= \phi^{k}x_{t-k} + \displaystyle\sum\limits_{i=0}^{k-1} \phi^{i}\epsilon_{t-i}       \end{align*}      Any advices? thank you =)


title: fontspec ruins Lilypond's note spacing

text: I use `lilypond-book` to include music examples in my TeX document, but it seems that `fontspec` breaks the horizontal spacing between the notes: without `fontspec`   ![without fontspec](http://i.stack.imgur.com/qgISK.png) with fontspec   ![with fontspec](http://i.stack.imgur.com/yp0av.png) This MWE shows the error               \documentclass{scrartcl}          %\usepackage{fontspec}          \begin{document}     This is a \lilypond[notime,fragment,staffsize=15]{bes' a' c' b'} test     \end{document}      when compiled with               lilypond-book test.lytex     xelatex text.tex      I guess that `fontspec` changes a certain font setting, which `lilypond` expect to have an other value. Maybe this can be fixed by adding something to `\preLilyPondExample` …


title: Loop to include multiple files

text: > **Possible Duplicate:**   >  How to iterate through the name of files in a folder I would like to include all the `*.tex` files from a directory in a document. To avoid me having to add manually the `\input{dir/plop.tex}`, `\input{dir/plip.tex}` `(…)`, I would like to do it with a loop, like we could write, for example in bash :               for file in /dir/*         do \include{$file}     done      I found in documentation things like multido, but it doesn’t sems to be able to do my stuff. Do you have any solutions for this problem?


title: Including all files within a directory

text: > **Possible Duplicate:**   >  How to iterate through the name of files in a folder Using `\input{filename}`, I can input a file canned "filename.tex". I have a directory containing all of the files I want to include. How can I create a for loop, which inputs all of those files?   * The contents of the directory sometimes changes (so I do not want to manually specify all of the files).   * The files are numbered (e.g. `file01.tex`, `file02.tex`), so the loop should have no difficulty inputing them in the correct order.   * Other code will be placed within the for loop (before and after the `input` command), so I do not want to simply list all of the files at once (e.g. `\input{file01,file02}`).


title: Draw Spiral Cone Tikz

text: Im trying to do a spiral cone in Tikz. I dont know what is the best way to do this. ![screenshot](http://i.stack.imgur.com/R8JGa.png)


title: Spacing of vdots in a0poster class

text: I'm having trouble with the spacing of the individual dots that are typeset by `\vdots` when using the a0poster class. In particular, the dots are much closer together than the dots typeset by either `\cdots` or `\ddots`. Does anyone know what causes this and how to fix it??


title: How to make captionof appear just in one slide in Beamer

text: I am trying to create an overlay of two pictures in Beamer. The first one has a caption and the second one doesn't. I tried using `\captionof` but the caption keeps appearing on the second slide.               \documentclass[xcolor=x11names,compress]{beamer}          \usepackage{graphicx}     \usepackage[spanish]{babel}     \usepackage[utf8]{inputenc}     \usepackage{caption}     \captionsetup{font=scriptsize,labelformat=empty}                    \begin{document}          \begin{frame}     \centerline{\includegraphics<1>[width=10cm]{Pic1}}%     \captionof{figure}{caption of 1st pic}      \centerline{\includegraphics<2>[width=10cm, height=7cm]{Pic2}}%     \end{frame}          \end{document}      Thanks.


title: Representing real part of a complex number and Fourier Transform symbol

text: I want to write in math mode the real part of a complex number and I used the command `\mathcal{R}(i)`. The problem is that the R it produces is not the same as the R in most books that represent the real part. One reason is that it is small and it shouldn't be as it is not meant as a letter but as a symbol. Using the `\mathcal{F}` I had the same problem representing the Fourier Transform. What command do you use and you think is best and most beuatiful for there operations?


title: Using TEXINPUTS to store macros

text: I use LaTeX on two different computers which are kept in sync. I use a bunch of macro files which are on a different location in each computer. I would like to get the TeX engine to automatically search the right folder. The perfect solution would be to store the location of the macro files under the TEXINPUTS environment variable. So I've created an environment variable called TEXINPUTS and added the path to the macro files. I use the following .bat file for this; set TEXINPUTS=C:/Users/Nick Riches/Documents/My Dropbox/LATEX/macros/; However when I put the file mymacros.tex in this location and I type               \input{mymacros}      it does not find the file. I'm wondering what I'm doing wrong here. BACKGROUND INFO; Windows 7 machine, Texlipse editor, MikTeX portable tex installation


title: Insert newline before pages, no double newline for inbook

text: Following up on, How to make pagination of inbook lowercase. How do I insert a newline before the pages field? I tried               \DeclareFieldFormat{pages}{\newline\mkpageprefix[pagination]{#1}}      but for `@inbook` it results in one newlines too much. Probably the real question is: How to turn "pages" into a block, so it is "newlined" by `block=npar` automatically.               \documentclass{article}          \usepackage[block=nbpar]{biblatex}     \usepackage{filecontents}          \begin{filecontents*}{refs.bib}     @article{foo,           author         = "Foo Bar",           title          = "Baz",           journal        = "A. B. C.",           volume         = "1",           issue          = "2",           pages          = "100-200",     }          @inbook{bar,           author         = "Foo Bar",           booktitle      = "Qux",           title          = "Baz",           pages          = "100-200",     }     \end{filecontents*}          \addbibresource{refs.bib}          \newtoggle{blockterm}     \preto{\newblockpunct}{\ifterm{\toggletrue{blockterm}}{\togglefalse{blockterm}}}     \appto{\newblockpunct}{\iftoggle{blockterm}{}{\midsentence}}          \DeclareFieldFormat{pages}{\newline\mkpageprefix[pagination]{#1}}               \begin{document}     \nocite{*}     \printbibliography     \end{document}      ![mwe](http://i.stack.imgur.com/h3m7Z.jpg)


title: How to properly expand an argument to the \url or \path macro?

text: In the following MSE:               \documentclass{article}          \usepackage{url}          \newcommand{\rootDir}{\$ROOTDIR}     \newcommand{\myDir}{my/dir}     \newcommand{\makeFilePaths}[3]{%       \expandafter\newcommand\expandafter{\csname dfile#1\endcsname}{%         \rootDir/#2/#3%       }%       \expandafter\newcommand\expandafter{\csname ifile#1\endcsname}{%         ../../#2/#3%       }%     }     \makeFilePaths{test}{\myDir}{a/file/path.txt}     \newcommand{\pathText}[1]{%       %\edef\temp{path{#1}}% Doesn't compile       \expandafter\path\expandafter{#1}%     }          \begin{document}     \dfiletest     \pathText{\dfiletest}     \end{document}      I'm trying to produce file paths from a set of macros, and then print the resulting path using the `\path` command (but I presume `\url` works equally well). However, I can't seem to get the argument to expand properly, as the code above yields:               $ROOTDIR/my/dir/a/file/path.txt       <- This is what I want     \rootDir/\myDir/a/file/path.txt       <- Should be the same as above      I probably need to use `\edef` in some for, but I keep getting compilation errors.


title: Latex: How to apply smaller size to all Figures/Tables contained in a Tex document

text: Figures/Tables do not fit into the page, so that some tables get cut by their right side (imagine that I cannot see the end of the table on its right side). Here is the complicated part: **My situation:**   1. I have two modes under which I compile the document: INFORMS (1column) and IEEE(2 column) The figures/tables are fine with IEEE template (2 column). It knows how to scale them well, so that everything fits. All figures are large when compiled with INFORMS. I want to reduce the size by say 40% on each figure. Some big tables do not fit into the page as described above. **My questions:** How can I apply 40% size reduction to all Figures (all Vector graphics), so that I get smaller figures without affecting the IEEE compilation part? How to define the tables so that they fit even with INFORMS template? **I did my homework!** The only solution that I am thinking of based on my little knowledge of latex is to use flag and define the objects in a duplicated manner and, depending on which mode, render the appropriate tables\figures. Obviously, this is really ugly solution. I am interested in solutions that can enforce something globally for all tables and/or figures.


title: Major problem with biblatex/biber

text: I've come to work today to find that over the weekend Biblatex has thrown a wobbly and no longer works. Every time I try to run it, it goes immediately to 'process exited with error(s)', and won't display what errors these might be, preventing any troubleshooting of the problem. I can run PDFLaTeX ok on the file, and it was all working fine on Saturday. I can't even get this M(N-)WE to compile when including Biblatex :(               \documentclass[oneside,12pt]{article}          \usepackage[sorting=nyt,                 style=authoryear,                            %hyperref=true,                 backref=true,                 maxbibnames=99,                 maxcitenames=1,                 uniquelist=false,                 uniquename = false,                 dashed=false,                 backend=biber]                 {biblatex}          \addbibresource{references.bib}               \begin{document}               \cite{Karlstrom2006}     \cite{Cerveny1971}          \printbibliography          \end{document}      My actual file is a great deal more complex of course, and using a custom class, but as I say, this all compiles ok in PDFLaTeX, it is Biblatex where it is falling straight over the cliff. I've reinstalled both biblatex and biber packages, with no effect. Has anyone else ever come across such a problem? I think this is different to other biblatex compilation problems as there is no error log output to locate the issue. Many thanks


title: How do I enter an arbitrary Unicode code point into my document?

text: I want to enter a GREEK CAPITAL LETTER ALPHA (U+0391) into my LaTeX document. I do not want a LATIN CAPITAL A. How do I do this?


title: Thesis chapter headings, any suggestions?

text: I've found a thesis with really beautiful chapter headings that I would like to use. What package am I going to need and how would I go about creating a heading that looks like the one below. Also, if you have or know of any nice headings do please share! ![chapter heading](http://i.stack.imgur.com/Ncgo1.png)


title: Match white space above chapter title to top margin as defined in geometry package

text: I would like to change the position of chapter titles, specifically the amount of white space above them. I am using the `book` class and defining margins using the `geometry` package. The chapter command prints the chapter title below the text boundaries of non-chapter-starting pages, which in my opinion looks ugly. How can this be changed? PS: I should also mention that I am using the `titlesec` package to customize my titles. Consider this MWE:               \documentclass[twoside,12pt,openany]{book}          \usepackage[margin=30mm]{geometry}     \usepackage{lipsum}          \usepackage[svgnames]{xcolor}     \usepackage[T1]{fontenc}     \usepackage{titlesec}     \titleformat{\chapter}[hang]{\Huge\bfseries}{\textcolor{NavyBlue}{\thechapter}\hspace{0.8ex}\textcolor{lightgray}{\fontsize{35}{0}\selectfont |}\hspace{0.8ex}}{0ex}{\Huge\bfseries}          \usepackage{showframe}               \begin{document}     \chapter{The Theory of Solid State Physics}     \lipsum     \end{document}


title: Drawing parallelogram in a flowchart with the psmatrix enviroment

text: I'm trying to draw flowcharts and I looked at a few packages. As I'm more familiar with `pstricks` I chose it, and as I checked the examples I'm trying to draw it with the `psmatrix` environment. Our teacher has told us that the "Initializations" should be written in a parallelogram, and when I tried to draw that in my flowchart I had no idea of what syntax should I use for a parallelogram! Is there any specific command for that? Should I use `\psdiabox` with a particular angle in order to get the parallelgram? If yes, how should I define the angle? Here is an example of what I'm trying to draw where I want to have the red box - "Initialization" - as a parallelogram instead of a rectangle. ![enter image description here](http://i.stack.imgur.com/VfHJD.jpg)               \documentclass{article}     \usepackage{pstricks}     \usepackage{pst-node}     \usepackage{pst-blur}     \definecolor{Pink}{rgb}{1.,0.75,0.8}     \pagestyle{empty}     \begin{document}               \vspace{0.5cm}     \small       \psset{shadowcolor=black!70,blur=true}       \begin{psmatrix}[rowsep=0.4,colsep=0.5]         \psovalbox{Begin} \\         \psframebox[,fillstyle=solid,fillcolor=red]{Initialisations} \\         \psdiabox{Special} &            \psframebox[shadow=true]{Call to SP1} & \psframebox[shadow=true]{Call to SP2} \\         \psframebox{Action 1} \\         ~\\         \psframebox{Action 2} \\         \psovalbox{End}         % Links         \ncline{->}{1,1}{2,1}         \ncline{->}{2,1}{3,1}         \ncline{->}{3,1}{4,1}<{\textcolor{red}{No}}         \ncline{->}{4,1}{6,1}         \ncline{->}{6,1}{7,1}         \ncline{->}{3,1}{3,2}^{\textcolor{red}{Yes}}         \ncline{->}{3,2}{3,3}         \ncbar[angleA=-90,armB=0,nodesepB=0.25]{->}{3,3}{4,1}       \end{document}


title: TikZ: complicated paths, e.g. for complex integrals

text: I would like to illustrate lecture notes on complex analysis, which by its nature is a lot about how the lines of integration are running through the complex plane. However, I'm having trouble finding a proper solution with `tikz` to do so. Take for example the following diagram, which should become a path coming from the upper right middle, then joining the circle, exiting at the lower right middle again:               \tikz{         \draw[help lines] (-2,-2) grid (2,2);            \draw (0, 0.1) -- (2, 0.1);         \draw (0,-0.1) -- (2,-0.1);         \draw (0,0) circle (1);     }      ![enter image description here](http://i.stack.imgur.com/9GAin.png) I would now like to cut out the shapes that do not belong to the individual paths, so that it becomes something like ![enter image description here](http://i.stack.imgur.com/riZcw.png)   * I've been looking for something like `\clip[inverse]`, but that apparently that doesn't exist.   * I also tried calculating the intersections by hand (i.e. Mathematica) to and then using arcs and other nasty things to do the trick, but after a few diagrams I thought this can't be it.   * The `tikz` manual didn't help (which is surprising to be honest). Am I overlooking some feature that does what I want? **Problem solved** , basically using an inverse clipping technique. See my response below.


title: What are the differences between latexmk and rubber?

text: I just stumbled on this blog post about `rubber` and was thinking: "Isn't that exactly what `latexmk` does?". So, now I wonder: isn't it? Or are there any differences?


title: LoT Heading in the second page of my intro

text: I got LoT heading in the second page of intro . How can I resolve the problem?               \documentclass[12pt,a4paper,twoside,openright]{book}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[english,italian]{babel}          \usepackage{lipsum}          \usepackage{microtype}          \usepackage{emptypage}               %-------------------------------     \usepackage{fancyhdr}     \newcommand{\changefont}{%         \fontsize{10}{11}\selectfont     }     \fancyhf{}     \fancyhead[RE,LO]{\changefont \slshape \leftmark}     \fancyfoot[C]{\changefont \thepage}     \pagestyle{fancy}     %-------------------------------          %-------------------------------          \begin{document}              \frontmatter          \tableofcontents         \renewcommand\contentsname{Indice}         \addcontentsline{toc}{chapter}{Indice}              \listoffigures         \renewcommand\listfigurename{Lista delle Figure}         \addcontentsline{toc}{chapter}{Lista delle Figure}              \listoftables         \renewcommand\listtablename{Lista delle Tabelle}         \addcontentsline{toc}{chapter}{Lista delle Tabelle}                   \mainmatter         \chapter*{Introduzione}         \addcontentsline{toc}{chapter}{Introduzione}              \lipsum[1]              \bigskip              \lipsum[2]              \bigskip              \lipsum[1]               \end{document}


title: Indic special characters on XeLaTeX

text: I am using XeLaTeX (XeTeX, Version 3.1415926-2.4-0.9998 on TeX Live 2012/W32TeX). There are some special Indic unicode characters which XeLaTeX does not seem to support. I am trying to produce character र्ऋ - which is character no. 1011 on this page - http://ccat.sas.upenn.edu/plc/tamilweb/trans/unicodehindi.html - it is combination of three unicode symbols hexadecimal codes are 0930, 094d, 090b. In Word, I can type using 0930 Alt-X 094d Alt-X 090b Alt-X which produces र्ऋ correctly. Then I can copy paste and all applications like notepad, Firefox, get it right. But in XeLaTeX it does not work. The following compiles successfully, but renders र्ऋ as "र् ऋ" (without a space in between). The hex chars also do not work.               \documentclass[14pt]{article}     \usepackage{polyglossia}     \usepackage{fontspec}     \setmainfont[Script=Devanagari]{Arial Unicode MS}     \begin{document}     र्ऋ \char"0930\char"094d\char"090b     \end{document}      Thanks in advance. Update on 2012-12-15: This works fine with Sanskrit 2003 font. I am yet to find a solution for Arial Unicode MS though.               \documentclass[14pt]{article}     \usepackage{polyglossia}     \usepackage{fontspec}     \setmainfont[Script=Devanagari]{Sanskrit 2003}     \begin{document}     रृ       \end{document}


title: PDF that can be scanned faster by a PDF reader

text: Searching words with `Ctrl`+`F` in common PDF readers takes sometimes very long. The time does not correlate with the number of pages, or the number of embedded pictures. What causes slow fulltext search and how can I improve it in LaTeX documents? Can LaTeX generate an **index** that improves search functions? This happens not only in LaTeX documents and is reproducible for specific files. I think the files have more or less efficient structures. A few very slow examples are Springer eBooks, some science papers and some thesis documents.


title: LaTeX Error: Option clash for package xcolor (for table)

text: > **Possible Duplicate:**   >  Option clash for package xcolor While trying to do this:`\usepackage [ table ]{ xcolor }` I get this error: > LaTeX Error: Option clash for package xcolor. All the packages               \documentclass{article} % For LaTeX2e     \usepackage{nips12submit_e,times}     \usepackage[english]{babel}     \usepackage{graphicx}     \usepackage{graphics}     \usepackage{subfigure}     \usepackage{a4wide}     \usepackage[latin9]{inputenc}     \usepackage{fancyhdr}     \usepackage{amsmath}     \usepackage{amstext}     \usepackage{float}                       \usepackage{listings}     \usepackage{url}                 \usepackage{multirow,tabularx}     \usepackage [ table ]{ xcolor }     \usepackage { hhline }      Any idea what is wrong ?


title: Numbering and aligning an equation with multiple columns

text: I search a way to align an equation with multiple columns where the following criteria should be met:   * The equation tag should be in the last line   * The equal signs should be centered and aligned Using `alignat` gives me the right numbering but I have been unable to center the last equal sign in the second row as it is `overset` with a reference. Using `array` inside an `equation` I can get the alignment correct (although with more space between the columns) but the numbering is now centered and not at the end.               \documentclass{book}     \usepackage{amsmath}     \renewcommand\theequation{\thesection.\arabic{equation}}               \begin{document}     \chapter{}     \section{Section}     \subsection{subsection}     \begin{equation}      1 + 1 = 2       \label{eq:1}     \end{equation}          \begin{alignat}{3}      E =& n^\mu n^\nu T_{\mu\nu} &&=&& \rho \notag \\      T =& T^\mu_\mu = -\rho + p_r + 2 p_\perp                         &&\overset{(\ref{eq:1})}{=}&& 2 (p_\perp -\rho) \notag \\      S =& T+E &&=&& 2 p_\perp - \rho \notag \\      p^\mu =& - \gamma^{\mu \alpha} n^\beta T_{\alpha \beta} &&=&& 0 \quad .     \end{alignat}          \begin{equation}     \begin{array}{cclcl}      E &=& n^\mu n^\nu T_{\mu\nu} &=& \rho  \\      T &=& T^\mu_\mu = -\rho + p_r + 2 p_\perp                         &\overset{(\ref{eq:1})}{=}& 2 (p_\perp -\rho)  \\      S &=& T+E &= & 2 p_\perp - \rho  \\      p^\mu &=& - \gamma^{\mu \alpha} n^\beta T_{\alpha \beta} &= & 0 \quad .     \end{array}     \end{equation}          \end{document}


title: Creating a Korean to English Dictionary

text: What package would be best for creating a multilingual dictionary? The glossaries package doesn't seem to work very well with Korean.


title: How can I put a figure to the right of a multiple-choice question?

text: I have code to automatically align the four choices of a multiple choice question and put the answer after the question with dotted lines. It works quite well with the `exam` document class (see the screenshot of the output below). ![image shot](http://i.stack.imgur.com/jHZYN.png) The minimal sample code is below:               \documentclass[answers,a4paper]{exam}     \usepackage{graphicx}     \usepackage{environ}     \usepackage[normalem]{ulem}     \usepackage{etoolbox}     \usepackage{enumitem}     %     \renewcommand{\choiceshook}{%         \setlength{\leftmargin}{10pt}%     }          \newlength\answerspace     \setlength\answerspace{0.5in}     \newcommand\dottedanswerline[1][{}]{%       % One optional argument, the default value of which is empty.       \unskip\linebreak[0]\enspace       \hbox{}\nobreak\dotfill        \ifprintanswers         \hbox to \answerspace{(\hfil#1\hfil)}%       \else         \hbox{(\hskip 0.5in)}%       \fi     }% dottedanswerline          \makeatletter     \newlength\choiceitemwidth     \newif\ifshowsolution \showsolutiontrue     \newcounter{choiceitem}%          \def\thechoiceitem{\Alph{choiceitem}}%     \setlength{\fboxsep}{0pt}     %\def\makechoicelabel#1{#1\uline{\thechoiceitem.}\else\thechoiceitem.\fi\space} %underline the answer item label if we want to print the answer     \def\makechoicelabel#1{#1\fbox{\thechoiceitem.}\else\thechoiceitem.\fi\space} %underline the answer item label if we want to print the answer          \def\choice@mesureitem#1{\cr\stepcounter{choiceitem}\makechoicelabel#1}%          %measure the choices, this is the first time we need to parse the \BODY     \def\choicemesureitem{\@ifstar       {\choice@mesureitem\ifprintanswers \xappto\theanswer{\thechoiceitem}\ignorespaces}%       {\choice@mesureitem\iffalse}}%          \def\choice@blockitem#1{%       \ifnum\value{choiceitem}>0\hfill\fi       \egroup\hskip0pt       \hbox to \choiceitemwidth\bgroup\hss\refstepcounter{choiceitem}\makechoicelabel#1}          \def\choiceblockitem{\@ifstar       {\choice@blockitem\ifprintanswers\ignorespaces}%       {\choice@blockitem\iffalse}}          \def\choice@paraitem#1{%       \par\refstepcounter{choiceitem}\makechoicelabel#1}          \def\choiceparaitem{\@ifstar       {\choice@paraitem\ifprintanswers\ignorespaces}%       {\choice@paraitem\iffalse}}               \NewEnviron{items}{%       \def\theanswer{}       \begingroup         \let\item\choicemesureitem         \setcounter{choiceitem}{0}%         \settowidth{\global\choiceitemwidth}{\vbox{\halign{##\hfil\cr\BODY\crcr}}}%       \endgroup \dottedanswerline[\theanswer]       \setlist[trivlist]{nosep}       \trivlist\item\relax%         \parindent0pt%       \setcounter{choiceitem}{0}%       \ifdim\choiceitemwidth<0.25\columnwidth         \choiceitemwidth=0.25\columnwidth         \let\item\choiceblockitem         \bgroup\BODY\hfill\egroup       \else\ifdim\choiceitemwidth<0.5\columnwidth         \choiceitemwidth=0.5\columnwidth         \let\item\choiceblockitem         \bgroup\BODY\hfill\egroup       \else % \choiceitemwidth > 0.5\columnwidth         \let\item\choiceparaitem         \BODY       \fi\fi       \endtrivlist     }     \makeatother               \begin{document}          \section{multiply choice questions}     \begin{questions}          \question this is a question     \begin{items}     \item wrong choice     \item wrong choice     \item wrong choice     \item * right choice     \end{items}          \question this is a question     \begin{items}     \includegraphics[width=5cm,height=5cm]{example-image}\\     \item wrong choice     \item wrong choice     \item wrong choice     \item * right choice     \end{items}          \question this is a question     \begin{items}     \includegraphics[width=5cm,height=5cm]{example-image}\\     \item wrong choice     \item wrong choice wrong choice wrong choice wrong choice     \item * right choice     \item wrong choice          \end{items}          \end{questions}          \end{document}      You see I have put a figure in the question. However, I want to save space, which means I want to put the figure in the right side of the choices (as the the red arrows show). How can this be done? Note that the four choices were typeset in a compact way, which means they can either be put in one row, or two rows, or four rows, depending on their max length of the choice. Details can be found in the solved question here: automatically align the four choices of a multiple choice question and put the answer after the question with dotted lines. **EDIT:** In my TeX code, the image width is used to calculate the maximum length of the choices, so, if I use the following code:               \question this is a question     \begin{items}     \includegraphics[width=15cm,height=5cm]{example-image}\\     \item wrong choice     \item wrong choice     \item wrong choice     \item * right choice     \end{items}      Note that the image has width of 15cm, now the result choices were typeset in one column, but it is expected in two columns, see the second question of the screen shot. EDIT2: I have an issue with nickie's solution, if I have such code:               \question this is a question     \begin{items}[{\includegraphics[width=15cm,height=2cm]{example-image}}]     \item wrong choice     \item wrong choice     \item wrong choice     \item * right choice     \end{items}      I will get the image here: ![image is too wide, so the choices does not look good](http://i.stack.imgur.com/sWjpw.png) So, in this case(I guess the image is larger then 0.75\columnwidth), we should put all the four choices below the figure.


title: How do I "unprotect" an argument?

text: I'm having trouble with an argument that I need to "protect" (a concept I don't completely grasp‡) in order to avoid errors. When I write               \command{\argument}      I get an error; but when I try to avoid the error by writing               \command{\protect\argument}      I do not get the output I expect. For example, using Tufte-LaTeX, I have to choose between crashing, or failing to format a date as desired:               \documentclass[]{tufte-handout}         \usepackage[orig,american]{isodate}         \begin{document}      %\allcaps{\today}           % ! Illegal parameter number in definition of \reserved@a.     \allcaps{\protect\today}    % Fails to change case     \end{document}      ‡This may not be my problem at all, but I'm guessing its the source.


title: Malfunction when loading preamble code using \include{}

text: I am trying to load a piece of code using `\include{file}`. This code uses `tikz` to create fancy chapters. The weird thing is that when I load my code, the `\chaptername` gets cut(after running the code twice), like is shown in the image below. ![enter image description here](http://i.stack.imgur.com/navnk.png) However if I directly put the code in my preamble and run it twice, it works fine! ![enter image description here](http://i.stack.imgur.com/Pap7z.png) I cannot think of any logical reason for this malfunction. Any idea on what might be wrong and how can it be fixed? My code is **`main.tex`**               \documentclass{book}          \usepackage{etex}%Makes able the use of many packages     \include{Preamble/fancyChapter}          \begin{document}            \chapter{rkbnjg}       %\eng{Hello world}, Γεια σου κόσμε\\          \end{document}      **`fancyChapter.tex`**               \usepackage[english,greek]{babel}     \usepackage[iso-8859-7]{inputenc}     \usepackage{kerkis}     \usepackage{pifont}     \usepackage[explicit]{titlesec}          \usepackage{tikz}     \usepackage{epigraph}     \usepgflibrary{qrr.shapes.openrectangle}          \definecolor{mybluei}{RGB}{0,173,239}     \definecolor{myblueii}{RGB}{63,200,244}     \definecolor{myblueiii}{RGB}{199,234,253}          \tikzset{     mynode/.style={       rounded corners=30pt,       shape=open rectangle,       open rectangle fill=myblueii,       open rectangle sides=#1,       }     }          \titleformat{\chapter}[display]       {\normalfont\huge\sffamily}       {}       {20pt}       {%       \begin{tikzpicture}[remember picture,overlay]       \node[         anchor=west,         rectangle,         minimum height=4cm,         text width=\paperwidth,         xshift=-\the\dimexpr\oddsidemargin+1in\relax,         outer sep=0pt,         fill=myblueiii] (titlerect) {};       \node[         anchor=south west,         xshift=2cm,         text width=\textwidth]          at ([yshift=5pt]titlerect.south west) {\fontsize{30}{36}\selectfont#1};       \node[         mynode=nw,         anchor=south east,         fill=myblueii,         inner xsep=1.5cm,         outer sep=0pt,         font=\color{white},         minimum height=30pt]          at (current page.east|-titlerect.north)          {\bfseries\MakeUppercase{\chaptertitlename}\ \thechapter};       \end{tikzpicture}%       }     \titleformat{name=\chapter,numberless}[display]       {\normalfont\huge\sffamily}       {}       {20pt}       {%       \begin{tikzpicture}[remember picture,overlay]       \node[         anchor=west,         rectangle,         minimum height=4cm,         text width=\paperwidth,         xshift=-\the\dimexpr\oddsidemargin+1in\relax,         outer sep=0pt,         fill=myblueiii] (titlerect) {};       \node[         anchor=south west,         xshift=2cm,         text width=\textwidth]          at (titlerect.south west) {\Huge#1};       \end{tikzpicture}%       }     \titlespacing*{\chapter}       {0pt}{-20pt}{60pt}          \usepackage[margin=2.8cm]{geometry}          \setlength\beforeepigraphskip{1.5\baselineskip}     \setlength\afterepigraphskip{2\baselineskip}     \setlength\epigraphwidth{6.8cm}     \setlength\epigraphrule{0.1pt}     \renewcommand\epigraphsize{\large}     \renewcommand\textflush{flushright}          \let\oldepigraph\epigraph \renewcommand\epigraph[2]{%       \oldepigraph{\color{blue}\itshape #1}{#2}}          \usepackage{titletoc}     \newcommand\DoPToC{%     \startcontents\printcontents{}{1}{\noindent{\color{blue}\rule{\textwidth}{.5pt}}\par\medskip}}     \usepackage{xpatch}


title: Redefine \figref so that it can accept optional arguments

text: I have some figures to include in my document that contains subfigures. I don't use the subfigure environment, but rather I produce only one EPS in which every part of it is labelled as A, B and so on. (editors want subfigures to be uploaded this way). I want to use these figures also in my PhD thesis and refer to them using the `\figref` command. The problem is that if I write something like `( \figref{fig:label} A)`, then the "Figure 1" part is blue and contains the link to the figure but the "A" is black. I find this a bit ugly, so I'd like to redefine the `\figref` so that it can accept an argument like `\figref{fig:label}{A}` and the reference and the link (I use the package hyperref in my document) appear blue. Is there any way to do this?


title: How can I create bibliography in MLA format with BibTeX?

text: I know how to create a bibliography of the MLA style manually:               \begin{thebibliography}{9}       \bibitem{Poz}         Pozrikidis, C. \emph{Boundary Integral And Singularity Methods For Linearized Viscous Flow}. Cambridge [England] : Cambridge University Press, 1992. Print.          \end{thebibliography}      The link about BibTeX gives the following description: > If a document references this handbook, the bibliographic information may be > formatted in different ways depending on which citation style (APA, MLA, > Chicago etc.) is employed. The way LaTeX deals with this is by specifying > \cite commands and the desired bibliography style in the LaTeX document. It does not mention _how_ can the bibliographic information be formatted in different style. **Question:**   How can I create the bibliography automatically with BibTeX with the same MLA style? (Window Vista, MiKTeX, WinEdt 6.0) [ **EDITED:** ]Are there other ways to create the bibliography in MLA style in LaTeX?


title: Wrong figure reference number

text: I'm trying to insert a figure in a LaTeX file, but LaTeX always gives the reference number of this figure as figure 1 instead of 2, although there is already a figure 1 earlier in the document. I also can't reference this figure using `~\ref{fig:regress}`. The figure number just doesn't print. Here's the code I used to insert the image in LaTeX:               \documentclass[11pt]{article}     \usepackage{graphicx}         \usepackage{caption}     \usepackage{subcaption}     \usepackage{chngcntr}          \begin{document}            I'm trying to reference Figure~\ref{fig:regress} here...          \begin{figure}[htp]             \centering             \begin{subfigure}{0.8\textwidth}                     \centering                     \includegraphics[width=\textwidth]{im1.png}                     \caption{Scatter plot fitted with straight line}                     \label{fig:linfit}             \end{subfigure}%                  \begin{subfigure}{0.8\textwidth}                     \centering                     \includegraphics[width=\textwidth]{im2.png}                     \caption{Scatter plot fitted with 2nd degree polynomial}                     \label{fig:quadfit}             \end{subfigure}          \end{figure}          \newpage     \begin{figure}     \ContinuedFloat     \centering             \begin{subfigure}{0.8\textwidth}                     \centering                     \includegraphics[width=\textwidth]{im3.png}                     \caption{Scatter plot fitted with 3rd degree polynomial}                      \label{fig:cubicfit}             \end{subfigure}                  \caption{Scatter plots of wavelength vs. pixel position for the spectrum from night 1, fitted with polynomials of orders 1-3.}   \label{fig:regress}     \end{figure}     \end{document}      I checked that I have `\label` and `\caption` in the right order. What's going on?


title: How to do a line break after an itemize?

text: The question is in the title. I've               \begin{itemize} \renewcommand{\labelitemi}{$\bullet$}            \item item1 ...     \item item2 ....     \end{itemize}                                                         New paragraph etc......       I want in the result to have a blank line between the paragraph and the itemize.


title: How to adjust the font in a \newcommand math expression to the environment

text: I'm writing my thesis about the gas NO2. The correct way to write this is `$NO_2$`. Currently, I have a macro defined to make typing easier: `\newcommand{\notwo}[0]{\chem{NO_2}\xspace}` `\chem` is a macro defined in the Copernicus package:               \def\testbx{bx}     \DeclareRobustCommand*{\chem}[1]{\ensuremath{%     \mathcode`-="0200\mathcode`\=="003D% no space around "-" and "="     \ifx\testbx\f@series\mathbf{#1}\else\mathrm{#1}\fi}}      However, I'd like to expand this a bit more. Especially, when I'm in sans- serif, I want `\notwo` to be sans-serif, and when I'm in sans-serif-bold, I want `\notwo` to be sans-serif-bold. I'm using xelatex, and I'm using system-wide installed _Myraid Pro_ font (OTF) via the line               \setsansfont[Mapping=tex-text,ItalicFont={MyriadPro-It},BoldFont={MyriadPro-Bold}]{Myriad Pro}.      How can I achieve this?


title: How do I use a phantom section in conjunction with nameref?

text: To have the bibtex bibliography properly in the toc I use a `\phantomsection` and give it a label. Then I add it to the toc using `\addcontentsline{toc}{section}{References}`. You can see a full example below for clarification. Now I'd like to reference the bibliography automatically by it's heading string (in my case this heading is "References"). If I change the heading to e.g. "Bibliography" or "Sources" it is supposed to change the reference to that string on it's own. The problem here is that `\nameref` always uses the heading of the last real section (in my case that is "Some Section"). That problem applies to all bibliography-style lists such as the list of tables, list of figures and list of abrevations. Do you have a solution/workaround for that problem?               \documentclass[a4paper,10pt]{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage{hyperref,url}     \usepackage[all]{hypcap}          \bibliographystyle{plainnat}          \begin{document}          \section{Some Section}     Some uninterstion citation: \cite{random}      %%%%%%%%%%%%%%%% Below this line it gets interesting %%%%%%%%%%%%%%%%     Some text \nameref{refer}. % <--- This nameref produces "Some Section" instead of "References"          \phantomsection \label{refer}     \addtocounter{section}{1}     \addcontentsline{toc}{section}{\protect\numberline{\Alph{section}}References}     \bibliography{test}          \end{document}


title: Using \restoregeometry in environment, next page runs off the page bottom

text: The problem is as follows. In a `memoir` document, I defined the page geometry:               \usepackage{geometry}     \geometry{     paperwidth=5.25in,     paperheight=8in,     textwidth=95mm,     textheight=150mm,     outer=17mm     }     \setlength{\stockwidth}{5.25in}     \setlength{\stockheight}{8in}     \addtolength{\headheight}{5pt}      Then I defined an environment to put a piece of text dead centre on a page:               \newenvironment{quotepage}[1]%     {\newpage\newgeometry{margin=0pt}%     \thispagestyle{empty}%     \bgroup\centering%     \noindent\par\mbox{}\vspace*{-\baselineskip}\vfill%     \begin{minipage}{#1}%     \setlength{\parskip}{0.6\baselineskip}%     \setlength{\parindent}{0pt}%     }{\end{minipage}%     \vfill\egroup%     \restoregeometry}      When using this environment,               \begin{quotepage}{0.7\linewidth}     \itshape     What is the Noble Truth of Suffering? ...          Saṃyutta Nikāya 56.11, Dhammacakkappavattana Sutta     \end{quotepage}      The next page (the one after `\restoregeometry` was called) will begin with good header and textwidth, but the page content runs way off the page at the bottom. The page after that has good header, footer, text width, height and all. ![text runs off the page](http://i.stack.imgur.com/Za7Kl.png) However, this doesn't happen if I don't use an environment. If I just copy- paste the code which the environment should insert, the page after `\restoregeometry` is good, and so are the rest. Very puzzling. Something is going wrong with how I defined the environment, but I can't figure it out. Can someone see the problem?


title: Adding an image in luatex

text: I would like to use Lua functions in order to reproduce the effect of `\includegraphics{testimg}`. This means that the image "testimg.pdf" would appear centered in the following example.               \documentclass{minimal}     \begin{document}     \centering          Some text.          \directlua{       tex.print("Text from Lua.")       a = img.new({filename="testimg.pdf", height="200bp"})       img.write(a)     }          Some more text.          \end{document}      While the text does indeed appear centered, the image appears at the left of the page. Clearly, I am doing something wrong. Any hints?


title: Overfull \hbox produced by ntheorem subtitles

text: I switched from using the standard AMS theorem package to `ntheorem` so I can put alternative end marks on theorem environments (I want my examples to have an end mark, but not the same one as proofs). However, this seems to be causing another problem. Many of my examples have subtitles, by which I mean I start them with   `\begin{example}[subtitle]`, where the subtitle is some description of the example. Some of these subtitles are long enough that they need multiple lines, which works fine with the standard AMS environment. On the other hand ntheorem seems to try to set the subtitle all on one line, giving an overfull `\hbox` whenever it is long enough that it should span multiple lines (I'm not talking a character or two wider than it knows how to deal with like a usual overfull `\hbox`, I mean they go through the whole margin and off the page). This can be reproduced by               \documentclass[12pt]{article}       \usepackage{amsmath}     \usepackage[thmmarks,amsmath,amsthm,thref]{ntheorem}     \newtheorem{example}{Example}     \begin{document}     \begin{example}[blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah]     Content     \end{example}     \end{document}      Is this a bug in `ntheorem` or am I doing something wrong? Perhaps this is an abuse of the subtitle field. Is there a simple fix?


title: TG Schola – missing symbol textbullet

text: I am using the `tgschola` package which provides the TeX Gyre Schola font. When I run a .tex file containing an `itemize` environment through `pdflatex`, I get the following warning:               [Font] Font shape `OMS/qcs/m/n' undefined using `OMS/cmsy/m/n' instead for symbol    `textbullet'. (page 1)      Is there a way of fixing the warning?


title: Is there a document class optimized for small screens (i.e. phone screens)

text: I happen to read more documents on my (android) phone, including scientific papers from the arXiv (where the TeX source is available). Obviously, such a narrow screen is not well suited to read papers made with the usual \documentclasses . What is the best way to compile a LaTeX document in order to read it easily on a small screen (smart phone or e-book reader) ?


title: Including many figures from a directory

text: I have a large number of figures (~300) in a folder called 'allimages'. The figures are numbered fig1.eps, fig2.eps,.....fig300.eps. I want to put all of them in latex such that 6 images appear on one page. What I know to do is something like this               \begin{figure}[h]     \caption{Write the caption here.}     \vspace{0.0cm} \centering     \includegraphics[height=5.4cm]{allimages/fig1.eps}     \includegraphics[height=5.4cm]{allimages/fig2.eps}     \includegraphics[height=5.4cm]{allimages/fig3.eps}     \includegraphics[height=5.4cm]{allimages/fig4.eps}     \includegraphics[height=5.4cm]{allimages/fig5.eps}     \includegraphics[height=5.4cm]{allimages/fig6.eps}     \end{figure}      But doing like this will be time consuming. Is it possible to have some looping statement that makes it easier and help me skip long listing of figures. Thanks!


title: Problem in combining header, table, and href

text: I am trying to make a specific header for the first page while the header for the rest of the pages will be the same but different from the first page. The header for the first and the second pages is shown below (only top portion of each page is shown), where the header is basically a table. My first question is how I can put a `\href` inside this table. I actually followed the instruction that was provided here but the compiler does not allow me to use `\href`. The other question is how I can create the second header different from the first page. ![enter image description here](http://i.stack.imgur.com/2N9q1.png) Here is the code I used.               \documentclass{article}     \usepackage[margin=1in,headheight=5\baselineskip,headsep=1\baselineskip,includehead]{geometry}     \usepackage{tabularx}     \usepackage{graphicx}     \usepackage{multirow}     \usepackage{hyperref}          \newlength{\headerwidth}     \setlength{\headerwidth}{\textwidth}     \newsavebox{\myheader}     \begin{lrbox}{\myheader}%         \begin{minipage}[b]{\headerwidth}         \renewcommand{\arraystretch}{1}%         \begin{tabularx}{\headerwidth}{p{0.75\linewidth}p{0.25\linewidth}}             {\bf FirstName LastName} & \\             Address1 & Phone +1 (123) 456 7890 \\             Address2 & Fax +1 (123) 456 7890\\             Address3 & \href{mailto:myname@x.yz}{myname@x.yz}\\         \end{tabularx}         \end{minipage}     \end{lrbox}          \usepackage{fancyhdr}     \pagestyle{fancy}     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}     \lhead{}     \chead{\usebox{\myheader}}     \rhead{}     \lfoot{}     \cfoot{}     \rfoot{}          \usepackage{lipsum}     \begin{document}     \lipsum[1-3]     \end{document}


title: Displaying slides with Beamer and Article class

text: (Edited to include a MWE; note that the current version is much simpler than what was mentioned in the original question and is essentially acceptable.) Right now, I create an article version of my beamer presentation where each slide is specifically included explicitly using a \showslide command follows:               \begin{frame}<presentation>[label=slide1]        ...     \end{frame}     \showslide{slide1}      and where I use the option to avoid duplication of the slide content in the text. Is it possible to (re)define an environment so that this is automatically done (ideally with automatic slide label numbering.)? Ideally I would have like to be able to either redefine frame or define a new environment and just type               \begin{myframe}        ...     \end{myframe}      thus avoiding having to specify the mode every time and avoiding having to specify a new label. MWE example using 3 files follows. Note that, sometimes, the explanatory text included for a given slide in the article version may be a few pages long. %minitest.beamer.tex               \documentclass[ignorenonframetext]{beamer}      \input{minitest.tex}      %minitest.article.tex               \documentclass{article}      \usepackage{beamerarticle}     \usepackage{pgf}          \setjobnamebeamerversion{minitest.beamer}          \newcommand{\showslide}[1]{\begin{figure}     \center \fbox{\includeslide[width=12cm]{#1}}     \end{figure}}          \input{minitest.tex}      %minitest.tex               \begin{document}          \begin{frame}<presentation>[label=slide1]     \frametitle{First slide}     \begin{enumerate}     \item First item     \item Second item     \end{enumerate}     \end{frame}     \showslide{slide1}          Some text included only in the article mode.     \newpage          \begin{frame}<presentation>[label=slide2]     Second slide     \end{frame}     \showslide{slide2}          Yet more text included here for the second slide.     \end{document}


title: how do I multiply a command argument with a constant?

text: I'm writing a novel and I defined a set of commands for starting a new chapter:               %A     \newcommand{\AKapitel}[1]{\lettrine[lines=3, lraise=-0.2,findent=-22pt, nindent=14pt, loversize=0.26,slope=9pt]{A}{#1}}          %B     \newcommand{\BKapitel}[1]{\lettrine[lines=3, lraise=-0.2,findent=-9pt, nindent=5pt, loversize=0.26,slope=1pt]{B}{#1}}          %D     \newcommand{\DKapitel}[1]{\lettrine[lines=3, lraise=-0.2,findent=-8pt, nindent=7pt, loversize=0.26,slope=-4pt]{D}{#1}}      This way, I don't have to write out the lettrine parameters all the time. Works pretty well. But when I pick a different format (a4 instead of a5) or a different base font size, it gets messed up. So here is what I want to do: define a constant as factor and multiply all the parameters with it. Something like in this pseudocode:               scalefactor := 0.87     \newcommand{\AKapitel}[1]{\lettrine[lines=3, lraise=-0.2*scalefactor,findent=-22pt*scalefactor, nindent=14pt*scalefactor, loversize=0.26*scalefactor,slope=9pt*scalefactor]{A}{#1}}      How do I do this in actual latex code? Sorry for my limited knowledge about latex, I'm learning by doing.


title: How to change the background color of \framebox?

text: I'm trying to change a picture drawn using the plain picture environment and I need to change the background color of certain `\framebox` to lightgrey. Is it possible? I know that there are more powerful environment like `tikz`, but the figure is quite complex, and I prefer to change the less I can. For example, supposing to have this LaTeX code:               \documentclass[12pt]{article}     \usepackage{picture}     \begin{document}         \begin{figure}[hp]         \begin{center}           \setlength{\unitlength}{1cm}           \begin{picture}(7,3)(0,0)             \put( 4,3){\framebox(3,3){World}} % background = grey ??             \put( 0,3){\framebox(3,3){Hello}}           \end{picture}         \end{center}         \end{figure}     \end{document}      producing this figure: ![enter image description here](http://i.stack.imgur.com/wsMIy.png) How can I change that code in order to get this result: ![enter image description here](http://i.stack.imgur.com/gvpQA.png) with the minimal effort in term of code changes ? I tried to use `pstricks` that is something like a superset of `picture` package, but I wasn't able to solve my issue...


title: Strange error in my table

text: I need help with an error:               \begin{table}     \centering     \begin{tabular}{@{}ccp{8cm}@{}}     \toprule     Valor DOP & Calificación & Descripción \\     \cmidrule(c){1-1}\cmidrule(c){2-2}\cmidrule(p){3-3}     <1 & Ideal & Este es el mayor nivel posible, para aquellas aplicaciones que requieren el mayor nivel de precisión en todo momento \\     1-2 & Excelente & A este nivel, las medidas de posicionamiento se consideran lo suficientemente precisas para la mayor parte de las aplicaciones de precisión\\     2-5 & Bueno & Representa el mínimo nivel para tomar decisiones de navegación en ruta\\     5-10 & Moderado & Las medidas de posicionamiento pueden utilizarse para hacer cálculos, pero la calidad debe mejorarse. Este nivel (e inferiores) suelen aparecer al no encontrarse en condiciones de cielo abierto\\     10-20 & Razonable & Representa un nivel bajo de confianza. Estas medidas deben descartarse o emplearse únicamente para hacer estimaciones de la posición donde se requiera poca precisión\\     >20 & Pobre & A este nivel las medidas pueden presentar imprecisiones de hasta 300 metros, con lo que deben ser descartadas\\     \bottomrule     \end{tabular}     \caption{Significado de los valores DOP}     \label{fig:doptable}     \end{table}      I'm getting this error:               Undefined control sequence. <argument>       ...al \expandafter \let \cmrsideswitch \@tempa \fi \fi     1.227 \cmidrule(c){1-1} \cmidrule(c){2}\cmidrule(p){3-3}


title: How to modify APA Biblatex style to look like "elsarticle-harv" style?

text: I have been using the `\bibliographystyle{elsarticle-harv}` style for a long time, since I newly swtiched to `biblatex` and it is only for `natbib`, so how to modify the default `biblatex` style or specifically the `APA` style, so that making the citation style same as `elsarticle-harv`. The `elsarticle-harv` author-year citation style:               \cite{LathamVOF:2012} -----> Latham (2012)     \citep{LathamDEM:2012} -----> (Latham,2012)           \cite{LathamM:2010} -----> Latham et al.(2010)   % multi-author     \cite{LathamMeer:2011} -----> Latham and Meer (2011)     % 2 authors          \cite{LathamVOF:2012,LathamDEM:2012} -----> Latham (2012a, b)      The new setting of `biblatex` is given:               \usepackage{csquotes}     \usepackage[         style=apa,         backend=biber,         refsection=chapter,         natbib=true  ]  {biblatex}      \DeclareLanguageMapping{british}{british-apa}      However, the `APA` sytle was like:               \cite{LathamVOF:2012} -----> Latham, 2012     \citep{LathamDEM:2012} -----> (Latham,2012)   % <--- same           \cite{LathamM:2010} -----> Latham, A & B, 2010  % <--- too many cited authors!     \cite{LathamMeer:2011} -----> Latham & Meer, 2011     % & instead of and!          \cite{LathamVOF:2012,LathamDEM:2012} -----> Latham, 2012a,2012b       So how to make the year in `()` when using `\cite{}` and lessen the authors (if>3) as `FirstAuthor et al.` **Edit1:** using `￼\LetLtxMacro{\cite}{\citet}` makes year in `()`, however, the setting `maxcitenames=2` seems not working. Besides, how to change the `&` to `and`? MWE codes:               \documentclass[12pt, a4paper]{book}           \usepackage{hyperref}     \usepackage{color}     \usepackage[ ]{libertine}     \usepackage[ T1 ]{fontenc}               \definecolor{DarkBlue}{RGB}{0,51,153}         \hypersetup{         colorlinks,%         linktocpage =true,         citecolor=DarkBlue,%         filecolor=red,%         linkcolor=DarkBlue,%         urlcolor=green,     } % colorlinks setting               \usepackage[UKenglish]{babel}     \usepackage{csquotes}     \usepackage[         style=apa,         backend=biber,         refsection=chapter,         maxcitenames=2,                 natbib=true  ]  {biblatex}      \DeclareLanguageMapping{british}{british-apa}     \LetLtxMacro{\cite}{\citet}  % year in ()          \addbibresource{reffile.bib}     \begin{document}     \frontmatter     \tableofcontents     \mainmatter          \chapter{Introduction}          \citep[e.g.][]{Tsuji:2008, TsujiDEM:2008}             \cite{TsujiDEM2D:2008, TsujiDEM:2008}           \cite{Shirgaonkar:2009}.           \citep{Sorensen:2006}     \printbibliography[heading=subbibintoc]     \end{document}      and `reffile.bib`               @ARTICLE{Tsuji:2008,       author  = {Tsuji, T. and Yabumoto, K. and Tanaka, T. and Peter, B.},       title   = {Spontaneous structures in three-dimensional bubbling gas-fluidized bed by paralled {DEM-CFD} coupling simulation},       journal = {  Powder Technology },       year    = { 2008  },       volume  = { 184  },       pages   = {  132-140 },       number  = {5 }       }          @ARTICLE{TsujiDEM:2008,       author  = {Tsuji, T. },       title   = {Spontaneous structures in three-dimensional bubbling},       journal = {  Powder Technology },       year    = { 2008  },       volume  = { 11  },       pages   = {  11-17 },      number  = {2 }       }          @ARTICLE{TsujiDEM2D:2008,       author  = {Tsuji, T. },       title   = {Spontaneous structures in 2-{D} bubbling },       journal = {  Powder Technology },       year    = { 2008  },       volume  = { 10  },       pages   = {  13-19 },      number  = { 7}       }               @ARTICLE{Shirgaonkar:2009,       author  = {Shirgaonkar, A. A. and Maclver, M. A. and Patankar, N. A.},       title   = {A new mathematical formulation and fast algorithm for fully resovled simulation of self-propulsion},       journal = {Journal of Computional Physics},       year    = { 2009  },       volume  = { 228  },       pages   = {  2366-2390 },      number  = {11 }       }            @ARTICLE{Haeri:2012,       author  = {Haeri, S. and Shrimpton, J. S.},       title   = {On the application of immersed boundary, fictitious domain and body-conformal mesh methods to many particle multiphase flows},       journal = {International Journal of Multiphase Flow},       year    = { 2012  },       volume  = { 40  },       pages   = {  38-55 },       number  = { 18}       }          @BOOK{Sorensen:2006,        author = {Sorensen, R. M.},        title = { {Basic Coastal Engineering} },        publisher = {Springer Science, New York},        edition = {Third},        year    = { 2006 },        }      Output: Displaying 3-5 authors in citation looks really odd `:(`, but `maxcitenames` is not available in `APA` ![enter image description here](http://i.stack.imgur.com/QRdir.png) The printed references style: Journal name and volume is `italic`, how to make it as normal font; or just make the `volume` number non-italic, because the combination _18_ (5) (where 5 is the number) looks weird. For comparison, the original `natbib` output is also attached: ![enter image description here](http://i.stack.imgur.com/PewB0.png)


title: Beamer Class Logo in Header

text: I created a presentation using the beamer class with texmaker. Right now it looks like this: ![enter image description here](http://i.stack.imgur.com/KMDiv.png) Now I would like to include a jpg where the red circle is located, so basically inside a palette. Can anybody help me how to do that? The code:               \documentclass[t,compress,10pt,xcolor=dvipsnames]{beamer}          \usepackage{lmodern}     \usepackage[labelformat=empty,labelsep=none]{subfig}     \usepackage{caption}     \usepackage{float}     \usepackage{wrapfig}          \newcommand*\oldmacro{}%     \let\oldmacro\insertshorttitle%      \renewcommand*\insertshorttitle{%       \oldmacro\hfill%          \insertframenumber\,/\,\inserttotalframenumber}          \definecolor{UniDunkel}{RGB}{73,142,137}     \definecolor{UniHell}{RGB}{142,184,182}          \setbeamertemplate{blocks}[rounded][shadow=true]     \setbeamercolor{structure}{fg=UniDunkel}          \setbeamercolor{block body}{parent=normal text,use=block title,     bg=block title.bg!10!bg}     \setbeamercolor{block body alerted}{parent=normal text,use=block title      alerted,bg=block title alerted.bg!10!bg}     \setbeamercolor{block body example}{parent=normal text,use=block title      example,bg=block title example.bg!10!bg}          \setbeamercolor*{palette primary}{use=structure,fg=white,bg=UniDunkel!115}     \setbeamercolor*{palette secondary}{use=structure, fg=UniHell,  bg=UniHell}     \setbeamercolor*{palette tertiary}{use=structure,fg=white,bg=UniDunkel!115}     \setbeamercolor*{palette quaternary}{fg=Orange}          \setbeamercolor*{sidebar}{use=structure,bg=structure.fg}     \setbeamercolor*{palette sidebar primary}{use=structure,fg=structure.fg!10}     \setbeamercolor*{palette sidebar secondary}{fg=white}     \setbeamercolor*{palette sidebar quaternary}{fg=white}     \setbeamercolor*{titlelike}{parent=palette primary}          \setbeamercolor*{fine separation line}{}          \setbeamercolor{block title}{use=structure,fg=white,bg=structure.fg!0!red}     \setbeamercolor{block title alerted}{use=alerted text,fg=white,bg=alerted text.fg!0!white}     \setbeamercolor{block title example}{use=example text,fg=white,bg=example text.fg!0!white}          \useoutertheme{miniframes}     \useinnertheme{circles}     \setbeamertemplate{footline}[frame number]          \beamertemplatenavigationsymbolsempty          \begin{document}          \section{Section1}     \subsection{Subsection1}     \frame     {     \frametitle{Frame1}     }          \section{Section2}     \subsection{Subsection2}     \frame     {     \frametitle{Frame2}     }               \end{document}


title: The Title of Document Runs off the page, as part of header on page 3

text: Here's my preamble:               \documentclass[11pt]{amsart}     \usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.     \geometry{letterpaper}                   % ... or a4paper or a5paper or ...      %\geometry{landscape}                % Activate for for rotated page geometry     %\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{epstopdf}     \usepackage{float}     \usepackage[normalem]{ulem}          \DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}          \title{\emph{Research Proposal:}\\Perceptual Effects of Cross-Contextualized Soundscapes within the Built Environment}      Here's what happens: ![enter image description here](http://i.stack.imgur.com/l738x.png) Any ideas?


title: pdf file size doubled in xelatex

text: all was fine with my using XeLaTex in TexWorks. It generated nice 6Mb pdf files. Suddenly, yesterday, i started getting 12Mb pdf files. What could be the reason for that? Ok, i can illustrate this, but i can not post here the pdf file i try to includepdf in my document. With the example i have here, the pdf file to be included was generated out of MS Word 13, and the situation is the opposite: XeLaTex pdf is smaller than pdfLatex pdf. The pdf i want to include was created two years ago. But the font issue (the second issue i ve got when swithchin between XeLaTex abd pdfLatex ) persists: XeLaTex created pdf, when read by Adobe Reader, does not recognise the \mathds{1}, unlike the pdfLatex created pdf. This should be run compiled with pdfLatex               \documentclass[12pt]{book}          %\let\zz\[\let\zzz\]     %\usepackage{polyglossia}     %\let\[\zz\let\]\zzz          \usepackage{amsfonts}     \usepackage{amsthm}     \usepackage{amsmath}      \usepackage{amssymb}      \usepackage{graphicx}      \usepackage{pdfpages}     \usepackage{epstopdf}     \usepackage{dsfont}          \begin{document}          \includepdf[pages=-]{BLABLABLA.pdf}           \begin{equation}     \mathds{1}_{(c = d)}     \end{equation}          \end{document}       While this - with XeLaTex               \documentclass[12pt]{book}          \let\zz\[\let\zzz\]     \usepackage{polyglossia}     \let\[\zz\let\]\zzz          \usepackage{amsfonts}     \usepackage{amsthm}     \usepackage{amsmath}      \usepackage{amssymb}      \usepackage{graphicx}     \usepackage{pdfpages}     \usepackage{epstopdf}          \usepackage{dsfont}          \begin{document}          \includepdf[pages=-]{BLABLABLA.pdf}           \begin{equation}\label{colatloan1}     \mathds{1}_{(c = d)}     \end{equation}          \end{document}       the BLABLABLA.pdf is a page made out of any pdf creating software (word, etc.). * * * @ChristianFeuersänger Ok, i can illustrate this, but i can not post here the pdf file i try to includepdf in my document. With the example i have here, the pdf file to be included was generated out of MS Word 13, and the situation is the opposite: XeLaTex pdf is smaller than pdfLatex pdf. The pdf i want to include was created two years ago. But the font issue (the second issue i ve got when swithchin between XeLaTex abd pdfLatex ) persists: XeLaTex created pdf, when read by Adobe Reader, does not recognise the \mathds{1}, unlike the pdfLatex created pdf. This should be run compiled with pdfLatex               \documentclass[12pt]{book}          %\let\zz\[\let\zzz\]     %\usepackage{polyglossia}     %\let\[\zz\let\]\zzz          \usepackage{amsfonts}     \usepackage{amsthm}     \usepackage{amsmath}      \usepackage{amssymb}      \usepackage{graphicx}      \usepackage{pdfpages}     \usepackage{epstopdf}     \usepackage{dsfont}          \begin{document}          \includepdf[pages=-]{BLABLABLA.pdf}           \begin{equation}     \mathds{1}_{(c = d)}     \end{equation}          \end{document}       While this - with XeLaTex               \documentclass[12pt]{book}          \let\zz\[\let\zzz\]     \usepackage{polyglossia}     \let\[\zz\let\]\zzz          \usepackage{amsfonts}     \usepackage{amsthm}     \usepackage{amsmath}      \usepackage{amssymb}      \usepackage{graphicx}     \usepackage{pdfpages}     \usepackage{epstopdf}          \usepackage{dsfont}          \begin{document}          \includepdf[pages=-]{BLABLABLA.pdf}           \begin{equation}\label{colatloan1}     \mathds{1}_{(c = d)}     \end{equation}          \end{document}       the BLABLABLA.pdf is a page made out of any pdf creating software (word, etc.).


title: Commands that disable everything except the counters

text: # what I'm looking for... I'm looking for a couple a commands, `\disableAllButCounters` and `\enableAll` that would do the following: > Everything between `\disableAllButCounters` and `\enableAll` would be > ignored excepted commands such that `\setcounter{counterA}{k}`, so that the > only common thing between >   >   >     \disableAllButCounters >     \manyCommands >     \enableAll >   > > and >   >   >     %\disableAllButCounters >     \manyCommands >     %\enableAll >   > > would be that after both, the values of the counters is the same. In > particular, anything between these commands will not produce any output (nor > `aux`). > > I'm looking for a solution for latex and for a solution for luatex. If it exists, these commands could provide a solution to this question. # but why!? Basically, I would to produce several outputs from a single latex file: one output for the content from A to B, one output for the content from B to C, etc. I plan to do it by cutting the file into multiple files. My question raises the problem of dealing with the references. If by any chance, you think of a better solution, don't hesitate!!


title: warning on xypic

text: I get several warning about `xypic`, I have no idea what to do about them. Can anyone help me? I can provide more info, if you ask me. The warnings I get are as follows: ![enter image description here](http://i.stack.imgur.com/cvTNj.png)


title: Dimension too large while plotting with pgfplots

text: I have the following pgfplots code:               \begin{tikzpicture}     \begin{axis}[domain=-8:2]     \foreach \i in {-10,-9.8,...,10} {\addplot+[smooth] {-x/\i+\i};}%     \end{axis}     \end{tikzpicture}      I need several line-plots in order for the parabolic pattern to emerge, hence the for loop with a 0.2 increment. Unfortunately, this gives me the `dimension too large` error. What can I do?


title: Sums in math mode: how to display index under the sigma sign?

text: I have a fraction with sums above and under the line. How can I convince LaTeX to write the indices of the sums _under_ the sigma instead of next to it?               \begin{displaymath}       \frac{\sum_{s \in S} s^2}{\sum_{p \in P} p^2}     \end{displaymath}


title: kpfonts with eufrak

text: Is there a way to use kpfonts but with the standard mathfrak? At first I thought it was nice to have a more readable font, but now I feel like the original one was actually better!


title: Spacing of characters in a mathematical set, displayed inline in paragraph

text: I have a mathematical set notation that I want to display inline in a paragraph of text. However, when I write this, the output is not very beautiful:               $\{ (w_j,\dots,w_{j+n-1}) | 0 \leq j \leq k-1-n\}$      The curly braces look a bit too small, but it's bearable. What's worse is the spacing, I think: the curly braces are too close to the opening parenthesis on the left side and the "n" on the right side. The same with the pipe symbol in the middle: it's practically glued to the closing parenthesis and the "0". Overall the tight spacing makes the definition difficult to read. So I wonder if there is a "better" way to write the above set, so that the output is more esthetically pleasing.


title: Labeling non axis parallel braces in tikz

text: Given two points, the following code draws a brace connecting them and labels it.               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc,decorations.pathreplacing}     \begin{document}     \begin{tikzpicture}       \coordinate (a) at (0,0);       \coordinate (b) at (4,0);       \draw[decorate,decoration={brace,amplitude=10pt,raise=1pt,mirror},yshift=0pt] (a) -- (b) node [midway,yshift=-15pt]{$x$};       \fill (a) circle (2pt);       \fill (b) circle (2pt);     \end{tikzpicture}     \end{document}      This yields: ![enter image description here](http://i.stack.imgur.com/jps2K.png) However, if the line connecting `a` and `b` is not axis-parallel, we can have something like the following:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc,decorations.pathreplacing}     \begin{document}     \begin{tikzpicture}       \coordinate (a) at (0,0);       \coordinate (b) at (4,2);       \draw[decorate,decoration={brace,amplitude=10pt,raise=1pt,mirror},yshift=0pt] (a) -- (b) node [midway,yshift=-15pt]{$x$};       \fill (a) circle (2pt);       \fill (b) circle (2pt);     \end{tikzpicture}     \end{document}      which yields: ![enter image description here](http://i.stack.imgur.com/uL5o1.png) How can the `x` label be automatically located in this case in the _"right"_ place? If there's no automatic way, I guess one has to use a combination of `xshift` and `yshift` and take into account the `raise` and `amplitude` of the brace. When I tried to tweak these I failed... What's the smart way out here?


title: Driver specification for hyperref and graphicx

text: When using `hyperref` and compiling via `pdflatex` or `dvips`, I do not need to specify the driver with `\usepackage{hyperref}`. However when compiling via `dvipdfm` this fails and I have to specify the driver using `\usepackage[dvipdfm]{hyperref}`. A similar situation occurs with the use of `graphicx`. Why is that so? Is there a way to fix the `hyperref` or `graphicx` packages so that `dvipdfm` need not be manually specified each time?


title: How to change color for a block of texts?

text: I am editing a LaTeX paper with Emacs. Sometimes, just for myself, I want to make a block of texts less obvious (or less important to see). Instead of totally hide them, I still want them to be there. So I am wondering if there is an easy way to embed them in something so that it changes color (to grey for instance) and looks less important. Could anyone help? By the way, besides changing color, do you have other suggestions for this kind of need (making easily a block of texts look less important)?


title: Document working with cite package, but not with natbib package

text: I am trying to use the `natbib` style in order to cite references by author and year. Using the tex and bib example here I am able to create a pdf file using the `cite` package. `mydocuments.tex`               \documentclass[11pt]{article}          \usepackage{cite}          \author{John Doe} \title{Sample Document}          \begin{document} \maketitle          \section{Introduction}          According to the handbook of van Leunen \cite{vanleunen}, this paragraph---and certainly this section---should be longer than one sentence.          \bibliographystyle{plain}   % (uses file "plain.bst")          \bibliography{myrefs}       % expects file "myrefs.bib"     \end{document}      `myrefs.bib`               @book{vanleunen,    title = "A Handbook for Scholars",             author = "Mary-Claire van Leunen",             publisher = "Knopf",             year = "1979"             }      When I switch to the `natbib` package (and the bibliography style `plainnat`), I get the error.               Package natbib Error: Bibliography not compatible with author-year citations.      `mydocuments.tex`               \documentclass[11pt]{article}          \usepackage{natbib}          \bibliographystyle{plainnat}          \begin{document} \maketitle          \section{Introduction}          According to the handbook of van Leunen \cite{vanleunen}, this paragraph---and certainly this section---should be longer than one sentence.          \bibliographystyle{plain}   % (uses file "plain.bst")          \bibliography{myrefs}       % expects file "myrefs.bib"     \end{document}      What is wrong with the bib file in the example, and how do I format it for `natbib` please?


title: biblatex: exclamation mark in title of bib item interferes with field separator

text: The following code shows, that an exclamation mark in the title of a bib entry removes the field separator (here: a comma) which separates the title from the journal. How can this be avoided? If the title does not contain the exclamation mark, the comma is correctly printed. Note: you have to run the code twice (first, `bib.bib` has to be generated)               \documentclass{scrartcl}          \usepackage[T1]{fontenc}     \usepackage[american]{babel}     \usepackage{blindtext}     \usepackage[     backend=bibtex,     style=authoryear,     sorting=ydnt     ]{biblatex}          \usepackage{filecontents}     % remove "!" and the comma separator will be there     \begin{filecontents*}{bib.bib}     @article{mykey,       author={TeX, L.},       journal={Journal of LaTeX questions},       pages={1--10},       title={{Minimal title!}},       volume={1},       number={1},       year={2011}}     \end{filecontents*}          % bibliography     \renewcommand*{\newunitpunct}{\addcomma\space}     \DeclareFieldFormat*{title}{#1}     \renewbibmacro*{in:}{}          \addbibresource{bib.bib}% bibliography data          \begin{document}     \blindtext[1]     \textcite{mykey}     \printbibliography     \end{document}


title: Spacing between subfigure and subcaption

text: Consider the code below. I'm attempting to add space between the subfigures and their respective captions by modifying subfigcapskip (I've also tried skip, aboveskip, and captionskip), but I'm not getting the desired effect. What is the correct property to specify?               \documentclass[11pt]{article}     \usepackage{tikz}     \usepackage{subcaption}     \usepackage{caption}          \begin{document}          \begin{figure}     \centering     \begin{subfigure}{0.45\textwidth}     \centering         \begin{tikzpicture}             \fill[blue] (0,0) rectangle (3,3);         \end{tikzpicture}         \subcaption[subfigcapskip =50pt]{A blue square.}     \end{subfig}%     \begin{subfigure}{0.45\textwidth}     \centering         \begin{tikzpicture}             \fill[red] (0,0) rectangle (3,3);         \end{tikzpicture}         \subcaption[subfigcapskip = 50pt]{A red square.}     \end{subfig}     \caption{Two squares.}     \end{figure}          \end{document}      ![MWE](http://i.stack.imgur.com/toX0u.png)


title: biblatex, hyperref and punctuation issue

text: And a little bit more biblatex stuff: I've noticed that, when using hyperref, there is an issue in form of an ugly space between the citation and the punctuation (be it comma or period). Please, take a look at the following example code:               \begin{filecontents}{mybib.bib}     @book{JSmith,     author = {Smith, John},     title = {A book of}     }     \end{filecontents}          \documentclass{article}          \usepackage[style=authortitle]{biblatex}     \bibliography{mybib.bib}          \usepackage[colorlinks]{hyperref}          \begin{document}     Test~\cite*{JSmith}. Test~\footcite{JSmith}          Test~\emph{A book of}. Test\footnote{Smith, \emph{A book of}.}     \end{document}      Any ideas? * * * **EDIT** : Just to let you know, I posted the question here too: http://groups.google.com/group/comp.text.tex/browse_thread/thread/908bd4ff3f8633b2# I'll keep them both in sync. * * * **EDIT 2** : Heiko Oberdiek kindly provided the answer "why" this happens (on comp.text.tex): > `\cite*` uses `\emph` and `\emph` suppresses the italic correction at the > right end if a comma or period follows (`\nocorrlist`). However adding a > link implies that whatits are added in between (in case of hpdftex.def there > are two whatits, the end of the link and restoring the color. Therefore the > period is hidden from `\emph`. > > Example without **biblatex** : >   >   >     \documentclass[12pt]{article} >     \showboxdepth=\maxdimen >     \showboxbreadth=\maxdimen >     \usepackage[colorlinks]{hyperref} >   >     \begin{document} >     \section{Foo}\label{sec:foo} >     \huge >     \noindent >     Test~\emph{Smith of}.\\ >     Test~\hyperref[sec:foo]{\emph{Smith of}}. >   >     \tracingonline=1 >     \showlists >     \end{document} >   * * * **EDIT 3** : Ulrike Fischer proposed a local fix: > You can locally reset the definition of `\citetitle` (if you do it globally > it will perhaps remove the italic correction also in places where you want > it): > > `{\DeclareFieldFormat{citetitle}{\mkbibemph{#1\nocorr}}\cite*{JSmith}.}`


title: lines above and below section

text: I'm currently using the code below for making section-like titles in a two- column document                   \newcommand{\titulo}[1]         {         \par\medskip         \begin{noindent}         \rule{\linewidth}{0.8pt}         \fontsize{14pt}{0pt}{\selectfont\textbf{#1\\}}         \rule{\linewidth}{0.8pt}         \end{noindent}         }      and               \begin{document}          \titulo{Resultados}     Some results     \titulo{Discusión y Análisis}     Some analysis          \end{document}      getting someting like: ![](http://i.stack.imgur.com/v8u0n.png) But I want that the space after the above line to be equal to the one below, and there's a little space at the beggining of the rule. Also, how do I make this to be the default `\section` format?


title: texstudio scripting:converting selected text

text: There is not ToUppercase ToLowercase function which convers text in my language from so called small letters to capital letters. how can i loop char by char in selected text in texstudio to convert selected text? example: from_array={'ა','ბ','გ','დ'} to_array={'Ⴀ','Ⴁ','Ⴂ','Ⴃ'} need to replace seelcted text from from_array to to_array


title: Hiding output of a macro

text: Is there a way to get a macro to hide its output but still do the logic with counters etc.? I'm stuck on the definition of macro `\dontoutput` below.               % \documentclass, \usepackage, ...          \newcount\innercount          \def\dontoutput#1{#1} % ???          \long\def\inner#1{\advance\innercount 1\relax}          \long\def\outer#1{       \innercount 0\relax       \dontoutput{#1}    % call it, increment counters in \inner, but don't output anything!       Inner called \the\innercount times.       \def\inner##1{##1} % we want to output it too now.       #1                 % call again     }          \begin{document}       \outer{         a         \inner{b}         \inner{c}         \inner{d}         e       }     \end{document}          % Outputs:  a e Inner called 3 times. abcde     % I'd like:     Inner called 3 times. abcde


title: algorithm2e + cleveref: problem with wrong reference to line numbers

text: For some reason I do not understand, `cleveref`produces wrong references to line numbers of listings produces with the `algorithm2e` package. I hope that I did not miss a simple solution ... My example is the following:               \documentclass[paper=A4, fontsize=11pt]{scrbook}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[linesnumbered]{algorithm2e}     \usepackage{hyperref}     \usepackage{cleveref}          \begin{document}          \begin{algorithm}     Do something\;     Do something else\;\label{line}     \end{algorithm}          line~\ref{line} vs.\ \cref{line}.     \end{document}      The output (which you can also check online) is ![Example output](http://i.stack.imgur.com/cWpbA.png) The `\ref` command works as expected (and refers to line 2) but the `\cref` command always refers to line 1 (no matter how many lines there are and which line I try to reference). Does anybody know a solution to this problem?


title: Customizing inline enumerate with enumitem still not working?

text: I have the latest version of the `enumitem` package and I'm trying to use different labels for enumerate lists which are set as normal lists and enumerate lists which are set inline. However, it doesn't seem to work (one customization overwrites the other), and I've already asked a question about this where it turned out to be due to a bug. However, I still can't get it to work. I have the following MWE:               \documentclass{article}     \usepackage[inline]{enumitem}          \setlist[enumerate,1]{%       label=\arabic*.,     }     \setlist*[enumerate,1]{%       label=(\roman*),     }          \begin{document}          \begin{enumerate}       \item item 1       \item item 2       \item item 3     \end{enumerate}          \begin{enumerate*}       \item item 1       \item item 2       \item item 3     \end{enumerate*}          \end{document}      and what I get is: ![enter image description here](http://i.stack.imgur.com/m7CKX.png) Either I don't understand how to use the `\setlist` to get this to work, or the bug still remains. I can't figure out which.


title: Changing fonts for heads and subheads in Sphinx LaTeX

text: In pdf export the AvantGarde font is used a lot for heads and subheads. I would like to use a modern font like Helvetica. Is it possible to just exchange AvantGarde with Helvetica. If possible I would like to just change the conf.py file (latex preamble).


title: How to show Abstract title

text: I think that is something very simple, but I can't see the Abstract title in the `abstract` environment.               \documentclass{scrreprt}          \usepackage[english]{babel}           %Loaded here: microtype,graphicx,booktabs,caption,tabularx,hyperref,amsmath     \usepackage{classicthesis-preamble}     \usepackage{classicthesis}          \begin{document}          \begin{abstract}     Text     \end{abstract}          \end{document}      Is it also possible to have a double abstract (one in English and one in Italian) in the same page?


title: Own table of contents?

text: Is it possible to introduce an own table of contents in LaTeX? I would like to introduce an own tag, to define some terms in my document. At the end of the document I would like to automatically generate a list of defined terms, with links to the page, where the term was defined.