title: Problem with \renewcommand

text: I am trying to use `\renewcommand` to change the size of footnotes throughout the main text. I do this by changing `\footenotesize` to a different command, `\scriptsize`. Later on, I would like the command `\footnotesize` to return to its original use. But, using `\renewcommand` again to do this causes my .tex file to stop compiling, typically on the first `\includegraphics` command. Even without the `\includegraphics` command, the .tex file will not compile. I don't understand what's going on, but if I remove the second `\renewcommand`, the document compiles.               \documentclass{article}     \usepackage{graphicx}   % Graphics package to include figures (need graphicx.sty)          \begin{document}          \renewcommand{\footnotesize}{\scriptsize}          Here is some text. And Here is some text with a footnote.\footnote{Here is the footnote text.}          \renewcommand{\footnotesize}{\footnotesize}          \begin{figure}     \caption{Probability of Leaving within One Year: 1999-2002}             \begin{center}        \includegraphics[width=4in]{combined-one-3060-vertical.eps}        \end{center}     \label{fig:leave1-baseline}     {\footnotesize     Notes:  The top panel plots the average leave probability for one-year age bins for the 2002 sample, while the bottom panel separately plots these probabilities for the 2002 and 1999-2001 samples.     }     \end{figure}          \end{document}


How to draw a line passing through a point and parallel to another?               \draw (0,0) -- (1,0);     \node (A) at (1,1);      I need `\draw (0,1) -- (1,1);` parallel to first line.


title: Not sorting a bibtex for a single page

text: I use `unsrt` style for my BibTeX bibliography and everything is fine. It sorts the entries according to the hierarchy in which I refer to them. However, for one page (which is the abstract of my work) I don't want the entries to be counted. For instance, in that page I reference to a paper I mentioned in chapter 7 which is [67] and then another one from chapter 9 which is [89]. But as soon as I cite them in the preface, they become [1] and [2]


title: Including a PDF page in latex with pdfpages without scaling

text: I am writing a document in LaTeX and I'm trying to include a frontpage in PDF (aptly called "Frontpage.pdf") the document, to be compiled with Pdflatex. I tried to include it with the pdfpages package and the the command lines               \includepdf{Frontpage}      or, alternatively               \includepdf[noautoscale]{Frontpage}      Both of the above include the file in question, but scale its size, regardless of the options I've been setting. I would simply like to include the file "as is", keeping its size intact.


title: How to produce a longer \sim with a small letter on top

text: I am able to produce a standard length \sim with a tiny S above it, but I would like the \sim tilde to be longer (maybe one and half times as wide as a capital letter). Any tips on how to change the width/length of \sim?


title: \huge and \newcommand variable don't work together

text: I want do define a project name somewhere and use it all through my document – but I get problems when trying to use my project name in the document title which should be quite big, so I tried this way:               \newcommand{\projectName}{MyProject}      ...               \begin{titlepage}     \begin{center}          \HRule \\[1.2cm] % horizontal line     {\huge \bfseries \projectName{}}\\[0.5cm] % title     \HRule \\[1.5cm] % Horizontal line          \end{center}     \end{titlepage}      But what I get when I try to set the file is the following:               ./TitlePage.tex:lineNumberWhereProjectNameIsUsed: Undefined control sequence.      Does anyone know **what I do wrong** or **how I can solve this**? Thanks in advice for all helpers! **EDIT:** Here's the full main .tex files content (in which the TitlePage.tex above is included):               \documentclass[11pt, a4paper, oneside]{Thesis} % Paper size, default font size and one-sided paper          \graphicspath{{./Pictures/}} % Specifies the directory where pictures are stored          \usepackage[square, numbers, comma, sort&compress]{natbib} % Use the natbib reference package - read up on this to edit the reference style; if you want text (e.g. Smith et al., 2012) for the in-text references (instead of numbers), remove 'numbers'      \hypersetup{urlcolor=blue, colorlinks=true} % Colors hyperlinks in blue - change to black if annoying     \usepackage[ngerman]{babel}     % Sprachen     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[german]{varioref}     \hyphenation{}     % adding glossary functionality     \usepackage{hyperref}     \usepackage[toc]{glossaries}     \makeglossaries     \input{./GlossaryEntries}      % only showing chapters and sections in table of contents     \setcounter{tocdepth}{1}               \begin{document}     \selectlanguage{ngerman}    % set language to german          \frontmatter % Use roman page numbering style (i, ii, iii, iv...) for the pre-content pages          \setstretch{1.3} % Line spacing of 1.3          % Define the page headers using the FancyHdr package and set up for one-sided printing     \fancyhead{} % Clears all page headers and footers     \rhead{\thepage} % Sets the right side header to show the page number     \lhead{} % Clears the left side page header          \pagestyle{fancy} % Finally, use the "fancy" page style to implement the FancyHdr headers          \newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % New command to make the lines in the title page          %----------------------------------------------------------------------------------------     %   TITLE PAGE     %----------------------------------------------------------------------------------------          \include{TitlePage}          \end{document}


title: LaTeX class for typesetting question paper

text: I came across the "exam" class for typesetting question papers in LaTeX. I have TeXLive 2013 distribution. The distribution provides me `exam.cls` file. But my TeXMaker doesn't recognize it. When I downloaded the `exam.sty` file, I got the output but the subject name and many other fields like the university name are all fixed. I am not able to modify them. What do I do?


title: hyperref package prevents shifting from OT1 to T1 encoding

text: As addressed in Temporarily change font encoding with fontenc, I need to switch to T1 encoding to get certain T1 glyphs. This compiles fine with `hyperref`:               \documentclass{article}     \usepackage[T1, OT1]{fontenc}     \usepackage{hyperref}     \begin{document}     Har{\fontencoding{T1}\selectfont{\dh}}arson     \end{document}      As addressed in \renewcommand and \newcommand for accented letters, I'm redefining some T1 macros in my preamble. In this case, however, `hyperref` seems to insist that the encoding is still in OT1 (it compiles fine without `hyperref`).               \documentclass{article}     \usepackage[T1, OT1]{fontenc}     \renewcommand{\dh}{\fontencoding{T1}\selectfont{\symbol{240}}}     \usepackage{hyperref}     \begin{document}     Har{\dh}arson     \end{document}      > LaTeX Error: Command \dh unavailable in encoding OT1. What is going on here ... ? * * * **EDIT** : It turns out that it works fine if the macro is redefined after `hyperref` is loaded:               \documentclass{article}     \usepackage[T1, OT1]{fontenc}     \usepackage{hyperref}     \renewcommand{\dh}{\fontencoding{T1}\selectfont{\symbol{240}}}     \begin{document}     Har{\dh}arson     \end{document}      So this now begs the question why `hyperref` causes this behavior.


title: Vertically centering page with @texttop and @textbottom

text: I am trying to use `\@texttop` and `\@textbottom` to vertically center a page in a manner similar to Use of \@texttop and \@textbottom for vertical positioning. Everything works fine if I do               \documentclass{minimal}     \makeatletter     \def\@texttop{\vskip \z@ plus 1fill\relax}     \def\@textbottom{\vskip \z@ plus 1fill\relax}     \makeatother     \begin{document}     hello world     \end{document}      but if I switch `\vskip \z@ plus 1fill\relax` to something like `\vskip \z@ plus 0.5\textheight\relax` or even `\vskip \z@ plus 0.1fil\relax` the page is no longer centered. My guess is there must be some one el stretch sneaking in some place in my MWE, but I cannot figure out where. Why doesn't a stretch of `0.5\textheight` center the page?


title: How can I compare two (not necessarily integer) variables?

