title: Help with using /pstool with sibling directories by moving files to the auxilary directory

text: Broadly, I want to achieve the pstool equivalent of `\graphicspath` (which is a known issue when working with non-sub directories). As far as I can tell, the only solution without changing `openout_any` is to move the .eps files. If there is a new or better way to do this, I would love to here it. So, following http://phdtools.blogspot.ca/2011/07/latex-psfragfig-of-figures- in-other.html?m=1 or similar approaches, the idea is to move the .eps files to your location with \write18, then run pstool as normal. **Setup:** I am on windows, with an environment like the following:   * Make sure that you have -shell-escape. My pdflatex (in texstudio) looks like: `"C:/apps/MiKTeX 2.9/miktex/bin/pdflatex.exe" -aux-directory=C:\Windows\Temp -shell-escape -interaction=nonstopmode %.tex`   * Create any .eps file and put it in the super-directory of a test file. I created mine as `figtest.eps` for example, and made a subdirectory called `test` underneath with a file called `psfragtest.tex`   * Note the auxilary directory For the .tex file, use the following:               \documentclass[12pt]{article}     \usepackage{pstool}     \newcommand{\figureinlocation}{../ }     \newcommand{\figureoutlocation}{C:/Windows/Temp/ }     \newcommand{\figurefiles}{figtest.eps}     \immediate\write18{robocopy \figureinlocation \figureoutlocation \figurefiles}          \begin{document}         \psfragfig{figtest}     \end{document}      Because the \figureoutlocation is the same as auxilary directory, this will first move the .eps file listed to that location, and then psfragfig files it/works **My Question** : In order to make this better, there are a few things I could use help with:   1. When I run this the first time, it says something like `Could Not Find C:\working\projects\figtest-pstool.tex`. This is a non-terminating error, and it seems to work otherwise.      * But if you look in the directory C:\Windows\Temp you will see the file, so      * I think pstool is generating this .tex file, putting it in the auxilary folder, and then not looking for the .tex file generated by pstool in the main directory.      * So, my question is how to tell `pstool` to consider the auxilary directory for its processing   2. I would love it if I could get the generated .pdf and .aux file that pstool creates (and then imports into my main .pdf) within the auxiliary directory.     * I think this is related to the first problem. I tried to change the settings with something like: `\usepackage[ps2pdf-options={-aux-directory=C:/Windows/Temp -output- directory=C:/Windows/Temp}]{pstool}`     * But this doesn't work and it gives a MikTeX GPL Ghostscript error: `9.05 **** Could not open the file utput-directory #C:/Windows/Temp`. (Note the spelling of `utput-directory` which is not a typo here.)     * I also tried to use the `dvips-options` within pstool, but had trouble there as well.   3. Is it possible to get the `-aux-directory` being used to process pdflatex as a variable within latex itself so I don't need to keep them in sync? (One word of caution if you try to play with this, delete all of the auxilary, pdf, etc. file moved and generated each time as the behavior changes


title: Titlesec creates entry in ToC for a starred part

