title: How to remove a blank page "before" the title page

text: I'm using MiKTeX 2.9 and TeXniCenter for writing my thesis. I have a lot of packages and everything was going well, until last night that a blank page with ".0" written in the top left corner kept generating _before_ my title page and still I cannot figure out how to remove it. Is there any kind of command that I can use except `\let\cleardoublepage\clearpage`? I have been searching heavily but could not find a useful way. I'd appreciate any help.


title: Still showing the file is missing after installing the package of MikTeX

text: I meet the problem that when running the code, WinEdt says: > `The required **** file is missing....` after updating MiKTeX 2.8 to 2.9 version. And I have tried to install the package that missing files in by Package Manager, however, after installing successfully, I still meet the same problem says the same file is missing. Can someone help me?


title: References not showing up

text: I have created a .bib file using Jabref. Now I placed this file in the same folder where all my other latex fles are present. I am adding the reference to this .bib file using this:               \section*{References}     \bibliographystyle{elsarticle-num}     \bibliography{jab}      I am compiling my latex code on WinEdt but afterwards the file generated does not contain any references. Reference part is just blank. Please guide me in this regard.


title: Postscript commands in TeX using \special

text: It is possible to include a graphic image and place a hyperlink reference within it, directly in TeX? I've created a M(non)WE example below to try and demonstrate what I'm thinking. (This becomes a MWE if you remove the `\special` statement in the first `\figure`). Basically I want to include graphics and create hyperlinks between them (note the `hypertarget` in the second figure). I can add hyperlinks to PDF using Ghostscript, so wondered if the same could be achieved using the `\special` command in TeX? Currently I'm using pdfLaTeX.               \documentclass{article}          \usepackage[a3paper,landscape]{geometry}     \usepackage{graphicx}     \usepackage{hyperref}          \begin{document}          \begin{figure}[p]        \centering        \includegraphics[viewport=597 1069 1088 1320,clip=true]{parent.pdf}        \caption{My Image Caption}        \special{ps:           [ /Rect [602 1083 1087 1320]             /Border [0 0 2]             /Color [1 0 0]             /Dest link_child_page             /Subtype /Link             /ANN pdfmark        }     \end{figure}     \clearpage               \begin{figure}[p]        \centering        \includegraphics[viewport=750 1166 935 1223,clip=true]{child.pdf}        \caption{My Child}     \end{figure}     \hypertarget{link_child_page}{}     \clearpage          \end{document}


title: How to make the table fit into the column?

text: Hi I have a two columns table with ACM SIG Proceedings template http://www.acm.org/sigs/publications/proceedings-templates Here is my latex:               \documentclass{sig-alternate}     \usepackage{ctable}     \begin{document}     \begin{table}[h]       \centering              \begin{tabular}{rrrrr}         \toprule         \multicolumn{1}{c}{\small{QoS Attribute}} & \small{Sequential} & \small{Parallel} & \small{Loop} & \small{Conditional} \\         \midrule         \small{Response Time} & $\sum\limits_{i=1}^n q(s_i)$   & $\max\limits_{i=1}^n q(s_i)$   & k(q(s))   & $\max\limits_{i=1}^n q(s_i)$ \\     \midrule         \small{Availablity} & $\prod\limits_{i=1}^n q(s_i)$   & $\prod\limits_{i=1}^n q(s_i)$   & $q(s)^k$   &  $\min\limits_{i=1}^n q(s_i)$ \\     \midrule         \small{Throughput} & $\min\limits_{i=1}^n q(s_i)$   & $\min\limits_{i=1}^n q(s_i)$  & $q(s)$  & $\min\limits_{i=1}^n q(s_i)$ \\         \bottomrule         \end{tabular}%     \caption{Add caption}       \label{tab:compositionalStructure}%     \end{table}     This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1 This is line 1          \end{document}       ![enter image description here](http://i.stack.imgur.com/BgM1E.png) The problem is the table length cannot fit into the first columns width as shown as the blue color lines. Is there any way to make the table smaller? In particular, how to make the font smaller(i try `\small` as shown in code, but I do not know how to deal with equation) and the table spacing smaller (I do not know how to do it)?


title: Unwanted code present in file output

text: # Edit for clarification: I have a counter whose value I want to write to an aux file. The counter will later be used very dynamically so it has to be read back on subsequent runs or recalculated depending on the need. **The main aim of this question is to figure out how to simply write a counter which gets incremented in a macro to a file.** ======== When I run the following MWE the `\writeVerse` command rightly displays the value of this counter in the PDF output, yet it also adds a bunch of code when I write that counter to a file. Why is this happening?               \documentclass[pagesize=pdftex, fontsize=10]{scrbook}          \newcounter{countVerse}          \newcommand{\writeVerse}{%       \stepcounter{countVerse}%       \thecountVerse%     }          % Write the position to file.     \def\msec@write@lines#1#2{%         \pdfsavepos%         \write\yposoutputfile{%         \string{#1\string}%         \string{#2\string}%         }%     }          \begin{document}     \newwrite\yposoutputfile%     \openout\yposoutputfile=\jobname.ypos.txt%          \writeVerse %this works     \msec@write@lines{1}{F}~Some test text for the first verse.     \msec@write@lines{\writeVerse}{F}~And some more text for the second verse. %this doesn't work EDIT: Added second variable {F}          \closeout\yposoutputfile%     \end{document}      produces this in the output file where the parts in **bold** should not be present: {1}{F} { **\global \advance \c@countVerse \@ne \relax \begingroup \let \@elt \global \c@ \csname\endcsname\z@ cl@countVerse\endcsname \endgroup** 1} **{\nobreakspace {}}**


title: Inline Oval symbol in LaTeX

text: How can I create an inline oval symbol? I tried to use `\Ellipse` from the bbding package but I get an error saying `Command \Asterisk already defined`. Probably due to the mathabx package that I am also using.


title: Getting the first line of an environment

text: as the title suggests, I'm looking for a way to get the first (printable) line in an environment. My first naive attempt (ignoring the printable requirement) was something like this:               \newcommand*{\theline}{}     \newcommand*{\getline}[1]{%       \renewcommand*{\theline}{#1}%       #1%     }          \newenvironment{anewenvironment}{%       \getline%     }{}      However, afterwards `\theline` is only the first character. Eg.               \begin{anewenvironment}       Test     \end{anewenvironment}     Line: \theline      prints:               Test     Line: T      when the required output is:               Test     Line: Test      I suppose this indicates a fundamental misunderstanding about how TeX/LaTeX handles arguments on my part, so any ideas or more broad clarification on how arguments are handled would be appreciated. Thanks. P.S. I understand that the concept of a "line" is rather vague — "paragraph" might be a better term in retrospect, though "X words" would also fit my use case. **EDIT:** The aim of this is to find a way to automatically get incipits for poetry or blocks of text. See this issue on PoetryTeX for more info. **EDIT 2:** Looks like none of these solutions are very good for what I need, however, they did answer my question so I've marked an answer.


title: Toggle Hide/Show cites, footnotes etc