text: After experimenting and researching for hours, I still cannot figure out how to perform a simple equality test between two numbers. More specifically, here, the two numbers in question are the argument to my `\abc` command (`#1`) and my `\test` variable. This is what I've come up with, but it doesn't produce the expected result:               \documentclass{article}          \begin{document}     \def\test{0.5}          \newcommand{\abc}[1]{     \ifnum #1=\test       Something % do something     \fi}          \abc{0.5} % does something     \abc{0.7} % does nothing          \end{document}      Please help me with this one.


title: Caption and tablenotes in two columns (in threeparttablex)

text: I have a table with a long caption and footnotes on a landscape page, prepared using `ThreePartTablex`, but it does not fit. I'm now looking for options to make it fit. My best idea so far was to set both caption and footnotes in two columns. However, I have no idea how to do this for the caption and if using the `multicols` environment for the tablenotes, the distance from the table is too large. This is an example of what I've tried so far:               \documentclass{scrreprt}     \usepackage[headsepline, footsepline]{scrpage2}     \pagestyle{scrheadings} %using scrpage2 to highlight typearea        \usepackage{lscape}     \usepackage{pdflscape} % automatically rotates the pdf on landscape pages     \usepackage{multicol}     \usepackage{ThreePartTablex}    % as I'm also using longtabu in another section, I'm using the x version of the package     \usepackage[format=plain, font={small}, labelsep = space, width=0.9\textwidth]{caption}      \usepackage{blindtext}          \begin{document}          \begin{landscape}     \begin{table} % to force everything onto one page         \centering     \begin{ThreePartTable}         \caption{My caption is quite long and uses multiple lines. \\ \blindtext }         \rule{20cm}{9cm} %This table is actually in a separate pdf, thus I'm using a box here to represent it.         \begin{multicols}{2}         \begin{tablenotes}             \footnotesize             \item[a] First item             \item[b] Another item             \item[c] Another item             \item[d] Another item             \item[e] Another item             \item[f] Another item         \end{tablenotes}     \end{multicols}     \end{ThreePartTable}     \end{table}     \end{landscape}     \end{document}      I'm also happy to hear about possible other solutions that might be cleaner and/or look nicer, but spreading the table over multiple pages, for example, is not really an option as it presents an overview.


title: Beamer: Default blocks in and out the columns environment

text: I would like to set a block followed by two additional ones below the first block. However, the widths and margins differ (see screenshot below). I'd like   * the two narrower blocks to span across the same width as the wider block, and   * the margins to remain unchanged. How can I obtain that? ![enter image description here](http://i.stack.imgur.com/mrmUC.png)               \documentclass{beamer}     \usetheme{Boadilla}          \begin{document}          \begin{frame}          \begin{block}{Guguck}         Hallo du da, im Radio!     \end{block}          \begin{columns}     \column{0.5\linewidth}         \begin{block}{Guguck}             Hallo du da, im Radio!         \end{block}          \column{0.5\linewidth}         \begin{block}{Guguck}             Hallo du da, im Radio!         \end{block}     \end{columns}          \end{frame}     \end{document}      I can adjust the factor `0.5` to get the desired result, but that is an annoying work to do and probable not independent in changes of margins, textwidth etc. EDIT: I used the option from samcarter, but it does not work properly. So I played around and find the option `\setbeamertemplate{blocks}[default]` which destroys the nice outlook. Here is the corresponding MWE. (I do not want to manipulate my first question.) ![enter image description here](http://i.stack.imgur.com/gMWzS.png)               \documentclass{beamer}     \usetheme{Boadilla}     \setbeamertemplate{blocks}[default]          \begin{document}          \begin{frame}          \begin{block}{Block 1: Guguck}         Hallo du da, im Radio!     \end{block}          \begin{columns}[onlytextwidth, t]     \column{0.45\linewidth}         \begin{block}{Block 2a: Guguck und eine laengere Ueberschrift}             \begin{itemize}                 \item a                 \item b                 \item c             \end{itemize}         \end{block}          \column{0.45\linewidth}         \begin{block}{Block 2b: Guguck}             Hallo du da, im Radio!         \end{block}     \end{columns}          \end{frame}     \end{document}


title: Simple if statement latex

text: Having difficulties understanding basic latex operations I want to use: if not (number between x and y): next iteration in loop Can anyone help me with a simple if statement for this?               \newread\reader     \newcount\TotalFiles                 \makeatletter     \newcommand\IterateImages[2]{%     % #1: directory path with a trailing /     % #2: a list of file extensions: eps pdf jpg png     \immediate\write18{batch "#1" \jobname\space #2}     \openin\reader=\jobname.list\relax     \newcounter{figurecounter}\setcounter{figurecounter}{1}     \loop         \read\reader to \filename         \unless\ifeof\reader         \filename@parse{\filename}         %\section*{\filename}         \         \vfill         \begin{figure}[!htb]         \begin{center}                 \includegraphics[scale=0.5]{"#1\filename@base"}         \caption{{\bf text}         \label{fig:item\thefigurecounter}         \end{center}         \end{figure}         \vfill         \         \stepcounter{figurecounter}         \endgraf         \advance\TotalFiles1\relax         \clearpage     \repeat     \closein\reader     }


title: Number math problems

text: So I'm trying to type up my math homework and I'm wondering how to number the problems (NOT THE EQUATIONS!). So I has to be like               4.3      //work     4.4     //work     5.2     //work     6.1     //work      Does anyone know how to do that?


title: Removing space after section heading after using baselineskip

text: Basically after setting a large `\baselineskip` there is now a huge space under my section heading: source:               \documentclass[14pt,extrafontsizes]{memoir}     \usepackage[margin=10pt,paperwidth=496pt, paperheight=588pt]{geometry}     \usepackage[fleqn]{amsmath}     \usepackage{multicol,array,collcell,stix}     \usepackage[shortlabels]{enumitem}     \usepackage[dvipsnames]{xcolor}     \everymath{\displaystyle}          \begin{document}     {\setlength{\baselineskip}{36pt}     \section*{Converting repeating decimals to fractions}         \begin{enumerate}[\color{MidnightBlue} 1.]         \item Express $0.\dot{3}$ as a fraction. \\             Let $x=0.\dot{3}$ \\             then $10x=3.\dot{3}$ \\             $10x-x=3.\dot{3}-0.\dot{3}$ \\             $9x=3$ \\             $9x=\frac{3}{9}$         \item Express $0.\dot{1}\dot{2}$ as a fraction. \\             Let $x=0.\dot{1}\dot{2}$ \\             then $100x=12.\dot{1}\dot{2}$ \\             $100x-10x=12.\dot{1}\dot{2}-0.\dot{1}\dot{2}$ \\             $90x=12$ \\             $x=\frac{12}{90}$ \\             $x=\frac{2}{15}$      \end{enumerate}}     \end{document}      output: ![1](http://i.imgur.com/qKCKwK6.png)


title: Typesetting in Devanagari

text: I am writing a small part of my code.               \documentclass {article}          \usepackage{devanagari}          \begin{document}          {\dn gunottar ani praman}          \end{document}      This does not yield me the required output. What is the solution to this problem? edit: Texlive 2012 pdflatex produces ![enter image description here](http://i.stack.imgur.com/wQTpf.png)


title: Selecting environment with double click in Emacs+AUCTeX

text: I want to select whole environment by just double clicking on `\begin{environment}` or `\end{environment}`. Maybe someone already did this? Also how can I change definition of a word that double clicking on `\command` selects not only word 'command' but also a slash in front of it, however I don't want to select subsequent slash if it exists.


title: Beamer/Beamerarticle: \mode<article> is ignored after <presentation> was set, and vice versa

text: I have a problem with latex ignoring text after `\mode<presentation>` or `\mode<article>` was set. ## MWE description I have a large document that changes modes often, and I also `\include` some more latex files. I've reduced it to the following MWE.               \documentclass{article}     \usepackage{beamerarticle}          %\documentclass{beamer}          \begin{document}            1. Text without a mode being set. This should be shown          in both presentation and article mode.            \mode       <presentation>         \begin{frame}           2. This is text inside a frame. It should only appear in presentation         \end{frame}            \mode       <article>         3. Text outside a frame. Only in article.            \mode       <all>        \include{in}          \end{document}      With the file `in.tex` closely following the example in the beamer user guide ver. 3.26, p. 210               \mode*     4. This is some text outside a frame. Shouldn't be shown in presentation mode.          \begin{frame}       5. This is text inside a frame. This is expected to show in article mode.     \end{frame}          \mode<all>      ## Problem description There are two cases to be considered here, compiling with `\documentclass{beamer}`, or with `\documentclass{article}` and `\usepackage{beamerarticle}`. As I understand the relevant documentation, I should get the results as described in the body of the MWE. Instead, I get the following:   * Case "article"     * Everything after `\mode<presentation>` seems to be ignored. I get a single page with sentence 1. Switching back to `\mode<article>` does not produce sentence 3, and the `\include` command does not seem to be processed.   * Case "beamer"     * Sentence 1. and 2. get typest, the included file is ignored, even though it should be processed in all modes. Experimentation with the third flavour of the `mode` command and `ignorenonframetext` has yielded the same results, please see the output here and here (can't include directly due to lack of reputation). I am using the second mode flavour for `\include` to work, and because I need to do fancy things like set backgrounds on some slides. ## Question What am I missing here? As far as I can tell I have structured the document correctly. Am I misunderstanding how modes are set and processed? Is this a bug in `beamer` or `beamerarticle`? I would like to achieve the result as described in the MWE. I am compiling this document on Arch Linux with texlive 2012, which at the moment represents rev. 28273.


title: Multiple horizontal line separators? Multiple \over-s?

text: How to code the syntax like fraction, but with more than 2 components? Fractions consist of numerator and denominator while I need more. In other words: how to code column-matrix with horizontal lines separations (and without any surrounding brackets). P.S. All components should be of equal size not like in               {a \over {b \over {c \over d}}}


title: Center long column title

text: `MWE` of my table:               \documentclass[a4paper,10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{graphicx}     \usepackage{multirow}     \usepackage{array}     \begin{document}          \begin{table}     \hspace{-3cm}     \footnotesize{     \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}     \hline      & \multicolumn{3}{p{3cm}}{\centering Very long column title that needs to be centered} &     \multicolumn{3}{p{3cm}}{\centering Very long column title that needs to be centered 2} &     \multicolumn{3}{p{3cm}|}{\centering Very long column title that needs to be centered 3} \\     \hline      \multirow{2}{*}{Cooooooool1} & \multirow{2}{*}{Cooooool2} & ``Col &     \multirow{2}{*}{Cooooool1} &     \multirow{2}{*}{Cooooool2} & ``Coooooool & \multirow{2}{*}{Coooooool1} &     \multirow{2}{*}{Coooooool2} & ``Coooooool \\      & & & 3'' & & & 3'' & & & 3'' \\     \hline     1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\      \hline     \end{tabular}     }     \end{table}          \end{document}      which gives me: ![table](http://i.stack.imgur.com/E0CIb.png) You'll notice that the column titles are centered but not along the three columns they occupy. How could I make them be centered?


title: biblatex: adding entries outside of main .bib file; possibly a 'multiple bibliographies' problem with filecontents package

text: Is there a way to include additional entries outside of the `.bib` file in the a bibliography for `biblatex`? For instance, I have a few web references (http) which I don't want to add in my general `.bib` file, but only within a particular document (`.tex` file). Is this possible? I am imagining something which might use the filecontents package like this, but not sure how this can be done with `biblatex`.


title: Combine cycle lists in pgfplots

text: Is it possible to combine two cycle lists? That is, is it possible to apply simultaneously several cycle lists to a common plot without the last list overriding the others (that is, getting a behaviour not unlike the `/.style append` commands)? For instance, I have a first list of markers and a second of colours:               \documentclass{article}          \begin{document}          \pgfplotscreateplotcyclelist{list1}{%     {},     {mark=x},     {mark=+}}          \pgfplotscreateplotcyclelist{list2}{%     {color=red},     {color=blue},     {color=green}}                    \begin{tikzpicture}     \begin{axis}     % Mising commands before plot 1     \addplot {x}; % should be red and have no marker     \addplot {x+1}; % should be blue and have `x' marker     \addplot {x+2}; % should be green and have `+' marker          % plot 2     \pgfplotsset{cycle list name=list1}     \addplot {2*x}; % is red and has default marker     \addplot {2*x+1}; % is blue and has default marker     \addplot {2*x+2}; % is green and has default marker               % plot 3     \pgfplotsset{cycle list name=list2}     \addplot {-x}; % is default colour and has no marker     \addplot {-x+1}; % is default colour and has `x' marker     \addplot {-x+2}; % is default colour and has `+' marker     \end{axis}          \end{tikzpicture}     \end{document}      I want to use sometimes only the markers, sometimes only the colours and sometimes both simultaneously. This is different from `cycle multi list` which increment first the last list and then the first at each reset of the second. For sure, I can create a third list to manually combine `list1` and `list2` but I am wondering if that can be achieved more efficiently? Such a feature would come in handy when having using list for several features (colour, marker, line style etc.) in a long document and using them in various combinations. In this case, writing all the combinations is cumbersome and changing, say, one colour means tracking it done in every combinations.


title: Page breaks within moderncv

text: I'm typesetting a document with lengthy `itemize` lists and in most cases LaTeX leaves lots of empty space before the environment in order to get it entirely on one page. How can I encourage LaTeX to put page breaks within lists? **Update:** I found that it works just fine when used not within `\cventry` command. Is there anyway to fix `\cventry` definition in order to avoid non-breaking behavior? From `moderncvstylebanking.sty`:               \renewcommand*{\cventry}[7][.25em]{       \begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}%           {\bfseries #4} & {\bfseries #5} \\%           {\itshape #3\ifthenelse{\equal{#6}{}}{}{, #6}} & {\itshape #2}\\%       \end{tabular*}%       \ifx&#7&%         \else{\\\vbox{\small#7}}\fi%       \par\addvspace{#1}}      **Examples:** Originally I've used `\cventry` in the following way:               \cventry{March 2009--April 2011}{Software Developer}{Company}{City}{}{         \begin{itemize}             \item Item 1;             % Lots of items here             \item Item n.         \end{itemize}     }      Probably I'm just misusing `\cventry` because using the following makes it just fine:               \cventry{March 2009--April 2011}{Software Developer}{Company}{City}{}{}     \begin{itemize}         \item Item 1;         % Lots of items here         \item Item n.     \end{itemize}


title: Latex pgfpages cleardoublepage

text: I need to divide A4 into two A5 pages (landscape) which works fine with pgfpages but i also need special double page (like titlepage) where left half- page is empty and right contains text. But this page sometimes splits so one part is on the previous page. I tried to use `\cleardoublepage` which doesn't end the whole A4 page (if half empty). minimal example to clarify: (if text fills even number of A5 pages its fine but if number of pages filled by text is odd, my double page splits)               \documentclass[12pt,a4paper]{article}     \usepackage[left=2cm,text={17cm, 24cm},top=3cm]{geometry}     \usepackage{pgfpages}     \usepackage[czech]{babel}     \pgfpagesuselayout{2 on 1}[a4paper, landscape, border shrink=5mm]     \begin{document}          {\Large Empty page}          \newpage     {\LARGE Title page}     %end of special double page     \cleardoublepage          {\LARGE text unknown length}          \null\cleardoublepage     %beginning of second special double page     {\Large Empty page}          \newpage     {\LARGE Title page}     %end of second special double page     \null\cleardoublepage     {\LARGE text unknown length}               \end{document}


title: Correct way of organizing bibliography

text: What is the correct way of organizing the bibliography: Is it better to have only one `.bib` file which is shared by all TeX files, or am I supposed to have one `.bib` file for each TeX file (each paper)?


title: How to have the title at the top of a LaTeX document?

text: So far I have the following code for some document;               \begin{document}          \title{..}          \author{..}          \maketitle          \end{document}      When I create the file, the title is always centred but at the middle of the page. Is there any way to move the title (and author) to the top of the page? Apologies if I am missing something simple - at this stage I am simply experimenting with the software which I will use extensively next semester.


title: I'd like to have my lower boundary as -infinity but it will only have one character

text: \documentclass{article}           \title{Latex exercice}       \author{ME}            \begin{document}       \maketitle % showing both title and author, plus date       \begin{equation}         \Gamma(x)=\int_\infty^\infty dt           \Gamma(x)=\int_{-\infty}^\infty dt       \end{equation}       \end{document}


title: TikZ externalize, pgfplots and animate

text: I gave a very fetching presentation written with beamer today. It included a pgfplot animated with the `animate` package, and the result was fantastic. The problem? One of my colleagues wants to borrow the plot for a presentation written in something non-LaTeX. In addition, it would be nice to know how to externalise animated pgfplots frame by frame for animation using using `convert` or `mencoder` to produce a standalone file for inclusion in websites etc. Naturally, I turned to `externalize` to do the job for me. It seems that `animate` and `externalize` don't agree... How can I convince them to kiss and make up? Below is a massively simplified example for the wizards to work with               \documentclass{standalone}     \usepackage{pgfplots}     \usepackage{animate}     % Comment out the following line to see what the plot looks like.     \usepgfplotslibrary{external}\tikzexternalize           \begin{document}     %     \begin{animateinline}[controls]{10}       \multiframe{30}{ind=0+1}{         \begin{tikzpicture}           \begin{axis}[ymin=-1, ymax=1, xmin=0, xmax=3.14]             \addplot {sin(deg(x+\ind*pi/16))};           \end{axis}         \end{tikzpicture}       }     \end{animateinline}     %     \end{document}


title: Arrows between a list and a picture in beamer

text: How can I draw arrows between an item in an `itemize` environment and spots on a picture using tikz? MWE:               \documentclass{beamer}     %\usepackage{beamerthemeshadow}     \setbeamercovered{transparent}          \begin{document}     \section{section}     \begin{frame}      \frametitle{frame title}           \begin{columns}      \column{.4\textwidth}         \begin{block}{block title}               \begin{itemize}             \item <1-> stone             \item <2-> more stones             \item <3-> water           \end{itemize}         \end{block}       \column{.6\textwidth}           \begin{figure}[h]         \includegraphics[width=\textwidth]{25}%         \caption{Landscape}           \end{figure}       \end{columns}          \end{frame}     \end{document}      I want to achieve something like this: ![enter image description here](http://i.stack.imgur.com/LTDx2.png) ![enter image description here](http://i.stack.imgur.com/NGEsy.png) ![enter image description here](http://i.stack.imgur.com/VeJQw.png)


title: mdframed and colortbl Connection problem

text: I'm using mdframed for bordered tables. Additionally I'd like to change the bg-colour of some columns using the package `colortbl`. However when I try to load `colortbl` with `\usepackage`, the document refuses to compile moaning about a runaway argument/forgotten endgroup. When I do not load `colortbl`, the error disappears. Is this a known bug? How can I avoid it then? The error message in question:               Package mdframed Info: mdframed inside float     mdframed uses option nobreak mdframed on input line 2440.     Package mdframed Info: mdframed inside a box      mdframed uses option nobreak mdframed on input line 2440.     Runaway argument?     {\textbf {Migräne}      ! Paragraph ended before \multicolumn was complete.


title: Displaying numbers above each other (like a fraction), but without horizontal line and with less vertical space between them

text: I want to have a 2x2 matrix of arrows (`\uparrow` and `\downarrow`) to illustrate electronic spins. I've managed to get a fraction without the horizontal line using `\genfrac`, but I can't figure out how to reduce the vertical spacing between the pairs of arrows down. What I have so far (working example):               \documentclass[a4paper,10pt]{article}       \usepackage{amsmath}       \newcommand{\stack}[2]{\genfrac{}{}{0pt}{0}{#1}{#2}}       \begin{document}       $\stack{\uparrow\uparrow}{\downarrow\downarrow}$       \end{document}      EDIT: This is what I ended up doing, after combining some of the answers here:               \newcommand{\stack}[2]{\array{c}{\scriptstyle #1}\\[-1.1ex]{\scriptstyle #2}\endarray}      And the final result, which is going into my report:               \documentclass[a4paper,10pt]{article}     \usepackage{amsmath}     \newcommand{\up}{\uparrow}     \newcommand{\dw}{\downarrow}     \newcommand{\stack}[2]{\array{c}{\scriptstyle #1}\\[-1.1ex]{\scriptstyle #2}\endarray}     \begin{document}          \begin{table}         \centering         \begin{tabular}{|c|c|c|c|c|}             \hline             Spin arrangements &Spins up &Degeneracy &Energy &Magnetization \\ \hline             $\stack{\up\up}{\up\up}$ &4 &1 &-8J &4 \\             $\stack{\up\up}{\up\dw}$ $\stack{\up\up}{\dw\up}$ $\stack{\up\dw}{\up\up}$ $\stack{\dw\up}{\up\up}$ &3 &4 &0 &2 \\             $\stack{\up\up}{\dw\dw}$ $\stack{\dw\dw}{\up\up}$ $\stack{\up\dw}{\up\dw}$ $\stack{\dw\up}{\dw\up}$ &2 &4 &0 &0 \\             $\stack{\up\dw}{\dw\up}$ $\stack{\dw\up}{\up\dw}$ &2 &2 &8J &0 \\             $\stack{\up\dw}{\dw\dw}$ $\stack{\dw\up}{\dw\dw}$ $\stack{\dw\dw}{\up\dw}$ $\stack{\dw\dw}{\dw\up}$ &1 &4 &0 &-2 \\             $\stack{\dw\dw}{\dw\dw}$ &0 &1 &-8J &-4 \\             \hline         \end{tabular}     \end{table}          \end{document}


title: How to create a new environment for items with an image as bullet?

text: How to declare a fresh environment on which I can put items with an external local image, please? Any brilliant suggestion?


title: define new command: \renewcommand{\longto}{\longrightarrow}

text: I define this new command:               \documentclass[8pt,a4paper]{article}     \newcounter{conto}     \setcounter{conto}{\time}     \usepackage{lmodern}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{amssymb}     \usepackage{ dsfont }     \usepackage[mathscr]{euscript}     \renewcommand{\longto}{\longrightarrow}     \usepackage[a4paper,top=1cm,bottom=2cm,left=3cm,right=3cm]{geometry}     \begin{document}     \begin{flushleft}     \( a \longto +\infty \)     \end{flushleft}     \end{document}      but the command `\renewcommand{\longto}{\longrightarrow}` doesn't work!!


title: Collecting contents of environment and store them for later retrieval

text: I want to store contents of an environment and add them to a macro or command I could easily retrieve them, but I do not want to use the collect package. Are there any alternatives?               \documentclass{article}     \usepackage{environ}     \usepackage{blindtext}                    \NewEnviron{env}{     \global\let\content\BODY     %i want to add content to running list and later get whole contents     }          \begin{document}       \begin{env}      text text text\\      \end{env}          \blindtext               \begin{env}       moretext moretext more text\\     \end{env}          \end{document}


title: Compiler error when tikz nodes should be visible on non censecutive slides using temporal

text: Using `temporal` it is possible to get a transitioning effect on one slide. The following example creates an error on one of the lines. Essentially: This does work: `node at (ONE) [select on=<1>]{ONE}` This does work: `node at (ONE) [select on=<3>]{ONE}` This does work: `node at (ONE) [select on=<1-3>]{ONE}` This does not work: `node at (ONE) [select on=<1,3>]{ONE}`               \documentclass[c]{beamer}          \usepackage{tikz,times}          \begin{document}          \begin{frame}[fragile]          \newcommand{\magic}{1}     \newcommand{\interesting}{2}     \newcommand{\selected}{3}          \resizebox{0.485\textwidth}{!}{     \begin{tikzpicture}[baseline={(ONE.base)}]     \tikzset{         normal/.style={fill=white, align=center, draw},         selected/.style={fill=orange, align=center, thick, draw},         temporal/.code args={<#1>#2#3#4}{\temporal<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}{\pgfkeysalso{#4}}},         select on/.style={temporal=#1{normal}{selected}{normal}}       }          \coordinate (ONE) at (0,0);     \coordinate (TWO) at (4,1);     \coordinate (THREE) at (8,-1);          \draw (ONE) -- (TWO) -- (THREE);          \draw         %ERROR HERE         node at (ONE)   [select on=<\magic,\selected>]{ONE}         %node at (ONE)   [select on=<1,3>]{ONE} <- same error         %node at (ONE)   [select on=<\magic>]{ONE} <- no error         node at (TWO)   [select on=<\interesting>]{TWO}         node at (THREE) [select on=<\selected>]{THREE}         ;     \end{tikzpicture}     }     \begin{minipage}[t]{0.485\textwidth}     \scriptsize     \begin{overprint}     \onslide<\magic>     \textcolor{orange}{\emph{Magic}} --      The selected nodes are magic, the audience applaudes.          \onslide<\interesting>     \textcolor{orange}{\emph{Interesting}} --      The selected nodes are interesting, an author wrote a book.          \onslide<\selected>     \textcolor{orange}{\emph{Selected}} --     The selected nodes are selected. This may or may not be obvious.          \end{overprint}     \end{minipage}          %DO NOT INDENT THE END OF A FRAGILE FRAME     \end{frame}     \end{document}      To sort and present my data the way i want to i need the selections to show up multiple times in the presentation in different constellations. How can i fix this in a way that gets `node at (ONE) [select on=<\magic,\selected>]{ONE}` to work. Normal on all slides but 1 and 3 where the nodes show up as selected.


title: Latex gives error if I put an equation in the title of a section

text: I've a bit of a weird question. I would like to put an equation in the section title (I'm using `book`) but LaTex spits out the following error:                   [31] [32]Making bbold25.tfm from C:\Users\unknown\AppData\Local\MiKTeX\2.9\fonts\source\jknappen\sauter\bbold25.mf...     Running miktex-mf.exe...     This is METAFONT, Version 2.718281 (MiKTeX 2.9)          (C:\Users\unknown\AppData\Local\MiKTeX\2.9\fonts\source\jknappen\sauter\bbold25.          mf          ! I can't find file `b-bbold'.          l.2 input b-bbold                           ;          Please type another input file name          ! Emergency stop.          l.2 input b-bbold                           ;          Transcript written on bbold25.log.          miktex-maketfm.exe: Windows API error 2: The system cannot find the file specified.          miktex-maketfm.exe: Data: bbold25.tfm           5.     ! Font U/bbold/m/n/24.88=bbold25 at 24.88pt not loadable: Metric (TFM) file not     found.     <to be read again>                         relax      l.2280 \chapter{The $beta$}          ?       I've tried to debug and found that there is no problem with my setup (packages, etc.) because I can use equation in titles when I've deleted all my previous chapters. Subsequently, I tried deleting each chapter one at the time to determine what chapter causes the problem and, weirdly, it turns out that all the chapters are not compatible with my section. So in other words, I can put equations in titles if I start a new document, but for some reason it doesn't work with my existing dissertation. I would also like to mention that the error printed above is mentioning `MiKTex`, which I have installed on my computer, but I'm using TeXworks because I like it more. This may have something to do with the problem? If anybody could help me with this problem then that would be great. Best regards, Edit to show the code that is not working:               \documentclass[10pt,twoside]{book}               \begin{document}          \chapter{Blabla}          \begin{equation}     e^{i 2 \pi \mathcal{N}}=\mathbb{1} \Rightarrow \mathcal{N}=n' \;,\; n' \in \mathbb{Z}     \end{equation}          \section{The $\beta$}               \end{document}      At the moment that I would delete the equation above, then it does work. Also, this code does work:               \begin{document}          \chapter{Blabla}          \begin{equation}     e^{i 2 \pi \mathcal{N}}= \Rightarrow \mathcal{N}=n' \;,\; n' \in      \end{equation}          \section{The $\beta$}          \end{document}      So it seems to be related to the `\mathbb` syntex.


title: \xspace doesn't add whitespace before quotes if they are active

text: I'm trying to get `\xspace` to add a whitespace before “ if it is an auto quote using `csquotes`. Here is an MWE:               \documentclass{minimal}          \usepackage[autostyle,german=guillemets]{csquotes}          \usepackage{xspace}               \MakeAutoQuote{(}{)}          \def\test{test\xspace}          \begin{document}          Hello, \test (after command.)          \end{document}      It doesn't do what I want, no matter how hard I try... what am I missing? EDIT: more info: in the meantime I figured that even this               \def\qq{\csq@oqopen}     Hello, \test \qq after command)      will not work. Something is going on here that makes `\xspace` think it must not add a space. But I am lost as to why.


title: Shouldn't Beamer redefine \mathrm?

text: `beamer` does switch to a sans serif font for math. However, it does not redefine `\mathrm`. I think it should do so. I have a few formulas that use `\mathrm` to get upright characters and they look ugly with `beamer`. Do you agree or did I miss something?               \documentclass{beamer}     \begin{document}       $abc\mathrm{abc}$     \end{document}      * * * PS. I know how I could get properly looking formulas with `beamer`. I am not asking for help in this regard. In fact, I am suggesting an improvement (or even bugfix) here and would like to discuss how well the `beamer` package is written with regard to that issue. Argument: Other packages that define sans-serif math fonts redefine `\mathrm` as upright math (sans-serif) font. For example:               \documentclass{article}     \usepackage{cmbright}     \begin{document}       $abc\mathrm{abc}$     \end{document}      * * * `cmbright`, `sfmath` and `arevmath` all redefine `\mathrm` as upright sans- serif font. So I'd say `beamer` is the odd one here and should be changed.


title: How to calculate exactly the proper textwidth to get a pregiven wrapping?

text: I have a text written with 12pt letters. I would like to use 10pt letters with shorter textwidth but the same wrapping. How to calculate the width? It is possible to force LaTeX to do the same wrapping?


title: How to deal with different commas in text and math mode?

text: I'm writing a thesis and decided to use Charter (`\usepackage{XCharter}`) for text and Palatino (`\usepackage{mathpazo}`) for math. Unfortunately the commas in Charter and Palatino look very different, so I run into troubles when writing lists of variables in the text. Here's a minimal example:               The polynomial ring $\C[x,y,z]$ has variables $x$, $y$, $z$.      This renders as: ![rendered example](http://i.stack.imgur.com/57Mjo.png) Is this difference in fonts acceptable or should I consider using a different combinations of fonts?


title: How do I add numbered footnotes on every page?

text: I wan to be able adding numbered footnotes for some words in my documents, but displaying them on the same page and not at the end of the document. Ho do I do that?


title: Spell out Volume and Edition # in words - Biblatex in German?

text: Is it possible to make Biblatex output the word "Second" (in German) instead of the number 2? For example here is my preamble:               \usepackage[utf8]{inputenc}     \usepackage[         sorting=none,            backend=biber,         babel=other]{biblatex}     \usepackage{csquotes}     \usepackage[german,american]{babel}     \addbibresource{references.bib}      and here is my bibliography entry:               @book{Cantor,         author="Cantor, Moritz.",         title="Vorlesungen über Geschichte der Mathematik.  (von 1200 - 1668).",         language={German},         volume={2},         edition={2},         address="Leipzig",         publisher="Druck und Verlag von B.G. Teubner",         date={1900},         pagetotal="XII + 943 S.",         hyphenation={ngerman},         note="(in Germ.)",     }      However, when I run Babel+Biblatex on it, it outputs:               Moritz. Cantor. Vorlesungen uber Geschichte der Mathematik. (von 1200 - 1668).      German. 2. Aufl. Bd. 2. (in Germ.) Leipzig: Druck und Verlag von B.G. Teubner,      1900. XII + 943 S.      Whereis I want it to output "Zweite Auflage" and "Zweiter Band" instead of "2.Aufl." and "Bd. 2". Does anyone know if this is this possible with biblatex?


title: What steps are done by XeLaTeX when compiling input files with PSTricks codes, jpeg, png, eps, pdf images?

text: I am confused why XeLaTeX can produce a pdf output from an input file that contains PSTricks codes, PNG, JPEG, PDF, EPS images. It is the first time I use XeLaTeX and I am really surprised that I can import images from many different format in the same input file. Usually I use latex-dvips-ps2pdf to compile my input file that contains PSTricks codes and only EPS images. If I have PNG, JPEG and PDF images, I must convert them in advance to get the EPS version. Unfortunately, XeLaTeX runs slower than latex-dvips-ps2pdf. I don't know why. Behind the scene, what steps are actually done by XeLaTeX when compiling input files with PSTricks codes, jpeg, png, eps, pdf images?


title: how to put graph in the paragraph with text?

text: I wish to put some special symbols as highlighted in the following picture in to the text garagraph, I just know how to put graph independent from the paragraph. Would someone help me? ![enter image description here](http://i.stack.imgur.com/YbfN8.jpg)


title: How to add a custom symbol to LaTeX?

text: Suppose I need some crazy custom symbol for personal use. e.g. when I write `\foobar`, LaTeX should show ![](http://i.stack.imgur.com/swvUU.png). How do I achieve this? **Update:** I was writing Klingon writing system for fun. Thank you very much you all. Looks like this now ![enter image description here](http://i.stack.imgur.com/6ObOp.png)


title: How do I generate only the first 10 pages of a document?

text: I use `pdflatex` to generate my documents. I want to create a preview of my document and generate only the first 10 pages, but I still want the full table of contents. How do I do that?


title: Defining a reusable string from within an environment

text: I write documents that rely heavily on the 'enumerate' environment. I'd like to turn any particular item from within that environment into a variable that I can use elsewhere. The idea is to ensure consistency with long headers I have to repeat later. Ideally, the string store method wouldn't check for special characters like @ or _.   Better still if I could use numbers for the string name.               \begin{enumerate}              (piles of content)                \item\label{itm:01} \def\AA{Heading text.} \rAA\          \end{enumerate}          (piles of content)          \rAA      This throws an 'undefined' error. It's possible to define the command outside an environment and use it within one, but with extended lists and multiple headers, repeatedly going elsewhere to find out what section I'm in slows my workflow. Am I overlooking a simple way (or even not-so-simple way) of doing this?


title: [minimal] option for CV

text: I've been thinking of implementing an option for my CV where it extracts a set of predefined sections (in a minimal form) and typesets that instead of the entire list of everything I've done in my life. How can I go about implementing this? I just need an example of how my code should look like, e.g., for my Talks sections, the minimal option would remove the authors, but would keep only the title of the talk and the venue. At the same time, it would be nice to modify the margins, to squeeze more info onto pages. I'm thinking that it will involve some ifthenelse options? If [minimal], \ignore{\authors} or something of the sort. Can someone give me example code to steer me? I'm OK with messing in LaTeX, but just need guidance with starting this approach.


title: Using TikZ to draw a water channel profile

text: I want to draw a relatively simple sketch using TikZ but I can't do it. What I want is a representation of an open water channel with 4 pools, a dam upstream, and a waste reservoir downstream, as depicted in the picture below: ![Open channel profile](http://i.stack.imgur.com/bqFLJ.jpg) I would like to label the pools, dam and waste as I did in the drawing. In addition, I also would like to label the interface locations (numbered from 4 to 8, in this example). Those inclined lines are supposed to represent the ground. The water representation itself, in blue, is not mandatory, I included it in the drawing just for better understanding. I may not include it in the final sketch. I like to use LaTeX and TikZ and I like to do these things in a flexible way that let me easily adjust sizes or reuse parts of the code in other pictures.


title: How to install fonts from the LaTeX font catalogue?

text: How can I install both fonts in the page http://www.tug.dk/FontCatalogue/garamondx/ to work together? My attempt so far was installing both as OpenType system fonts and using XeLaTeX with no success. I'm currently using TeXworks and MikTeX on Windows 7.


title: How to customize .bst files

text: Hi all as I'm trying to make citations according to norm ISO 690-2 I faced "decapitalisation" of BibTeX entries, see: BibTeX loses capitals when creating bbl file. That was for `plain` style. Now I switched to different style but I'd like to change a bit it's appereance.   1. List item I'd like to have enumerated list instead of [Name(year)] notation.   2. I'd like to have references in upper index. For `2`, I created command `\cituj`as `\raisebox{1ex}{\footnotesize\cite{#1}}` but it forced errors when used in captions. Thanks for any approach or link to `.bst` manual, I've tried to find some hints, but it took me only to `makebst`.


title: Renaming date in revtex4

text: I found the similar question and answer for renaming some of the keywords, but they were for revtex4-1. Since my document is giving me strange errors when I'm using revtex4-1, and not when I'm using revtex4, this solution didn't help. I also found a documentation about revtex4 and there I found this: > The optional argument allows the user to override the text that will be > typeset along with the date; the default value of that text is itself a > localized macro.               1156\renewcommand*\date[2][\Dated@name]{\def\@date{#1#2}}%     1157\def\@date{}%      But this isn't working (or I don't understand how to use this) Here's the 'mwe'               \documentclass[onecolumn,prb,floats,amsmath,amssymb,superscriptaddress,nofootinbib,12pt]{revtex4}          \usepackage{graphicx}     \usepackage{bm}     \usepackage[croatian]{babel}     \usepackage{ucs}     \usepackage[utf8x]{inputenc}     \usepackage[dvipdfm,colorlinks=true,bookmarks=false,urlcolor=DarkOrchid,citecolor=ForestGreen,linkcolor=Cerulean,pdfstartview={XYZ null null 1.00}]{hyperref}     \usepackage{extarrows}     \usepackage{subfigure}     \usepackage{caption}     \usepackage{mathtools}     \usepackage{bbm}     %\usepackage{float}     \usepackage{psfrag}     \usepackage{url}     \usepackage[all]{hypcap}     \usepackage{subfigure}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}     \usepackage{listings}     \usepackage{array}     \usepackage[paperwidth=210mm,paperheight=297mm,centering,hmargin=2cm,vmargin=2.5cm]{geometry}     \usepackage{enumitem}     \setlist{nolistsep}     \makeatletter      \gdef\@ptsize{0}% 10pt documents      % or:      %\gdef\@ptsize{1}% 11pt documents      %\gdef\@ptsize{2}% 12pt documents      \let\@currsize\normalsize      \makeatother      \usepackage{setspace}      \onehalfspacing          \renewcommand*\date[2][\Dated@name]{\def\@date{#1#2}}%     \def\@date{Datum:}%          \renewcommand{\tocname}{Sadržaj}          \makeatletter     \renewcommand{\thesection}{\arabic{section}}     \renewcommand{\thesubsection}{\thesection.\arabic{subsection}}     \renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}     \makeatother               \DeclareCaptionFont{white}{\color{white}}     \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}     \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}          \newcolumntype{y}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}     \renewcommand*{\arraystretch}{1.2}               \begin{document}          \title{Random title}     \author{Random guy}     \affiliation{Random place, 99999 Randomville}     \date{\today}          \begin{abstract}          \end{abstract}          \maketitle          \begingroup     \hypersetup{linkcolor=black}     \tableofcontents     \endgroup               \section{Intro}          \section{Bla}          \subsection{Bla1}               \section{Bla!}               \end{document}


title: Pgfplots contour gnuplot crazy labels

text: This is driving me mad. I am tryng to create some contour plots, but I get them full of labels, so that they are unreadable! I can't even see the lines or read the values because they are too much. I just formatted the numeric output from my script, so that the code I am placing here is not really nice. Anyway, I can get the right contour but I would like to have ONLY ONE label on each contour line, not N. I couldn't find any solution on pgfplots manual. Here is my code:               \begin{tikzpicture}         \begin{axis}              [xlabel=$x$,              ylabel=$y$,              width=0.48\columnwidth,                      view={0}{90},                      ymin=0, ymax=70                      ]             \addplot3                  [contour gnuplot,                              thick                              ]                 coordinates {                 .....                 };         \end{axis}     \end{tikzpicture}      I did not post the coordinates because my file was more than 1000 lines. Any idea? Thanks in advance


title: Colored fully bars in bar vertical plot

text: I created a plot with pgfplots using this snippet of code:               \begin{figure}[htp]     \centering         \begin{tikzpicture}             \begin{semilogxaxis}[ybar stacked,ymajorgrids=true]                 \addplot [red]                     table [x=nodes,y=1]                     {./MATLAB/grafici/energia/broadcast_scenario/energy_broadcast_varpktslossprobability_100nodes.txt};             \end{semilogxaxis}         \end{tikzpicture}     \end{figure}      I got as result the correct plot, but the bars aren't fully colored. Only the borders of this bar are colored of red, instead I would like them fully colored also internally.


title: Is it a bad idea to use \begin{section} ... \end{section} in LaTeX?

text: In several discussions about relatives merits of LaTeX v. xml, a xml supporter complained that in LaTeX sections, subsections etc are not properly closed, so it is hard to tell where a section ends. Of course it is typically possible to recognize an end of a section, but there is actually a number of ways how a section can end: start of another section, start of the next chapter or part, start of `\endmatter`, bibliograpy, index, etc, or the end of document. That makes it hard if you want to write a script that would in some way manipulate sections (change their order, write each of them into a separate file, ...). The same is of course true for subsections, paragraphs etc. One answer to that is that it is actually possible in LaTeX2e to use sectioning commands as environments, and write               \begin{section}{Blah blah}        ...     \end{section}      and because of the way environments are handled in LaTeX2e, it will work. I he recently seen several comments discouraging such use of regular commands as environments, and it seems that in LaTeX3 it will no longer be possible (on the other hand, it seems that you will be able to define a `section` environment without causing a conflict with the `\section` command). I wanted to know what people think about using sectioning commands as environments. Is it a good idea, is it OK, or should it not be done?


title: Problems converting matlab figures to pdf using /psfragfig

text: I am trying to include MATLAB figures as pdf files in my thesis. However after reinstalling my OS this doesn't work anymore and I am desperately trying to find a solution... **What I do:** I use the function **_matlabfrag.m_** to export the .fig files to **.eps** and **.tex** files. This works perfectly fine. Then I create a temporary .tex file. This file contains the command               \psfragfig{figurename}      which replaces the standart MATLAB font with latex commands formulas etc. specified in the figurename.tex file. This temporary .tex file is then used to create a .pdf file with the command               pdflatex -shell-escape --src -interaction=nonstopmode tempfilename.tex       So far so good. Before I reinstalled my OS everything worked fine. Now I get the **Error** : > Package pstool Warning: Execution failed during process: ps2pdf > -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImag > eFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -dPDFSETTINGS=/prepress > "70 00_CFC60_acc_single-pstool.ps" "7000_CFC60_acc_single-pstool.pdf" This > warning occurred on input line 16. > > LaTeX Font Info: Try loading font information for T1+aett on input line 16. > (/usr/share/texlive/texmf-dist/tex/latex/ae/t1aett.fd File: t1aett.fd > 1997/11/16 Font definitions for T1/aett. ) runsystem(echo " === pstool: end > processing === ")...executed. > > runsystem(rm -- 7000_CFC60_acc_single2.oldaux)...executed. > > [1 Non-PDF special > ignored!{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] > (./7000_CFC60_acc_single2.aux) > > LaTeX Warning: Label(s) may have changed. Rerun to get cross-references > right. > > ) (\end occurred when \ifx on line 16 was incomplete) The .ps file looks perfectly alright. As the error suggests the problem must be .ps >> .pdf. I also stripped down the .tex file to a bare minimum, however only encountered other errors. Here is my temporary **tempfilename.tex** file:               \documentclass[11pt, oneside]{article}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage[T1]{fontenc}     \usepackage[utf8x]{inputenc}     \usepackage{ae}     \usepackage{psfrag}     \usepackage{color}     \usepackage[crop=pdfcrop]{pstool}     \pagestyle{empty}          \begin{document}       \begin{figure}           \centering           \psfragfig[width=\textwidth]{7000_CFC60_acc_single}       \end{figure}          \end{document}      I hope someone can help me :)


title: How to draw horizontal line with rubber length?

text: The `\hrulefill` command could draw rubber length underlines, like `abc___def`. I just want to draw line in the vertical centre of a text, like `abc---def`. Thanks.


title: A more wedge-like symbol instead of a caret in typewriter-font text?

text: I'm trying to typeset some computer code which involves a caret (for powers); for example               \verb!x^3+x^2-1!      The trouble here is that the caret produced is rather flat. I could use a wedge instead:               \newcommand{\pwr}{${}^\wedge}$}     \texttt{x\pwr 3+x\pwr 2-1}      but the wedge here is too pointy, as well as being the wrong weight for the typewriter font. What I want to know is: is there a symbol, which comes halfway between caret and wedge in shape, and is the same weight as a typewriter caret (so can be used within `\texttt{}`)? I've tried replacing `\verb!^!` with `{{}\large\textasciicircum}` and this sort of works, but is still clearly not an optimum solution.


title: Typesetting documents that are a mix of Arabic and Latin script without annoying markup

text: How can I insert LTR script directly within RTL text without cumbersome markup? (consider a Language learning book. ) What is most clean method to write following texts?               Aa bb cc ااا ببب تتت dd ee ff.      or               ااا ببب ثثث aa bb cc تتت خخ.      If I do not use extera markup the output of `One Two Three` will be `Three Two One` in RTL document and output of `یک دو سه` will be `سه دو یک` in LTR documents. also see: LTR sequences within RTL text - alternative to cumbersome markup?


title: How can I get textpos to respect beamer overlays?

text: I'm using `textpos` to position text blocks in a `beamer` frame. However, the `textblock` environment does not seem to respect overlay commands. In the following example, I want "some more text" to be invisible on the first slide and visible on the second. However, when I compile the document, it is visible on both slides. How can I make it invisible on the first slide?               \documentclass{beamer}          \usepackage[overlay,absolute]{textpos}     \setlength{\TPHorizModule}{1cm}     \setlength{\TPVertModule}{1cm}          \begin{document}          \begin{frame}     Some text            \visible<2->{             \begin{textblock}{5}(6,6)                 Some more text             \end{textblock}               }     \end{frame}          \end{document}      **Edit:** Both of the answers that have been given so far are quite useful, and I am not sure which one to accept. On one hand, CyberSingularity's answer allows me to use multiple `textblock` environments with a single overlay command, while Paul Gaborit's answer would require a different overlay command for each `textblock`. On the other hand, Paul Gaborit's answer allows me to use the `\visible` command. I prefer `\visible` to `\only`, since, as cyberSingularity noted, `\visible` reserves the amount of space that it needs.


title: Autocompile LaTeX doc when updated in Windows (via dropbox, in this case)

text: **Goal:** I'd like to be able to have a script running on my Windows computer that autogenerates the PDF of my LaTeX doc whenever the main .tex doc gets updated. **Use case** is I am editing the .tex file via an iPad, and I want my main computer to compile the pdf so that I can open it in my Dropbox app on the iPad to see the results, whenever I update the .tex file via the iPad and dropbox synchronizes it. **My Problem:** The main thing I know nothing about is how to get a script running on windows that can automatically do this. I _could_ spend hours googling and learning about such things, but would rather get a suggestion by someone who knows a quick solution. In short, please don't just tell me a windows scripting language to learn. Show me how to do make this work. For everyone's benefit, here's what I understand is needed to make this happen:   1. A working LaTeX implementation on the Windows machine (miktex is base install, TeXnicCenter is editor of choice when on Windows machine)   2. A (latex friendly) text editor on my iPad with integration to dropbox. (textastic for me)   3. A script that automatically runs on my Windows machine whenever the dropbox file gets updated. This is where I need suggestions. Bonus points for an easy way to enable and disable the script from running.


title: Translating Matlab figures into TikZ

text: When ever I want to write a research paper and print the simulated results (by Matlab) into an `.eps` file, I think of a direct way of translating Matlab fig files into LaTeX (especially TikZ). Is there a way to do such a thing?


title: Create an environment like the `checkboxes` in exam.cls

text: I am having trouble on how will i create something like the `checkboxes`or `oneparcheckboxes` environment in `exam.cls`. The only difference is that since the `checkboxes` gives circle, i'd like to create environment which give squarebox for multiple choice. when i type this in `.tex` file:               \documentclass{exam}     \begin{document}     \begin{questions}     \question How should I?     \begin{checkboxes}     \choice AA \choice BB \choice CC     \end{checkboxes}     \end{questions}     \end{document}      it would output a vertical lane of choices like ![enter image description here](http://i.stack.imgur.com/WFFbG.png) and using `oneparcheckboxes` environment:                \begin{onecheckboxes}      \choice AA \choice BB \choice CC      \end{onecheckboxes}      ![enter image description here](http://i.stack.imgur.com/a1Rxu.png) i would like to create something like the `checkboxes` and `oneparcheckboxes`: ![enter image description here](http://i.stack.imgur.com/5IzWw.png)


title: More sophisticated syntax highlighting of Prolog code

text: I'm wondering, does listings allow you to define your own syntax highlighting, and if so, how sophisticated is its system? Here's a minimal example:               \documentclass{article}     \usepackage{listings}          \lstset{emph={%          {:-}%          },emphstyle={\color{red}\bfseries\underbar}%     }%          \begin{document}     \begin{lstlisting}[language=Prolog]         foo(Arg1, Arg2) :-           bar(Arg3),           baz(Arg4),           length([1,2,3], 3).     \end{lstlisting}     \end{document}      Ideally, in the following code sample, "foo" would be highlighted (since it's declaring a new clause), as would ":-". I tried to use emph and morekeywords to highlight :-, but neither worked. They seems to work for regular words like "for" and "while", but not for the sequence ":-". Is there a special way to escape this to add a keyword? To highlight the name of the predicate before :-, I have no idea how I would tackle that. It's not essential, but it would be nice if I could get it working. Can I define custom syntax/grammar for highlighting Prolog?


title: Integrate Latex in desktop application

text: I'm considering using LaTeX in a (windows) desktop application. The idea is to deploy LaTeX via my installer. My application would then start it by a process execute call in order to generate a report. Has anybody experience with deploying LaTeX with an application? I don't want to use the typical installer that starts to download the required packages but provide everything by my installer. Could I run into license trouble?


title: Beamer slides slow to change when using media9

text: I'm successfully using the `media9` package to compile presentation pdf's with embedded _mp4_ files. The problem is that after the video is done, and I am ready to change to the next slide, it takes at least 10 seconds until the pdf renders the next page. I usually work in Linux, but I'm trying to use Windows just to play this presentation. I'm using `MiKTeX 2.9` to compile the slides, and the version of `media9` compiled on March 27, 2013. My slide is as follows:               \begin{frame}[c]       \begin{center}         \includemedia[ label=vidA,                 activate=onclick,                 width=.95\textwidth,                addresource=http://localhost//vid_mod.mp4,                flashvars={src=http://localhost//vid_mod.mp4}                ]{\fbox{~}}{StrobeMediaPlayback.swf}       \end{center}     \end{frame}      I have tried using `VPlayer.swf`, and the videos did not play at all. I have also tried embedding the videos directly into the pdf i.e. not using a local webserver, and I get the same behavior. Any suggestions?


title: How do I pass an expanded optional argument using expl3/xparse?

text: I have a command defined using `xparse` syntax:               \DeclareDocumentCommand \foo { O{} m } {}      Inside some other command (say, `\bar`), I want to call this command. The calling command (`\bar`) has to construct the arguments to feed to `\foo`. So the call is something like:               \foo [\tl_use:N \l_my_temporary_tl] {}      I want to make sure that when `\foo` is called, it is the actual token list and not the command that gets passed. If `\foo` took two mandatory arguments then it would appear that I could just do               \exp_args:No \foo {\tl_use:N \l_my_temporary_tl} {}      (I realise that the number of expansions here might be incorrect, but that's not the point.) Is there a similar syntax for optional arguments? If not, how would the following look:               \cs_new:Npn \exp_opt_args:No #1[#2] { \exp_after:wN #1 \exp_after:wN [#2] }      and similar ...


title: How to increase the node memory size in ConTeXt?

text: With a very large document, after about 30 minutes of compiling with `context`, I get this error:               ! TeX capacity exceeded, sorry [node memory size=100987760].      I added a line to `texmf.cnf` which says `node_memory_size=1000000000`, which should increase the memory size by 10 times, then ran `sudo fmtutil-sys --all`, but the error still appears.   * What value do I need to change to get this document to compile?


title: Drop brackets around reference item in `natbib`

text: I am writing for a journal (Transportation Research Record) that has strange and particular bibliographic guidelines. I've been able to adapt `natbib` to work for the in-text citations. But the bibliography prints brackets around the item numbers.               \documentclass[11pt]{amsart}     \usepackage{graphicx}     \usepackage{amssymb}     \title{Brief Article}     \author{The Author}         \usepackage[round,sort,numbers]{natbib}         \newcommand{\trbcite}[1]{({\it\citenum{#1}})}     \begin{document}     \maketitle          This is an example citation \trbcite{Mokhtarian2008}.     \bibliographystyle{plain}     \bibliography{bibfile}     \end{document}      ![enter image description here](http://i.stack.imgur.com/zWAig.png) With `bibfile.bib` containing               @article{Mokhtarian2008,     author = {Mokhtarian, Patricia L. and Cao, Xinyu},     doi = {10.1016/j.trb.2007.07.006},     issn = {01912615},     journal = {Transportation Research Part B: Methodological},     keywords = {built environment,causality,land use,residential location,smart growth},     month = mar,     pages = {204--228},     title = {{Examining the impacts of residential self-selection on travel behavior: A focus on methodologies}},     url = {http://linkinghub.elsevier.com/retrieve/pii/S0191261507000744},     volume = {42},     year = {2008}     }      Any easy ways to do this? Or is this something that will require the .bst file?


title: LyX: Configure a command for 3x3 determinant

text: I've been trying to add a new command to LyX to easen my way through physics, when mostly 3x3 determinants are used. I clicked `Document` -> `Settings` -> `Preamble` and wrote the following:               % det 3x3     \newcommand{\ninedet}{$\begin{vmatrix}\\     \\     \\     \end{vmatrix}$}      Now, there are a few problems:   1. I understand that this code is supposed to make a 3x1 det, not 3x3.   2. It doesn't seem to work either way. Thoughts? Any help would be deeply appreciated. `:)`


title: Can I fill an area transparent?

text: I am currently trying to improve the images of some basic geometry articles in Wikipedia. One image I have improved is the of an Arbelos (en). This is the LaTeX-Code:               \documentclass{article}     \usepackage[pdftex,active,tightpage]{preview}     \setlength\PreviewBorder{2mm}     \usepackage{tikz}          \begin{document}     \begin{preview}     \begin{tikzpicture}              % Draw A         \coordinate[label=left:$A$]  (A) at (0,0);              \begin{scope}[shift={(4,0)}]             % big half-circle from A to B             \draw[thick,fill=green!30] (0,0) -- (0:4cm) arc (0:180:4cm);                  % Draw D             \coordinate[label=below:$D$] (D) at (2,0);                  % Perpendicular CD             \draw[thick] (2,0) -- node[] {} (2,3.47);                  % Draw C             \coordinate[label=above:$C$] (C) at (2,3.47);         \end{scope}              \begin{scope}[shift={(3,0)}]             % Crop circle AD from the big green circle AB             % This is the one I would like to be transparent             \draw[thick,fill=white] (0,0) -- (0:3cm) arc (0:180:3cm);                  % Draw B             \coordinate[label=below:$B$] (B) at (5,0);         \end{scope}              % Circle DB - should also be transparent         \draw[thick,fill=white] (7,0) -- (8cm,0) arc (0:180:1cm);              % Cirlce CD         \draw[thick] (6,1.735) circle (1.735cm);              % I have to draw this one, as "arc" doesn't completely          % draw the line AB         \draw[thick] (0,0) -- node[] {} (8,0);       \end{tikzpicture}     \end{preview}     \end{document}      It is working and looks like that: > ![enter image description here](http://i.stack.imgur.com/nD8QX.png) Looks fine, except that the two circles AD and DB are white, not transparent. Take a look at the SVG for that: File:Arbelos-tikz.svg. How can I overwrite the green filled circle with transparent / crop this part out of the green circle? (If it is possible to make this piece of LaTeX-Code simpler, please let me know.)


title: Other than syntax what is the difference between \dimen0= and \setlength{}{}?

text: I have been browsing around for a while trying to find an answer to the above question, and I have found some similar questions along with there answers, so I already have a vague idea how to answer my own question. As a result I am really just looking for confirmation. First some similar questions:   * What is the difference between \def and \newlength?   * What are the differences between \newdimen, \newskip and \newlength? My understanding at this point: `\dimen0=value` is a tex primitive, which does roughly the same thing as the following combination of latex commands `\newlength{\name}\setlength{\name}{value}` where the numerical identifier `0` fulfils the purpose of the name chosen with `\newlength`. So my first real question is whether that is more or less correct? I also have a follow up question: When if ever is it appropriate to use the more basic version of some command? I have recently embarked upon my first LaTeX project that really goes beyond mere usage. In my past usage, the distinction between basic Tex and LaTex commands simply never came up. I am increasingly getting the feeling that I need to read an actual book to get any further than where I am now, so for a final follow up question, I would like to ask the more experienced amongst you out there, how I might go about going beyond a competent user understanding of TeX.


title: Theorem packages: which to use, which conflict?

text: As far as I know, one can create theorem environments using any of `amsthm`, `ntheorem`, `thmtools` and probably more. How should I define my theorem environments? Is one package clearly superior? Which packages conflict? Is there one package that does everything? (For some reason I am using `ntheorem` but I cannot remember why). For example, `thmtools` looks like it has some nice features, but I'm afraid of breaking my `ntheorem`-defined custom environments...


title: ntheorem vs. amsthm

text: As far as i know, these are alternative packages for playing with theorem-like environments. What do you choose and why? What should be the _de facto standard_? * * * Regarding the same topic, are you able to port the following solutions to use the alternative package?   * Example environment (amsthm)   * Theorem environment (ntheorem)


title: Amend tabular environment in preamble: different font

text: I'd like to put some lines in the preamble _to change the font of all tabulars in the document_. I know that I can easily define my own environment »mytabular«. But for different reasons I need to change tabular. I thought about simply adding (see MWE below) code to the macro, unfortunately without success.               \documentclass{article}              \makeatletter         \g@addto@macro\tabular\fontfamily{phv}\selectfont         \makeatother          \begin{document}          This is some text.          \bigskip          \begin{tabular}{lr}       Hello! & 1234 \\     \end{tabular}     \end{document}      Those tabulars will be used outside floats, so it does not help to change something in the table environment.


title: How to set style of a single edge in the tree (TikZ) ?

text: The Tikz manual gives "edge from parent" construct.   But it is peculiar (it changes all the edges in subtree and some nodes).   How to color and thicken exactly one edge?


title: Typesetting the entire Song That Never Ends

text: I've heard that LaTeX (and for that matter TeX) are Turing-complete, so it should be possible to produce an infinite loop. And indeed, a quick search reveals several questions in which users have found infinite loops--but these were always for subtle reasons and rather indecipherable to someone just wanting to see a basic loop construction. (I suppose that "transparent" infinite loops are usually solved by the programmer without having to ask here.) Hence, my question: How do you produce an infinite loop in a way that is enlightening to someone to whom the Turing-completeness of LaTeX feels like a myth? Or, just to spice it up a bit: How do you tell LaTeX to print all infinitely many verses of "The Song That Never Ends"? [Note: I conceived of a version of this question some time ago--long before I knew the answer--but never got around to posting it. I am interested in seeing approaches besides the one I eventually came up with myself.]


title: Replicate Figure w/out Inserting New Entry in List of Figures

text: I would like to replicate a figure in Chapter 3 within Chapter 6 such that the figure is displayed and optionally, it has the caption and Figure number of the figure in Chapter 3. If that is not possible, I would like to remove its entry from the List of Figures so that 2 of the same figures are not present. For the latter I was able to find this: Removing captions but I suspect it will add the entry to the list of Figures. Is this achievable? Secondly, is this the preferred way of performing a replication?


title: Putting a tabular in a node within a matrix

text: I have a picture in which each of the nodes looks something like this:               \node (species1) [shape=rectangle,draw] {       \begin{tabular}{c c c}       \multicolumn{3}{c}{{Species 1}} \\       \colorbox{red}{G1a} & \colorbox{blue}{G2a} &       \colorbox{green}{G3} \\       \colorbox{blue}{G1b} & \colorbox{red}{G2b} &        \end{tabular}     };      The nodes look fine, but when I put them all into a `matrix` node to align them properly, the `tabular`s inside the nodes are all screwed up and I get errors like this one:               Extra alignment tab has been changed to \cr. ...{G1} & \colorbox{blue}{G2a} &     \colorbox (followed by: {green!50}{G3})      Is there are way to make this work?


title: (How) can I manually specify the axis of a (horizontal) box in math mode?

text: > **This question led to a new package:**   >  `underoverlap` I've been using the `\overunderbrace` macro provided in this answer. It works fine for simple examples, but since the original definition uses `\vcenter`, vertical alignment is not correct when the axis of the 'content' is not aligned to its vertical center. For example, to get proper alignment in the following formula, I had to do some manual tweaking with `\raisebox`. Not ideal.   ![enter image description here](http://i.stack.imgur.com/SOq8X.png) I'm trying to perfect the macro; perhaps write a small package. (There are several extensions possible, e.g., `\underoverbrace`, custom vertical spacing, custom brace-command (`\underoverline`), etc.) **Question:** Rather than 'naively' using `\vcenter`, is there a way to raise/lower the whole structure the exact amount needed to align its axis with the axis of the 'content' (which is a row in a `\halign`)? Several possible solutions come to mind:   * The simplest (for me) would be to add two optional arguments to the macro for the content before and after the bracing. I could then put them in the 'content row'. But I'd rather not have to.   * If I have to, I can probably measure the segments and calculate the correct amount to raise/lower. I'm just hoping there's a simpler solution I'm not yet aware of. * * * **Edit:** Here's a simple MWE of the misalignment, based on the example of the original answer:               \documentclass{article}          \makeatletter     \def\overunderbrace#1#2#3{%         \begingroup         \let\overunderbrace@sup\empty         \let\overunderbrace@sub\empty         \@ifnextchar^%             {\@overunderbracesup{#1}{#2}{#3}}%             {\@ifnextchar_%                 {\@overunderbracesub{#1}{#2}{#3}}%                 {\@overunderbrace{#1}{#2}{#3}}%             }%     }          \def\@overunderbracesup#1#2#3^#4{%         \def\overunderbrace@sup{#4}%         \@ifnextchar_%             {\@overunderbracesub{#1}{#2}{#3}}%             {\@overunderbrace{#1}{#2}{#3}}%     }          \def\@overunderbracesub#1#2#3_#4{%         \def\overunderbrace@sub{#4}%         \@ifnextchar^%             {\@overunderbracesup{#1}{#2}{#3}}%             {\@overunderbrace{#1}{#2}{#3}}%     }          \def\@overunderbrace#1#2#3{%     \mathop {\vcenter {\m@th \ialign {##&##&##\crcr         \noalign {\kern 3\p@}%         \span\omit\hfil\hbox{\vbox to 0pt{\vss\hbox{\vbox{\hbox{$\m@th\scriptstyle\overunderbrace@sup$}\vspace{0pt}}}}}\hfil         &%         \crcr \noalign {\kern 5\p@\nointerlineskip}%         \span\omit\downbracefill&%         \crcr \noalign {\kern 3\p@\nointerlineskip}%             $\hfil \displaystyle {#1}\hfil $&%             $\hfil \displaystyle {#2}\hfil $&%             $\hfil \displaystyle {#3}\hfil $%         \crcr \noalign {\kern 3\p@\nointerlineskip}%           & \span\omit  \upbracefill         \crcr \noalign {\kern 5\p@\nointerlineskip}%         &\span\omit\hfil\hbox{\vbox to 0pt{\hbox{\vbox{\vspace{0pt}\hbox{$\m@th\scriptstyle\overunderbrace@sub$}}}\vss}}\hfil         \crcr \noalign {\kern 3\p@ }%     }}}%         \endgroup     }     \makeatother               \begin{document}         $$             a+b+             \overunderbrace                 {c+\mathord{\mathop{\Sigma}_d} + \mathord{}}                 {e+f+g}                 {\mathord{}+h+i}^{x}_{y}             = e^2         $$     \end{document}      ![enter image description here](http://i.stack.imgur.com/Hnl0Z.png)


title: change location and size of title page logo

text: I have a title thesis with a logo: ![enter image description here](http://i.stack.imgur.com/pveMq.png) but i would like to get the logo (size 990x369) a little higher and bigger than current result (if I change the size of image it goes down...), also how can I format the name of advisors and synodal? ![enter image description here](http://i.stack.imgur.com/xjkhZ.png) I have :               \begin{titlepage}     \includegraphics[width=.23  \textwidth]{images/logo.jpg}     % \TitleBlock{\includegraphics[height=2.6cm]{imagenes/logo.png}}     \vspace{+.21in}     \parbox[][3in][s]{6in}{%             {\vspace{+.05in} \par}             \centering                           {\small \textsc{ \bfseries {THE NAME OF THE THESIS GOES RIGHT\\ HERE IT IS A LITTLE LONG BUT IT\\ IS HOW IT IS}} \par}                 \vspace*{\fill}                 {\small \textsc{Thesis presented by} \par}                 \vspace*{\fill}                 {\small \bfseries {The name of the guy doing defending the thesis} \par}                 \vspace*{\fill}                 {\small \textsc{To become} \par}                 \vspace*{\fill}                 {\small \bfseries {\textsc{Ph. D. }} \par}                 \vspace*{\fill}                 {(Certain kind of Ph. D.) \par}                 \vspace*{\fill}                      \vspace{+.1in}                 \vspace*{\fill}                 \vspace{+.5in}                 \vspace{+.3in}                 {Advisors: \par}                 \vspace*{\fill}                      {\small \bfseries {Dr. the first name} \par}                 {\small \bfseries {Dr. the second name} \par}                            \vspace*{\fill}                 \vspace{+.5in}                 {Synodal: \par}                 \vspace*{\fill}                      {\small \bfseries {Dr. the first name} \par}                 {\small \bfseries {Dr. the second name} \par}                 {\small \bfseries {Dr. the third name } \par}                 \vspace{+.4in}         \parbox[][.35in][s]{6in}{%             \vspace*{\fill}             {\centering             \textsc{University} \par             \textsc{Departament} \par             \textsc{City and Date} \par                  }             \vspace*{\fill}         }         }     \end{titlepage}


title: File with log is not found error and can't run bibtex

text: I have a long CS thesis text in Latex. After adding package for Python code, I receive error: `Can't find file and log`. And can't run Bibtex from TexMaker. I put variable to MiKTex bin and folder with `.tex` files. Tried to comment out parts and exclude some text and remove packages but no way to fix that. I have reinstalled MikTex on several computers but it can't help. What to do to fix this problem?


title: How to find characters that LaTeX doesn't like?

text: I use exported .bib entries with `biber`, `biblatex` and `\usepackage[utf8]{inputenc}`, in my literature reports for my group. This means most standard annoying characters (à, etc) are handled automatically. However, there are a lot that are not. Also, it prints gibberish on the command line. > \u8:� Is the closest I can get (via pdflatex file.tex >demo.txt), thought it gives actual gibberish on the command line, depending on what the symbol is. It also doesn't say anything about where in the bib file that character is, so I have to try and use several runs of kill here and run fully to guess the entry... This means that quite often I have to search through my document trying to find the one character that is screwing it up. Often it isn't even a letter, but someone is using a non-ASCII hypen or some such. Is there an easy way to check for non-LaTeX approved characters in a file? The closest I've found is some mode in emacs that turned non-ASCII characters red, but I forget how I did that, and I still had problems noticing one slightly red hyphen in a 3000 line file. Are there better tools? Or even someone who knows who to turn that mode back on?


title: Use [midway], [near end] etc. for weights in TikZ

text: Is it possible to move weights of vertices using the commands `[midway]`, `[near end]`, `[near start]` etc? Just stating `{above}` and `{below}` doesn't always help, since the weights sometimes overlap:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{center}     \begin{tikzpicture}[scale=4,auto,swap]     \foreach \pos /\name in {{(0,0)/4},{(1,0)/5},{(2,0)/6},{(0,1)/1},{(1,1)/2},{(2,1)/3}} \node[vertex](\name) at \pos{$\name$};     \foreach \source /\dest /\weight /\pos in {1/6/12/{above left},3/4/10/{above right},4/5/6/{below},5/6/9/{below},1/5/7/{above left},3/5/6/{right}} \path[edge] (\source) -- node[weight, \pos] {$\weight$} (\dest);     \foreach \source /\dest /\weight in {1/2/12,2/3/7,2/4/4,3/6/5,4/1/10,6/2/8} \path[arrow] (\source) -- node[weight] {$\weight$} (\dest);     \end{tikzpicture}     \end{center}     \end{document}


title: pgfplotstable: centering colums and adding vertical lines

text: I'd like table to have centrally aligned columns and a vertical line between columns 2 and 3. This was possible before I included the 'dec sep align' code but afterwards the columns shifted to the left and the vertical line disappeared. Any help would be great. Here is my attempt at inputting these commands.               \documentclass[a4paper,12pt]{report}     \usepackage{tabularx}     \usepackage{amsmath}     \usepackage{booktabs}     \usepackage{pgfplotstable}     \usepackage{multirow}     \usepackage{amssymb}     \usepackage{pgfplots,pgfplotstable,filecontents}     \usepackage{array}          \begin{document}               \begin{table}[H]     \centering          \pgfkeys{/pgf/number format/.cd,fixed, fixed zerofill}     \pgfplotstabletypeset[col sep=comma,every head row/.style={before      row=\toprule,after row=\midrule},every row no 2/.style={after row=\midrule},every last row/.style={after row=\bottomrule},     columns/NG/.style={string type,column name=$M_n~(g\,m^{-2})$,column type=c,dec sep   align,precision=0},     columns/ID/.style={column name=$\rho_i\,(g\,cm^{-3})$,dec sep align},     columns/R2/.style={column type=|C,column name=$r^2$,dec sep align},     columns/IN/.style={column type=C,column name=$Intercept\,(cN/tex)$,dec sep     align},     columns/GR/.style={column type=C,column name=$Gradient\,\times10^{-4}$,dec sep    align     },     ]     {% data from file     NG,ID,R2, IN, GR     0, 0.60, 0.79, -9.30, -5.81      , 0.67, 0.87, -7.10, -4.76      , 0.71, 0.94, -6.60, -4.57     12, 0.60, 0.38, 6.01, 0.02      , 0.67, 0.08, 6.41, 0.01      , 0.71, 0.42, 6.65, -0.02     }          \end{table}               \end{document}      Also, I am unsure how to insert code into a Tex post without having to space bar 4 times for every line.


title: Why do some arguments in a macro need to be preceded by \noexpand?

text: I keep on studying the use of nested tikzpicture environments (sorry) and I discover the next problem. I'm not sure but it sounds like a problem with "fragile" commands. Perhaps, the problem is the nested environments but I do not think so because the code works in many cases. It's very strange, that `$\mathbf{\Pi}$` gives no problem while `\textbf{textbf}` is catastrophic !. In the next code, I use the macro `\place` to put an object ( some tex's code) with the help of a node. I simplify a little bit the chain of macros but I keep the essential things. **Code** I work with pgf 2.1 CVS Uncomment the line               \documentclass{scrartcl}     \usepackage{amsmath,tikz}          \makeatletter     \def\place{\pgfutil@ifnextchar[{\place@i}{\place@i[]}}%     \def\place@i[#1]#2(#3)#{\place@ii[#1]{#2}(#3)}%     \def\place@ii[#1]#2(#3)#4{%      \begin{tikzpicture}[overlay]       \path (0,0)--(#3);       \node[anchor=#1,rotate=#2] at (#3) {#4};     \end{tikzpicture}%     }%           \begin{document}          Baseline%     \begin{tikzpicture}      \draw[help lines] (0,-4) grid (5,1);      \place[west]{0}(1,-2){$ \frac{2}{3}$}       \place[west]{-30}(2,-3){$\mathbf{\Pi}$}      \end{tikzpicture}%           % uncomment the next line with \place to see the problem     \begin{tikzpicture}      %\place[west]{0}(4,0){\textbf{textbf}}      \end{tikzpicture}           % \noexpand resolves the problem      \begin{tikzpicture}      \place[west]{0}(2,0){\noexpand\textbf{textbf}}      \end{tikzpicture}            \end{document}       **Results** ![enter image description here](http://i.stack.imgur.com/PKO9T.png) but if I don't use `\noexpand`: ![enter image description here](http://i.stack.imgur.com/BgOKE.png) **What kind of problem I encountered?**


title: Drawing the area under the curve of a function in LaTeX

text: Could you give me some guidance for producing a simple graph showing the integral of a function as the area under its curve?


title: Center text in TikZ according to the text baseline, not the object itself

text: As a follow up to Adding TikZ code to TOC, I have a TikZ code added to each index entry. That code may contain these specific letters: `A`, `N`, `C`, `P` and `Q`. See the following example:               \documentclass{article}          \usepackage[titles]{tocloft}     \usepackage{tikz}          \newcommand*\info[1]{%       \begin{tikzpicture}         \node[draw,inner sep=1pt, minimum height=0.32cm, minimum width=0.9cm] {\tt\scriptsize #1};       \end{tikzpicture}}          \newcommand{\listfoo}{List of foo}     \newlistof[section]{foo}{idf}{\listfoo}          \begin{document}          \refstepcounter{foo}     \addcontentsline{idf}{foo}{\protect \info{ANCP}\ Hello world.}          \refstepcounter{foo}     \addcontentsline{idf}{foo}{\protect \info{ANCPQ}\ Hello bar.}          \listoffoo          \end{document}      ![List of foo 1](http://i.stack.imgur.com/VOcDU.png) As you can see, (pardon my possible misuse of the terms) both text _objects_ are centralized, but the latter - because of the letter `Q` - does not look _that_ aesthetic to me. Since I know all the possible letters I may use, and as the only problematic letter is the `Q`, I wrote this fix using the `xstring` package and Martin Scharrer's suggestion:               \documentclass{article}          \usepackage[titles]{tocloft}     \usepackage{tikz}     \usepackage{xstring}          \newcommand*\info[1]{%       \begin{tikzpicture}         \IfSubStr{#1}{Q}{%         \node[draw,inner sep=1pt, minimum height=0.32cm, minimum width=0.9cm] {\raisebox{\dimexpr-.5\height+.5\depth-.8ex\relax}{\tt\scriptsize #1}};}{%         \node[draw,inner sep=1pt, minimum height=0.32cm, minimum width=0.9cm] {\tt\scriptsize #1};}       \end{tikzpicture}}          \newcommand{\listfoo}{List of foo}     \newlistof[section]{foo}{idf}{\listfoo}          \begin{document}          \refstepcounter{foo}     \addcontentsline{idf}{foo}{\protect \info{ANCP}\ Hello world.}          \refstepcounter{foo}     \addcontentsline{idf}{foo}{\protect \info{ANCPQ}\ Hello bar.}          \listoffoo          \end{document}      ![List of foo 2](http://i.stack.imgur.com/wYtEV.png) That pretty much solves my issue. I'd like to know if there are better ideas of how to solve this particular alignment issue, dynamically or not.


title: Defining a phrase containing math and text usable in both math and text mode

text: I would like to define a phrase _once_ that contains both math and text, and be able to use usable in _both_ math and text mode. For example:               \newcommand{\Constraint}{\ensuremath{x \neq 0} \text{ and } \ensuremath{x \neq -1}}      This works fine in math mode, but leaves too much space in text mode. Of course:               \newcommand{\Constraint}{\ensuremath{x \neq 0} \text{and} \ensuremath{x \neq -1}}      works fine in text mode, but not in math mode. Well that led me to:               \newcommand{\Space}{\ifmmode{ }\else{}\fi}%     \newcommand{\Constraint}{\ensuremath{x \neq 0} \text{\Space and\Space} \ensuremath{x \neq -1}}      which of course is a brilliant solution, except for the fact that it only yields correct results in text mode!! I attempted to replace the `{ }` with various math spacing (`\;`, and `\hspace{1ex}`) and they had no effect in math mode. The one case that does yield correct spacing in both is using an `\mbox` as in:               \newcommand{\Constraint}{\mbox{\ensuremath{x \neq 0}  and \ensuremath{x \neq -1}}}      but then the text can not be split across line boundaries so is not good enough. Below are my various failed attempts commented out. The code as below yields: ![enter image description here](http://i.stack.imgur.com/kYMRm.png)               \documentclass{article}     \usepackage{amsmath}     \usepackage{xspace}     \usepackage{showframe}          %%%% Math Mode: Works fine     %%%% Text Mode: Too much space before and after "and"     %\newcommand{\Constraint}{\ensuremath{x \neq 0} \text{ and } \ensuremath{x \neq -1}}          %%%% Math Mode: No space before and after "and"     %%%% Text Mode: Works fine      %\newcommand{\Constraint}{\ensuremath{x \neq 0} \text{and} \ensuremath{x \neq -1}}               %%%% Math Mode: Works fine     %%%% Text Mode: Too much space before and after "and"     %\newcommand{\Constraint}{\ensuremath{x \neq 0} \text{~and~} \ensuremath{x \neq -1}}               %%%% Math Mode: missing space after "and"     %%%% Text Mode: Too much space before and after "and"     %\newcommand{\Constraint}{\ensuremath{x \neq 0} \text{~and\xspace} \ensuremath{x \neq -1}}          %%%% Math Mode: missing spaces before and after     %%%% Text Mode: Works fine.     \newcommand{\Space}{\ifmmode{ }\else{}\fi}%     \newcommand{\Constraint}{\ensuremath{x \neq 0} \text{\Space and\Space} \ensuremath{x \neq -1}}          \begin{document}     \begin{align*}         \frac{2x}{x+1} &= \frac {2x-1}{x}\\         \implies 2x  (x)   &= (x+1) (2x-1) \qquad\Constraint     \end{align*}     %     In a short sentence note the constraint: \Constraint.          In a long sentence note the above the constraint must be satisfied: $\Constraint$.     \end{document}


title: Is there a LuaTeX analogue to XeTeXinterchartoks?

text: Just as the title of the questions says, is there an LuaTeX analogue to XeTeXinterchartoks?


title: How to define the vertical location of navigation text?

text: I am using `beamer2thesis`, i.e., the `beamerthemeTorinoTh` style to compile my presentation slides. It is nice but I realized that I need to do some modifications. The upper header stripes seems quite unnecessary unless I put navigation bar there, to show the sections we are in. I modified the outertheme style file,                \leavevmode%      \hbox{%      \begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt,center]{page header}%      \usebeamerfont{navigation} \insertsectionnavigationhorizontal{\paperwidth}{\hskip0pt   plus1filll}{}%      \end{beamercolorbox}%      }%      The navigation text locates in the bottom of the colorbox. I expect it is at the center of the box instead of a location so low. Any modification I need to do? By the way, I want the color to be white, not this interaction color, because it looks quite not clear. ![enter image description here](http://i.stack.imgur.com/OYC1B.jpg)


title: How to align a top-align a table that starts with an \hline?

text: I want to TeXify this document as an exercise. At the bottom of its second page, there are some tables. I tried to create something similar to this using LaTeX and finally did this:               Von den 15 Zerlegungen \emph{bei} $\mu=4$ sind die ersten sieben:     \begin{flushleft}     $v=2;\ p=     \begin{tabular}[t]{|c|c|}\hline     $-1$&$-256$\\\hline     \end{tabular}$     [bedeutet: $(-1)^2+(-256)^2=p$]\\     $v=3;\ p=     \begin{tabular}[t]{|c|c|}\hline     $255$&$0$\\\hline     $-16$&$-16$\\\hline     \end{tabular}$     \end{flushleft}      To me, that code seems very strange and it doesn't works. Can some TeXpert help me please?


title: Tikz: text containing formulas and symbols following a given curve

text: I have already been searching for this some time, but unfortunately I cannot find an answer. I am trying to write some text that is following a given curve. As long as I do not use math mode that works out fine. However, I need some formulas resp. symbols in that text too, so, is there a way to obtain that? It should be something like this:               \begin{tikzpicture}         \path [decorate,decoration={text along path,             text={$t\rightarrow t_0$}}]             (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0) sin (7,-1);     \end{tikzpicture}      There is of course some more text coming, but just to give an idea...