text: I have the following code, creating section titles starting with "Section [number].", exactly as I wish:               \documentclass{article}     \usepackage[hidelinks]{hyperref}     \usepackage[explicit]{titlesec}     \newcommand\sectiontext{}     \titleformat{\section}%         {\refstepcounter{section}%         \renewcommand\sectiontext{Section \thesection. #1}%         \Large\bfseries}         {}         {0pt}         {\sectiontext}         [\addcontentsline{toc}{section}{\sectiontext}]     \begin{document}     \tableofcontents     \section*{A section}     \section*{Another section}     \end{document}      (The macro `sectiontext` is used for clarity.) Also in the table of contents the sections are displayed as I want (except for the Contents itself, but I know how to fix that), and `hyperref` creates exactly the right links:               % Contents entry for the contents itself left out     \contentsline {section}{Section 2. A section}{1}{section.2}     \contentsline {section}{Section 3. Another section}{1}{section.3}      (Don't mind the Contents entry, it is numbered as the first section.) Note that starred sections must be used. Summarizing, there is no problem here. A problem arises when I use a completely analogous code for parts instead of sections:               \documentclass{article}     \usepackage[hidelinks]{hyperref}     \usepackage[explicit]{titlesec}     \newcommand\parttext{}     \titleformat{\part}%         {\refstepcounter{part}%         \renewcommand\parttext{Part \thepart. #1}%         \Huge\bfseries}         {}         {0pt}         {\parttext}         [\addcontentsline{toc}{part}{\parttext}]     \begin{document}     \tableofcontents     \part*{A part}     \part*{Another part}     \end{document}      Using this, the ToC file becomes:               % Contents entry for the contents itself left out     \contentsline {part}{Part I. A part}{1}{part.1}     \contentsline {part}{A part}{1}{part.1}     \contentsline {part}{Part II. Another part}{1}{part.2}     \contentsline {part}{Another part}{1}{part.2}      As you can see, `titlesec` creates an additional entry for each part. (This is also the case when I don't load `hyperref`.)   This is really strange, because it is almost the same code as for sections. How can I remove those entries?


title: Difference between dvipdf executables

text: What is the difference between the different dvipdf executables in \MiKTeX 2.8\miktex\bin               dvipdfm.exe     dvipdfmx.exe     dvipdft.exe


title: hyperlinks in biblatex

text: I'm making a `biblatex` style to solve an issue with the standard styles: if you have a reference with a `doi` field, it just prints the DOI number, with a clickable link if `hyperref` is enabled. But a DOI number is big and ugly; no one wants to see it. I want to make the link anchored behind the journal reference: beginning with the journal name and ending with the pages. So far I managed to make the following code:               \DeclareBibliographyDriver{article}{%       \usebibmacro{bibindex}%       \usebibmacro{begentry}%       \usebibmacro{author/translator+others}%       \setunit{\labelnamepunct}\newblock       \usebibmacro{title}%       \newunit       \printlist{language}%       \newunit\newblock       \usebibmacro{byauthor}%       \newunit\newblock       \usebibmacro{bytranslator+others}%       \newunit\newblock       \printfield{version}%       \newunit\newblock       \href{http://dx.doi.org/\thefield{doi}}{\usebibmacro{journal+issuetitle}%       \newunit\newblock       \usebibmacro{byeditor+others}%       \newunit\newblock       \usebibmacro{note+pages}}%       \newunit\newblock       \iftoggle{bbx:isbn}         {\printfield{issn}}         {}%       \newunit\newblock       \usebibmacro{eprint+url}%       \newunit\newblock       \usebibmacro{addendum+pubstate}%       \newunit\newblock       \usebibmacro{pageref}%       \usebibmacro{finentry}} ` But there's a problem: as the punctuation and spacing is actually produced by the first `\printfield` after `\newunit\newblock`, they are captured by the `\href`, and the result is very ugly. Is there a way to force them to be produced before the journal title, and the next one exactly after `\usebibmacro{note+pages}`? In other words, can I make the link environment to begin exactly at the journal name, and include the punctuation after `note+pages`?


title: Declaring document-wide font size outside of the document class command

text: I have a document, where I want two versions: one versions 10pt size and another version, 2 page to a side 12pt. So I currently have:               \documentclass[10pt,a4paper,oneside,openany,article]{memoir}      \newif\ifprintver     %\printvertrue          \ifprintver     \usepackage{pgfpages}       \pgfpagesuselayout{2 on 1}[a4paper,border shrink=1mm,landscape]     \fi      But I have to change the font size by hand. What can I put inside my `\if` that would change the font size document wide?


title: Nested foreach loop in TikZ

text: I would like to draw some vector fields on a triangle, and I am using nested `\foreach` loop to do that, however in the inner loop, you can't use the outer loop variable as the numeric range. For e.g. The following code does not work:               \begin{tikzpicture}     {\draw (0,0) -- ++(1,0) -- ++(-1,1) -- cycle;}     \foreach \x in {0,0.1,...,1}       \foreach \y in {0,0.1,...,1-\x}       {       \draw [->] (\x,\y)--(-1 + \x + 2*\y,-\y);       }     \end{tikzpicture}      Is there a way to do nested loop like this? Or I have to manually go through the loop for each `\y` which is `\x` dependent?


title: What are category codes?

text: Following on from this question, I'd like to ask a more general question: > What are category codes, and what can I achieve by changing them?


title: How to draw a separator between the columns of a matrix.

text: Is there a simple way to tell TikZ that I want a vertical line to separate the columns of a matrix? I know how to draw them manually, I am looking for an automatic solution, maybe using styles or something.


title: Where is the left-hand margin?

text: I'm working on the TikZ-from-TeX-SX package, specifically developing the code for putting equation numbering at places within a tikzpicture environment. To do this, I need to know where the text starts and stops horizontally on the page. From looking at a couple of diagrams, it seems that the left-hand margin is at: `\hoffset` + 1in + `\oddsidemargin` (but that `\oddsidemargin` worries me somewhat!) and to get the right-hand margin I add `\textwidth`. So the question: how do I reliably figure out where my left and right margins are (as measured from, say, the left-hand edge of the page)? If it matters, then I'd rather go for where TeX _thinks_ they are than where they _actually_ are. Namely, if there's some grouping in which the user has changed a load of lengths that fool TeX temporarily, but where that fooling is over before TeX actually puts anything on the page, then I'll join TeX in its dream-world. Also, I guess that knowing which page I'm on will be important. In which case, I'm allowed to have two TeX runs to figure it out since I already need two TeX runs for some other stuff in the package. ( **Note:** This question is _absolutely nothing to do with TikZ_ )


title: LaTeX font for 18th century English

text: I am busy typesetting a book for guntenberg.org and I would like to keep as far as possible close to the original style. The book was written in 1787. Here is an extract. ![scan from the book](http://i.stack.imgur.com/i2moa.png) Is there a similar font for LaTeX? I would particularly like to retain the ligatures and the long s i.e., "ſ" used as 's'.


title: Unequivocally force first reference to same page as the referred item?

text: ## Background Writing a manual using LyX. All tables, figures, and source listings are always referenced in the paragraph (or enumerated step) that immediately precedes them. The preamble to the manual includes `\raggedbottom` to prevent large vertical spaces between list items. ## Problem The problem can be seen here: ![](http://i.stack.imgur.com/Igh4u.png) The heading "1.1 Hierarchies" (no orphaned headings allowed) and the reference to "Figure 1.1" should be at the top of Page 2, on the same page as the image. ## LaTeX Code The images are added to floats so that they can have captions and cross- references. The LyX documents contain the following commands:               \float_placement H      I have tried changing the commands to:               \float_placement !htbp      These affect figure placement, but do nothing for the cross-references. ## LyX Code This is the code that LyX generates:               \begin{figure}[H]     \includegraphics{drawings/directory-hierarchy-01}          \caption{\label{fig:Example-Directory-Organization}Recommended Directory Organization}          \end{figure}      ## Possible Solutions   1. `\begin{samepage} ... \end{samepage}`   2. `\clearpage` The `\clearpage` option is possible when the manual is complete. The `samepage` environment needs tweaking. ## Question What needs to be added to the document preamble to force the first cross- reference to remain on the same page as the item that is being referenced? ## Related   * Force image and its caption to be on the same page   * Keeping tables/figures close to where they are mentioned   * Force figure placement in text


title: Start new page with each section

text: I would like to start each section on a new page. Is adding the following to my preamble this the preferred method, or a hack?               \let\stdsection\section     \renewcommand\section{\newpage\stdsection}


title: XML syntax highlighting does not work

text: How do I make comments highlighted in the form:               <!-- ======= Processing Root tag =======   -->      . This is not working.               \documentclass[11pt]{scrartcl}     \usepackage{listings, color}          \definecolor{gray}{rgb}{0.4,0.4,0.4}     \definecolor{darkblue}{rgb}{0.0,0.0,0.6}     \definecolor{cyan}{rgb}{0.0,0.6,0.6}          \lstloadlanguages{XML}          \lstdefinelanguage{XML}     {       morestring=[b]",       morestring=[s]{>}{<},       morecomment=[s]{<?}{?>},       morecomment=[s][\color{orange}]{<!--}{-->},       stringstyle=\color{black},       identifierstyle=\color{darkblue},       keywordstyle=\color{cyan},       morekeywords={xmlns,version,type}     }          \lstdefinestyle{listXML}{language=XML, extendedchars=true,  belowcaptionskip=5pt, xleftmargin=1.8em, xrightmargin=0.5em, numbers=left, numberstyle=\small\ttfamily\bf, frame=single, breaklines=true, breakatwhitespace=true, breakindent=0pt, emph={}, emphstyle=\color{red}, basicstyle=\small\ttfamily, columns=fullflexible, showstringspaces=false, commentstyle=\color{gray}\upshape}          \begin{document}      XSLT listing:      \begin{lstlisting}[style=listXML]     <?xml version="1.0" encoding="UTF-8"?>     <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"     version="1.0">     <!-- ======= Processing Root tag =======   -->     <xsl:template match="Root">         <TeXML>           <TeXML escape="0">                     \documentclass[14pt]{extarticle}                     \usepackage[T2A]{fontenc}                     \usepackage{pscyr}                     \usepackage[cp1251]{inputenc}                     \usepackage[english,russian]{babel}                     \usepackage{longtable}                     \usepackage[a4paper, left=30mm, right=15mm, top=20mm, bottom=20mm]{geometry}                     \usepackage{indentfirst}                     \usepackage{fixltx2e}              </TeXML>           <env name="document">             <cmd name="clearpage"/>             <xsl:apply-templates select="BasicInfo | StatusInfo"/>           </env>         </TeXML>       </xsl:template>       <!-- ======= Types of opening ====== -->       <xsl:template match="ConsDescr">         <cmd name="par"/>         <cmd name="textbf">     ....     \end{lstlisting}      \end{document}


title: Controlling paragraph spacing in LyX

text: I'm working on a rather large document for my university using LyX. I have been using the `report (KOMA-Script)` document class. According to my university's document specification each paragraph should have 6pts of spacing before and after it. Is there any simple way to do this? I've looked around all of the settings provided in LyX and haven't found a solution. And I'm very new to LaTeX, so I do not really understand how to go about this. Most of the document is written under the `Standard` Environment along with the appropriate chapters, sections and sub-sections. I need this `Standard Environment` text to have the correct paragraph spacing.


title: Is ADF Venturis based on an established typeface?

text: I'm just curious, since I've started using the venturis package with pdfLaTeX. I haven't been able to find much information about its provenance, unlike most of the other 'plug and play' LaTeX fonts. Thanks! _edit:_ I have already looked at ADF's website, but it doesn't give much detail. _edit 2:_ There's also the venturis package documentation, which indicates that the fonts "were developed by Hirwen Harendal of the Arkandis Digital Foundry." Maybe that's good enough as an answer. If they had based it on an older typeface, there would probably be some indication. Anyway, if nobody chimes in soon, this question can probably be closed.


title: How do you draw this prism in tikz/pstricks

text: ![enter image description here](http://i.stack.imgur.com/ZMEoQ.jpg) The numbers are in Persian (side SB=6 and angle SBA=60 degrees).


title: Set position for \maketitle in article

text: I want to create a handout to support a speech I have to give. Since I am only familiar with the `\documentclass{article}`, I wrote the following code:               \documentclass[12pt,a4paper]{article}     \usepackage[utf8x]{inputenc}     \PrerenderUnicode{äöüÄÖÜß}     \usepackage[ngerman]{babel}          \title{Some title}     \author{A. Uthor}     \date{2.7.2012}     \pagestyle{headings}     \begin{document}             \vspace*{-5pt}         \maketitle              \subsection*{Text \& Author}         \begin{itemize}             \item foobar         \end{itemize}          \end{document}      What I want is to have the title, author, date etc. directly on the upper edge of the paper. I understand, there will be more elegant ways to solve this, anyway: This `\vspace*{-5pt}` generates an empty page before the actual content of my handout. Why does it, how can I prevent it to do or (which would be best to know) what is the more elegant way?


title: How to make onecolumn/twocolumn parts in a document class?

text: I have a simple document class adapted from `article`, but independent (`.cls` file). The document is `twocolumn`, but when I add a title with                 \newcommand\maketitle{\begin{titlepage}%       \begin{center}%         {\LARGE \@title \par}%       \end{center}\par       \end{titlepage}%     }     \newenvironment{titlepage}         {%           \@restonecoltrue\onecolumn           \thispagestyle{empty}%           \setcounter{page}\@ne         }%      This makes the entire document `onecolumn`. How should I set the `titlepage` environment to be `onecolumn` without affecting the entire document?


title: How can I create a queuing node using tikz?

text: I am a newbie trying to recreate an M/M/1 queue in tikz and would really appreciate any help.![enter image description here](http://i.stack.imgur.com/SQSRo.png)


title: Error with \foreach in TikZ

text: In the MWE below               \documentclass{article}     \usepackage{tikz}     \begin{document}       \begin{tikzpicture}       \foreach \i in {0, 1, 2, 3}         \draw (\i, 0) rectangle +(0.5, 0.5);     %   \draw (\i, 1) rectangle +(0.5, 0.5);     %   Error if above line is uncommented:     %   ! Undefined control sequence.     %   \pgfmath@dimen@ ...men@@ #1=0.0pt\relax \pgfmath@       \end{tikzpicture}     \end{document}      the file compiles as is with pdflatex but gives an error as noted in MWE if the commented line is uncommented. I know I am doing something silly, but being an occasional user of TikZ, I am unsure what it is. Grateful for an explanation.


title: Including wraptable in itemize list

text: Attempting to use wraptable/wrapfigure from within a bulleted list results in the table going below the list, and not within the list itself. The text in the bulleted list should be paragraph-sized, but I've shortened them for the purpose of a MWE.               Preamble text     \begin{itemize}     \item Bullet 1     \item Bullet 2     \item Bullet 3          \begin{wraptable}{r}{4.3cm}     \begin{tabular}{|c|c|}     \hline       &\textbf{YYYYY}\\     \hline     HF/HF &XXXX         \\       HF/HF &XXXX         \\       HF/HF &XXXX         \\     \hline      \end{tabular}     \caption{Caption.}     \label{table: XXYY}     \end{wraptable}          \item Bullet 4     \item Bullet 5     \item Bullet 6     \end{itemize}          Prologue text      Usually the way I've worked around this is to place the wraptable just before `\begin{itemize}`, but this anchoring only works so far and is undesirable if the table needs to be, say on the second page of a two-page bulleted list.


title: TikZ Automata Make An Arrow To Nowhere

text: I have the following TikZ code:               \documentclass{standalone}      \usepackage{tikz}     \usetikzlibrary{arrows,automata}      \begin{document}         \begin{tikzpicture}[shorten >=1pt,node distance=2cm,>=stealth',thick]             \node[state] (1) {$1$};             \node[state,draw=none] (d1) [left of=1] {};             \draw [->] (1) to[loop above] node[auto] {} (1);             \draw [->] (1) to[bend left] node[auto] {} (d1);         \end{tikzpicture}     \end{document}      which produces this image: ![TikZ output](http://i.stack.imgur.com/jCYEq.png) Notice, that I've used a hidden node (d1) above in order to produce the nice arrow going to the left. The sadness of this is that now I have a big circle-sized empty space. I'd like to keep the arrow, I'd like the arrow to look the same, but I'd like to get rid of that empty space. Is there a way to draw the arrow without introducing the invisible node? Or is there a way to crop the figure? What's an elegant way to solve this problem? Thanks!


title: Prevent biblatex from printing the language name and use language only for hyphenation

text: In my `.bib`-file the `language` field is filled out in all entries. As MWE, they all look (as expected) like:               @Collection{Bakker:Grammar,       editor =   {Egbert J[an] Bakker},       gender =   {sm},       title =    {Grammar as Interpretation},       subtitle = {Greek Literature in its Linguistic Context},       shorttitle = {Grammar},       language = {english},       year =     1997,       series =   {Mnemosyne. Supplementum},       number =   171,       publisher = {Brill},       location ={Leiden AND New York AND K{\"o}ln}       }      To print the bibliogeaphy I created this file               \documentclass[paper=a4,twoside,ngerman]{scrartcl}     \usepackage[LGR,T1]{fontenc}     \usepackage[utf8]{inputenc}     \input{ix-utf8enc.dfu}     \usepackage{savesym}     \usepackage{gfsdidot,gfsporson}     \savesymbol{og}     \usepackage[main=ngerman,greek,italian,frenchb,english,british,german]{babel}     \usepackage[GlyphNames,boldLipsian]{teubner}     \savesymbol{breve}     \savesymbol{aa}     \usepackage[osf,sc]{mathpazo}     \restoresymbol{pplj}{breve}     \usepackage{courier}     \usepackage[scaled=.9]{DejaVuSansCondensed}     \Lipsiantrue     \ifFamily{pplj}{porson}     \usepackage{textcase}     \usepackage{textcomp}     \usepackage{xpatch}     \usepackage[pdftex]{hyperref}     \usepackage[style=german, german=guillemets]{csquotes}     \usepackage[style=philosophy-modern, sortlocale=de_DE,                 sorting=nyvt, autolang=hyphen, alldates=terse,                 annotation=true, useprefix=true, language=ngerman,                  datezeros=false,  bibencoding=auto, pagetracker=spread,                  publocformat= loccolonpub, backend=biber,                   citetracker = constrict, ibidtracker=constrict,                  opcittracker=constrict, idemtracker=constrict,                  relatedformat=parens,  clearlang=true]{biblatex}     \usepackage{moredefs}     \usepackage{lips}     \usepackage{ragged2e}     \usepackage[twothirds,nonegthinspace]{thinsp}     \usepackage[babel]{microtype}     \usepackage{fixltx2e}      After compiling it with `biber --bblsafechars mybib` and `latex mybib.tex` I get Bakker, Egbert J[an] 1997 _Hrsg._ , _Grammar as Interpretation_. Greek Literature in its Linguistic Context, Englisch, Mnemosyne. Supplementum 171, Leiden, New York und Köln: Brill. But I don't want LaTeX to print the name of the language ("Englisch" in the example above) but to use it _only for hyphenation_ , and though I've been trying everything I've been trying everything for several months, I only found ways either to put each entry in another `otherlanguage`-environment (by passing the option `babel=other` to biblatex) or suppress all infos about the language by putting all known languages in `\DeclareRedundantLanguages{ngerman}{german,english,french,italian,british,franconian,vedic,malaysian ...}` Another idea was to change the `language`-field in the `.bib`-file to `hyphenation`, but I still got the name of the language in each entry.


title: listing's lst@BeginWrite gobbles '->' and '=>' from input

text: I'm trying to write a package that takes verbatim input and appends it to several files. My current approach is based of off an answer by Martin Scharrer to a similar problem. The difficulty arises in that all occurrences of `=>` and `->` in the input are not output to `\jobname.xtr` nor to the desired files. That's to say, for               \begin{extract}[foo.bel]     a -> b     \end{extract}      we have `a b` output to the files instead of `a -> b`. I believe this may be due to an occurrence of               \lstset{literate=%                      {=>}{{$\Rightarrow~$}}2 %                      {->}{{$\rightarrow~$}}2 %     }      in the document's prelude, since it does not occur with `\lstset{literate={}}`. Short of unsetting the `literate` option for `lstset`, how does one fix this? The whole package is included below, since it only consists of the required macros (e.g. `appendtofile`, `apendfiletofile`, etc.) for the problematic `extract` environment at the bottom.               %% This is file 'extract.sty'     %%     %% Copyright (C) 2012 Ryan Kavanagh <rak@debian.org>     %%     %% This work may be distributed and/or modified under the     %% conditions of the LaTeX Project Public License, either version 1.3     %% of this license or (at your option) any later version.     %% The latest version of this license is in     %%   http://www.latex-project.org/lppl.txt     %% and version 1.3 or later is part of all distributions of LaTeX     %% version 2003/12/01 or later.     %%     %% This work has the LPPL maintenance status ``author-maintained''.     %%     %% \appendfile is by Martin Scharrer and was obtained from http://tex.stackexchange.com/a/12414/6128     %% It too is distributed under the LLPL 1.3c or later.     %     % Usage:     %     % \begin{extract}[a,b,c,d]     %   Some verbatim text to be displayed using whichever lstlisting configurations     %   are active. This text will be appended to the files a, b, c, and d.     %     %   To set the listings options precede `\begin{extract}[files]' with a     %   '\lstset{listings options here}'.     % \end{extract}     %     % \begin{extract*}     %   Some text to be appended to the files a, b, c, and d, but not displayed.     % \end{extract*}     %     \NeedsTeXFormat{LaTeX2e}[1995/12/01]     \ProvidesPackage{extract}[2012/05/29 v0.1 extracts lstlistings to files]          \RequirePackage{catchfile}     \RequirePackage{ifthen}     \RequirePackage{listings}     \RequirePackage{pstricks}          \def\recordfile#1{appendtofile@seen@#1}     \def\srecordfile#1{\expandafter\csname appendtofile@seen@#1\endcsname}     \def\defrecordfile#1{%       \expandafter\def\csname appendtofile@seen@#1\endcsname{defined}     }          \newwrite\appendwrite     \newcommand*\appendtofile[2]{%       \begingroup       \PackageWarning{extract}{\recordfile{#1}}       % ifundefined takes command name *without the slash*       \ifthenelse{\equal{\srecordfile{#1}}{defined}}{%         % Keep existing EOL         \CatchFileDef{\filecontent}{#1}{\endlinechar=`^^J\catcode\endlinechar=12\obeyspaces\relax}       }{%         % If we've not yet output to this file from this run, empty it         % Prevents having files with multiple concatenations of the same thing, one         % for each LaTeX run.         \global\defrecordfile{#1}         \let\filecontent\empty       }       \immediate\openout\appendwrite=#1\relax       \immediate\write\appendwrite{\filecontent #2}%       \immediate\closeout\appendwrite       \endgroup     }          \newread\appendingfile     \newcommand*\appendfiletofile[2]{%       \begingroup       % ifundefined takes command name *without the slash*       \ifthenelse{\equal{\srecordfile{#1}}{defined}}{%         % Keep existing EOL         \CatchFileDef{\filecontent}{#1}{\endlinechar=`^^J\catcode\endlinechar=12\obeyspaces\relax}       }{%         %\expandafter\ifcsundef{recordfile{#1}}{%         % If we've not yet output to this file from this run, empty it         % Prevents having files with multiple concatenations of the same thing, one         % for each LaTeX run.         \global\defrecordfile{#1}         \let\filecontent\empty       }       \openin\appendingfile=#2       \immediate\openout\appendwrite=#1\relax       \endlinechar-1       \immediate\write\appendwrite{\filecontent }       \loop \unless\ifeof\appendingfile           \readline\appendingfile to\line           \immediate\write\appendwrite{\line}       \repeat       \immediate\closeout\appendwrite       \immediate\closein\appendingfile       \endgroup     }          \newcommand\firstunempty[3]{%      \ifthenelse{\equal{#2}{}}{% Do nothing if empty      }{       #1#2#3      }     }          \newcommand\appendtofilewrapper[2]{\firstunempty{\appendtofile}{#1}{#2}}     \newcommand\appendfiletofilewrapper[2]{\firstunempty{\appendfiletofile}{#1}{#2}}          \lst@RequireAspects{writefile}     \lstnewenvironment{extract}[1][]{%       \ifthenelse{\equal{#1}{}}{%         \PackageError{extract}{extract with no filenames passed!}       }{}       \lst@BeginWriteFile{\jobname.xtr}%     }{%       \lst@EndWriteFile       \psforeach{\F}{#1,}{\appendfiletofilewrapper{\F}{{\jobname.xtr}}}       \lstinputlisting{\jobname.xtr}     }          \lstnewenvironment{extract*}[1][]{%       \ifthenelse{\equal{#1}{}}{%         \PackageError{extract}{extract* with no filenames passed!}       }{}       \lst@BeginWriteFile{\jobname.xtr}%     }{%       \lst@EndWriteFile       \psforeach{\F}{#1,}{\appendfiletofilewrapper{\F}{{\jobname.xtr}}}     }          \makeatother


title: Fitting background in Tikz

text: I need that the grey background also includes the labels T1 and T2               \documentclass{article}      \usepackage{tikz}     \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}     \begin{document}     \begin{tikzpicture}     \node [rectangle,draw] (set a) [label=right:$T_1$]                 {\textit{SET A}};     \node [rectangle,draw] (set b) [below=of set a, label=right:$T_2$] {\textit{SET B}};          \draw [->] (set a) to node [auto] {\textit{q}} (set b);          \begin{pgfonlayer}{background}     \node [fill=black!30,fit=(set a) (set b)] {};     \end{pgfonlayer}          \end{tikzpicture}     \end{document}


title: Write a \setcounter command to a file

text: I try to write a setcounter command to a file (using the `newfile` package) by something like the following               \addtostream{mystream}{\protect\setcounter{mycounter}{\myvariable}}      However, since the whole thing is protected, `\myvariable` isn't expanded and since it's value changes later in the document, the wrong value ends up in my counter. So, how can I 'unprotect' the variable here? ---EDIT--- Here's the minimal example:               \documentclass{article}          \usepackage{newfile}          \begin{document}     \newoutputstream{stream}     \openoutputfile{stream.file}{stream}          \newcounter{mycounter}     \setcounter{mycounter}{6}          \addtostream{stream}{%         \protect\setcounter{othercounter}{mycounter}%     }     \closeoutputstream{stream}          \end{document}      It outputs a file called `stream.file` with the content               \setcounter{othercounter}{mycounter}      but I want               \setcounter{othercounter}{6}


title: How to include the title of the website in bibliography

text: I want to include the website title in my bibliography. In the bibtex file (created by Zotero) the website title is stored as `journal`.               \RequirePackage{filecontents}          \begin{filecontents*}{mybib.bib}     @book{test1,         address = {London},         url = {www.jstor.com/somearticle.html},         urldate = {2013-10-29},         title = {Cyberprotest: {New} media, citizens, and social movements},         publisher = {Routledge},         editor = {van de Donk, Wim B. H. J.},         year = {2004}     }     @misc{test2,         title = {This is the title of the webpage},         url = {www.blog.com},         urldate = {2013-08-29},         journal = {This is the title of the website},         month = feb,         year = {2009}     }     }     \end{filecontents*}          \documentclass[a4paper]{article}               % Set the values for the bibliography     \usepackage[         style=apa,         backend=biber,         isbn=false,         url=false,         doi=false,         eprint=false,         hyperref=true,         backref=false,         firstinits=false,     ]{biblatex}          % Remove series & month     \AtEveryBibitem{       \clearfield{series}       \clearfield{labelmonth}       \clearfield{edition}     }          % Set language     \usepackage[british]{babel}     \DeclareLanguageMapping{british}{british-apa}          \addbibresource{mybib.bib}          \begin{document}          \cite{test1}           \cite{test2}          \printbibliography     \end{document}      which produces ![enter image description here](http://i.stack.imgur.com/e73rX.png)


title: Why am I getting the PGF Math Error: Unknown function `getargs'?

text: I'm using TiKZ 2.10 to create a document that includes a tikzpicture with `\pgfmathmin` (yes, I also have `\usetikzlibrary{calc}`). Previously the document compiled fine but now I get an error like: > Package PGF Math Error: Unknown function `getargs' (in 'getargs(3,4)') I can eliminate this by replacing the occurrence of `\pgfmathmin{3}{4}` with `\pgfmathparse{min(3,4)}` but I'm not sure why the former no longer works. Am I misusing the `\pgfmathmin` command? EDIT: A minimal example to compile (with a version of TiKZ approximately 2.10, the version included in miktex 2.9)               \documentclass{minimal}     \usepackage{tikz}     \begin{document}     \pgfmathmin{1}{2} \pgfmathresult % This yields an error message about getargs     \end{document}


title: How do I use the "enumerate mini template" of the beamer class?

text: I'm working on a document and tried to change the way enumeration items look with the line               \setbeamertemplate{enumerate mini template}{i)}      found in the documentation BeamerUserGuide on page 114. Whatever I tried, I did not work. Okay - for now I got a workaround - but I'm interested, how to use that template. Any ideas?


title: Parse a file with a regexp and return first match

text: I need to write a command that searches a file for a string that matches a certain regexp, and inserts that string. I know how to parse a string of text using a regex with               \usepackage{l3regex}     \ExplSyntaxOn     \cs_new_protected:Npn \mycom #1       {         \tl_set:Nn \l_tmpa_tl {#1}         \regex_replace_all:nnN { THE-REGEXP } { THE-REPLACEMENT } \l_tmpa_tl         \tl_use:N \l_tmpa_tl       }     \ExplSyntaxOff      but I don't know how I can use it to parse the contents of a file. I tried replacing `{#1}` with `{\input{#1}}`, but it didn't work (the `\input` was simply considered part of the string).


title: Is combination of markdown and LaTeX a future trend of LaTeX development?

text: I think markdown language is encroaching on the market of LaTeX, could latex developers share about your opinions on this language? Do you think a kind of combination of markdown and LaTeX be a good idea? For me, when I use Mou on my mac, I found some markdown editors are able to insert images quite nicely, so I was thinking if someday somehow it could even live preview the flowchart (including the TikZ in markdown), it would make life much easier. Isn't that the dream of original LaTeX project?


title: Renewcommand not working

text: I have a tex file compiling with no errors or warnings. But when I add this line:               \newcommand{\mag}{randomstr}      I get this error:               LaTeX Error: Command \mag already defined. [\newcommand{\mag}{randomstr}]      So, I try to change it to this:               \renewcommand{\mag}{randomstr}      but get all of these errors too:               report.tex:32: Missing number, treated as zero. [\begin{document}]     report.tex:32: Missing = inserted for \ifnum. [\begin{document}]     report.tex:32: Missing number, treated as zero. [\begin{document}]     report.tex:32: Missing $ inserted. [\begin{document}]     report.tex:32: Missing number, treated as zero. [\begin{document}]     report.tex:32: Missing = inserted for \ifnum. [\begin{document}]     report.tex:32: Missing number, treated as zero. [\begin{document}]     report.tex:32: You can't use `the letter r' after \the. [\begin{document}]     report.tex:33: Missing $ inserted. []      I have also tried the `\def` directive, but with no result. Any idea how to fix this? Thanks.


title: Math in table mixed with text and proper alignment

text: I have some problems using tabular environment mixed with math formulars, multiple lines and alignment. I have this code:               \begin{tabular}[!ht]{p{5cm}p{5cm}p{5cm}}         \toprule         Col1 & Col2 & Col3 \\         \midrule             Text with a\\             linebreak             &             \[                 A = B                 = C             \]             & Text with wrong vertical alignment \\         \bottomrule     \end{tabular}      Which produces this latex ![rendered table with math environment and wrong alignment](http://i.stack.imgur.com/UJFRk.png) As you can see, there are several problems with this:   * Col2 and A = B = C is not aligned horizontal   * A = B = C is not at the top of the cell   * = C should be in the next line (I need multiline equations)   * I can't use `&= C` to align the equal signs when using multiline equations   * "Text with wrong..." is also not at the top of the cell   * I have to specify every single column with its width in cm. Is there a way to only specify one width and let the other columns fit into the left space?   * I have to repeat the `\\[` and `\\]` for every line. I found sth with predefined commands inside the `{p{5cm}p{5cm}p{5cm}}`, where you can add automatically a math env to the cell. But it hasn't worked I found several table environments, like threeparttable, table, tabular... I'm a little bit confused which one to use, and I don't know how to achieve the layout I want to have (and I don't know which packages to use). So maybe someone can help me. Kind regards.


title: Loop Over Grid File

text: I have a grid file with data such as:               5     4     0 0 0 0 0     0 1 1 2 0     0 2 2 1 0     3 0 0 3 1      where 5 is the width of the grid, 4 is the height, and each number in the grid corresponds to an elevation. I can cut out the 5 and 4 if necessary. I'd like to display this as a grid of coloured squares in LaTeX with the numbers printed in the center of each square. I know how to draw rectangles and labels with TikZ, so I think I can figure that part out. It's reading in the data (and converting the numbers to a colour) that is stumping me. Any thoughts on how I could do it?


title: fancyhdr headings , how to remove the number of the section

text: I'm French so it's not easy to explain my problem but I'll try. I use fancyhdr to make my own headings (book class). I want the section's title at the right of the heading in small caps, and only in odds pages. But when I print it I can read e.g., "2. DERIVATION" which is what I was expecting. My question is: how can I remove the number of the section, so that I can obtain just "DERIVATION" and not "2.DERIVATION"? I wrote :               \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhead{} % clear all header fields     \fancyhead[LE]{\footnotesize{\scshape\nouppercase{\leftmark}}}     \fancyhead[RO]{\footnotesize{\scshape\nouppercase{\rightmark}}}     \fancyfoot{} % clear all footer fields     \fancyfoot[LE,RO]{\thepage}     \renewcommand{\headrulewidth}{0 pt}     \renewcommand{\footrulewidth}{0 pt}      `\leftmark` is for chapter and is OK. The problem is with the `\rightmark`, how can I redefine it?


title: Different citation colour for page number

text: I try to cite a specific page in LaTeX using the following command: `\cite[p.~42]{Friedberg1995}`. I use `colorlinks` and I have set a blue colour for my citations. After the compilation takes place I get the following result. **Friedberg and Hunt** ( **1995** , p. 42) I want you to imagine that in the aforementioned, what is in bold is actually blue. The point is why `[p. 42]` isn't in blue colour as well. Here is a minimal example:               \documentclass[hidelinks,parskip=full,12pt]{article}     \usepackage[utf8x]{inputenc}     \usepackage{booktabs}                         \usepackage{multirow}                         \usepackage{booktabs,xcolor,siunitx}         \definecolor{lightgray}{gray}{0.9}           \usepackage{threeparttable}                   \usepackage{threeparttablex}                  \usepackage{colortbl}                        \usepackage{longtable}                             \usepackage[font=small,format=plain,labelfont=bf,up,textfont=normal,up]{caption}     \usepackage{rotate}     \usepackage{ucs}      \usepackage[leqno]{amsmath}                   \usepackage{amsfonts, amssymb, amsthm}     \usepackage{makeidx}     \usepackage{graphicx}     \usepackage{lscape}     \usepackage{rotating}     \usepackage[left=1in,right=1in, top=1in, bottom=1in]{geometry}     \usepackage[sort]{natbib}           %%%%%%%%%%%%%%%%%%%%%%%%%%%%  Customized citation style  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \bibpunct{(}{)}{;}{a}{,}{,~}                  \usepackage[hyperfootnotes = true]{hyperref}      \hypersetup{colorlinks,                       linkcolor=red,                                    filecolor=darkgreen,      urlcolor=darkred,      citecolor=blue}          \usepackage{paralist}     \usepackage{enumitem}     \setlist{itemsep=2pt,parsep=2pt,topsep=15pt}          \usepackage{setspace}               \title{My title}          \author{Cicero \\ \textit{Roman Empire}}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    DOCUMENT BEGINS    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}     \maketitle          {\doublespacing          \begin{center}     \begin{minipage}[c]{13cm}     ``\textit{After World War I, laws were passed severely limiting    immigration. Only a trickle of immigrants has been admitted since then ... By keeping labor supply down, immigration policy tends to keep wages high.}''     \end{minipage}     \end{center}               As it is pointed out by \citet[p.~42]{Friedberg1995} ...               }     \newpage     \bibliographystyle{chicagoa}           \bibliography{mybib.bib}               \end{document}          }      and the bibliography is:               @ARTICLE{Friedberg1995,       author = {Rachel M. Friedberg and Jennifer Hunt},       title = {{The Impact of Immigrants on Host Country Wages, Employment and Growth}},       journal = {Journal of Economic Perspectives},       year = {1995},       volume = {9},       pages = {23-44},       number = {2},       month = {Spring},       timestamp = {2013.06.19}     }


title: What does the draft mode change?

text: I wonder which changes are made by the `draft` option? That means what will be changed by calling it as global class option (`\documentclass[draft]{<class>}`) or locally for a single package if it is available (`\usepackage[draft]){<package>}`. * * * **Note**   I know that this depends on the loaded packages and if they react on the `draft` option or not. But I thought it could be helpful to have a overview which packages do what. I suggest the answers to be **CW** and using this layout               Package/Class: `name`       Changes          - one     - two          Has `final` option too: yes/no      If you like we can discuss the layout in meta …


title: How to make equal width columns?

text: Based on Leo's answer but I removed one column and replaced the `\big)` with a vertical rule. Now I want to make all columns have the same width. How to do this? ![enter image description here](http://i.stack.imgur.com/YjZO0.png)               \documentclass{article}     \usepackage{amssymb}          \begin{document}          \[     x^3 - x + 1 = (x-1)(x^2+x) + 1 \in \mathbb{F}_3[x]     \]          \[     \renewcommand\arraystretch{1.2}     \begin{array}{*{6}{r}}     &         &             &                 1&                     1&                         0\\\cline{3-6}     1&         -1&             \multicolumn{1}{|r}{1}&                                     0&                                         -1&                                             1\\     &         &              1&                 -1&                     &                         \\\cline{3-5}     &         &             &                 1&                     -1&                         \\     &         &             &                 1&                     -1&                         \\\cline{4-6}     &         &             &                 &                     &                         1\\     \end{array}     \]          \end{document}      I got the solution by using `\begin{array}{*{6}{>{\hfill}m{1cm}}}`, but is there any other solution?


title: Mangling listings source code

text: I would like to make it harder for students to just copy/paste code listings from the PDF. How to achieve this? I want them to actually understand the code, close the book, and write from their minds. Currently, lstlisting is setup like this               \lstset{%         basicstyle=\footnotesize\ttfamily, % Standardschrift         numbers=left,               % Ort der Zeilennummern         numberstyle=\tiny,          % Stil der Zeilennummern         numbersep=5pt,              % Abstand der Nummern zum Text         tabsize=4,                  % Groesse von Tabs         extendedchars=true,         %         breaklines=true,            % Zeilen werden Umgebrochen         frame=b,                  showspaces=false,           % Leerzeichen anzeigen ?         showtabs=false,             % Tabs anzeigen ?         xleftmargin=17pt,         showstringspaces=false      % Leerzeichen in Strings anzeigen ?                 keywordstyle=\color{Red},         stringstyle=\color{OliveGreen},         identifierstyle=\color{Blue},         frame=shadowbox,         rulesepcolor=\color{Gray},         escapeinside={\%*}{*)},         % if you want to add a comment within your code         mathescape=false,         columns=flexible     }


title: Problematic space between S and its subscript

text: Though I have solved this problem, I still want to hear the LaTeX community on this point. I also need to know if I have misunderstood anything, or if my fix is wrong. I have the following mathematical expression:               S_p = \bigcup_{c \in C_p}^{\abs{C_p}} L_c \enspace \text{,}      which results in this: ![enter image description here](http://i.stack.imgur.com/pIb4V.gif) Not the annoying space between capital S and its subscript. It figured out a way to avoid that by using a negative thin space `\\!`:               {S\!}_p = \bigcup_{c \in C_p}^{\abs{C_p}} L_c \enspace \text{,}      which gives me: ![enter image description here](http://i.stack.imgur.com/CbGwj.gif) And the problem seems solved. Both graphics are screenshots from a zoomed PDF document in Acrobat Reader X. I am using the elsarticle class (Elsevier's LaTeX class). The blue text was marked with the mouse. Questions:   * Is my fix using the negative thin space correct?   * Or is there a better way?   * Is this a known problem with S and its subscript in general, or is is dependent on class used? I have not tried using the standard article class yet. I have studied What is the right way to use the `\!` spacing command? and it seems to be an acceptable way to fine tune mathematical expression.


title: Garamond kills bold Fonts

text: _[Cross posted from latex-community.org]_ When I use Garamond fonts, everything becomes immediately lighter, in particular the \begin{description} … \end{description} parts. With Garamond:               \documentclass[10pt]{book}     \usepackage[OT1]{fontenc}     \usepackage{pslatex}     \usepackage{garamond}          \begin{document}     \chapter{Introduction and Ideas}     \begin{description}     \item[Item 1]     \item[Item 2]     \end{description}          \section{More Ideas}          \end{document}      Without Garamond:               \documentclass[10pt]{book}          %\usepackage[OT1]{fontenc}     %\usepackage{pslatex}     %\usepackage{garamond}          \begin{document}     \chapter{Introduction and Ideas}     \begin{description}     \item[Item 1]     \item[Item 2]     \end{description}          \section{More Ideas}          \end{document}      How can I get around this? Thanks


title: Suppress latex output in scripts

text: I run a sequence of latex commands from a bash script. Since the latex output polutes the scripts own output I would like to suppress it. But sending the output to /dev/null will make the latex process inaccesible for the user. Hence it could be killed only manually in case there is a compilation error. How can I control latex from within the script. I.e. suppress the output and exit the process in case of error.


title: Multiple citations with pages using BibLaTeX

text: How can I do multiple citations with page numbers using bibLaTeX/biber? I have tried `\cite[2,3,4]{ref1,ref2,ref3,ref4}` but it doesn't work.


title: Finding the corresponding tex file/line from pdf

text: I am working on a pretty big latex project (a book) and I'd like to be able to quickly find the corresponding .tex file and line number, when having the resulting PDF in front of me. Being open-source, people come with "content fixes", yet they tell me things about the content. I am able to find it rapidly in the PDF, but it's harder to find where in the .tex source the paragraph I'm interested in is. The reported lines in the pdf do not need to be precise, and for each and every line in the source. An orientative line number per paragraph would suffice. Are there any solutions to this?


title: BibTeX Warning----empty title

text: I'm trying to compile my bib references with `natbib` and `\bibliographystyle{nature}`. To my uttermost surprise BibTeX reports that some of the entries have an empty title, while IMHO the title is not empty, e.g., on the following bibliographic entries:               @INPROCEEDINGS{WuWangZhaoMa,     author={Wu Kehe and Wang Zhuo and Zhao Xing and Ma Gang},     booktitle={Advanced Computer Theory and Engineering (ICACTE), 2010 3rd International Conference on},     title={Design and implementation of the monitoring system for EJB applications based on interceptors},     year={2010},     month=aug,     volume={4},     pages={V4-5--V4-9},     ISSN={2154-7491},     location = {Chengdu, China}     }      and               @inproceedings{DBLP:conf/sigdoc/TilleyH03,       author    = {Scott R. Tilley and                    Shihong Huang},       title     = "A qualitative assessment of the efficacy of {UML} diagrams                    as a form of graphical documentation in aiding program understanding",       booktitle = {SIGDOC},       year      = {2003},       pages     = {184--191},       ee        = {http://doi.acm.org/10.1145/944868.944908},       crossref  = {DBLP:conf/sigdoc/2003},       bibsource = {DBLP, http://dblp.uni-trier.de}     }     @proceedings{DBLP:conf/sigdoc/2003,       editor    = {Susan B. Jones and                    David G. Novick},       title     = {Proceedings of the 21st annual international conference                    on Documentation, SIGDOC 2003, San Francisco, CA, USA, October                    12-15, 2003},       booktitle = {SIGDOC},       publisher = {ACM},       year      = {2003},       isbn      = {1-58113-696-X},       bibsource = {DBLP, http://dblp.uni-trier.de}     }


title: defining Postscript procedures with global scope

text: How can I define a Postscript procedure whose definition survives page breaks, that is, which has global scope? Here is a trivial example, where the procedure invocations after a `\newpage` fail during `ps2pdf` conversion:               \documentclass{article}     \usepackage{pstricks}          \begin{document}     test     \pstVerb{/printany {256 string cvs print (\string\n) print} def}          \pstVerb{12345 printany}  % works     \pstVerb{(john) printany} % works          \newpage     test     \pstVerb{12345 printany}  % printany undefined     \pstVerb{(john) printany} % --"--          \end{document}


title: Sentence case for titles in biblatex

text: I'd like to have the titles of articles in Biblatex in sentence case (first word capitialized, the rest lowercase, override with {}) as is the default in Bibtex. I tried:               \DeclareFieldFormat{titlecase}{\MakeSentenceCase{#1}}      However it also makes converts other fields into sentence case, such as the booktile:               [Pai99] P Paillier. “ Public-key cryptosystems based on composite degree residuosity classes”. Eurocrypt. 1999       I'd like:               [Pai99] P Paillier. “ Public-key cryptosystems based on composite degree residuosity classes”. EUROCRYPT. 1999      (This assumes that booktitle is EUROCRYPT in the .bib file) Is there anyway to do this, short of adding {} to each booktitle entry?


title: tex capacity exceeded when including url in .bib file

text: When I include url in the .bib file latex throws the error:   Tex capacity exceeded, sorry[save size=5000] Do you have any idea why?   Below I paste the package I use and one reference               \documentclass[english]{article}     \usepackage[utf8]{inputenc} %write accent without the \ [' ` ^]      \usepackage{lmodern,textcomp} % + the above package use euro directly     \usepackage{babel}     \usepackage{harvard}     \bibliographystyle{agsm}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{setspace}     \usepackage{hyperref}     \usepackage[margin=1.5in]{geometry}     %\usepackage{times}          \begin{document}          as in \cite{AhlinTownsend2007}, blah, blah blah...     \cite{DufloBanerjee2013}          \bibliography{test}          \end{document}      and the test.bib file               @article {AhlinTownsend2007,     author = {Ahlin, Christian and Townsend, Robert M.},     title = {Using Repayment Data to Test Across Models of Joint Liability Lending*},     journal = {The Economic Journal},     volume = {117},     publisher = {Blackwell Publishing Ltd},     number = {517},     pages = {F11-F51},     issn = {1468-0297},     doi = {10.1111/j.1468-0297.2007.02014.x},     url = {http://dx.doi.org/10.1111/j.1468-0297.2007.02014.x},     year = {2007},     }          @techreport{DufloBanerjee2013,     title={The miracle of microfinance? Evidence from a randomized evaluation},     author={Duflo, Esther and Banerjee, Abhijit and Glennerster, Rachel and Kinnan, Cynthia G},     year={2013},     institution={National Bureau of Economic Research},          }


title: List of figures and list of tables overlaps figure/table indices with proceeding text when double figures are used

text: I have a list of figures, automatically generated using the `\listoffigures` command, The list is three numbers deep, and when i get double figures in one, it overlaps with text e.g. 1.2.12 My figure caption Only the last "2" in the number and "M" from "My" overlap one another. How can I fix this please. I'm using a class that redefines `\listoffigures` but I don't think it does anything. The problem seems to be because the system doesn't know to modify the lot of lof when \numberwithin{figure}{section} i gather that the `tocloft` package might be able to fix this for me but it seems like overkill for such a simple problem. Any ideas? thanks Here's an example code:               \documentclass{book}     \usepackage{amsmath}     %\usepackage[titles]{tocloft}               \numberwithin{figure}{section}               \begin{document}          \listoffigures          \chapter{my first chapter}          \section{hello}          \begin{figure}         \caption{stuff}         \label{fig:first1}     \end{figure}          \begin{figure}         \caption{stuff}         \label{fig:first2}     \end{figure}          \begin{figure}         \caption{stuff}         \label{fig:first3}     \end{figure}          \begin{figure}         \caption{stuff}         \label{fig:first4}     \end{figure}          \begin{figure}         \caption{stuff}         \label{fig:first5}     \end{figure}          \begin{figure}         \caption{stuff}         \label{fig:first6}     \end{figure}          \begin{figure}         \caption{stuff}         \label{fig:first7}     \end{figure}          \begin{figure}         \caption{stuff}         \label{fig:first8}     \end{figure}          \begin{figure}         \caption{stuff}         \label{fig:first9}     \end{figure}          \begin{figure}         \caption{stuff}         \label{fig:first10}     \end{figure}          \begin{figure}         \caption{stuff}         \label{fig:first11}     \end{figure}               \end{document}


title: How to set the distance between to subfigures each with a tikz-pic inside?

text: My code is as follows. I want to increase the distance between the two diagrams:               \PassOptionsToPackage{usenames,dvipsnames,svgnames,table}{xcolor}          \documentclass [11pt,a4paper] {article}     \usepackage{amsmath,tikz}     \usetikzlibrary{patterns,matrix,arrows,positioning}     \begin{document}     \begin{figure}[!htb]     \centering     \subfigure[Before]     {%     \begin{tikzpicture}[->,       >=stealth',       shorten >=1pt,       auto,       node distance=3cm,       thick,       main node/.style={                   circle,                   fill=RoyalBlue!90!green!80,                   draw,                   font=\sffamily\Large\bfseries}      ]       \node[main node,label=below:Cause]             (y)  {$Y$};       \node[main node,label=below:Effect,right of=y] (x)  {$X$};       \node[above=1cm of x]                              (nx) {$N_X$};       \node[above=1cm of y]                              (ny) {$N_Y$};            \path (y)  edge[right] node[below right,font=\sffamily\small] {} (x);     %  \path (x)  edge[bend right,orange]node[above,font=\sffamily\small,orange]{}(y);       \path (nx) edge[blue] node[left,font=\sffamily\small,orange] {} (x);       \path (ny) edge[blue] (y);     \end{tikzpicture}\label{fig:FCM}     %\caption{General Functional Causal Model for two 1D variables}     }     \subfigure[After]     {%     \begin{tikzpicture}[->,       >=stealth',       shorten >=1pt,       auto,       node distance=3cm,       thick,       main node/.style={                   circle,                   fill=RoyalBlue!90!green!80,                   draw,                   font=\sffamily\Large\bfseries}      ]       \node[main node,label=below:Cause]             (y)  {$Y$};       \node[main node,label=below:Effect,right of=y] (x)  {$X$};            \path (y)  edge[right] node[below right,font=\sffamily\small] {$\varphi$} (x);       \path (x)  edge[bend right,orange] node[above,font=\sffamily\small,color=orange] {$\varphi^{-1}$} (y);     \end{tikzpicture}     }     \end{figure}     \end{document}


title: plot 1d curves in 3d space with nice looking intersections

text: I am trying to draw multiple colored one-dimensional parametric curves in three dimensional euclidean space. The curves themselves do not intersect in 3d, but sometimes their projections intersect when projected into 2d for visualization. In these cases, I would like the color at the intersection to be the color of the curve 'in front.' The problem is that the curves are not strictly ordered (they could be knot- like) so I have some variant of the painter's problem, except a bit simpler because all my objects are one-dimensional and they do not intersect in 3d. Is there a nice LaTeX or related thing that could help me with this? I've looked at examples for asymptote and some other ps and tikz packages but I can't find a nice example where this is done automatically. Currently my work-around is to break all of the curves into tiny segments and then depth sort. This works as long as the segments are small relative to the minimum distance between curves in 3d, I think. But it is a hack and is ugly.


title: Displaying (source)Code in research article

text: I have this urgent need to display two pieces of code side by side for comparison in my article. Displaying a code, I've couple of requirement   1. Should indent properly   2. Output should be syntax highlighted   3. Should be as automatic as possible in handling long lines of code (that means, wrapping the lines if necessary)    4. Code should be easily copied from output pdf   5. Code can be arbitrarily long, i.e. spanning over many pages, so automatic handling of such thing would be preferred  I have explored two choices briefly, Verbatim and listing along with minipage. They sort of work alright! But only the output is absolutely hideous. What is a good setting for any of the two, which atleast would produce good looking output. For automation part, I can still write python scripts that would allow me to do that. If any of you know example of research articles that renders code in it beautifully- I'd appreciate if you share it with me. Keep in mind that I don't use Latex often.


title: Numbering and cross-references

text: I am writing a large document (guess what) with chapter, section, subsection, subsubsection (and paragrph). I have changed the numbering to fit my taste:               \setcounter{secnumdepth}{3} % Number subsubsections     \def\thechapter       {\Roman{chapter}}     \def\thesection       {\arabic{section}}     \def\thesubsection    {\thesection.\arabic{subsection}}     \def\thesubsubsection {\thesubsection.\arabic{subsubsection}}      This is nice but I have a problem. Suppose that in chapter II, I write a reference to section I.2. It will be rendered as 2 (ie, no chapter information). Is there a way to deal with that? Thanks in advance. P.S.: for details I use hyperref (the link points to the right section) and autoref.


title: MiKTeX: [...] does not seem to be a local package repository

text: I used MiKTeX 2.9 on windows.   I have downloaded a package I want to install from the internet (manually, not through MiKTeX). The archive (`*.lmza`) containing the package was saved to a directory on my `C:\` drive.   Through MikTeX -> Maintenance -> Settings -> Packages -> Change...   I can select the directory in which I have saved the archive containing the package.   However, if I choose `Packages shall be installed from a directory` and choose the location of the package, I get this error message:   `C:\my\package\is\here does not seem to be a local package repository.`   What does it take for a directory/folder to become a `local package repository`?


title: How can I highlight a freestanding regexp in string style?

text: I'm using listings to format a piece of JavaScript code, and I met a problem for the following code:               ...     regex = /abc/;     ...     ratio = 1.0/2.0;     ...      I want the regex is highlighted as a string, but if I use the following definition, the division sign will be recognized as a beginning of a string:               \lstdefinelanguage{JavaScript}{     morekeywords={break,case,catch,continue,debugger,default,delete,do,else,finally,for,function,if,in,instanceof,new,return,switch,this,throw,try,typeof,var,void,while,with},     morekeywords=[2]{class,enum,export,extends,import,super,implements,interface,let,package,private,protected,public,static,yield},     morekeywords=[3]{prototype},     morestring=[b]{"},     morestring=[b]{'},     morestring=[b]{/},     morecomment=[l]{//},     morecomment=[s]{/*}{*/}     }      How can I fix this? Can I escape the division sign in some way? * * * **Source here:**               \documentclass{article}          \usepackage{tikz}     \usepackage{listings}          \begin{document}          \lstset{     basicstyle=\footnotesize\ttfamily\bfseries\color{cyan!50!black},     keywordstyle=\color{green!50!black},     keywordstyle=[2]\color{red!50!black},     stringstyle=\color{yellow!80!black},     commentstyle=\itshape\color{gray!50!white},     identifierstyle=\color{blue!80!white},     escapeinside={(*@}{@*)}}          \lstdefinelanguage{JavaScript}{     morekeywords={break,case,catch,continue,debugger,default,delete,do,else,finally,for,function,if,in,instanceof,new,return,switch,this,throw,try,typeof,var,void,while,with},     morekeywords=[2]{class,enum,export,extends,import,super,implements,interface,let,package,private,protected,public,static,yield},     morekeywords=[3]{prototype},     morestring=[b]{"},     morestring=[b]{'},     morestring=[b]{/},     morecomment=[l]{//},     morecomment=[s]{/*}{*/}}          \begin{lstlisting}[language=JavaScript]     function foo()     {         // comments         var regex = /abc/;         var ratio = 1.0/2.0;         return 0;     }     \end{lstlisting}          \end{document}


title: How can I remove the underline on my coverletter?

text: I'm following along here: http://www.kindoblue.nl/articles/cover-letter-part3/               \documentclass[standard,a4paper, pagesize,backaddress=plain]{scrlttr2}         %\usepackage[english]{babel}      \begin{document}         \begin{letter}{             Title   \\%             Company \\%             Adress      \\%             City, State Zip     }         \setkomavar{subject}{Cover Letter}         \opening{Dear Recruiter,}         My name is John bla bla bla ...         \closing{Regards}         \end{letter}         \end{document}      * * * This is what I have, but I get the address from standard.lco to print out like this: Name, Address, City, State Zip, USA However, it is underlined... How do I make it so it's like the author of this tutorial? * * * Here is the `.lco` file I am using:               \ProvidesFile{standard.lco}[%             2002/07/09 v0.9a LaTeX2e unsupported letter-class-option]         %\usepackage[english]{babel}         \usepackage{fontspec}     \usepackage{fix-cm}      \usepackage{marvosym}     % ==================================================         % PERSONAL DATA     % ==================================================     \setkomavar{fromname}{name}     \setkomavar{fromaddress}{address\\city, state zip\\USA}     \setkomavar{fromphone}{phone number}     \setkomavar{fromemail}{email address}     \setkomavar{place}{city}     \setkomavar{signature}{name}     % ==================================================     % FORMATTING     % ==================================================     \defaultfontfeatures{Mapping=tex-text}     \setmainfont{Tahoma}     \setsansfont{Verdana}     \renewcommand{\normalsize}{\fontsize{11}{16}\selectfont}     \newcommand\myname{%         {\addfontfeature{LetterSpace=15.0}\fontsize{36}{36}\selectfont\scshape \usekomavar{fromname}}     }     \newcommand\mytitle{%         \fontsize{21}{21}\selectfont\scshape occupation     }     \setkomavar{firsthead}{         \centering             \myname\\[5mm]             \mytitle     }     \setkomavar{firstfoot}{         \centering         \addfontfeature{LetterSpace=20.0}\scshape         {\renewcommand{\\}{\ {\large\textperiodcentered}\ }         \usekomavar{fromaddress}\\         {\Large\Letter} \usekomavar{fromemail} \ {\Large\Telefon} \usekomavar{fromphone}     }        \endinput      * * * At the current time, I get the following error:               Runaway argument?     { \centering \addfontfeature {LetterSpace=20.0}\scshape {\renewcommand \ETC.     ! File ended while scanning use of \@@setkomavar.     <inserted text>                      \par      l.3 \begin               {document}     ?       Why does this error occur?


title: How to install "vanilla" TeXLive on Debian or Ubuntu?

text: Debian and Ubuntu have very good texlive packaging. But I'd like to use `tlmgr` to have a more fine-grained control about upgrades and which packages I want to be installed. So how do I install "vanilla" TeXLive on Debian/Ubuntu? Also how do I make `dpkg` aware that I have TeXLive installed? BTW: Debian & Ubuntu have TeXLive 2012 now ;-)


title: can't find tlmgr

text: I have quite some problems installing TeXlive on Kubuntu. I used the installation file provided by tug.org and followed the quick installation guide but skipped those steps **Interfaces to the installer: text, GUI, batch** and **Choosing a download host** since I worked with               ./install-tl       Afterwards I set my `PATH` and tried               tlmgr update --all      as well as               tlmgr --gui      followed by > couldn't find »tlmgr«, did you mean: ... (I don't know the English version of this). Then I thought, maybe TeXlive is not installed properly, so I tried               latex small2e      resulting in: > warning: kpathsea: configuration file texmf.cnf not found in these > directories: /usr/share/texmf/web2c:/usr/share/texmf- > texlive/web2c:/usr/local/share/texmf/web2c. This is pdfTeX, Version > 3.1415926-1.40.10 (TeX Live 2009/Debian) > > kpathsea: Running mktexfmt latex.fmt /usr/bin/mktexfmt: 975: .: Can't open > /usr/share/texlive-bin/debianize-fmtutil I can't find the format file > `latex.fmt'! What the heck is going on. I don't have a clue. BTW I am really new to Linux.


title: How to reinstall TeX Live 2013 on ubuntu

text: I would like to ask how can I reinstall TeX Live 2013 on Ubuntu. I use the command               rm -rf /usr/local/texlive/2013      but it gives me for every file this:               rm: cannot remove '/usr/local/...': Permission Denied.      Then I tried:               sudo rm -rf /usr/local/texlive/2013      but after I give my password nothing is happening for a long time. I want to reinstall TeX Live because I recently run auto-remove command, thinking it would clean unnecessary cache, but it didn't. It actually delete files and several packages (like greek.sty) and I cannot retrieve them. Any ideas?


title: Multiple LaTeX installations

text: The first time I installed LaTeX was in `/usr/share/texmf-texlive` (~600MB).   Yesterday I installed TeX Live from apt-get, I simply don't know where it has been installed (~1GB).   Today I installed Tex Live from tug.org (~4.5GB). It's in `/usr/local/texlive/2013`. However both Kyle and TeXMaker are still using the first installation. How can I choose which version to use?


title: Untarring .tar.xz file failed during installing texlive2014

text: I wanted to install texlive on ubuntu-14 using texlive.iso image.After entering ./install.sh, the following problem occurred: * * * Partial download of ./archive/Asana-Math.tar.xz found, removing it. untar: untarring /usr/local/texlive/2014/temp/Asana-Math.tar failed (in /usr/local/texlive/2014/texmf-dist) untarring /usr/local/texlive/2014/temp/Asana-Math.tar failed, stopping install. Installation failed. * * * It seems that .tar.zx can't be untarred by tar,but no idea of solving that.


title: Errors after TeX Live 2012 update on Ubuntu 12.04

text: I wanted to use `mdframed` package but I was getting the error package not found. I followed the advice here to update to Text Live 2011. However, I figured out there is Tex Live 2012 and therefore installed it using the instructions here. Now, several packages I was using are throwing up error... `stmaryrd.sty`,`comma.sty`,`appendix.sty` not found! Now, how do I get get rid of these errors and start using `mdframed`? Any help appreciated.


title: How do I manually install the necessary packages to get TeXmaker to work? And in which directory do I put them?

text: I use Ubuntu 12.04 and I'm just getting started with TeXmaker. However, I need to get the library/package (what's the difference anyway?) for it to work and I'm having trouble with finding it in the Ubuntu software manager. I have thought of installing them manually, but again I think I would have to put them in the right directories, right? I'm really not an expert in informatics, I just need to do some serious physics writing for my thesis so I guess I would need the maths/physics packages. Also the French package would be of great help.


title: How to install "catdvi" in TeXLive?

text: I need to install catdvi, I am using the vanilla TeXLive from CTAN. I have another option to install it is from the OS (i.e. Ubuntu) repository, but it will install another copy of OS specific TeX stack which I do not want. catdvi is not a latex macro/style file, it is an executable (like xdvi). I can install xdvi using tlmgr, but not catdvi. Even my tlmgr gives detailed info on the xdvi status --               > tlmgr info xdvi     package:     xdvi     category:    TLCore     shortdesc:   A DVI previewer for the X Window System.     longdesc:    The canonical previewer for use on Unix and other X-windows based systems. The distribution has been integrated with that of xdvik (no longer separately available), so that it will build with web2c "out of the box". In practice, it is usually distributed via Tex-live.     installed:   Yes     revision:    30339     sizes:       doc: 261k, run: 37k, bin: 1145k     relocatable: No     cat-version: 22.86     cat-date:    2013-05-08 11:16:41 +0200     cat-license: other-free     collection:  collection-basic      But tlmgr gives nothing on catdvi --               > tlmgr info catdvi     tlmgr: package repository http://mirrors.ibiblio.org/pub/mirrors/CTAN/systems/texlive/tlnet     tlmgr: cannot find package catdvi      But both of them are in the dviware directory. How do I install it through TeXLive? _Please also note that I have another option to directly download and compile the catdvi from the sourceforgerepository, but I do not want to do that._


title: Trouble with pgfplots and ubuntu

text: Using writelatex (because I was at work where I had to use a windows machine which did not have a working Latex setup) I was able to produce some relatively nice-looking graphics using pgfplots. My laptop runs Ubuntu 12.04 LTS and has every TexLive package installed and seemingly working well. Looking at the Ubuntu package manager this would seem to include pgfplots via texlive-pictures. Still when I run this stripped-down version of an example I was trying to create:               \documentclass{amsart}          \usepackage{graphicx}     \usepackage{pgfplots}     \pgfplotsset{width=\textwidth,height=\textheight}          \begin{document}               \begin{tikzpicture}     \begin{axis}[hide axis,enlargelimits=false]     \addplot[black,domain=0:2*360,samples=360]     {cos(x)};     \addplot[black,domain=0:2*360,samples=360]     {-cos(x)};     \addplot+[blue, only marks,mark=*, domain=90:630,samples=4]     {0};          \end{axis}     \end{tikzpicture}          \end{document}      I get this abomination: ![enter image description here](http://i.stack.imgur.com/z59ax.png) If you can't tell, the desired picture is supposed to be of smooth intertwining cosine graphs with the intersection points marked and without any axes or legend. I see from googling around that there are some potential problems installing pgfplots, but supposedly if it's already installed I should be in the clear. So what's the problem?


title: How to install TexLive 2012 in an unofficial distro based on ubuntu 12.04?

text: > **Possible Duplicate:**   >  How to install “vanilla” TeXLive on Debian or Ubuntu? I'm want to install an unofficial distro based on ubuntu 12.04, for old PC's


title: "Styles" for PGFplots table expressions

text: Is it possible to use a style, or something equivalent, to specify the column expressions for `plot table`? The objective is to be able to use the same expressions for a large number of different plots with a minimum of repetitive typing. Here is an example (which does not compile) that suggests what I would like to be able to do:               \documentclass{standalone}     \usepackage{pgfplots}     \pgfplotsset{/pgfplots/columns/.style={x=dof,y expr={\thisrow{L2}+\thisrow{Lmax}}}}     \begin{document}      \begin{tikzpicture}       \begin{loglogaxis}        \addplot table[columns] {      % sample data from PGFplots manual         dof     L2              Lmax            maxlevel         5       8.31160034e-02  1.80007647e-01  2         17      2.54685628e-02  3.75580565e-02  3         49      7.40715288e-03  1.49212716e-02  4         129     2.10192154e-03  4.23330523e-03  5        };       \end{loglogaxis}      \end{tikzpicture}     \end{document}


title: Use other font in restricted area wont compile

text: im trying to change the font of only one character in the document, but it wont compile with lualatex, what am missing ?               \documentclass[11pt,a4paper,sans]{moderncv}      \moderncvstyle{classic}     \moderncvcolor{blue}     \moderncvicons{awesome}          \newfontfamily\myfont[]{Arial}          \firstname{John}     \familyname{Doe}     \email{someName{\myfont @}me.com}          \begin{document}     \maketitle     \end{document}


title: biblatex: change name of author according to language?

text: Usually a name stays the same in whatever language. So, whenever I quote a work by Knuth -- be it in an English article or a German one -- I will quote him as `Donald E. Knuth`. This is not always the case with ancient or medieval names. They are spelled differently in different languages. Two examples in English | German | French:   * Aristotle | Aristoteles | Aristote   * Thomas Aquinas | Thomas von Aquin | Thomas d'Aquin This means that when I write an English article, I need a `bib`-file that contains the English names, but when I want to write a German article, I need to go through my bib file and change the names accordingly. Depending on how often I in fact publish in English or German this could keep me busy and is prone to error. So, I though, maybe I could have the different names already included in one single `bib`-file and let `biblatex` choose the correct name according to the primary language used in the document. Any ideas? NB: I do not want to use in one single document both spellings Aristotle and Aristoteles (as the following MWE might make you think). Of course, if the article's primary language is English, then all the references to Aristotle will use the English spelling of his name. However, I want to be able to write articles in different languages, without (a) having to edit my `bib`-files each time or (b) generally maintaing not one single `bib`-file but two different ones, one for each language, or (c) having two distinct entries in one `bib`-file ## MWE               % !TEX TS-program = lualatexmk     \documentclass{scrartcl}          \usepackage{fontspec}             \setmainfont[Ligatures=TeX]{Times New Roman}          \usepackage[ngerman, british]{babel}     \usepackage[babel]{csquotes}     \usepackage[style=verbose,abbreviate=false,backend=biber]{biblatex}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @book{aristotle:ross:1924,         Author = {Aristotle},    % It is here, I think, that something could be done, e.g., ...         Title = {Metaphysics},     % ... british=Aristotle,ngerman=Aristoteles,french=Aristote         Editor = {William David Ross},         Commentator = {William David Ross},         Introduction = {William David Ross},         Hyphenation = {british},         Location = {Oxford},         Publisher = {Clarendon Press},         Volumes = {2},         Year = {1924}}     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          \selectlanguage{british}     Some English text.\footcite{aristotle:ross:1924}          \selectlanguage{ngerman}     Etwas Text auf Deutsch.\footcite{aristotle:ross:1924}          \end{document}


title: How to force normal line spacing when inline math in text

text: I have trouble in writing my latex document : I have a lot of inline short math formulas in my text, and latex keep growing line spacing because of it. I'd like to force latex to keep a normal line spacing, even if it means writing the formulas over the text (in this case I would deal with it case by case). I've tried quite every command for fixing line spacing, but latex does not care. Here is a small picture of what I'd like to avoid (in particular, there is still much free space between lines I could reduce): ![enter image description here](http://i.stack.imgur.com/QZZLt.png)


![enter image description here](http://i.stack.imgur.com/Z5fHf.gif) Inspired by my question How to create a PDF presentation for each available Beamer theme automatically?, now I want to compile my input file for each available LaTeX font package installed in my machine. Listing each font name in `\foreach` as follows does not seem a good idea as it will not accommodate all available packages as well as it is not up-to- date.               % the file name of this code is inputfile.tex     % compile it with pdflatex -shell-escape inputfile.tex          \documentclass[preview,border=12pt,multi]{standalone}     \usepackage{filecontents}          \begin{filecontents*}{template.tex}     \documentclass[preview,border=12pt,12pt]{standalone}     \usepackage{\loadfont}     \usepackage{pgffor}     \usepackage{amsmath}     \usepackage{mathrsfs}     \begin{document}     \foreach \x in {1,...,26}{\char\numexpr\x+64\relax\char\numexpr\x+96\relax\space}     \begin{align*}     \sin (\alpha \pm\beta) &=\sin\alpha \cos \beta \pm \cos\alpha \sin\beta\\     \mathscr{L}\left\{f(t)\right\} &= F(s)\\     \vec{F} &= m\frac{\textrm{d}\vec{v}(t)}{\textrm{d}t}\\     \int_a^b f(x)\, \textrm{d}x &= F(b) -F(a)\\     \vec \nabla \cdot \vec \nabla \times A &= \vec\nabla  \times  \nabla U     \end{align*}     \end{document}     \end{filecontents*}          \usepackage{graphicx}     \usepackage{pgffor}          \def\dojob#1{\immediate\write18{pdflatex -jobname=template-#1 "\def\noexpand\loadfont{#1} \noexpand\input{template}"}}               \begin{document}     \foreach \x in {bera,palatino,mathpazo,helvet,libertine}     {%         \dojob{\x}%         \preview         \section{\x}         \includegraphics{template-\x}         \endpreview     }     \end{document}      ![enter image description here](http://i.stack.imgur.com/7gvol.gif) A list of all installed packages (the list includes not only font packages but also other packages) can be done easily with this method How to print the list of packages installed on TeX Live to a file?. However, I have no idea to filter the list and remove the non-font packages. How to compile the same input file for each of LaTeX font packages installed in our machine?


title: Asymptote: Transparency causes strange color rendering in Adobe Acrobat

text: I noticed that using transparency in a picture that's compiled as vector graphic output (render=0, no PRC) leads to strange colors (they look paler and desaturated) when the resulting picture is viewed with Adobe Acrobat (I use version X). When I view the output PDF with SumatraPDF everything looks fine. An Example:               size(10cm,0);          path cle=unitcircle;          draw((-2.5,0)--(2.5,0),linewidth(10mm));     filldraw(shift((-1.5,0))*cle,magenta+opacity(.5));     filldraw(shift((-0.5,0))*cle,green+opacity(.5));     filldraw(shift((0.5,0))*cle,red+opacity(.5));     filldraw(shift((1.5,0))*cle,blue+opacity(.5));          shipout(format="pdf");      ![Comparison of erroneous PDF viewed with Adobe Acrobat \(left\) and SumatraPDF \(right\)](http://i.stack.imgur.com/2lYgN.png) On the left hand side you see the picture viewed with Adobe Acrobat and on the right hand side you see the picture viewed with SumatraPDF. When I leave out the opacity settings everything looks fine: ![Comparison of errorless PDF viewed with Adobe Acrobat \(left\) and SumatraPDF \(right\)](http://i.stack.imgur.com/rMoWE.png) I encountered such an issue before when using opacity in a picture created by TikZ and think the problem might be connected to that (There seems to be some trouble with transparency groups in Adobe Acrobat). Here is a way to solve this problem in a TikZ picture. How can the coloring issue be solved in Asymptote?


title: Appendix Title with scrreprt

text: I'm trying to get the word Appendix in front of my appendix chapter titles. I would like it to look like: Appendix A My first appendix I tried the appendix package, using \usepackage[title,titletoc]{appendix}. Somehow this works in the toc but not in the title on the page itself. How can add it for the title as well? Here what I got:               \documentclass[pdftex,parskip=half,twoside, BCOR15mm]{scrreprt}%     \usepackage[title,titletoc]{appendix}     \usepackage{pdfpages}     \usepackage{amsmath, amssymb, fancyhdr}     \usepackage[english]{babel}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{here}               \begin{document}               \tableofcontents          \chapter{Chapter 1}     \chapter{Chapter 2}               \begin{appendices}               \chapter{Bli bla blubb}               asdasd     \end{appendices}          \end{document}


title: Fill a region between two coplanar paths in asymptote

text: I'd like to reproduce in 3D the same thing as can be seen in the manual (section 3.5, Paths) ![enter image description here](http://i.stack.imgur.com/hriMm.png)               size(0,100);     path unitcircle=E..N..W..S..cycle;     path g=scale(2)*unitcircle;     filldraw(unitcircle^^g,evenodd+yellow,black);      I tried this               import three;     path3 p =  (0,-2,-2)-- (0,2,-2) -- (0,2,2) -- (0,-2,2) -- (0,-2,-2) -- cycle;     path3 q =  (0,-.25,-1.1) -- (0,.25,-1.1) -- (0,.25,1.1) -- (0,-.25,1.1) -- cycle;     filldraw(q^^p,evenodd+yellow,black);      but I get a > `no matching function 'filldraw(path3[], pen)'` error Any ideas?


title: Making uses of cleveref packages standalone

text: I have used `cleveref` package for referring to equations, figures, etc in an article. However, I wish to compile my tex file on another system which only has a basic version of tex. I wish to make my tex file sort of _stand-alone_ . Is there any way I can use a code which will look at my use of formatting references and replace all `\cref` commands with `\ref` commands but in the appropriate format. Ex. when I use:               \crefformat{figure}{Fig.~(#2{}#1{}#3)}     \crefformat{section}{Sec.~(#2{}#1{}#3)}     \crefformat{equation}{Eq.~(#2{}#1{}#3)}      It should replace the instances of:               \cref{fig:label-for-fig}     \cref{eq:label-for-eq}     \cref{sec:label-for-sec}      by:               Fig. \ref{fig:label-for-fig}     Eq. \ref{eq:label-for-eq}     Sec. \ref{sec:label-for-sec}      (respectively). Can anyone suggests a code that already exists ? Any language is ok if I can manage to run it on my system.


title: How attach \circ to each horizontal labels representing angles?

text: The objective is to attach `\circ` to each horizontal labels representing angles in degrees. How to do so? I cannot find the solution in the `pst-plot` manual.               \documentclass[pstricks,border=12pt,12pt,dvipsnames]{standalone}     \usepackage{pst-plot}     \usepackage[nomessages]{fp}          \FPeval\dx{pi/4}     \FPeval\Dx{round(180/pi*dx:0)}     \FPeval\dy{1}               \FPeval\XMin{0-pi/3}     \FPeval\XMax{2*pi}     \FPeval\YMin{0-3}     \FPeval\YMax{3}               \FPeval\L{XMin-dx/2}     \FPeval\R{XMax+dx/2}     \FPeval\B{YMin-dy/2}     \FPeval\T{YMax+dy/2}               \psset     {         algebraic,         xunit=15mm,     }               \begin{document}     \begin{pspicture}(\L,\B)(\R,\T)         \psaxes[dx=\dx,Dx=\Dx]{->}(0,0)(\L,\B)(\R,\T)         \psplot[linecolor=blue]{\XMin}{\XMax}{2*sin(x)}     \end{pspicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/WC3wR.png)


title: \makeatletter within a beamer frame: how?

text: Within a beamer frame (not outside) `makeatletter` (or `\catcode`\@=11`) does not work.               \documentclass{beamer}     \makeatletter     \def\my@command{My at command}     \def\myatcommand{\my@command}     \makeatother      The following breaks with errors:               \begin{frame}     \makeatletter\my@command\makeatother     \end{frame}      The following works outside the frame               \makeatletter\my@command\makeatother     \begin{frame}     \end{frame}      Only the following works inside the frame               \begin{frame}     \myatcommand     \end{frame}      Is there a way around this shortcoming (feature?) that does not involve a definition outside the beamer frame?


title: Latex - Changing behavior of encoding in the same document

text: Currently, I am **trying to achieve a German inputencoding (`inputenc`)** for my thesis. My solution works just fine with a small exception: Whenever my umlauts are correctly input-encoded in the normal text, they are misinterpreted when it comes to my inputs/equation labels and vice versa. My tex-document-header looks like this:               \documentclass[bibtotoc,liststotoc,BCOR0mm,DIV12]{scrbook}     \usepackage{geometry}     \usepackage{longtable}          \usepackage[nodisplayskipstretch]{setspace}     \setstretch{1.5}          %choose font_________________________________________________     \usepackage[T1]{fontenc}          % GERMAN language configs     \usepackage[latin1]{inputenc}     \usepackage{ngerman} % deutsche Verzeichnisse          \fontfamily{phv}          %____________________________________________________________     \usepackage{graphicx}     \usepackage{url}     \usepackage{hyperref}     \usepackage[square]{natbib}          \graphicspath{{./img/}}          \input{hyphenation}          \usepackage{amsmath}     \numberwithin{equation}{subsection}          \newcommand{\rl}{\raggedleft}     \newcommand{\rr}{\raggedright}     \newcommand{\tn}{\tabularnewline}      When I am using `\usepackage[latin1]{inputenc}` the input is correct for the normal text. Exchanging this with `\usepackage[utf8]{inputenc}` works for inputs/equations. Here is an example of what would be inserted via `\input{...}`:               \begin{equation}     C = \frac{T \cdot W}{L} = \frac{K \cdot A}{L}     \label{eq:Conductance}     \end{equation}     \begin{spacing}{1}\begin{flushleft}     $C$: Leitfähigkeit (hydraulic conductance) [$\frac{m^{2}}{s}$] \\     $T$: Transmissivität [$\frac{m^{2}}{s}$] \\     $W$: durchflossene Breite [$m$] \\     $L$: durchflossene Länge [$m$] \\     $K$: hydraulische Leitfähigkeit [$\frac{m}{s}$] \\     $A$: durchflossene Fläche [$m^{2}$] \\     \end{flushleft}\end{spacing}      **I would like to know how I can encode the input, so that both normal text and equation labels are interpreted in the right manner.** If it isn't possible: How about a workaround? I would defenitely prefer a workaround for which I have to change as less as possible. Thank you in advance!


title: listings font size that fits 80 columns?

text: I want to include code in my LaTeX document using the listings package. My googling has not found me any configuration of the font size that actually fits approximately 80 columns to the width of the document. Most examples I've seen use pre-defined sizes:               \lstset{       basicstyle=\ttfamily\footnotesize,       ...     }      So far the ones I have found have all been too large (`\small`, `\footnotesize`, `\scriptsize`) or too small (`\tiny`). Is there no way to manually configure the size of the font (possibly without messing up all other font configuration), or is there at least a preconfigured setting that comes close to 80 columns? I realize margins might be different etc., but so far all the ones I have seen have been way off.


title: microtype and the French way of typing text

text: In French, we put spaces before characters `: ! ; ?` when we **type the text**. For instance, we will type               Que fait-on ? On met un espace avant les deux points : comme cela.      If I do so and use `microtype`, the spacing in the generated `pdf` file is not the right one. See the following example:               \documentclass{article}          \usepackage[utf8x]{inputenc}     \usepackage[french]{babel}     \usepackage[babel=true, kerning=french]{microtype}          \begin{document}            Voici ce qui se passe quand on met un signe \og{}deux~points\fg{}       avec le package \og{}microtype\fg{} : il semble que ça ne marche pas !       Un autre essai : est-ce que cela marche ?       \bigskip             \textbf{But what happens if I type my text following the       English typographic rules?}       \bigskip             Voici ce qui se passe quand on met un signe \og{}deux~points\fg{}       avec le package \og{}microtype\fg{}: il semble que ça ne marche pas!       Un autre essai: est-ce que cela marche?          \end{document}      ![enter image description here](http://i.stack.imgur.com/RrJmc.png) Hence:   * **How can I use`microtype` and type my text the French way?** * * * Note: here is the result without `microtype`.               \documentclass{article}          \usepackage[utf8x]{inputenc}     \usepackage[french]{babel}     %\usepackage[babel=true, kerning=french]{microtype}          \begin{document}            Voici ce qui se passe quand on met un signe \og{}deux~points\fg{}       avec le package \og{}microtype\fg{} :       il semble que ça ne marche pas ! Un autre essai : est-ce que cela marche ?          \end{document}      ![enter image description here](http://i.stack.imgur.com/RB6vE.png)


title: A new figure environment for the exam class

text: The incompatibility of having a float inside the solutions box of the exam class is somewhat well known. Multiple solutions for this exist, almost all of which use some variant of the caption package and the minipage environment. Why doesn't simply wrapping the figure inside a minipage environment work? I tried \renewenvironment{figure}{\begin{minipage}[c]{\linewidth}}{\end{minipage}}


title: After upgrading to 13.10, biblatex and biber are not compiling my references

text: I am working on a thesis using LaTeX, with my references relying on biblatex- apa. Ubuntu 13.04 provided all my LaTeX needs. But after upgrading to 13.10, the biblatex / biber combo will no longer compile my APA-style references. No other changes have been made to my documents or references -- and the rest of the document appears fine (albeit with broken references and no bibliography). I found reference to a possible cause -- which is that biblatex 1.7-1 is incompatible with texlive 2013 (as available through the 13.10 repositories) -- and that issue may be fixed by biblatex 2.7a-1 which has been committed upsteam in Debian. See: http://bugs.debian.org/cgi- bin/bugreport.cgi?bug=718244 However, that doesn't help me much, as I need to compile my references quite soon. How can I get my references to compile in the meantime? Is there a patched biblatex or biber that I can manually slot in place? Is the upstream fix on its way? or do I need to go to TexLive and do a replacement install directly (which is not my preference). Thanks!


title: click button and next picture will be shown

text: I would like to create presentation and export to GIF, for example. I have three files: `obr1.mp`, `obr2.mp`, and `obr3.mp` (which is my pictures drawn). I want have `.tex` file, where I could press space button and next picture will be shown. Is that even possible?


title: Code highlighting in ConTeXt

text: What is the best way to highlight code when using ConTeXt? I am aware of support for specific languages, as described on the ConTeXt wiki, but it seems rather limited at present. I know that we could also rely on vim, through the `t-vim` module. Now, I wonder if there exists more automated ways to deal with other languages like R, Python, Lisp, Asymptote? Also, I would like to be able to combine verbatim and mathematical notations, as it is currently available in Minted, for example. A working example would be very appreciated.


title: \newcommand and boolean statements

text: I'm getting better at creating \newcommand instances but I've just reached a part where my knowledge is just not enough for it and also reading this site or the manual doesn't help. Basically I'd like to create a newcommand that sets a vertical rectangle split in 3 parts, so far so good, but where I can control whether each part gets filled with a boolean. The command would look like (as I've envisioned it but I'm not sure it's feasible): `\command{1, 0, 1};` Here the first and third part would be filled with a color (black or whatever), the second would stay white. Alternatively, it could be `\command{1}{0}{1};` for the same result. This would use three arguments but I don't know how to separate arguments with the comma as shown above. The result would be something like this: ![enter image description here](http://i.stack.imgur.com/UbT89.png) Note that I'd like this to be dynamic, i.e. if I say `0,1,1`, the filled parts would be the second and third, and so on. I didn't manage to reach any level so I don't have a code to provide but here is a starting example so you don't need to rewrite all the code (ignore the settings the seem to be unnecessary here, they're used in other parts of the document):               \documentclass[10pt]{article}     \usepackage[a4paper, margin=3mm]{geometry}     \usepackage[utf8]{inputenc}     \usepackage{rotating}     \usepackage{amsmath}     \usepackage{pgfplots}     \usepackage{tikz}          \usetikzlibrary{fit, arrows,backgrounds,patterns,shapes,shapes.multipart,positioning,calc,decorations.markings}          \begin{document}              \begin{tikzpicture}                 \centering                   \end{tikzpicture}          \end{document}


title: How to use minted under MikTeX and Windows 7?

text: According to `minted` documentation: > Windows support is sketchy / untested at the moment. There are two > complications: installation and usage....... This question seeks a step by step elaboration of **How to setup`minted` for use with MikTeX under Windows?**