text: It annoys a lot, if my written text has lots of footnotes or cites, so a quick reading and writing in same editor ( not in pdf, as you may point out) is a tough matter. I wonder if there is any possiblity to hide or at least shorten Cites, footnotes, references in writing or reading mode in Sublime or other editor for MAC Edit: I found out that it is possible manually fold selected lines with (mac) cmd + alt + [ . But automated process whould be perfect


title: How to draw an elliptical arc in TikZ given only opposite extreme points (vertices) of the ellipse?

text: Given two nodes `(a)` and `(b)`, I would like to draw an elliptical arc from `(a)` to `(b)` whose major axis is the segment connecting `(a)` and `(b)` (the minor axis can be some arbitrary length). The main difficulty is that this ellipse's axes need not be parallel to the standard coordinate axes. Moreover, I don't know what angle the point `(b)` is at relative to `(a)`. What I have done so far is to, within a scope, shift the origin of tikz's coordinate system to the midpoint between `(a)` and `(b)`, and change the coordinate x-vector to `(a)`, with the plan of just drawing a plain old elliptical arc starting at `(1,0)` from 0 degrees to 180 degrees in this new coordinate system. The following example is the picture I'm trying to draw with almost everything stripped away, but I left in how I am making the points `(a)` and `(b)` to illustrate why I don't know their coordinates.               \documentclass[11pt]{article}     \usepackage[margin=1in]{geometry}     \usepackage{amsmath,amssymb,amsthm,amsfonts,graphicx}     \usepackage{tikz}     \usetikzlibrary{calc,decorations.markings,positioning}          \begin{document}     \begin{center}     \begin{tikzpicture}          \draw[postaction={decorate,decoration={markings,           mark=at position 0.7 with {\node (a) {};}}}]           (0,0) ellipse (0.6 and 0.4);          \draw[postaction={decorate,decoration={markings,           mark=at position 0.7 with {\node (b) {};}}}]           (0,0) ellipse (1.2 and 1);          \node (c) at ($(a)!0.5!(b)$) {};          \begin{scope}[shift={(c)},x={(a)}]     \draw (1,0) arc (0:180:1 and 0.3);     \draw[dashed] (-1,0) arc (180:360:1 and 0.3);     \end{scope}     \end{tikzpicture}     \end{center}     \end{document}      This produces ![enter image description here](http://i.stack.imgur.com/tMlIm.png) (I want the ellipse I'm drawing to lie within the annulus, i.e. each extreme point should be tangent to the inner or outer pieces, respectively.) By way of comparison, if instead of trying to make an ellipse, I just draw a line from `(-1,0)` to `(1,0)` in my new coordinate system, by changing the contents of my scope to               \begin{scope}[shift={(c)},x={(a)}]     \draw (-1,0) -- (1,0);     \end{scope}      then things work in the manner I want: ![enter image description here](http://i.stack.imgur.com/TSBtj.png) This works because it did not require using any y-coordinates. Unfortunately, I don't know what vector I should change the coordinate y-vector to. If there is an easy way to determine a perpendicular bisector of the segment connecting `(a)` and `(b)`, so that I can change the coordinate y-vector to it, that would be great, but I'd appreciate any other approaches to solving this issue.


title: "There's no line here to end" error when pages break at unfortunate locations

text: I'm recieving seemingly random `There's no line here to end` errors at different parts in my code. At first I thought they were truly random and that I had some weird configuration error somewhere, but after more thorough investigations I have found that the error occurs when a page break and an extra line break within a paragraph coincide. For example, if I have a paragraph containing an `eqnarray*` environment, and the entire paragraph does not fit on the page (so that the page breaks in the middle of the paragraph, usually between a line of text and the `eqnarray*`), I get the error. Does anyone have any idea why this happens?


title: New commands having variable numbers of parameters and being used in subscripts

text: Is it possible to make the last two cases work without the need in wrapping the command calls in curly brackets?               \documentclass{article}          \usepackage{amsmath}     \usepackage{amssymb}          \makeatletter     \def\command{\@ifnextchar\bgroup{\commandOne}{\commandNone}}     \def\commandOne#1{{\boldsymbol#1}}     \def\commandNone{{\boldsymbol\alpha}}     \makeatother          \begin{document}       \title{Cases}       \maketitle            \section*{Case 1}       $\command$            \section*{Case 2}       $\command{\beta}$            \section*{Case 3}       $A_{\command}$ % <--- WANTED: $A_\command$            \section*{Case 4}       $A_{\command{\beta}}$ % <--- WANTED: $A_\command{\beta}$     \end{document}      If I remove the curly brackets, I get the following error:               ! Missing { inserted.      Thank you! Regards, Ivan


title: How do I access an Arabic letter least painfully in a mathematical text

text: I write a mathematical text with the preamble               \documentclass[fleqn]{scrartcl}     \setkomafont{disposition}{\normalfont\bfseries}     \makeatletter\let\TTTemp\cap\makeatother     \usepackage[greek,english]{babel}     \usepackage{teubner}     \makeatletter\let\cap\TTTemp\makeatother     \usepackage{eurosym}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{lgreek}     \usepackage{graphicx}     \usepackage{textcomp}     \usepackage{cancel}     \usepackage{soul}     \usepackage{cjhebrew}     \usepackage{mathtools}     \usepackage{rotating}     \usepackage{esvect}     \usepackage{natbib}     \usepackage{MnSymbol}                         \usepackage{hyperref}     \usepackage{tocbibind}     \allowdisplaybreaks      I would like to access the Arabic letter Noon. How can I do it least painfully?


title: How to make a command for a composed symbol to work with all font sizes?

text: In my paper I need a letter $\mathbb{R}$ with a small circle above it. Currently I'm using the following command:   `\newcommand{\obbR}{{\mbox{\kern1.4pt \raisebox{7pt} {\scriptsize$\circ$} \kern-9.1pt}\mathbb{R}}}`   But unfortunately it works only with standard font size. The question is how to make a command for this "composed letter", which works with all font sizes. Actually, I have two problems with writing of this "universal" command.   1\. I don't know, how can one make values font-dependent.   2\. I don't know, how can one make the small circle, I should put above R, smaller, than `\scriptsize\circ`.


title: Back accent or grave accent in listings

text: I'm using listings to display a bash script like for instance               $ export MY_ENV=`pwd`      How can I make listing display the correct character for `. Right now it is displaying ' MWE:               \documentclass[11pt, article, oneside, a4paper]{memoir}          % Files encoding     \usepackage[utf8]{inputenc}     \usepackage[spanish, es-noquoting, es-tabla]{babel}     %es-noquoting era por el tikz          \usepackage[spanish]{translator}     \usepackage[OT1]{fontenc}     %\usepackage[T1]{fontenc}          %Listings     \usepackage[final]{listings} % to be shown independently draft of final     \lstdefinestyle{CommandLineStyle}{       basicstyle=\small\ttfamily,       numbers=none,     %  frame=tblr,       columns=fullflexible,     %  backgroundcolor=\color{blue!10},       linewidth=0.95\linewidth,       xleftmargin=0.05\linewidth,       breaklines=true,       breakindent=1em,     %  inputencoding=utf8/latin1,     %  postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}},     %  breakautoindent=true     }          \begin{document}          \begin{lstlisting}[style=CommandLineStyle]     $ export MY_ENV=`pwd`     \end{lstlisting}               \end{document}


title: Kröger Vink notation

text: > **This question led to a new feature in a package:**   >  `chemformula` How to properly typeset `Kröger Vink` notation? I can try something like `\ce{V_O^{..}}` (using `mhchem`) but the dots are not aligned well and too thin. I tried googling it and I can see people have done it but not how. Edit to add MWE:               \documentclass{report}     \usepackage{mhchem}     \begin{document}     \ce{O_O^x + Zn_{Zn}^x <-> 1/2 O2 + Zn_$i$^. + e^{-1}}     \end{document}


title: figure* environment skips page while using two-column document

text: I was told to use `table*` rather than the `table` environment to insert a table in a two-column document which is too small to fit in a single column. When I try to do the same thing with a figure, The figure chooses to move to a page of its own. How do I prevent this? The same thing happens in the `article` class               \documentclass[twocolumn, 11pt]{apa6}     \begin{document}          Why does the figure skip this page?          \begin{figure*}         \includegraphics[width=400 pt, height=200 pt]{test.pdf}                \caption{test.}      \end{figure*}          \end{document}      Page 1: ![Page 1](http://i.stack.imgur.com/yY1I4.png) Page 2: ![enter image description here](http://i.stack.imgur.com/eZ666.png)


title: Optional math symbols as arguments to custom command

text: I have a custom command defined as               \newcommand{\transition}[1]{$\stackrel{\texttt{#1}}{-->}$}      The argument that I pass to the command can sometimes be normal text and thus is formatted using `\texttt{text}` and sometimes I want to pass a math symbol such as `\tau` or `\alpha` or a combination of these. Is there a way how I can reason on the argument being passed, such as introduce an if then else depending on the type of the parameter?


title: In TexLive 2009, 'tlmgr' tells me there are 'no updates available' for months now. Really?

text: Running TeXLive 2009 on Ubuntu 10.4, a vanilla install. I used to be able to get updates for TeXLive 2009, I'm sure. But for months now it just tells me:               sudo /usr/local/texlive/2009/bin/i386-linux/tlmgr update --list     tlmgr: package repository http://www.tex.ac.uk/tex-archive/systems/texlive/tlnet     tlmgr: no updates available      I have a large TeXLive installation, with lots of packages. I would expect dozens of updates weekly to CTAN. Wouldn't 'tlmgr' normally get them? Or do I misunderstand things. I also tried the tlmgr GUI, with the same result. My net connection is working. Any ideas?


title: A better way to reference theorem-like environments?

text: I know how to use \label and \ref to get a reference to a result(or whatever else really) that I have made previously in the document. But this is tedious and requires me to create a label name every time. What I am wondering, is if there is a more systematic/powerful way to accomplish this. I suppose there are many ways to skin a cat, so I will word the question like this; > How do you reference theorem-like environments in your LaTeX documents, and > why do you do so in this way? Since I am asking the question in a way that suggest multiple answers with some opinions, I am marking this CW and putting the Big-list tag. If this is wrong, feel free to change.


title: Put a pstricks cover at the beginning of a file without affecting the rest of it

text: I have two files. One is a pstricks cover. The other is the interior of the book. They both are fine on their own. I would like to put the code for pstricks cover on the first page of the pdf and compile the whole document. However, when I do that, it messes up the formatting of the interior of the book. I have tried `\clearpage` and `\newpage` without success. Basically, I want latex to pretend that there are two separate documents.


title: How to place all chapter titles on verso pages in ConTeXt?

text: I need to set all of the chapters within a document to begin on the verso, or left-hand pages. How can I get ConTeXt to add a blank page before each chapter title if the chapter title does not appear on a verso page?


title: knit with `pdflatex --shell-escape myfile.tex`?

text: I want to insert a word count into my .Rnw file. To do this, I have the following line in `myfile.Rnw`:               \makeatletter\@@input|"echo `texcount -1 myfile.tex`| cut -c1-4"\makeatother      But this requires me to run `pdflatex` with the `--shell-escape` flag. With Sweave, I have a makefile that includes the line:               ...     R CMD Sweave myfile.Rnw     pdflatex --shell-escape myfile.tex      ...     ...      Is there a way to add the `--shell-escape` to pdflatex when I use knit instead of the makefile to compile the document? * * * ### Reproducible example: contents of myfile.Rnw:               \documentclass{article}     \begin{document}          Words: \makeatletter\@@input|"echo `texcount -1 myfile.tex`| cut -c1-4"\makeatother     Lorem ipsum dolor     \end{document}      what works:               R CMD Sweave myfile.Rnw     pdflatex --shell-escape myfile.tex      what doesn't work:               knit("myfile.Rnw")     "myfile.pdf" %in% dir() ## False


title: How to suppress some fields in abbrv.bst

text: I am using the abbrv style under the natbib package for my bibliography. Is it possible to suppress, e.g., the field "SERIES", in the output? Here is a item in my .bib file:               @book{GelfandVilenkin64GF4,           AUTHOR = {Gel'fand, I. M. and Vilenkin, N. Ya.},           TITLE = {Generalized functions. {V}ol. 4: {A}pplications of harmonic               analysis},           SERIES = {Translated by Amiel Feinstein},           PUBLISHER = {Academic Press},           ADDRESS = {New York },           YEAR = {1964},           PAGES = {xiv+384},           MRCLASS = {46.00 (46.40)},           MRNUMBER = {0173945 (30 \#4152)},           MRREVIEWER = {J. L. B. Cooper},         }      Thank you very much!


title: How to batch generate badges with a list of names?

text: I want to make a number of badges using LaTeX for the participants of a summer school. There are 40 or so people, so I don't want to manually change the name and compile and then print. I could think of:   1. Making a single document with a dropdown box with 40 choices. I don't know if it is possible to automate the choosing and printing in this case.   2. Using a script language such as python to call latex to do the job. But I have 0 experience with Python, and I didn't find a foolproof tutorial on the web (probably because of wrong search keywords). So...I'm waiting for you guys to come up with a good solution :-).


title: Changing the behavior of $$ but not of $

text: I am trying to set things up so that occurrences of `$$` are replaced by `\]` if in math mode, `\[` otherwise. My strategy is to make `$` active and have it behave differently depending on whether the following token is also a `$`. However, I cannot seem to make this work. Here is my attempt:               \documentclass{article}     \usepackage{lipsum}     \def\unactiveDollar{$}          \catcode`\$=\active     \def\activeDollar{$}          \def\executedollar{%             \if\isDollar\activeDollar%                 \let\next=\executeDDollar%             \else%                 \let\next=\unactiveDollar%             \fi%             \next%         }     \def\executeDDollar{%             \ifmmode%                 \let\next=\]%             \else%                 \let\next=\[%             \fi%             \next%             \let\absorbnext=         }     \def${\futurelet\isDollar\executedollar}          \begin{document}     \lipsum*[7]     $$\int x^2 \; dx = \frac{1}{3}x^3 + C$$     \lipsum[9]     %Make sure $ $ is not mistaken for $$:     It follows that $E = m c^2$ $\forall x \in X$.     \end{document}      The resulting error is               ./doubledollar.tex:29: TeX capacity exceeded, sorry [input stack size=5000].     \isDollar ->\if \isDollar                                \activeDollar \let \next =\executeDDollar \else \l...     l.29 $$            \int x^2 \; dx = \frac{1}{3}x^3 + C$$     ./doubledollar.tex:29:  ==> Fatal error occurred, no output PDF file produced!      Other variations (e.g., substituting `\ifx` for `\if`) give different errors or simply incorrect output, but nothing gets it right. And as far as I can tell, the key problem is that my method for determining whether the following token is a `$` (and absorbing it if so) simply does not work. What am I doing wrong, and how can I fix it? Additional note: An answer that throws an error whenever `$$` is used instead of other macros/environments (which must be able to use it internally) would also be acceptable, since it answers the titular question.


title: Labeled paragraphs

text: I would like to be able to label some paragraphs in a document and, when I compile the document using PdfLaTeX, choose which labels I want to keep in my document. More clearly, I would like to define an environment `\begin{labeledparagraph}[label]...\end{labeledparagraph}` (`label` being an argument of `labeledparagraph`) and a function `\selectlabels{label1,label2,label4}` (for example) which I would put in the preamble of my document. Here is an example :               \documentclass[a4paper,10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{comment}          \selectlabels{label1,label2,label4}          \begin{document}          \begin{labeledparagraph}[label1]       Paragraph1     \end{labeledparagraph}          \begin{labeledparagraph}[label2]       Paragraph2     \end{labeledparagraph}          \begin{labeledparagraph}[label3]       Paragraph3     \end{labeledparagraph}          \begin{labeledparagraph}[label4]       Paragraph4     \end{labeledparagraph}          \end{document}      When compiling this document, I would like my PDF document to contain only paragraphs 1,2 and 4. The idea is to avoid using only `\begin{comment}...\end{comment}` for each paragraph I want to exclude from the output document. The `labeledparagraph` environment could be something like this :               \newenvironment{labeledparagraph}[1]{\begin{#1}}{\end{#1}}      and `\selectlabels{label1,label2,label4}` would be equivalent to               \includecomment{label1}     \includecomment{label2}     \excludecomment{label3}     \includecomment{label4}      But I don't know how to do it automatically (the number of labels can be quite large). Thanks for your help !


title: Change bibliography title align when using quotchap

text: I'm writing my Masters Thesis and I'm using `quotchap` package in my chapter tiles. However I want Bibliography title align at left instead of right like the other titles. I've tried `\renewcommand{\bibname}{\leftline{References}}`. However, it alters the alignment in my table of contents and in the header of the bibliography pages. Here goes a MWE:               \documentclass{book}          \usepackage{filecontents}          \usepackage[nottoc]{tocbibind}     \usepackage{tocloft}     \setcounter{secnumdepth}{2}     \setcounter{tocdepth}{2}          \begin{filecontents}{\jobname.bib}       @book{Knu86,         author = {Knuth, Donald E.},         year = {1986},         title = {The \TeX book},       }     \end{filecontents}          \RequirePackage[times]{quotchap}     \definecolor{chaptergrey}{gray}{0.75}          \begin{document}          \tableofcontents          \chapter{My chapter}          This is a reference \cite{Knu86}               \bibliographystyle{alpha}     \renewcommand{\bibname}{\leftline{Bibliography}} %this lines aligns left and shows how I want that bibliography title loks, but it changes the alignment in toc and in header of page 6. Comment to see how toc and the header of page 6 must look.     \bibliography{\jobname}     \newpage\clearpage\mbox{}\clearpage     \end{document}


title: Controlling the numbering of section titles

text: Now i need to attach an endnote to the number of the beginning of section 16, and naive manipulations like `\section{\endnote{$\pi=3.14$}}` will make a big gap between the number 16 (which is automatically generated) and the mark of the endnote, therefore I changed it to `\section*{16\endnote{$\pi=3.14$}}` which consequently makes the number of the next section (which is section 17) 16. I don't want to adjust following sections' titles manually, so is there a way to attach the endnote/footnote? Or generally is there a way to control the sequence of numbering of the titles? A minimal example               \documentclass{article}     \begin{document}     \section*{1\footnote{In this section we take $c=0$}}%This one being the title of the first section.     This is the material of the first section.     \section{}%This is the title of the supposedly second section     This is what is contained in the second section.     \end{document}


title: Increase LaTeX table row height

text: How to increase the height of the rows in a LaTeX table?


title: inserting a pdf file in the beginning in xelatex

text: I was creating a book using XeLateX. I've got a front page created by someone else which is in pdf format. Now my question is how can I insert the pdf file to the beginning? I have done this in LaTeX using               \includepdf[noautoscale]{frontcover}      using the `pdfpages` package. but I'm unable to do so with XeLaTeX. Any pointers?


title: Malayalam package

text: Sorry if I am repeating, but I do not seem to see my post here. Does anybody know of a Malayalam language package. I am working on a Mac running Leopard.


title: Colorize external pictures using pdflatex

text: I have several greyscale-pictures that I would like to get colorized within pdflatex (so it will be automatically colorized to a given color, from black- to-white lets say black-to-red). Is there a way to manipulate external graphics in pdflatex directly? If this is not possible what way would you recommend to do this for a hundreds of pictures on a linux system? (maybe `imagemagick`?) Example: ![Example Image](http://i.stack.imgur.com/tKMgU.jpg) Should be something like: ![enter image description here](http://i.stack.imgur.com/VCpPE.jpg)


title: Bold text at 1., 2., 3., 4. etc

text: Is it possible to make all numbers followed by a point bold? Having thousands of questions to make bold is a tough effort. For example, if I have answers to some questions like this:               1. $8+2 \cdot 3 + 1 = 15$          2. 5+3=8          3. 4+9 =13          …      Is there any code I can write in the beginning of the document to produce _all_ the `1.`, `2.` etc. in a bold text?


title: Problem in creating bibliography for each chapter

text: I am having problem in enclosing bibliography after each chapter. In fact the bibliography of first chapter is repeating after each chapter with ? mark in the main text of the second chapter onwards. Here is what I am doing: The main TeX file:               \usepackage[square, comma, sort&compress]{natbib}     \begin{document}     ...     ...     \begin{thesis}          \headingsoff     \headingson     \include{ch1/ch1}     \include{ch2/ch2}     ......     ....     \end{thesis}     \end{document}          Each chapter is as follows:     \chapter{chapter 1}     {\large     \section{Introduction}     \label{intro}     .....     .....     \bibliographystyle{bibstyle/thesis_bib}     \bibliography{ch1/bib/myref}     }      I am compiling main.tex as LaTeX and then BibTeX and back as LaTeX. The ref in 1st chapter is coming alright. But second chapter onwards it is giving problem. I have separate bib file for each chapter. Please help me finding out where I have done mistake. Thanks


title: Indent or not based on section depth

text: I would like to know how to set it up so that a `\subsubsection{}` will indent the first paragraph but all other sectioning command of a higher level (`\chapter{}`, `\section{}`, and `\subsection{}`) will NOT indent the first paragraph. To be clear, I don't want to use the `indentfirst` package because that makes all section levels indented. I am using the `memoir` class, should that be somehow important.


title: Place image behind text in beamer

text: I'd like to put am image in a certain position on the title page in beamer. I also don't want it to interrupt the text flow, i.. I want the image to appear "behind" the text. Any ideas?


title: draw Fourier Series Expansion with tikz/pgfplots

text: This is a MATLAB code               T=0.3;     A=0.3;     t=0:0.01:4*T;     n1=length(t);     N=100;     s=0;          signal=0;     for i=1:n1     s=0;     for n=1:N     s=s+A*4/(pi*(2*n-1))*sin(2*pi*(2*n-1)/T*t(i));     end     signal(i)=s;     end     plot(t,signal);      Is it possible to draw this with tikz/pgfplots? ![enter image description here](http://i.stack.imgur.com/57DXy.png)


title: Enriching \to^*

text: I am trying to enrich `$\to^*$` with a `$w$` above it, and the cleanest look I could get was with the `{\smash {\overset w \rightarrow}}^*` command. However, I believe this to be a pretty ugly solution, and `\smash` also smashes the space between two variables and the arrow itself (in for example `$g {\smash {\overset w \rightarrow}}^* g'$`. Is there a better solution that does not result in the `w` to be high above the arrow, or the `*` high above the arrow? PS: How do you use mathmode or how can you display TeX commands? On other SE sites you can use $ $.


title: How to remove font information at the head of page 1?

text: I set TeXLive 2011 on my MacBookPro. In my preamble I have:               \usepackage{fontspec}     \setmainfont{Hoefler Text}     \newfontfamily{\sbl}[Script=Hebrew]{SBL Hebrew}      When I compile with xelatex I get at the head of the first page:               "20     .otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont     fontspec-preparse-externalScale=MatchLowercase,fontspec-preparse Hoefler Text      and the same for the font SBL Hebrew. When I change the main font, for instance with Linux Libertine, I have a lot of informations on this font. The informations occupy almost the half of the page with Linux Libertine. It is only on page 2 that the title of the article and my name appear. How can I do to remove these ugly and unnecessary informations?


title: Clickable hyperlinks wrong for sidewaysfigure

text: I have a few figures which must be shown rotated in landscape orientation. For that I use `\begin{sidewaysfigure}` instead of `\begin{figure}`. But now I found in my text there is a problem between the interaction of `sidewaysfigure` and `hyperref`. While figure numbering is correct both in the caption and the main text, clicking on the cross reference in the text is associated with wrong figures (a few numbers back). **EDIT:** The following reproduces the problem for me:               \documentclass[a4paper]{book}     \usepackage{caption}     \usepackage{rotating}     \usepackage[pdftex]{hyperref}     \usepackage[figure,table]{hypcap}   % corrects the hyper-anchor of figures/tables          \begin{document}          First: Fig.~\ref{fig:first}. Second: Fig.~\ref{fig:second}.     Third: Fig.~\ref{fig:third}. Fourth: Fig.~\ref{fig:fourth}.          \begin{figure}     \includegraphics[width=1\textwidth]{figures/zelle148_IMG_1903m.jpg}     \caption{First}\label{fig:first}     \end{figure}          \begin{figure}     \includegraphics[width=1\textwidth]{figures/zelle148_IMG_1903m.jpg}     \caption{Second}\label{fig:second}     \end{figure}          \begin{figure}     \includegraphics[width=1\textwidth]{figures/zelle148_IMG_1903m.jpg}     \caption{Third}\label{fig:third}     \end{figure}          \begin{sidewaysfigure}     \includegraphics[width=1\textwidth]{figures/zelle148_IMG_1903m.jpg}     \caption{Foruth}\label{fig:fourth}     \end{sidewaysfigure}          \end{document}      If I remove the `hypcap` package, the problem disappears. This is odd as the comment precisely reads " _corrects_ the hyper-anchor of figures/tables"... * * * I have found a very similar question which is not really answered. Some info from the console when rendering: > This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011) > > LaTeX2e <2009/09/24> When I add `\listfiles` as suggested in the other post, I get the following entries:               rotating.sty    2009/03/28 v2.16a rotated objects in LaTeX     hyperref.sty    2011/04/17 v6.82g Hypertext links for LaTeX     hobsub-hyperref.sty    2011/04/23 v1.4 Bundle oberdiek, subset hyperref (HO)      hycolor.sty    2011/01/30 v1.7 Color options of hyperref/bookmark (HO)       pd1enc.def    2011/04/17 v6.82g Hyperref: PDFDocEncoding definition (HO)     hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive      hpdftex.def    2011/04/17 v6.82g Hyperref driver for pdfTeX       hypcap.sty    2011/02/16 v1.11 Adjusting anchors of captions (HO)


title: How to automate biber within TeXnicCenter?

text: I am trying to automate my LaTeX pdf output within TeXnicCenter. I am using `pdflatex` with `biber` and it's been proposed to get the following settings: ![enter image description here](http://i.stack.imgur.com/4A7UK.png) However, whenever I add a new `\autocite{xyz}` in my document, TeXnicCenter outputs an error: Citation xyz not found. When I rerun `biber` manually, with `biber file.bcf` and recompile with `pdflatex` it works. How can I automate my process, to just compile and recompile from within TeXnicCenter? Note: My problem is NOT being discussed or solved with this question.


title: Turkish characters to uppercase

text: I can't make uppercase of turkish characters like `Giriş` Tex converts it to `GIRIş` instead of `GİRİŞ`.. It's making me crazy.               %this is mwe i guess     \documentclass[12pt,a4paper]{article}          \usepackage[utf8]{inputenc}     \usepackage{titlesec}          \usepackage[T1]{fontenc}     \usepackage[turkish]{babel}     \usepackage{pslatex}     \begin{document}     \uppercase{Giriş}     \end{document}


title: Text inside Math

text: I tried doing this:               \usepackage{amsmath}     $x^2 \text{something} y^2$      but that just came out like: > x^2somethingy^2 Anyone know how to fix this issue? I need to have text inside my math environment


title: Tikz: Using relative positioning and foreach variables

text: I want to generate a picture that replicates itself and slowy fades out. For that i plan to use a foreach statement and redraw the picture to its rigth. How can i use the foreach variable to position my replicated pictures. Here is a minimal example that illustrates what i want. The remaining job in the minimal example is to somehow use `\x` to create the names for relative adressing the nodes during redraw.               \begin{tikzpicture}[       item/.style={draw=black!#1, thick, text=black!#1, minimum width = 60},       label/.style={text=black!#1, right},       action/.style={black!#1, ->, thick},       downfrom/.style={below = 0.5 of {#1.south}, anchor=north},       rightfrom/.style={right = 0.5 of {#1.north east}, anchor=north west}     ]          \foreach \x in {100}     {         \node [item=\x]                     (first100) {first};         \node [item=\x, downfrom=first100]  (second100) {second};         \path[action=\x](first100) edge node [label=\x] {a} (second100.north);     }              \foreach \x in {67}     {         \node [item=\x, rightfrom=first100] (first67) {first};         \node [item=\x, downfrom=first67]   (second67) {second};         \path[action=\x](first67) edge node [label=\x] {a} (second67.north);     }              \foreach \x in {34}      {         \node [item=\x, rightfrom=first67] (first34) {first};         \node [item=\x, downfrom=first34]  (second34) {second};         \path[action=\x](first34) edge node [label=\x] {a} (second34.north);      }            \end{tikzpicture}      What i want to write but i dont know how would look like this:               \begin{tikzpicture}[       item/.style={draw=black!#1, thick, text=black!#1, minimum width = 60},       label/.style={text=black!#1, right},       action/.style={black!#1, ->, thick},       downfrom/.style={below = 0.5 of {#1.south}, anchor=north},       rightfrom/.style={right = 0.5 of {#1.north east}, anchor=north west}     ]          \foreach \x in {100, 67, 34}     {      \node ???      \node ???      \path ???     }             \end{tikzpicture}


title: Plot and label data from file with PGFPlots

text: Given some data from a file, I would like to use the first two columns as coordinates, and the second two columns as label for every point. The data is given in this form:               x                        y                        labela                   labelb     1.416197036356566059e+02 5.144315570548267715e+03 7.000000000000000000e+00 1.000000000000000000e+00      I use the `table` command to read the first two columns as data:               \begin{tikzpicture}         \begin{axis}             \addplot+[only marks,x=x, y=y, ] table {DataTable.dat};         \end{axis}     \end{tikzpicture}      The data of the second column should appear above each scatter point as simple text or may be in a bubble like this: `labela / labelb`. A promising option seems to be the option `nodes near coords` which I use to show the y-coordinate of points in other plots, but I don't see how I can use the data from the file and combine it with that.


title: Glossary heading not showing up with amsart

text: after getting a great solution to my problem, amsart with table of contents with "to" and "from" hyperlinks , I've now spent over a day - which is why I keep a template usually :) - trying to figure out why my "Glossary" heading is not showing up in the body of the document. It does show up perfectly in the TOC. Apart from the linked document (which works fine), I've added just what I've tried to get the glossary to work (in the preamble and the body). I did find somethings that may have helped but they relied on tocloft, which doesn't play well with amsart...               \documentclass{amsart}          %\usepackage{makeidx}          \usepackage[toc,section=section]{glossaries}     \newcommand{\dictentry}[2]{%       \newglossaryentry{#1}{name=#1,description={#2}}%       \glslink{#1}{}%     }     %\newglossary[slg]{symbolslist}{syi}{syg}{List of Symbols}     \makeglossaries     \glossarystyle{long3col}     \setlength{\glsdescwidth}{0.6\textwidth}     \setlength{\glspagelistwidth}{0.1\textwidth}     \newglossaryentry{x}{name=x,description={a helpful description of x}}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%% FROM PREVIOUS LINK IN TEXT - NEW STUFF IS ABOVE THIS LINE %%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \usepackage{etoolbox}          % Modifications to amsart ToC-related macros...     \makeatletter     \let\old@tocline\@tocline     \let\section@tocline\@tocline          % Insert a dotted ToC-line for \subsection and \subsubsection only     \newcommand{\subsection@dotsep}{4.5}     \newcommand{\subsubsection@dotsep}{4.5}     \patchcmd{\@tocline}       {\hfil}       {\nobreak          \leaders\hbox{$\m@th             \mkern \subsection@dotsep mu\hbox{.}\mkern \subsection@dotsep mu$}\hfill          \nobreak}{}{}     \let\subsection@tocline\@tocline     \let\@tocline\old@tocline          \patchcmd{\@tocline}       {\hfil}       {\nobreak          \leaders\hbox{$\m@th             \mkern \subsubsection@dotsep mu\hbox{.}\mkern \subsubsection@dotsep mu$}\hfill          \nobreak}{}{}     \let\subsubsection@tocline\@tocline     \let\@tocline\old@tocline          \let\old@l@subsection\l@subsection     \let\old@l@subsubsection\l@subsubsection          \def\@tocwriteb#1#2#3{%       \begingroup         \@xp\def\csname #2@tocline\endcsname##1##2##3##4##5##6{%           \ifnum##1>\c@tocdepth           \else \sbox\z@{##5\let\indentlabel\@tochangmeasure##6}\fi}%         \csname l@#2\endcsname{#1{\csname#2name\endcsname}{\@secnumber}{}}%       \endgroup       \addcontentsline{toc}{#2}%         {\protect#1{\csname#2name\endcsname}{\@secnumber}{#3}}}%          % Handle section-specific indentation and number width of ToC-related entries     \newlength{\@tocsectionindent}     \newlength{\@tocsubsectionindent}     \newlength{\@tocsubsubsectionindent}     \newlength{\@tocsectionnumwidth}     \newlength{\@tocsubsectionnumwidth}     \newlength{\@tocsubsubsectionnumwidth}     \newcommand{\settocsectionnumwidth}[1]{\setlength{\@tocsectionnumwidth}{#1}}     \newcommand{\settocsubsectionnumwidth}[1]{\setlength{\@tocsubsectionnumwidth}{#1}}     \newcommand{\settocsubsubsectionnumwidth}[1]{\setlength{\@tocsubsubsectionnumwidth}{#1}}     \newcommand{\settocsectionindent}[1]{\setlength{\@tocsectionindent}{#1}}     \newcommand{\settocsubsectionindent}[1]{\setlength{\@tocsubsectionindent}{#1}}     \newcommand{\settocsubsubsectionindent}[1]{\setlength{\@tocsubsubsectionindent}{#1}}          % Handle section-specific formatting and vertical skip of ToC-related entries     % \@tocline{<level>}{<vspace>}{<indent>}{<numberwidth>}{<extra>}{<text>}{<pagenum>}     \renewcommand{\l@section}{\section@tocline{1}{\@tocsectionvskip}{\@tocsectionindent}{\@tocsectionnumwidth}{\@tocsectionformat}}%     \renewcommand{\l@subsection}{\subsection@tocline{1}{\@tocsubsectionvskip}{\@tocsubsectionindent}{\@tocsubsectionnumwidth}{\@tocsubsectionformat}}%     \renewcommand{\l@subsubsection}{\subsubsection@tocline{1}{\@tocsubsubsectionvskip}{\@tocsubsubsectionindent}{\@tocsubsubsectionnumwidth}{\@tocsubsubsectionformat}}%     \newcommand{\@tocsectionformat}{}     \newcommand{\@tocsubsectionformat}{}     \newcommand{\@tocsubsubsectionformat}{}     \expandafter\def\csname toc@1format\endcsname{\@tocsectionformat}     \expandafter\def\csname toc@2format\endcsname{\@tocsubsectionformat}     \expandafter\def\csname toc@3format\endcsname{\@tocsubsubsectionformat}     \newcommand{\settocsectionformat}[1]{\renewcommand{\@tocsectionformat}{#1}}     \newcommand{\settocsubsectionformat}[1]{\renewcommand{\@tocsubsectionformat}{#1}}     \newcommand{\settocsubsubsectionformat}[1]{\renewcommand{\@tocsubsubsectionformat}{#1}}     \newlength{\@tocsectionvskip}     \newcommand{\settocsectionvskip}[1]{\setlength{\@tocsectionvskip}{#1}}     \newlength{\@tocsubsectionvskip}     \newcommand{\settocsubsectionvskip}[1]{\setlength{\@tocsubsectionvskip}{#1}}     \newlength{\@tocsubsubsectionvskip}     \newcommand{\settocsubsubsectionvskip}[1]{\setlength{\@tocsubsubsectionvskip}{#1}}          % Adjust section-specific ToC-related macros to have a fixed-width numbering framework     \patchcmd{\tocsection}{\indentlabel}{\makebox[\@tocsectionnumwidth][l]}{}{}     \patchcmd{\tocsubsection}{\indentlabel}{\makebox[\@tocsubsectionnumwidth][l]}{}{}     \patchcmd{\tocsubsubsection}{\indentlabel}{\makebox[\@tocsubsubsectionnumwidth][l]}{}{}          % Allow for section-specific page numbering format of ToC-related entries     \newcommand{\@sectypepnumformat}{}     \renewcommand{\contentsline}[1]{%       \expandafter\let\expandafter\@sectypepnumformat\csname @toc#1pnumformat\endcsname%       \csname l@#1\endcsname}     \newcommand{\@tocsectionpnumformat}{}     \newcommand{\@tocsubsectionpnumformat}{}     \newcommand{\@tocsubsubsectionpnumformat}{}     \newcommand{\setsectionpnumformat}[1]{\renewcommand{\@tocsectionpnumformat}{#1}}     \newcommand{\setsubsectionpnumformat}[1]{\renewcommand{\@tocsubsectionpnumformat}{#1}}     \newcommand{\setsubsubsectionpnumformat}[1]{\renewcommand{\@tocsubsubsectionpnumformat}{#1}}     \renewcommand{\@tocpagenum}[1]{%       \hfill {\mdseries\@sectypepnumformat #1}}          % Small correction to Appendix, since it's still a \section which should be handled differently     \let\oldappendix\appendix     \renewcommand{\appendix}{%       \leavevmode\oldappendix%       \addtocontents{toc}{%         \protect\settowidth{\protect\@tocsectionnumwidth}{\protect\@tocsectionformat\sectionname\space}%         \protect\addtolength{\protect\@tocsectionnumwidth}{2em}}%     }     \makeatother               % #1 (default is as required)          % #2          % #3     \makeatletter     \settocsectionnumwidth{2em}     \settocsubsectionnumwidth{2.5em}     \settocsubsubsectionnumwidth{3em}     \settocsectionindent{1pc}%     \settocsubsectionindent{\dimexpr\@tocsectionindent+\@tocsectionnumwidth}%     \settocsubsubsectionindent{\dimexpr\@tocsubsectionindent+\@tocsubsectionnumwidth}%     \makeatother          % #4 & #5     \settocsectionvskip{10pt}     \settocsubsectionvskip{0pt}     \settocsubsubsectionvskip{0pt}          % #6 & #7     % See #3          % #8     \renewcommand{\contentsnamefont}{\bfseries\Large}          % #9     \settocsectionformat{\bfseries}     \settocsubsectionformat{\mdseries}     \settocsubsubsectionformat{\mdseries}     \setsectionpnumformat{\bfseries}     \setsubsectionpnumformat{\mdseries}     \setsubsubsectionpnumformat{\mdseries}          % #10     % Insert the following command inside your text where you want the ToC to have a page break     \newcommand{\tocpagebreak}{\leavevmode\addtocontents{toc}{\protect\clearpage}}          % #11     \let\oldtableofcontents\tableofcontents     \renewcommand{\tableofcontents}{%       \vspace*{-\linespacing}% Default gap to top of CONTENTS is \linespacing.       \oldtableofcontents}          \setcounter{tocdepth}{3}                          %AMSART STUFF          \newtheorem{theorem}{Theorem}[section]     \newtheorem{lemma}[theorem]{Lemma}          \theoremstyle{definition}     \newtheorem{definition}[theorem]{Definition}     \newtheorem{example}[theorem]{Example}     \newtheorem{xca}[theorem]{Exercise}          \theoremstyle{remark}     \newtheorem{remark}[theorem]{Remark}          \numberwithin{equation}{section}          \usepackage[explicit]{titlesec}     \usepackage{hyperref}     \hypersetup{         colorlinks,%         citecolor=black,%         filecolor=black,%         linkcolor=black,%         urlcolor=black     }          % renew \contentsline for toc to include hypertarget     \let\oldcontentsline\contentsline%     \renewcommand\contentsline[4]{%     \hypertarget{toc#4}{}%     \oldcontentsline{#1}{#2}{#3}{#4}}          % renew \section to link to the toc     \titleformat{\section}     {\normalfont\Large\bf}     {{\thesection} \hyperlink{tocsection.\thesection}{#1}}     {1pc}     {}          % renew \subsection to link to the toc     \titleformat{\subsection}     {\normalfont\bf}     {{\thesection} \hyperlink{tocsubsection.\thesubsection}{#1}}     {1pc}     {}          % renew \subsubsection to link to the toc     \titleformat{\subsubsection}     {\normalfont\bf}     {{\thesection} \hyperlink{tocsubsubsection.\thesubsubsection}{#1}}     {1pc}     {}               \begin{document}          \title{Report}          %    Information for first author     \author{Ban}     %    Address of record for the research reported here     \address{5da}     %    Current address          \email{sh@a}     %    \thanks will become a 1st page footnote.     \thanks{The autnt.}          %%    Information for second author     %\author{Author Two}     %\address{Mathematical Research Section, School of Mathematical Sciences, Australian National University, Canberra ACT 2601, Australia}     %\curraddr{Department of Mathematics and Statistics, Case Western Reserve University, Cleveland, Ohio 43403}     %\email{two@maths.univ.edu.au}     %\thanks{Support information for the second author.}          %    General info     %\subjclass[2000]{Primary 54C40, 14E20; Secondary 46E25, 20C20}          \date{\today.}          %\dedicatory{Thior.}          \keywords{Matry}          \begin{abstract}     This paper is      \end{abstract}          \maketitle               \tableofcontents          \section{Introduction, Background, and Motivation}          \section{Tooling}          \subsection{Toion}                    \section{Stories}          \subsection{Sion}          \subsubsection{Ky}          \subsubsection{Background}          \begin{itemize}     \item Other Types     \item ming     \end{itemize}          \subsection{odels}          \subsubsection{n}          \subsection{archy}          \subsection{ies - \href{run:./s.pdf}{file}.}          \subsubsection{ink}          \subsubsection{ts)}          \subsubsection{tion}                    \dictentry{aardvark}{an animal}%     \dictentry{lion}{another animal, but with       a really long description that spills over many, many, many, many, many,        many, many, many, many, many, many, many, many, many, many, many, many,        many, many, many, many, many, many, many, many, many, many lines}     \dictentry{zebra}{yet another animal}%               \setlength{\glsdescwidth}{\textwidth}     \printglossary[title=Glossary]%[style=long]     \end{document}


title: Incorrect line spacing when using \Large in a center environment

text: When I enclose text with line breaks within a center environment, there is extra space after the first line, but only if the font size has been changed. The following working example prints the same block of text with line breaks four times, covering all combinations of whether the center environment \Large are used. Only when both center and \Large are used does it produce incorrect line spacing:               \documentclass{article}          \begin{document}          \newcommand{\mytext}{First Line \\ Second Line \\ Third Line \\}          First Line \\ Second Line \\ Third Line          {\Large First Line \\ Second Line \\ Third Line}          \begin{center}        First Line \\ Second Line \\ Third Line            {\Large First Line \\ Second Line \\ Third Line}     \end{center}          \end{document}      Any thoughts on what's going on to produce this unexpected behavior?


title: How to use \toks with \foreach

text: I would like to use `\foreach` to replace the next code :               \def\x{0}     \edef\y{\x}          \xdef\z{(b\y)}                 \def\x{1}     \edef\y{\x}     \xdef\w{\z(b\y)}               \def\x{2}     \edef\y{\x}     \xdef\z{\w(b\y)}            \def\x{3}     \edef\y{\x}     \xdef\w{\z(b\y)}          \w       The aim is to get this result : (b0)(b1)(b2)(b3) with a macro I got the result with `\toks` but perhaps it's possible to avoid this.               \documentclass{article}     \usepackage{tikz}          \begin{document}          \makeatletter     \toksdef\toks@=0 %  ?     \toksdef\toks@@=1 %      \xdef\tmp{}%          \foreach \x in {0,1,2,3}{%         \toks@\expandafter{\x}%         \toks@@\expandafter{\tmp}%         \xdef\tmp{\the\toks@@(b\the\toks@)}%      }     \makeatother      \tmp     \end{document}       I think this code is not nice. What is the better way to get the result without an extern package ?


title: LaTeX Companions Third Revised Boxed Set, The

text: I just found The LaTeX Companions Third Revised Boxed Set: A Complete Guide and Reference for Preparing, Illustrating and Publishing Technical Documents (2nd Edition). It might be time for me to update these LaTeX books of mine, but what are the differences between the first and second edition?


title: How to use the parrun package

text: The documentation for the `parrun` package claims it can be used to display parallel text. I cannot find any example code showing how to use it and I have failed to create a simple example to test how it work. How do I get this package to display parallel text as it was designed to?


title: Use negative page number before the \mainmatter

text: I want to put negative number page before the main page of a book document class. So, I will have something like page -4, -3, -2, -1, 0 (this is the first main page), 1, 2… I can put on the top of the `document` environment `\setcounter{page}{-<number>}` but I have to know how many pages is before the `\mainmatter` to put it as a `<number>` variable. So how can I get this value?


title: Increase row height and center, but only the first row

text: I have a table, built using the `tabu` package. My code currently looks like below. The `\\[5ex]` _does_ increase the row height, but the contents of the third cell is aligned top instead of middle (notice the `X[c,m]` definition). The `\arraystretch` changes the height of all the rows, but I only want to increase the height of only the first one.               \documentclass[]{article}          \usepackage{tabu}          \begin{document}          \begin{table}[h!]         \begin{center}             \begin{tabu} to 0.5\linewidth {| X[c,m] | X[c,m] | X[c,m] |}                 \hline                 \textbf{First column} & \textbf{Second Column} & \textbf{Third Column} \\[5ex] \hline                 \hline                      1 & 0x1 & 01 \\ \hline                 2 & 0x2 & 02 \\ \hline                 3 & 0x3 & 03 \\ \hline                 4 & 0x4 & 04 \\ \hline                 5 & 0x5 & 05 \\ \hline                 6 & 0x6 & 06 \\ \hline                 7 & 0x7 & 07 \\ \hline                 8 & 0x8 & 010 \\ \hline                 9 & 0x9 & 011 \\ \hline                 10 & 0xa & 012 \\ \hline                  \end{tabu}         \end{center}              \caption{Example of another short table, but smaller and centered.}     \end{table}          \end{document}


title: bibtex + natbib + APA syntax confusion

text: my code is:               \documentclass[12pt,letterpaper]{report}          \usepackage[square,sort,comma,numbers]{natbib}               \begin{document}               It is particularly notable for its flexibility, its     superb hyphenation, and its ability to choose aesthetically satisfyingline\citep{Wel03}          \bibliographystyle{apalike}     \bibliography{Bibliography}          \end{document}      my bib file is :               @Book{Tho05,     author = "Thomas F. O'Brien and Tilak V. Bommaraju and Fumio Hine",     title = {Handbook of Chlor-Alkali Technology Volume I: Fundamentals},     publisher = {Springer Science+Business Media Inc.},     year = {2005},     address = {233 Spring Street, New York, NY 10013,     USA},     }      it compiles to: ![enter image description here](http://i.stack.imgur.com/Jjh94.jpg) in the natbib documentation it says that \citep{key} results to: ![enter image description here](http://i.stack.imgur.com/a4hQX.jpg) I wanted to have that (author et. al, year) format just like the one in the documentation. What \cite would I need to type in?


title: English minitoc entry within a Greek utf8 document

text: In a document set up as shown in the question Greek pdf bookmarks, the interesting bits are:               \documentclass[greek,english]{scrbook}     \usepackage[LGRx,T1]{fontenc} % define LGR and T1 encodings     \usepackage[utf8]{inputenc} % standard UTF-8 input encoding     \usepackage[greek,english]{babel}     \usepackage[unicode]{hyperref}      The minitoc package is used to present mini-ToCs on a per-chapter basis.               \usepackage[k-loose]{minitoc} % Mini-ToCs with loose line spacing     \mtcsettitle{minitoc}{} % for empty title     \mtcsetrules{minitoc}{off} % turn off rules before and after the minitoc's     \mtcsetpagenumbers{minitoc}{off} % turn off page numbering in minitoc's      All but one section titles are Greek. The only English section, named _Thumb index_ and correctly (?) defined in English using `\selectlanguage{english}`, appears with Greek letters in the mini-ToC as _Τηυμβ-ινδεξ_. **Note** the section title appears correctly in the (normal) Table of Contents! How should be minitoc instructed to respect the language setting?


title: How can I set the vertical margin of my chapter headings?

text: I currently don't like the typesetting of a document. In my two sided document, I want that the chapter headings not have a vertical space before their appearance. The text on the second page should start at line 1 or if it's possible on line 2. My document preamble:               \documentclass[12pt,parskip=half,a4paper,twoside]{scrreprt}     [..]     \usepackage{fancyhdr}     \usepackage{titlesec}     [..]     \titleformat{\chapter}[hang]{\normalfont\huge\bfseries}{\thechapter}{1em}{\Huge}     \titlespacing*{\chapter}{0pt}{0pt}{1em}          \titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{}     \titlespacing*{\section}{0em}{1em}{0em}          \titleformat{\subsection}{\normalfont\large\bfseries}{\thesubsection}{1em}{}     \titleformat{\subsubsection}{\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}     \titleformat{\paragraph}[runin]{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}     \titleformat{\subparagraph}[runin]{\normalfont\normalsize\bfseries}{\thesubparagraph}{1em}{}          \begin{document}     [..]     \end{document}      ![Margin](http://i.stack.imgur.com/foJqQ.png)


title: Vertical alignment of text in node spanned over multiple matrix columns

text: The problem with the following MWE is that I don't understand why the text in the big node isn't aligned in the center (vertically speaking). How can I do that? ## Picture ![enter image description here](http://i.stack.imgur.com/YZfGN.png) ## MWE               \documentclass[     11pt     ]{scrartcl}     \usepackage{     tikz,     relsize,     tgheros     }          \usetikzlibrary{         calc,trees,shadows,positioning,arrows,chains,         decorations.pathreplacing,         decorations.pathmorphing,         decorations.shapes,         decorations.text,         shapes,         shapes.geometric,         shapes.symbols,         matrix,         patterns,         intersections,         fit     }          \pgfdeclarelayer{background layer}     \pgfdeclarelayer{foreground layer}     \pgfsetlayers{background layer,main,foreground layer}          \tikzset{         >=latex,         line/.style={draw, thick, ->},         phase/.style={             align=left,             anchor=center,             rectangle,             %drop shadow={opacity=0.5},             %   minimum width=2cm,             minimum height=1.0cm,             %   text width=6cm,             font=\sffamily\bfseries\small,             draw=black,             very thick,             fill=black!40,             %top color=white,             %bottom color=white!20!blue         },         phasentext/.style={             align=left,             anchor=center,             %node distance=0.5cm,             rectangle,             %drop shadow={opacity=0.5},             %rounded corners,              minimum width=2cm,             minimum height=1cm,              %   text width=7cm,             draw=gray,             very thick,             %fill=black!20,             %shade,             font=\sffamily\small,             %top color=white!80!black,             %bottom color=white         }     }          \begin{document}     \begin{center}     \begin{tikzpicture}[font=\sffamily\small,node distance=0.5cm]     \matrix (Versuchsplan) [     matrix of nodes,     nodes in empty cells,     row sep=6mm,     column sep=3mm,     inner sep=7pt     ] {         %         |[phase]| 1 & & & & \\         & |[phasentext] (WordA)| Testa: \tikz \draw[thick, circular glow={fill=gray}] (0,0) circle [radius=6pt]; &         |[phasentext] (WordB)| Stuff: \tikz \draw[very thick, drop shadow] (0.2,0.1) rectangle (0.7,0.2); &         |[phasentext] (WordC)| Stuff text word: \begin{tikzpicture} \draw[thick] (0,0) circle [radius=6pt]; \draw[thick,fill=black] (0,0) circle [radius=0.5pt]; \end{tikzpicture} &         |[phasentext] (WordD)| Some more words: \begin{tikzpicture} \draw[thick] (0,0) circle [radius=6pt]; \draw[thick] (-3pt,-2pt) -- (3pt,-2pt) -- (0,2pt) -- cycle; \draw[thick] (0,2pt) -- (0,-2pt); \end{tikzpicture} \\     };     \node[phase, fit=(Versuchsplan-1-2)(Versuchsplan-1-5), align=left, anchor=center] (Words) {Longs text I suppose};     \end{tikzpicture}     \end{center}     \end{document}


title: latexdiff does not highlight changes within \AtEndDocument

text: For a certain journal I have to follow this structure:   1. Main text   2. References   3. Figures, one per page   4. Extra text I've managed to accomplish that by using package `endfloat` that moves the figures to the end, and `\AtEndDocument`, which allows me to put the extra text after the figures. I have now to submit a revised version, with changes marked. I intended to do this with latexdiff, but it seems it does not highlight changes in the extra text. Unfortunately this is where many changes will be located. Perhaps relevant to this is that I'm using the --flatten option of latexdiff, since the sources are split in several .tex files (some of them being included within an \AtEndDocument). I'd like a solution that does not involve separate documents so page numbering is kept, and there is only one master file. Alas, I'm stuck here. Do you know any way around this? Probably getting rid of `\AtEndDocument`. Thanks in advance.


title: Error when trying to import an Image

text: I am new to LaTeX and I am trying to import a `.jpg` file. I have this code that I compiled from different sources online:               \begin{figure}[ht!]     \centering     \includegraphics[width=90mm]{svm.jpg}     \caption{Max Margin Seperators}     \label{Machine Learning}     \end{figure}      But I keep on getting an error. The `.tex` file and the `.jpg` are saved in the same directory.


title: tikz node align text to bottom of rectangle

text: How can I align the text of a node to the bottom of the rectangle shape without hard coding values? (centered horizontally but justified to the bottom)               \tikz[]{             \node[shape=rectangle, inner sep=8pt, minimum height=1.2cm, fill=black, text=white, font=\huge, text depth=-0.6cm] {test};     }\tikz[]{             \node[shape=rectangle, inner sep=8pt, minimum height=1.2cm, fill=black, text=white, font=\huge, text depth=0cm] {test};     }\tikz[]{             \node[shape=rectangle, inner sep=8pt, minimum height=1.2cm, fill=black, text=white, text depth=-0.6cm] {test};     }\tikz[]{             \node[shape=rectangle, inner sep=8pt, minimum height=1.2cm, fill=black, text=white, text depth=0cm] {test};     }      Obviously `text depth` can be hard coded but I would like it to automatically work for any given font and rectangle height.


title: Applications of various strength of \linebreak command

text: This is a curiosity-driven question. The LaTeX `\linebreak` command comes with five options, from 0 to 4, determining its strength. `\linebreak[0]` allows TeX to break a line where he normally does not do it, while `\linebreak[4]` forces him to break a line in a place where the command is put (and is thus equivalent to `\linebreak`). To be honest, in my LaTeX practice never have I used any variation of the command beyond mere `\linebreak`. So, I would like to ask you to share your experience with applying other possibilities. To be more precise:   * could you please point to situations in which it is reasonable to apply `\linebreak[i]`, where `i is not 4` ? could you please explain why you do so ?   * maybe some of you worked out some general rules which facilitate typesetting with LaTeX (similar for example to placing non-breakable space joining single letter with a word that follows it, like in: `a~dog`) ? This, I think, qualifies as a CW question, yet I do not have enough reputation to create it.


title: TeX export from octave puts legend underneath graphs

text: when exporting figures from octave 3.8.1 somehow the legends contained in figures get put underneath the graphs. In the example below the legend elements get put to the far background, so the line and grid elements will be on top of it. Also, the elements appear to be transparent, take a close look at the legend box. I do not know if this is an octave related issue or a tex problem. Please have a look at the octave code and and .tex-file.               figure('Name','Plot Export Demo');     hold on;     grid on;     plot([0,10],[0,10],'LineWidth',2,'Color','blue');     plot([0,10],[10,0],'LineWidth',2,'Color','red');     set(gca,'xtick',[0:10]);     set(gca,'ytick',[0:10]);     legend('blue line','red line');     print('-dtex','plot_export_demo');      A minimum working example .tex file:               \documentclass[10pt,a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage{graphicx}     \usepackage{color}     \usepackage[left=3.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry}     \begin{document}     \resizebox{1.0\textwidth}{!}{\input{plot_export_demo.tex}}     \end{document}      A screenshot of the resulting image from the .pdf-file is attached below. You can see the blue line on top of the legend box in the .eps file produced by octave already. So I guess everything else is a follow up? ![screenshot of legend under graphs](http://octave.1599824.n4.nabble.com/file/n4664335/screenshot.png)


title: Ignore "global" scaling in Tikz?

text: I'm using several macro's to quickly draw points in a figure (I have to realy draw a lot). For example I use:               \newcommand{\punt}[3]{\draw[fill,scale=1]#1 coordinate(#2)circle(0.5pt)node[#3]{$#2$};}      to quickly draw a point and it's name, as well as give it the correct coordinate. My problem is that as I'm drawing I might later decide to scale the entire picture (using `scale`). This results in larger dots that depict the points. I don't want this because I might scale one picture to 2 times it's size and another one to 0.5 it's size and this leads to a discrepancy in dot sizes throughout my document. An even greater problem arises when I use `xscale` or `yscale` which leads to deformed circles. Is there a way I can tell my macro to ignore all other scaling? As you can see I tried putting `scale=1` in the draw options but this didn't help...


title: How to insert page numbers on some frames produced by Beamer?

text: I wonder how to insert the page numbers (say) on the top left-corner of the frames of my presentation file (excluding the first frame -namely the Title Frame- and the last one, namely the Thank-You Frame) - in a (PDF)LaTeX. I have used the `\documentclass{beamer}` in the TeX file as follows.               \documentclass[     %     %pdf,     %noFooter,     %draft,     %nocolorBG,     %slideBW,     %colorBG,     %slideColor,     %ntnu     %winter     %autumn     ]{beamer}          \usepackage{amsmath}     \usepackage{rotating}     \usepackage{graphicx}     \usepackage{multimedia}          \useinnertheme[shadow=true]{rounded}     \useoutertheme{shadow}     \usecolortheme{orchid}     \usecolortheme{whale}          \title[Title of the presentation]{Title of the presentation}     \author[Dept. of Mathematical Sciences, NTNU \hspace{1mm} Name]{Name}     \institute{\href{http://www.ntnu.no}     {Norwegian University of Science and Technology}}     \date{Month, Year}          \begin{document}          \newcommand{\dif}{\, \mathrm{d}}     \def\norml       {\mid\!\mid\!}     \def\normr       {\!\mid\!\mid}     \def\normel       {\mid\!\mid\!\mid\!}     \def\normer       {\!\mid\!\mid\!\mid}          \maketitle          \begin{frame}\frametitle{Frame Title}          \end{frame}          .....          \end{document}


title: Stating a linear program

text: I know how to do this the hackish way. However, what would be a more mature and clean way to state a linear program, as here on Wikipedia? That is, an expression of the form: minimize f(x) subject to g_i(x) <= 0, for i in {1,...,n} h_j(x) = 0, for j in {1,...,m}


title: Left-aligning Beamer titles with text

text: How can I set things up so that my `\frametitle` has the same indentation as the main body of text in my slide?


title: Name arrangement macro

text: I'm trying to write a c.v. macro. I've got a first, middle and last name and I would like to arrange these as either "first middle last" or as "first last" if middle is unknown The code I have so far is as follows (which works) :               \def\@normalname{      \@ifundefined{@middlename}      {       \@firstname\ \@lastname      }{      \@firstname\ \@middlename\ \@lastname     }}      and a shorter version that doesn't               \def\@normalname{      \@firstname\      \@ifundefined{@middlename}{}{\@middlename\ }      \@lastname     }      Any reason why the code would fail in the second case ? (using pdfLatex if it helps)


title: How to make \subsection not appear in the ToC

text: How do I get a sub `\subsection{title}` I choose not not appear in the ToC and not interfere with the counting of the other `\subsection`'s?


title: Can I use Beamer's \alert<x>{...} inside fancyvrb Verbatim with overlay?

text: I would like to use Beamer's `\alert<x>{...}` command inside of a `Verbatim` environment (from the `fancyvrb` package) to highlight the text. I've found that when the `\alert` command is inside the `Verbatim`, it just highlights the text, but doesn't do any overlays. > Can I use the overlay feature of `\alert` inside a `Verbatim` environment? Note: I don't want to use a `semiverbatim` environment because I want to put a frame around the text. A minimal working example is copied below. It does not do what I'd like it to.               \documentclass{beamer}     \usepackage{fancyvrb}          \begin{document}          \begin{frame}[fragile]{Testing}          \begin{Verbatim}[commandchars=\\\{\},fontsize=\scriptsize,frame=single]     1.423930+0 8.164981+5 1.257190+02834 3  2  545     1.900300-1 \alert<2>{8.184120+5 3.506000-7}2834 3  2  546     2.307450-2 8.192910+5 2.396970-12834 3  2  547     \end{Verbatim}     \end{frame}          \end{document}      ![enter image description here](http://i.stack.imgur.com/tNKJ7.png)


title: Splitting a row into several rows in pgfplotstable

text: I have data set as follows:               id vala    valb     1  24      75     2  56      87      In this data set, there are two value types: `vala` and `valb`. The number of types may change, it can be three, four, etc. I need to convert this first data set to:               id val type     1  24  a      1  75  b     2  56  a     2  87  b      and then typeset it. Or without conversion, typeset the first data set in the format of the second data set. `type` column is to differentiate `id`s, however it is not very necessary. If possible, it should be generated from the last character of the column names. Here is MWE:               \documentclass[parskip]{scrartcl}     \usepackage[margin=15mm]{geometry}     \usepackage{pgfplotstable}     \pgfplotsset{width=10cm,compat=1.6}     \usepackage{filecontents}               \begin{filecontents}{testdataExisting.dat}     id vala    valb     1  24      75     2  56      87     \end{filecontents}          \begin{filecontents}{testdataGenerated.dat}     id val type     1  24  a      1  75  b     2  56  a     2  87  b     \end{filecontents}           \begin{document}     Table 1           \pgfplotstabletypeset[col sep=space,columns={id,vala,valb},]{testdataExisting.dat}          Table 2           \pgfplotstabletypeset[col sep=space,columns={id,val,type},         columns/type/.style={string type,column type=r},      ]{testdataGenerated.dat}      \end{document}      Output: ![](http://i.stack.imgur.com/JvyjJ.jpg)


title: Use \textquotedbl in repeating cells in pgfplotstable

text: I have Table 1. Repeating values in consecutive cells of a column should be replaced with `\textquotedbl` as in Table 2. Also `\textquotedbl` should be aligned centered according to column width although numbers are aligned right. Here is MWE:               \documentclass[parskip]{scrartcl}     \usepackage[margin=15mm]{geometry}     \usepackage{pgfplotstable}     \pgfplotsset{width=10cm,compat=1.6}     \usepackage{filecontents}     \usepackage[T1]{fontenc}           \begin{filecontents}{testdataExisting.dat}     id val     1  5634     2  78945     3  78945     4  689623     5  14514     6  14514     7  14514     \end{filecontents}          \begin{filecontents}{testdataGenerated.dat}     id val     1  5634     2  78945     3  \textquotedbl     4  689623     5  14514     6  \textquotedbl     7  \textquotedbl     \end{filecontents}           \begin{document}     Table 1           \pgfplotstabletypeset[col sep=space,columns={id,val},          columns/val/.style={fixed,precision=0,column type=r},      ]{testdataExisting.dat}          Table 2           \pgfplotstabletypeset[col sep=space,columns={id,val},        %  columns/val/.style={fixed,precision=0,column type=r},         columns/val/.style={string type,column type=r},      ]{testdataGenerated.dat}      \end{document}      Output: ![](http://i.stack.imgur.com/N7pvw.jpg) In the solution, `testdataGenerated.dat` should not exist. I need a solution that postprocesses the table of `testdataExisting.dat` so that it replaces repeating values with `\textquotedbl` and align these `\textquotedbl`s.


title: Does AucTeX Autocomplete?

text: The quick start guide for AUCTeX says > As nearly everywhere in AUCTeX, you can use the TAB or SPC key to get a list > of available level names, and to auto-complete what you started typing. Which tantalizingly makes me thing AUCTeX has an auto-complete feature. But pressing TAB does nothing. I apologize for the simple question, but I've spent more time searching for it than I am ever likely to save so this is a last resort before I give up on it. So, is there in fact an auto-complete feature in Emacs AUCTeX? How does one turn it on if so? Edit: I just figured out `M-TAB` is problematic since it is bound to a OS GUI action. I saw a website discuss this problem and it notes that there are two key bindings which are supposed to be equivalent: `c-[ c-I` and `ESC TAB`. Except these for some reason give me dictionary spelling corrections for the word I wrote which is not exactly what I was expecting.


title: What is the best way to insert document-level JavaScript in LaTeX documents

text: I have been toying with the idea of converting some forms at work to interactive forms. I have tried some of the routines that come with insdljs, but they seem a bit dated. The idea is very attractive. I am looking for more recent information, links and pointers. Does Beamer use JavaScript?


title: How to draw slanting arrows between columns of a table?

text: I'd like to draw some simple slanting arrows between cells in a table. The two cells can be in almost any position in the table. For example given this table: ![Table without arrows](http://i.stack.imgur.com/8ItZR.png) How can I modify it to obtain: ![Table with arrows](http://i.stack.imgur.com/xLkaG.png) Another example with also vertical arrows: ![Table with also vertical arrows](http://i.stack.imgur.com/Pnk4b.png) Ideally I'd like to avoid using Tikz, since using `tabular` is pretty straightforward to draw this kind of diagrams, but if nothing else can be done then I'll accept a Tikz solution. The MWE code for the table:               \documentclass[a4paper,10pt]{article}     \usepackage[utf8]{inputenc}          \begin{document}          \begin{figure}[H]     \begin{tabular}{cccccccc}     ((\textbf{N}   & $\Rightarrow$ & \textbf{N}) & $\Rightarrow$ & \textbf{N})& $\Longrightarrow$ & \textbf{N} &     \\                    &               &             &               &            &                   &     $q$      & $O$ \\                    &               &             &               &    $q$     &                   &              & $P$ \\                    &               &     $q$     &               &            &                   &              & $O$ \\                    &               &             &               &    $q$     &                   &              & $P$ \\                    &               &     $q$     &               &            &                   &              & $O$ \\            $q$     &               &             &               &            &                   &              & $P$ \\                    &               &             &    $\vdots$   &            &                   &              &     \\     \end{tabular}     \end{figure}          \end{document}


title: How do I set the margin for the glossary item in my Table of Contents?

text: I have a table of contents and I use the `glossaries` package to make my glossaries. At some point in my code, I have the command `\printglossary[type=glossarytype]` which prints my glossary. The problem is the glossary word in my table of contents is not aligned with my chapters (which are numbered). I need my glossary entry in ToC to have a little space at the left, where would normally go a chapter number.


title: Circular ends of lines and positioning of nodes?

text: I am trying to replicate the following image: ![enter image description here](http://i.stack.imgur.com/PBCCb.png) My work so far:               \documentclass{article}          %%for graphs     \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{pgfplots}     \pgfplotsset{compat=1.10}     \usepgfplotslibrary{fillbetween}     %%end graph code          \begin{document}     \begin{tikzpicture}[scale=1]     \begin{axis}[             axis x line=bottom,%need to change to bottom to put 0 in              axis y line=middle,             x label style={at={(axis cs: 2.6, -0.12)},anchor=south},%rotate = degrees number can be used to rotate the label             y label style={at={(axis cs:0, 2.5)},anchor=south},             xtick={0, 1, 2}, %or {listofvalues, , },             ytick={0, 1, 2},             yticklabels={$0$, $1$, $2$},             xticklabels={$0$, $1$, $2$},             ymin=0,             ymax=2.5,             xmin=0,             xmax=2.5,             ylabel=$y$,              xlabel=$x$,             area style,             ]         %thick lines         \draw[draw = black, ultra thick] (axis cs: 0, 0) -- (axis cs: 0, 2);         \draw[draw = black, ultra thick] (axis cs: 0.5, 0) -- (axis cs: 0.5, 1.5) node [above, right] {$y = 2 - x$};         %y=0 label         \node [below] at (axis cs: 0.5,0) {$y=0$};         %line with label         \addplot+[draw = black, ultra thick, name path = upper, domain=0:2] {2-x} node [midway, sloped, above, black] {$x + y = 2$};         %node for labeling line         \addplot+[draw = black, ultra thick, name path = lower, domain=0:2] {0};           %shading             \addplot[gray!40] fill between[of = upper and lower];     \end{axis}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/aX44F.png) The main issues are that the node labels aren't appearing and and positioned correctly, and I'm not sure how to get the circular ends of lines. Thanks for any help - sorry if these questions have already been answered elsewhere.


title: textsl in Beamer

text: I notice that the `\textit` and `\textsl` behave much alike in Beamer. The following MWE produces the image:               \documentclass{beamer}          \begin{document}     \begin{frame}{}     \textsl{Welcome to my world!}          \textit{Welcome to my world!}     \end{frame}     \end{document}      ![](http://i.stack.imgur.com/ImicB.png). How can these two can be made different, as they are in Article class:               \documentclass{article}          \begin{document}     \textsl{Welcome to my world!}          \textit{Welcome to my world!}     \end{document}      ![](http://i.stack.imgur.com/ZFoaS.png)


title: knitr xtable make two tables equal width

text: I am using knitr and xtables to automate a report procedure. I want to include a few tables in this report and make them displayed with equal width. The Rnw code is listed below. Anyone could tell me how to make the tables of different column numbers showed of the same width in page? thanks!               \documentclass[a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english]{babel}     \usepackage{booktabs}     \usepackage{colortbl, xcolor}     \usepackage{longtable}          \begin{document}          <<do_table,echo=FALSE, results = "asis">>=     library(xtable)     mydf <- data.frame(id = 1:10, var1 = rnorm(10), var2 = runif(10))     mydf1 <- data.frame(id = 1:10, var1 = rnorm(10), var2 = runif(10),var3=rnorm(10))     print(xtable(mydf))     print(xtable(mydf1))     @          \end{document}


I'm using texstudio on linux for writing paper. the version is: TeXstudio 2.3 (SVN ??) Using Qt Version 4.8.4, compiled with Qt 4.8.0 Copyright (c) (original TexMaker) 2004-2010 by Pascal Brachet TeXstudio: Benito van der Zander, Jan Sundermeyer, Daniel Braun I want to compile the following source code(the source codes are with a `IEEEtran.cls` ), but it shows : File `subcaption.sty' not found. in texstudio. then I downloaded subcaption.sty and put it in the same folder as the .tex file, there are even more errors. how to deal with this? My OS is fedora 16, my used version is `This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6) (format=pdflatex 2012.2.27) 12 SEP 2013 13:25`.               \documentclass[conference]{IEEEtran}          \usepackage[demo]{graphicx} % demo is just for this example, remove it     \usepackage{subcaption}          \begin{document}          \title{0000}          \author{\IEEEauthorblockN{00000}}          \maketitle     \begin{abstract}     X     \end{abstract}          \IEEEpeerreviewmaketitle          \section{0000}          \begin{figure}[!htbp]     \centering     \begin{subfigure}[b]{0.5\columnwidth}     \includegraphics[width=\linewidth]{pic/loop.png}     \caption{First}     \label{subfig-1:dummy}     \end{subfigure}\hfill     \begin{subfigure}[b]{0.3\columnwidth}       \includegraphics[width=\linewidth]{pic/twopath.png}       \caption{Second}       \label{subfig-2:dummy}     \end{subfigure}     \caption{Dummy figure}     \label{fig:dummy}     \end{figure}          \end{document}


title: Pgfplots label not appearing

text: \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{tkz-euclide}     \begin{document}         \begin{tikzpicture}         \begin{axis}[ticks=none,                 xtick={-10,-9,...,10},                    xmin=-6,                 xmax=6,                 xlabel={$\alpha$},                 axis x line=middle,                 ytick={-10,-9,...,10},                 ymin=0,                 ymax=10,                 ylabel={$s$},                 axis y line=middle,                 no markers,                 samples=100,                 domain=-10:10,                 restrict y to domain=-20:20, xscale=1.2 ]             \addplot[green,samples=400] (x,{-1/x});             \addplot[blue,samples=400] (x,{1/(1+2*x)});             \addplot[red,samples=400, domain=-1:1] (x,{-4*x/(1+x)^2}) node[pos=0.5, pin=135:{$\frac{-4\alpha}{(1+\alpha^2)}$}] {};             \draw[cyan] (axis cs:1,0) -- (axis cs: 1,10) node[pos=1, pin = -30: {\tiny $\alpha=1$}] {};             \draw[cyan] (axis cs:-1,0) -- (axis cs: -1,10) node[pos=0.5, pin = -120: {\tiny $\alpha=-1$}] {};         \end{axis}          \end{tikzpicture}     \end{document}      My one plot label `\addplot[red,samples=400, domain=-1:1] (x,{-4*x/(1+x)^2}) node[pos=0.5, pin=135:{$\frac{-4\alpha}{(1+\alpha^2)}$}] {};` doesn't want to display for some reason. Does anyone see a problem with my code?


title: How to remove hanging indentation from bibliographic entries

text: I would like to use a bibliography style that aligns the text of the second and later lines of each reference entry with the text of the first. I have been using `\bibliographystyle{apalike}` but, as can be seen from in image below, the text of each line is not aligned. Which styles will achieve this? Thanks... ![enter image description here](http://i.stack.imgur.com/a3fMg.png)


title: Writing mod in congruence problems without leading space

text: I have been writing               $a \equiv r (\mod n)$      but this puts a space between the `(` and `mod`. For example, `r ( mod n )` instead of `r (mod n)`. So, how do you write `r (\mod n)` without that space? What would be the correct way to write `$a \equiv r (\mod n)$`?


title: Meeting Minute with supervisor

text: I want to make a table of **Meeting Minutes** with supervisor. The format is as follow;               -------------------------------------------------------------------------------------     Meeting#-------------Roll#-----------Meeting Date---------Minutes     -------------------------------------------------------------------------------------     Summary of Discussion:     -------------------------------------------------------------------------------------      The code below is only for header of meetings, but I don't know how I include **Summary of Discussion** paragraph in this table....                 \documentclass{book}          \begin{document}          \begin{center}     \begin{tabular}{ |p{3cm}||p{2cm}||p{3cm}||p{6cm}|  }     \hline     \hline     \multicolumn{4}{|c|}{\textbf{Meeting Minutes}} \\     \hline     \hline     \textbf{Meeting no}& \textbf{Roll no}&\textbf{Meeting Date}&\textbf{Duration}\\     \hline     {1}& {112}&{17-04-2014}&{30 Minutes}\\     \hline     \end{tabular}     \end{center}     \end{document}


title: xparse: \NoValue gone -> how to check multiple NoValues now?

text: I used to have a definition like the following to check if all optional arguments were missing:               \NewDocumentCommand \question {o o o m} {         \bool_if:nTF {             \str_if_eq_p:nn { \NoValue } { #1 } &&             \str_if_eq_p:nn { \NoValue } { #2 } &&             \str_if_eq_p:nn { \NoValue } { #3 }          } {              <DO STUFF 1>          } {              <DO STUFF 2>          }     }      But that broke with the latest `xparse` update. Now there seems to be only the `\IfNoValueTF{}{}{}` macro but then I have to repeat one the `DO STUFF x` things. I read the `xparse.sty` but there seems to be no such easy solution anymore due to the `QNoValue-` "hack". Any ideas?


title: Issues when compiling TeX files with Vim and LaTeX-suite

text: I'm having problems compiling a TeX file with LaTeX-suite on Ubuntu. In my `.vimrc`, I have the following lines :                filetype plugin on      set grepprg=grep\ -nH\ $*      filetype indent on      let g:tex_flavor='latex'      When I go to the menu and tell it to compile, if I put `.dvi`, a `.dvi` file is generated but I ask for a `.pdf`, nothing happens. Can anyone give me some pointers on this?


I have a bibliography in BibDesk, and use biblatex with biber backend. However, biblatex complains `Package biblatex Warning: No driver for entry type 'url'.` and apparently falls back `Using fallback driver on input line 126.` Here is a MWE:               \documentclass{scrartcl}     \usepackage[english]{babel}     \usepackage{csquotes} % rec'd by babel          \usepackage{biblatex}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @Url{nytnigeria2011,         Author = {{New York Times}},         Title = {Nigerians Vote in Presidential Election},         Url = {http://www.nytimes.com/2011/04/17/world/africa/17nigeria.html},         Urldate = {2012-03-25},         Year = {2011}     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          \section{Introduction}     Dummytext~\cite{nytnigeria2011}.     \newpage     \printbibliography     \end{document}


title: How do I print a beta in TeX Gyre Termes text mode?

text: I have to write a document in Times. Therefore I started writing it in TeX Gyre Termes, based on the note on Time's font page. However, I use PDFLaTeX, so I can't directly type Greek characters. So if I want to write isopropyl-1-thio-β-D-galactopyranoside I need to type isopropyl-1-thio-$\beta$-D-galactopyranoside. However, this puts the beta as italic (Which I need anyway, not bad) but lists it in a different font then the surrounding text. I noticed that Times ( \usepackage{mathptmx} ) is listed as math-compatible, while TeX Gyre Termes is not, so I switched packages and lo and behold my beta now works. However, I noticed that if you look through Termes technical documentation it lists it as having a beta, in normal, italic, bold and bold italic. (Character 03B2 on page 10, section 3. Standard other unicodes 0080 .. DFFF (actually in 00A0 .. uni2AB0)) Some examples with a MWE:               \documentclass[letterpaper,12pt]{article}     \usepackage{tgtermes}     \usepackage[T1]{fontenc}          \begin{document}     Hey, look, a $\beta$, that doesn't match the text.      \end{document}      ![tgtermes with a non-matching beta](http://i.stack.imgur.com/MN7K9.png) And a better looking example:               \documentclass[letterpaper,12pt]{article}     \usepackage{mathptmx}     \usepackage[T1]{fontenc}          \begin{document}     Hey, look, a $\beta$, that better matches the text.      \end{document}      ![A better looking beta from mathptmx](http://i.stack.imgur.com/t7kWX.png) I thought \usepackage[utf8]{inputenc} would let me just type β and have it work, but no dice. egreg also told me to try this:               \documentclass[letterpaper,12pt]{article}     \usepackage{tgtermes}     \usepackage[T1]{fontenc}     \usepackage{newunicodechar}     \newunicodechar{β}{\beta}               \begin{document}     Hey, look, a β that gives me gibberish     \end{document}      ![newunicodechar gives me gibberish](http://i.stack.imgur.com/DbfUP.png) Which makes me wonder: 1) In what way is Termes better then Times if it isn't math-mode usable? 2) Can I use Times as my math-font and Termes as my body? 3) Can I get access to the 4 betas from Termes in PDFLaTeX?


title: \begin{alltt} inside \subfloat

text: I am trying to use the `alltt` environment inside a `\subfloat` element, and inside a minipage. The problem is that if I use `\subfloat` the indented text looses its indentation. Do you know any solution? Herein a snippet of my code:               \subfloat[Caption]{     \begin{minipage}[t]{0.48\linewidth}     {\tiny     \begin{alltt}        content...     \end{alltt}     }     \end{minipage}


title: Does pgfplots ignore the minor grid?

text: I'm trying to plot an easy function and I would like to enable the minor grid.   But it seems that this instruction is ignored. I used the `grid=both` option but it has no effect. The only grid I can see is the major grid. I could not find anything helpful on the internet. Thanks for any advise.               \documentclass[11pt]{amsart}     \usepackage{geometry}                     \geometry{a6paper}                        \usepackage[utf8]{inputenc}     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{epstopdf}     \usepackage{pgfplots}     \usepackage[german]{babel}     \usepackage{tikz}     \usetikzlibrary{shapes.misc}     \usetikzlibrary{decorations.markings}      \title{Control}          \begin{document}          \begin{tikzpicture}      \begin{axis}[grid=both,xlabel={error},ylabel={power}]     \addplot[mark=none,domain=4:30,samples=200]{55/(1.3*(ln(x)/ln(10)))};     \end{axis}     \end{tikzpicture}     \end{document}       ![enter image description here](http://i.stack.imgur.com/EzlLU.png)


title: Itemize - set default option

text: I have plenty of lists, all with the `[noitemsep]` option:               \begin{itemize}[noitemsep]         \item foo         \item bar     \end{itemize}      Is it possible, to setup itemize to use this option by default? Or do I have to write my own "wrapper" macro around `itemize`.


title: Am I programmatically tieing my hands behind my back by insisting on a particular engine?

text: I've read Differences between LuaTeX, ConTeXt and XeTeX, but still have a niggle at the back of my mind that I'd like to ask about. I'm developing a LaTeX package/class/stuff with the aim of making it possible for me to write any document I like in LaTeX even if the output format is not PDF/DVI/PS (see Getting LaTeX on to the Web for the backstory). Because this is subverting TeX ever-so-slightly, I end up having to do a bit of tinkering under the bonnet. Because my TeX skills are somewhat basic, I often wonder if I'm going about things the right way. Let me give two pertinent examples.   1. There are several times where it is convenient to use catcode changes to implement some stuff. For example, making `^` active so that I can preprocess the stuff that is about to get superscripted. But messing around with catcodes is part of the Dark Arts and it seems that wherever I actually do the catcode change I end up in trouble. One of the simplest bits of trouble is when a macro argument is read in but needs a catcode change in the middle. When I get to this point, I find myself thinking: > I could do this by cunning auxiliary macros and other `\aftergroup` nonsense > or ... I could say "Stuff it, I'll use `\scantokens`".   2. The eventual output is text, but it has to go through PDF and then a pdf-to-text converter. I want some ligatures, such as `--` to an endash and quotes, but not most ligatures. As the eventual output is text the actual font doesn't matter so I could create my own that suits. When I get to this point, I find myself thinking: > I could spend ages sorting out all the `.tfm`, `.afm`, `.ttfn` files or ... > I could say "Stuff it, I'll use `fontspec`". The point is that if I insist on using a particular engine, I could go for the easy options. Now, the primary purpose of my package is to make it easy for **me** to write documents using my familiarity with LaTeX. It is _not_ **not** _**not**_ for converting existing LaTeX documents to some other format. Nonetheless, I would like to make it useful for other people to use, and experience says that the first use most will put it to is to convert some existing document to some other format (who reads the manual these days?). So assuming that I put in some instructions on which packages to add or remove (thinking mainly of fonts), my question is this: is there anything in terms of the basic programming functionality of the different engines that I need to be aware of? In more direct terms, if I think purely with regard to primitives, is there a total order on the engines: TeX < eTeX < XeTeX < LuaTeX? Or, is there anything that TeX can do that, say, LuaTeX can't?


title: Transform defined coordinates in TikZ

text: Say I have a triangle with vertices defined using               \coordinate (a) at (0,0);     \coordinate (b) at (1,0);     \coordinate (c) at (0,1);      Let us denote by `T(x,y)` the triangle defined by `(a),(b)` and `(c)` which is translated by a vector `(x,y)`. I can now easily draw `T(0,0)` as follows:               \draw (a) -- (b) -- (c) -- cycle;      So far so good. Now, lets say that I want to plot the triangle `T(2,3)`. Ideally, I would like to do something like:               \begin{scope}[shift={(2,3)}]         \draw (a) -- (b) -- (c) -- cycle;     \end{scope}      However, as the coordinates were defined outside of the scope the transformation (translation in this case) won't effect them. See this answer. What would be the smart way to do it? Or more generally: **What is the best way to reuse coordinates that are defined once under varying transformations?** **Possible solution:** Basing on the comment of @Qrrbrbirlbel I posted an answer. This answer however, is very limited and local - is the something more general?