title: Packages multirow and columncolor give ugly stripes

text: I have two problems on one slide. This is an example:               \documentclass{beamer}          \usepackage{graphicx}     \usepackage{tabulary}     \usepackage{colortbl}     \usepackage{multirow}     \usepackage{xcolor}     \usepackage{setspace}          % DEFINE COLORS     \xdefinecolor{lGrey}{RGB}{238,238,238}     \xdefinecolor{dGrey}{RGB}{64,64,64}     \xdefinecolor{myRed}{RGB}{164,30,55}          \title{Example}     \author{PM}     \date{\today}          \begin{document}          \frame{\titlepage}          \frame     {         \frametitle{Title}         \begin{center}         {\scriptsize{         \begin{tabular}{>{\columncolor{myRed}}ccc}             \rowcolor{myRed}                 & \color{lGrey} Metaphor & \color{lGrey} Instrument \\                 \cellcolor{myRed} & Something, & Something else \\                 \cellcolor{myRed}\multirow{-2}{*}{\color{lGrey} My stuff}                     & And more & (and paper and pen) \\                 \cellcolor{myRed} & Hand & Leg, \\                 \cellcolor{myRed}\multirow{-2}{*}{\color{lGrey} Other stuffs}                     & thoughts & data \\         \end{tabular}         }}     \end{center}     }          \end{document}      The problem is that I am getting ugly stripes for multirow cells: they should be red, but between one can see white line. How can I eliminate this? Another issue, if I may, is that table is not really centered. It is more to the right.


title: How to get just ONE space between the number of a section's title and its title in the TOC (memoir class)?

text: In my Toc Iam trying to get just one space from the escape key between the number of the section and its title. Example (TOC): 1. My section For the moment, I am using this many time:               \setlength{\cftparagraphnumwidth}{5mm} %or cftparagraphnumwidth,      %cftsubsectionnumwidth, etc.      and this for a new section created by my own with your help :               \cftsetindents{subsubparagraph}{18.0em}{5mm}      Indeed I have noticed that 5mm is nearly the lenght of a space from my keyboard. However, I would like to have something better! Could you fix this please ? Thank you.


title: Colon instead of "p." in Biblatex authoryear-comp

text: I'm using the `authoryear-comp` style with `biblatex`. But when using citing commands, instead of `p/pp.` I would rather have a colon. I have tried these:               \DeclareFieldFormat{postnote}{: #1}     \DeclareFieldFormat{multipostnote}{: #1}      but get `, :` instead. How can I remove the comma in citations?


title: Best practices for LaTeX code in org-mode-beamer (especially url links)

text: I'm using org-mode to produce beamer presentations. I'm having trouble figuring out the best way of including Latex snippets. As far as I can tell, there are two ways of signalling to org-mode to interpret text as LaTeX code. The first is to sandwich the LaTeX code between:               #+begin_latex     .....[LateX code here]....     #+end_latex      The other is to have the line start with `#+LaTeX`:               #+LaTeX: .....[LateX code here]....      The problem about both of these methods is that they require the LaTeX code really sits on its own line (or lines) separate from "regular org-mode" code/text. But if I want a bullet point followed by LaTeX code, say a `\url{}`, this doesn't work, as it has to be on the following line:               * Heading one     ** some point     ***      #+LaTeX: \url{http://www.gnu.org}     *** something else     ***      #+begin_latex     \url{http://tex.stackexchange.com}     #+end_latex      And, unfortunately, org-mode doesn't seem to be to automatically interpret `\url{}` without LaTeX tags. If I just have:               * Heading one     ** \url{http://www.hello-world.net}      Then the PDF output looks like:               * Heading one     ** [[http://www.hello-world.net][http://www.hello-world.net]]      So, is there a better way to handle LaTeX snippets generally? And, more specifically, some good way of getting URLs to be processed in some reasonable way? (Reasonable here means that they standout in some way (colour or fontface) and are "clickable".) Edit: The first suggestion in mvarela's answer is, I think, close to what I want, as it actually "looks like a url" in the output. The other possibility suggested here, as well as Seamus's suggestion, are indeed clickable urls in the pdf output, but are formatted as regular text. Thus:               *** \murl{http}{www.google.com}     *** [[http://www.google.com][google.com]]     *** http://www.google.com     *** <http://google.com>      Outputs as: ![org output](http://gobblin.se/media/media_entries/660/shot-2012-08-09_10-35-36.jpg) Only the first one is visually differentiated from other text.


title: Is there something between singlespace and onehalfspace?

text: Perhaps there is a trivial solution for this, but I wonder if there is anything between singlespace and onehalfspace. The reason is that, when I use singlespace it seems to be very compact while onehalfspace puts more space between lines than I would like it to.


title: How to draw industry schematic diagram in LaTeX?

text: Is it possible to create the following diagram in LaTeX ? I am interested in the main body, any colour inside the box is fine. ![enter image description here](http://i.stack.imgur.com/n9FyZ.png)


title: Why doesn't font family change take effect when using AtBeginEnvironment{figure} together with memoir?

text: I'm trying to use `\AtBeginEnvironment{figure}` to customize the font family and font size used in figures. However, it doesn't seem to have any effect. Here is a minimal example:               \documentclass{memoir}     \usepackage{etoolbox}          \makeatletter     \AtBeginEnvironment{figure}{%       \def\@floatboxreset{\reset@font\sffamily\tiny\@setminipage}%       \patchcmd{\@xfloat}{\normalsize}{\selectfont}{}{}     }     \makeatother          \begin{document}          \begin{figure}       % \tiny % this works       test     \end{figure}          \end{document}      Any ideas on what's happening here? **EDIT:** Forgot to mention that I'm using `memoir`. The solution found in another question works for setting the font family, but not the size.


title: Display long form (first-use like) entries of non-acronym-type entries

text: I was searching for 2 hours straight now and I must say the package documentation is extensive but not very clear - frustrating. I'm looking for a way to manually display the first use form (long form) of non-acronym-type entries without resetting the counter. Can somebody help me? I've learned so far there are indeed commands for acronyms which do exactly that. But used on an entry in a different glossary (main or custom) produces no text. Edit: First, I like to thank mafp for his answer so far. I should maybe elaborate on my problem some more. I am currently writing on my Bachelor thesis. Since I introduced a good amount of formulas what i would like is to have a glossary for the symbols with a brief description of what they stand for. Additionally, I am thinking about inserting the same definition underneath each formula. One of my entries looks like the following:               \newglossaryentry{degvi}{type=symbols,     name=$\Delta E_{GP,i}$,     symbol={MJ},     sort=energie differenz grau verbrauch,     description={Differenz graue Energie und Verbrauch zu Produktion des betrachteten Systems}}      which produces an output like this: ![Visualizing the code](http://i.stack.imgur.com/YGBf4.png) Honestly, I would like to see the same output below the equation without typing everything twice. Maybe this isn't the best approach, but I like the idea of having the database of symbols with the automatic glossary creation for reference (e.g., if I'm trying to find an equation with a specific symbol).


title: Rule between environments (no spacing!)

text: I want to place a rule between two centered `tabular`s like the following example. But I am not able to control the correct spacing of 2mm in between the rule. Can somebody maybe explain :-) what should be added and why the several spacing commands should be added to obtain the result of 2mm vertical space between the rules?               \documentclass[12pt,a4paper,fleqn]{scrreprt}          \usepackage[ngerman]{babel}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[utf8]{inputenc}          \usepackage{fancyhdr}     \usepackage{chappg}     \usepackage{wrapfig}          \usepackage{xspace}     \usepackage{latexsym}     \usepackage{amsmath}     \usepackage{amssymb}          \usepackage{graphicx}     \usepackage{tabularx}     \usepackage{array}     \usepackage{colortbl}          \begin{document}         {\centering%         \begin{tabularx}{\textwidth}{ASBSCSM}%         \cellcolor[gray]{0.9}Name && \cellcolor[gray]{0.9}Vorname && \cellcolor[gray]{0.9}ETH-Nummer && \cellcolor[gray]{0.9}Studiengang \\[0.6cm]%         \end{tabularx}%         }        \vspace{2mm}%        \rule{\textwidth}{1pt}%        \vspace{2mm}%        {\centering%             \begin{tabularx}{\textwidth}{ASBSCSM}%             \cellcolor[gray]{0.9}Name && \cellcolor[gray]{0.9}Vorname && \cellcolor[gray]{0.9}ETH-Nummer && \cellcolor[gray]{0.9}Studiengang \\[0.6cm]%             \end{tabularx}%        }     \end{document}


title: Caption number increases by two for every inclusion

text: I am trying to typeset my captions in margin using `marginpar` and `captionof`. Here is what I get by the MWE. Note the wrong caption numbers. ![Wrong caption numbering](http://i.stack.imgur.com/NsE1T.png) The first caption is included using macro `\fixedmarginpar` and the second caption using `\marginpar`. The figure number gets incremented by 2 for every caption included using `\fixedmarginpar`. Please read vspace-in-marginpar-adds-unwanted-vertical-space for the `\fixedmarginpar` macro used in MWE. This macro sets the caption in a box, and offsets the vertical alignment depending on the height of the box. The caption number is incremented by two because this macro sets a box with caption for calculating the height (`\captionof` is called for the first time) and then sets it in the `marginpar` (`\captionof` is called again). Whats a good workaround?               \documentclass{scrreprt}     \usepackage{calc}     %http://tex.stackexchange.com/questions/78519/vspace-in-marginpar-adds-unwanted-vertical-space     \newcommand{\fixedmarginpar}[2][0pt]{%       \setbox0=\vtop{#2}\marginpar{\vspace{\dimexpr-\ht0+#1}#2}%     }     \begin{document}     \listoffigures          \fixedmarginpar{\captionof{figure}{A}}     \marginpar{\captionof{figure}{A}}     \end{document}


title: Problem retrieving text from pgf plot table

text: I'm trying to include and fetch text from a pgf plot table without succeeding. When using just numbers, everything goes smoothly:               \documentclass{standalone}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{tikz}          \pgfplotstableread[col sep=comma]{     1     }\mydata          \begin{document}     \begin{tikzpicture}     \pgfplotstablegetelem{0}{0}\of\mydata     \node[draw=black] at (0,0) {\pgfplotsretval};     \end{tikzpicture}          \end{document}      However, when exchanging the number for a letter or a text string, like so               \documentclass{standalone}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{tikz}          \pgfplotstableread[col sep=comma]{     a     }\mydata          \begin{document}     \begin{tikzpicture}     \pgfplotstablegetelem{0}{0}\of\mydata     \node[draw=black] at (0,0) {\pgfplotsretval};     \end{tikzpicture}          \end{document}      I get the following error message:               ! Package pgfplots Error: Sorry, could not retrieve column '0' from table '<inl     ine_table>'. Please check spelling (or introduce name aliases)..          See the pgfplots package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.12 \pgfplotstablegetelem{0}{0}\of\mydata      How can I include and fetch text from my pgf plot table? I've tried things like enclosing the text in `"` or `'` to no avail.


title: Fill an arrow head with TikZ

text: I would like to fill an arrow head with a color, but I have a problem with the `fill` command : ![enter image description here](http://i.stack.imgur.com/x9FV3.png) My code is :               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{arrows}          \begin{document}     \begin{tikzpicture}          \def \dx{10}     \def \dy{5}     \def \dz{5}          \draw  (0,\dy/4,\dz/2)--++(\dx/8,0,0)--++(0,1,0)[-open triangle 60 reversed];     \draw  (0,-\dy/4,\dz/2)--++(\dx/8,0,0)--++(0,1,0)[-open triangle 60 reversed, fill=blue];          \end{tikzpicture}     \end{document}      but it's not working ... Any clue ? **EDIT :** I have modified my code to use the new library `arrows.meta` but there is a problem with specific arrow heads like reversed triangle to fill it with a color : ![enter image description here](http://i.stack.imgur.com/003ZI.png) The code :               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{arrows.meta}     \usetikzlibrary{arrows}          \tikzset{         antenne/.style={             -{open triangle 60 reversed[fill=blue]}                     },         ronde/.style={             -{Circle[fill=blue]}                     },             }          \begin{document}     \begin{tikzpicture}         \draw[antenne] (0,0) -- (2,0) -- (2,2) ;         \draw[ronde] (5,0) -- (7,0) -- (7,2) ;     \end{tikzpicture}     \end{document}      **RE-EDIT :** I found the problem, to fill the arrow head I had to replace `open triangle 60 reversed[fill=blue]` by `triangle 60 reversed[fill=blue]`, the open prevents TikZ from filling the head with a color. ![enter image description here](http://i.stack.imgur.com/ASxS7.png)


title: loop above fill only the arrowhead

text: i have a very annoying problem i seem unable to solve. The actual idea is quite simple: I want a Node with a background color and a self loop that has an ending in the same color.               \begin{tikzpicture}          \node (Node) at (0,0)      [rectangle, draw, text width=10em, text centered, minimum height=4em, rounded corners=3mm, fill=blue!30] {Box};          \path[] (Node) edge [loop above,-*, fill=blue!30] (Node);          \end{tikzpicture}      However it always fills the path under the loop. thanks in advance


title: Is It Possible to Combine TikZ Distance and Line-To Operations?

text: Using LaTeX and TikZ, is it possible to use a Line-To operation in the same command as a distance operation? I would like to draw a rectangle and then create a named node at the midpoint of the upper edge of the rectangle. To do this I am using a Distance Operation to find the center of the Rectangle and then a Line-To Operation to find the upper edge. See below for the MWE code that I think should work, but is not working.               \documentclass[11pt]{article}     \usepackage{tikz}     \usetikzlibrary{calc}          \begin{document}          \begin{tikzpicture}     \node (A) at (0,0) {};     \node (B) at (10,10) {};     \node [above right] at (A) {A};     \node [below left] at (B) {B};     \draw [draw=black] (B) rectangle (A);     \node at ($(A)!0.5!(B)$ |- B) {Top of Rect [incorrect]};     \node (ABMid) [below] at ($(A)!0.5!(B)$) {Midpoint AB};     \node (rectTop) [above] at (ABMid|-B) {Top of Rect [correct]};     \end{tikzpicture}     \end{document}


title: Including XML file into LaTeX

text: I am using LaTeX for very first time and have very basic knowledge about it. I am using the template from here to write my thesis. I am using Ubuntu 12.04. When I try to include a small XML file in LaTeX with the following code, it shows the file just in one line (I am not able to see the full file in line though). But I want it to be displayed as a typical XML file (showing hierarchy).               \lstinputlisting[language=Xml]{Files/Myfile.xml}      Could someone please tell me how I can make LaTeX treat that file as an XML and show properly?


title: Natbib numbers order

text: I'm having some trouble with BibTeX. The code below makes references in author-year order, but for references with same author and year order is arbitrary. Any solution? Thanks :D               \documentclass{thesis}          \usepackage{indentfirst}     \usepackage{fancyhdr}     \usepackage{graphicx}     \raggedbottom     \usepackage[a4paper,top=4cm,bottom=4cm,left=3cm,right=3cm]{geometry}     \pagestyle{empty}          \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage{textcomp}     \usepackage[utf8]{inputenc}     \usepackage{microtype}     \usepackage{enumitem}          \bibliographystyle{siam}     \usepackage[numbers]{natbib}     \usepackage{chapterbib}          \frenchspacing     \usepackage{setspace}     \onehalfspacing                         \newcommand{\cit}[1]{``#1''}     \makeatletter     \renewcommand\@biblabel[1]{}     \makeatother               \begin{document}     \cleardoublepage      \nocite{*}     \renewcommand\bibsection{\subsection*{UNdocs}}     \bibliography{un}     \bibliographystyle{siam}               \end{document}          Entry examples:     @Proceedings{unmik2,     title = {On the Authority of the Interim Administration in Kosovo},     year = {1999},     address = {Pristina},     organization = {UNMIK [United Nations Interim Administration Mission in Kosovo]},     note = {U.N. Doc. UNMIK/REG/1999/1},     }          @Proceedings{unmik3,     title = {On the Appointment and Removal from Office of Judges and Prosecutors},     year = {1999},     address = {Pristina},     organization = {UNMIK [United Nations Interim Administration Mission in Kosovo]},     note = {U.N. Doc. UNMIK/REG/1999/7},     }      Here's two entry in the .bib file order. When I compile they appear in a random order while I'd like the imput order.


title: Custom chapter template

text: I am trying to define a custom chapter style like this one (`\documentclass{book}`): ![](http://i.stack.imgur.com/AgqQT.png) The closest I found is to use > \usepackage[Glenn]{fncychap} which produces: ![](http://i.stack.imgur.com/EyWDS.png) I have created the picture in an image editor, so ignore fonts.


title: Drawing plankton with TikZ

text: Can anyone suggest a method for drawing random plankton communities with TikZ? Similar to ![image](http://i.stack.imgur.com/YV1pg.jpg) I know it is possible to save the image and then load it into LaTeX but I was hoping there was a way of drawing these individually.


title: Is there any tool available to LaTeX to search for files with wildcards?

text: Say I want to find all of the packages of the form               tikzlibrary*.code.tex      Is there any way I can retrieve a list of all such files available in TeX's path in a portable way, hopefully one that doesn't require a special compilation sequence? My actual task has nothing to do with TikZ—so TikZ-specific answers will probably not work.


title: Draft compilation without changing code

text: I usually have my `documentclass` not in the body file but in a different one, so when I want to switch between draft and final modes I have to change the file I'm working on and look for that line. My question is: is there any way of configuring TexMaker (in my case) in order to have one compiling **command** to build the draft version and another one to produce the final one?


title: Enumitem: Restart/Reset counter of new list

text: I use the `enumitem` package to manipulate the appearance of my list. Because I want to keep the default `enumerate` list, I defined a new list `edulist` and configured it. The list should be used in an environment `edulistvar`, which gives the user the ability to change the `itemsep` with an optional argument. I want this list to resume until several points in my document are reached (see `\exercise` in the example below). Resetting the counter of the list I want to do with `\restartlist<list-name>}` which seems to exist exact for this reason: > # enumitem documentation > > Currently, with >   >   >     \setlist[enumerate]{resume} >   > > you can get a continuous numbering through a document.A new command has been > added for restarting the counter in the middle of the document: >   >   >     \restartlist{<list-name>} >   > > It is based solely in the list name, not the list type, which means > `enumerate*` as defined with the package option inline is not the same as > `enumerate`, because its name is different. Unfortunately, I don't get it work in the following MWE. # Code               \documentclass{scrartcl}          \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{enumitem}     \usepackage{xparse}          \DeclareDocumentEnvironment {edulistvar} { O{0pt} } {       \begin{edulist}[itemsep=#1]     }{       \end{edulist}     }          \DeclareDocumentCommand \exercise {  } {%       \bigskip       \textsf{\bfseries\Large Exercise}       \medskip       \par       \restartlist{edulist}     }               \newlist{edulist}{enumerate}{1}          \setlist[edulist]{%       label=\alph*),           format=\sffamily,       resume=edulist,       partopsep=0ex,       topsep=0.5\baselineskip,       parsep=\parskip,     }          \begin{document}          \exercise          Bli Bla Blub          \begin{edulist}       \item One       \item Two       \item Three     \end{edulist}          Bli Bla Blub          \begin{edulist}       \item One       \item Two       \item Three     \end{edulist}          \exercise          Bli Bla Blub          \begin{edulistvar}[\baselineskip]       \item One       \item Two       \item Three     \end{edulistvar}          \end{document}      # Document ![Wrong enumeration](http://i.stack.imgur.com/hXVBo.png) Any idea how to reset the counter of the list? Manually resetting it (`\setcounter{edulisti}{0}`) doesn't work, as well.


title: Caption of table is too small and does not align with other captions of tables

text: I am making a paper and for one table I have to use the `longtable` package, after struggling a lot I am almost done with this table. One problem left, the caption does/header of the table is too small and does not align with the other tables (these other tables are not made with `longtable` but with `tabular`). I used almost exactly the example on http://stackoverflow.com/questions/2896833/how-to-stretch-a-table-over- multiple-pages                 \documentclass[12pt]{article}            % input Marco        \setlength{\parindent}{30pt}       \usepackage{perpage} %the perpage package       \MakePerPage{footnote} %the perpage package command       \usepackage{rotating}       \usepackage{longtable}            % Standard list of included packages       \usepackage{setspace}           % Allows easy changes to line spacing        \usepackage{graphicx}           % Allows including of graphics files       \usepackage{amsmath}            % Additional math capabilities       \usepackage{tabularx}       \usepackage{longtable}       \usepackage{multirow}        \usepackage{array}       \usepackage{nth}       \usepackage{multicol}       \usepackage{versionPO}          % Include text conditionally       \usepackage{marginnote}         % Used with todonotes package       \usepackage{datetime}           % Allows formatting of date and time       \usepackage{enumitem}           % Change formatting of lists       \usepackage{subfigure}          % Create numbered and captioned subfigures       \usepackage{rotating}           % Create landscape tables and figures       \usepackage{hyperref}           % URLS and hyperlinks       \usepackage{float}              % Activate [H] option to place figure HERE            \usdate  % Use usual LaTeX date layout       % Packages included specifically for this document.       \usepackage{texintro}           % Document-specific definitions       \usepackage{tocvsec2}           % More flexible formatting of table of contents       \usepackage[longnamesfirst]{natbib} % Bibliography formatting       \usepackage{bibentry}           % Print full citation in text         \nobibliography*                                % Allow use of \bibentry         \usepackage[retainorgcmds]{IEEEtrantools}  % Equation formatting. Option needed         % to                                          % allow enumitem to work.                  % Notes options         \ifnotes{%         \usepackage[margin=1in,paperwidth=10in,right=2.5in]{geometry}%         \usepackage[textwidth=1.4in,shadow,colorinlistoftodos]{todonotes}%         }{%         \usepackage[margin=1in]{geometry}%         \usepackage[disable]{todonotes}%              \begin{document}         \begin{center}         \begin{longtable}{lccccc}         \caption{{\bf Cointegration}\newline In ....         \hline \multicolumn{1}{c}{\textbf{Intercept}} & \multicolumn{1}{c}{Max. rank} &                            multicolumn{1}{c}{Parameters}          & \multicolumn{1}{c}{Eigenvalue}         & \multicolumn{1}{c}{T-stat}         & \multicolumn{1}{c}{5\% Crit. value}         \\ \hline         \endfirsthead                 \multicolumn{3}{c}%         {{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\         \hline \multicolumn{1}{c}{\textbf{Slope}} & \multicolumn{1}{c}{Max. rank} &                \multicolumn{1}{c}{Parameters}           & \multicolumn{1}{c}{Eigenvalue}         & \multicolumn{1}{c}{T-stat}         & \multicolumn{1}{c}{5\% Crit. value}         \\ \hline         \endhead              \hline \multicolumn{3}{c}{{Continued on next page}} \\ \hline         \endfoot              \hline          \endlastfoot             % \(then my results)                  \end{longtable}         \end{center}         \vfill         \end{document}      First I thought may be I can exclude `\begin{center}` and `\end{center}` but unfortunately, it did not help. Thanks for your response. PS: I also made a screenshot of my problem!! Where on the first page is a good table made with tablurx and on the second page (after the pagebreak) there must be my longtable, but as you can see the caption is smaller than the caption of the first table. ![enter image description here](http://i.stack.imgur.com/XdxIL.png)


title: Automatically adding space in math superscripts

text: I am using mathspec, but the superscripts in math mode are a bit cramped. This is a well-known problem, so much so that the package defines a command to add space around characters (the double quote). However, it is labour-intensive and it breaks compatibility with Latex. The same goes for adding spaces manually (using, say, `\,`). Is it possible to increase the space between characters and their superscripts automatically, by, say, redefining some parameter in the preamble? Here's a MWE showing the problem and the two manual solutions:               \documentclass[12pt]{article}     \usepackage{mathspec}     \setmainfont                            {Arno Pro}     \setmathsfont   (Latin,Digits,Greek)    {Arno Pro}          \begin{document}          No space: $ V^1 $.          Double quote: $ {"V}^{"1} $.          Manual space: $ V^{\,1} $.          \end{document}      ![MWE](http://i.stack.imgur.com/QXdAe.png)


title: Wrong alignment of split equation in align environment

text: This is an example code of my problem:               \documentclass[a4paper]{article}     \usepackage{amsmath}     \begin{document}      \begin{align*}         x_n&=\begin{split}                &1+\frac{1}{2}+\left( \frac{1}{3}+\frac{1}{4} \right)+\left( \frac{1}{5}+\frac{1}                {6}+\frac{1}{7}+\frac{1}{8} \right)+\cdots+\left( \frac{1}{2^{k-1}+1}+\cdots+\frac{1}{2^k} \right)\\                &+\cdots+\left( \frac{1}{2^{2N-1}+1}+\cdots+\frac{1}{2^{2N}} \right)              \end{split}\\            &>1+2^0\frac{1}{2^1}+2^1\frac{1}{2^2}+2^2\frac{1}{2^3}+\cdots+2^{k-1}\frac{1}{2^k}+\cdots+2^{2N-1}\frac{1}{2^{2N}}      \end{align*}     \end{document}      It produces a giant blank gap between equality sign and split equations like the following: ![enter image description here](http://i.stack.imgur.com/1ykN6.png) I don't know what is wrong. Can anybody enlighten me?


I am having a problem when trying to compile my .tex document, where I get the following output:               TraditionalBuilder: Invoking latexmk... done.          No errors. Warnings:          ./ieeeconf.cls: LaTeX Warning: You have requested document class `ieeeconf', but the document class provides `cssconf'.          [Done!]      The document compiles nicely but I cannot quite understand why it raises this warning. In my preamble I have the standard IEEEtran stuff, straight out of their template that comes with their zip file.               %\documentclass[letterpaper, 10 pt, conference]{ieeeconf}  % Comment this line out                                                               % if you need a4paper     \documentclass[a4paper, 10pt, conference]{ieeeconf}      % Use this line for a4                                                               % paper          \IEEEoverridecommandlockouts                              % This command is only                                                               % needed if you want to                                                               % use the \thanks command     \overrideIEEEmargins       I have the following stuff placed in (I think) the right place on my Ubuntu machine:               XXXXXXXXXX:/usr/share/texmf/tex/latex/IEEE/IEEEtran$ ls     bare_adv.tex   bare_jrnl_compsoc.tex  bare_jrnl_transmag.tex  changelog.txt  IEEEtran.cls        README    tools     bare_conf.tex  bare_jrnl.tex          bibtex                  extras         IEEEtran_HOWTO.pdf  testflow      Equally I have the ieeeconf.cls file in the same place as the .tex file that I am trying to compile as well. Evidently I have mucked something up, any ideas?


title: Float right aligned text around a text snippet in first line of a paragraph

text: I have right-aligned paragraphs and want to float text around a little text snipped, which should be placed in the first line of the paragraph at the right side. ![enter image description here](http://i.stack.imgur.com/zRZjm.png) How can I achieve this? The LaTeX code with the text snipped at the end of the paragraph (thanks to David Carlisle http://tex.stackexchange.com/a/144263/40802):               \documentclass[c6paper,DIV=14,pagesize=auto,fontsize=8pt]{scrbook}     \newcommand\zz[2]{\par{\normalsize\strut\textbf{#1} #2} \hfill\ignorespaces}     \begin{document}     \begin{flushright}\tiny          \zz{I}{Some Name}Lorem ipsum dolor sit amet, consectetur adipiscing \textit{\textbf{some comment}}     \zz{II}{Another Name} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum elit \textit{\textbf{some comment}}     \zz{IIa}{Variant of Another Name}Lorem ipsum dolor sit amet, consectetur  adipiscing elit. \textit{\textbf{some comment}}     \end{flushright}     \end{document}


title: Macro inside TikZ node properties

text: I was looking for a way to use a conditional expression to define the node type in TikZ. Specifically, I wanted to do something based on the section number.                \def\checksectionshape#1{\ifthenelse{\value{section}=#1}{typea}{typeb}}      ...      \begin{tikzpicture}      \node[\checksectionshape{1}] at (0,0) {Test};      \end{tikzpicture}      From some of the similar questions and their, I guess this is because the `\ifthenelse` part is probably not expanded when the macro is called. But I couldn't manage to get one of those answers to work for my case. Is there a workaround?


title: How to define the badness of a river?

text: I've written an algorithm to try and detect rivers in paragraphs and it actually detects quite a lot when I run it. Some of them are clearly false positives, but there are others that are indeed aligned spaces on consecutive lines. Here are some, colored in green in the following picture: ![a collection of rivers](http://i.stack.imgur.com/toB1W.png) When are rivers really problematic and/or ugly? Are there rivers in this example that are worth fixing? What are the parameters (and their importance) to qualify the "badness" of a river, and how could they be calculated? As an additional question, there doesn't seem to be a standard definition of a river. Defining a river properly would surely help to define the parameters that make it bad. How would you define a river?


title: How to put a full-width table at the top or bottom of the same two-column page as the reference text?

text: I'm posting today because I would like to reduce white space in a document I'm writing. The content is two-columns but I have floating tables that span across both columns (`table*`). At some point, the text ends in the beginning of the first column of a new page. I would like to include my table on this page since it has a lot of free space below the text, but when I insert the `table*` right after the text, it goes to the top of the next page instead: ![](http://i.stack.imgur.com/B2rM5.png) Do you know a way of obtaining the desired behavior? Minimal working example :               \documentclass{article}     \usepackage{lipsum}          \begin{document}     \twocolumn          \paragraph{}     \lipsum[1]          \begin{table*}     \centering     \begin{tabular}{|c|c|c|c|}     \hline     Column 1 & Column 2 & Column 3 & Column 4 \\     \hline     Column 1 & Column 2 & Column 3 & Column 4 \\     \hline     \end{tabular}     \end{table*}%               \end{document}


title: Add an equation at the bottom of a KOMA-script article in twocolumn mode

text: how can I place a large equation at the bottom of a page when using the document class `scrartcl` with the `twocolumn` option enabled. I know about this solution using multicols, but I'd rather stick with twocolumn mode and _not_ use the `multicols` package because of problems with figure placements. Any help is much appreciated. Edit: to clarify, I do _not_ want to have the equation printed where it's defined, but rather on the bottom of the same page.


title: Background image for frame title

text: Using `beamer`, how can I insert a background image under the title of each frame? I could insert an image but the result was that the title disappeared because the image is over it. Any ideas?


title: cross symbol over a mathematical term

text: I am writing a presentation with beamer               \documentclass[a4paper]{beamer}     \usepackage{amsmath}     \begin{document}     \begin{frame}     \[\hat{H}=\sum(-\frac{\nabla_i^2}{2m})+\sum(-\frac{\nabla_i^2}{2M})+\dots\]     \end{frame}     \end{document}      Now, I want to show in my presentation that we can ignore the 2nd term `\sum(-\frac{\nabla_i^2}{2M})` possibly putting a cross over it. So, in the next frame, I will like to have               \[\hat{H}=\sum(-\frac{\nabla_i^2}{2m})+     \A_RED_CROSS_OVER_THIS_TERM{\sum(-\frac{\nabla_i^2}{2M})}+\dots\]      Is this possible? **EDIT**               \documentclass[a4paper]{beamer}     \usepackage{amsmath,color}     \definecolor{red}{RGB}{255,127,0}     \usepackage[makeroom]{cancel}     \renewcommand{\CancelColor}{red}     \begin{document}     \begin{frame}       \[\hat{H}=\sum(-\frac{\nabla_i^2}{2m})+\xcancel{\sum(-\frac{\nabla_i^2}{2M})}+\dots\]     \end{frame}     \end{document}      Tried this, and color has not changed.


title: Best practice for ggplot transparency in pdf figures

text: I lost a couple of hours because of few transparent figures which Adobe Professional couldn't flatten to print (it crashed in the process). I wonder if there's any trick to produce PDF figures with `ggplot` (I mean with the knitr option `dev='pdf'`) which include transparent objects and yet avoid issues during pre-printing. I don't know exactly why Acrobat Pro couldn't flatten them (yes, they are complicated) since it did it for other images. I have been trying these solutions (here and and here) but finally the only thing it worked was to convert the images to jpg before running LaTeX. And this is a pain because of course the text in the images is also converted. The image I can't print with Acrobat Pro because it fails flattening it is something like (I avoided embedding the code into a knitr chunk, then this is pure R code):               require(ggplot2)     set.seed(123)     data = data.frame(date=seq(as.Date("2001-01-01"), as.Date("2014-01-01"), "weeks"),                       value=rnorm(679))     mean0 = rnorm(1)     mean1 = rnorm(1)     mean2 = rnorm(1)     mean3 = rnorm(1)     mean4 = rnorm(1)          line1 = as.numeric(as.Date("2012-05-01"))     line2 = as.numeric(as.Date("2013-05-01"))     line3 = as.numeric(as.Date("2007-05-01"))          plot <- ggplot(data, aes(x=as.Date(date), y=value)) +        geom_line(size=.25, alpha=0.7) +       xlim(as.Date("2001-01-01"), as.Date("2014-01-01")) +       theme(legend.position="none") +       geom_segment(y=0.26, x=line3-30, yend=0.24, xend=line3,                    arrow=arrow(length=unit(2, "mm")), alpha=.2, colour="gray") +       geom_segment(y=0.20, x=line1-400, yend=0.165, xend=line1-20,                    arrow=arrow(length=unit(2, "mm")), alpha=.2, colour="gray") +       geom_segment(y=0.28, x=line2-200, yend=0.30, xend=line2-20,                    arrow=arrow(length=unit(2, "mm")), alpha=.2, colour="gray") +       geom_segment(y=0.1, x=as.numeric(as.Date("2004-01-01",origin="1970-01-01")), yend=0.02, xend=as.numeric(as.Date("2005-01-29",origin="1970-01-01")),                    arrow=arrow(length=unit(2, "mm")), alpha=.2, colour="gray") +       annotate("text", label="Text", y=0.1, x=as.Date("2004-01-01",origin="1970-01-01"), size=4) +       annotate("text", label="Text", y=0.265, x=as.Date(line3,origin="1970-01-01")-30, size=4) +       annotate("text", label="Text", y=0.20, x=as.Date(line1,origin="1970-01-01")-500, size=4) +       annotate("text", label="Text", y=0.275, x=as.Date(line2,origin="1970-01-01")-300, size=4) +       labs(y="Frequency",x=NULL) +       geom_segment(aes(y=mean0, x=as.Date("2001-01-01",origin="1970-01-01"), yend=mean0, xend=as.Date("2005-01-29",origin="1970-01-01"))) +       geom_segment(aes(y=mean1, x=as.Date("2005-01-29",origin="1970-01-01"), yend=mean1, xend=as.Date(line3,origin="1970-01-01"))) +       geom_segment(aes(y=mean2, x=as.Date(line3, origin="1970-01-01"), yend=mean2, xend=as.Date(line1, origin="1970-01-01"))) +       geom_segment(aes(y=mean3, x=as.Date(line1, origin="1970-01-01"), yend=mean3, xend=as.Date(line2, origin="1970-01-01"))) +       geom_segment(aes(y=mean4, x=as.Date(line2, origin="1970-01-01"), yend=mean4, xend=as.Date("2014-01-01", origin="1970-01-01")))          pdf("nonprintable_plot.pdf", width = 4, height = 4)     grid.arrange(plot, ncol=1)     dev.off()


title: LaTeX plus BibTeX but don't work in TeXworks

text: I have Googled a lot about how to make it work. This is what I have now: I have `IEEEtran.bst, mybibfile.bib` and `test.tex` all located in the same folder. This is `test.tex`:               \documentclass{article}     \usepackage{cite}     \begin{document}          \cite{sample1234}Hello world.          \bibliographystyle{IEEEtran.bst}     \bibliography{mybibfile.bib}               \end{document}      This is `mybibfile.bib`:               @book{sample1234,       title={Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables},       author={Abramowitz, M. and Stegun, I. A.},       edition = {9th edition},       year={1964},       publisher={Dover}     }      And I press the "Typeset" green arrow button on the TeXworks editor in the following sequence: `tex`, `bib`, `tex`, `tex` After this, the generated "paper" looks like:               [?]Hello world.      Now there are these files in the same folder:               IEEEtran.bst     mybibfile.bib      `mybibfile.log` --> This file is empty               test.aux      `test.log` --> This file is not empty               test.pdf     test.synctex.gz     test.tex      My TeXworks version is 0.4.4, and the MiKTeX version is 2.9. I spent a whole night on it. EDIT: something suspicious in `test.log`:               (C:\TUT\BSHE\LATEXBIB\test.aux)     LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.               LaTeX Warning: Citation `sample1234' on page 1 undefined on input line 5.          No file test.bbl.     [1          {C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}]     (C:\myfolder\test.aux)          LaTeX Warning: There were undefined references.           )


title: Help with drawing Process Flow Diagram

text: > **Possible Duplicate:**   >  How to get started with drawing this flow chart in TikZ? I was wondering if I can get any hit/help drawing a process flow diagram such as the one in the attachment. Thank you for all the help/hint/or link to the similar examples.![Sample Process flow diagram](http://i.stack.imgur.com/bTESy.png)


title: Showing weights on Tikz graph using "draw edge" commands

text: I would like to show some numbers as weights of the edges of my Tikz graph. My graph without weights is the following:               \begin{figure}[!ht]     \begin{tikzpicture}[shorten >=1pt, auto, node distance=3cm, ultra thick]         \tikzstyle{node_style} = [circle,draw=blue,fill=blue!20!,font=\sffamily\Large\bfseries]         \tikzstyle{edge_style} = [draw=black, line width=2, ultra thick]         \node[node_style] (v1) at (-2,2) {2};         \node[node_style] (v2) at (2,2) {3};         \node[node_style] (v3) at (4,0) {6};         \node[node_style] (v4) at (2,-2) {4};         \node[node_style] (v5) at (-2,-2) {5};         \node[node_style] (v6) at (-4,0) {1};         \draw[edge_style]  (v1) edge (v2);         \draw[edge_style]  (v2) edge (v3);         \draw[edge_style]  (v3) edge (v4);         \draw[edge_style]  (v4) edge (v5);         \draw[edge_style]  (v5) edge (v6);         \draw[edge_style]  (v6) edge (v1);         \draw[edge_style]  (v5) edge (v1);         \draw[edge_style]  (v5) edge (v2);         \draw[edge_style]  (v4) edge (v2);         \end{tikzpicture}     \end{figure}      I have tried looking for something on the web, but I have not found anything to show weights using the `\draw` edge command, which is the command I am using in my graph. Could you suggest me how to solve my problem?


title: Vertical spaces above and below longtabu

text: This is, in a way, a follow-up-question to New table-environment, spaces and enclosing { } in a new environment, which has already been answered conveniently by @egreg. * * * Please compile this MWE to see and follow the problem:               \documentclass[a4paper, 11pt]{scrbook}     \usepackage{blindtext}     \usepackage[cm]{fullpage}          \usepackage{tabu, longtable, booktabs}     \usepackage{caption}          \newenvironment{texttab}[1]%             {\setlength{\topsep}{\baselineskip}%                 \begin{center} \tabulinesep=0.6ex%                 \begin{tabu} to 0.9\textwidth {#1} \toprule \rowfont{\bfseries}}                 {\end{tabu}%             \end{center}}          \newenvironment{tabspaces}[1]%         {\setlength{\topsep}{\baselineskip}%             \begin{center} \tabulinesep=0.6ex%                 \begin{longtabu} to 0.9\textwidth {#1} \toprule \rowfont{\bfseries}}                 {\end{longtabu}%             \end{center}}          \newenvironment{texttab*}[1]%         {\setlength{\topsep}{\baselineskip}%         \LTpre=0pt%         \LTpost=0pt%             \begin{center} \tabulinesep=0.6ex%                 \begin{longtabu} to 0.9\textwidth {#1} \toprule \rowfont{\bfseries}}                 {\end{longtabu}%             \end{center}}          \begin{document}     \section{TEST}     \blindtext     %     \begin{texttab}{X[l,2] X[l,2] X[l,3]}     Test1   &   Test2   &   Test3 works fine  \\ \midrule     Test1   &   Test2   &   Test3 works fine  \\     Test1   &   Test2   &   Test3 works fine  \\ \bottomrule     \end{texttab}%     %     \blindtext     %     \begin{tabspaces}{X[l,2] X[l,2] X[l,3]}     Test1   &   Test2   &   Test3   \\ \midrule     Test1   &   Test2   &   Test3   \\     Test1   &   Test2   &   Test3   \\ \bottomrule     \end{tabspaces}%     %     \blindtext     %     \begin{texttab*}{X[l,2] X[l,2] X[l,3]}     Test1   &   Test2   &   Test3   \\ \midrule     Test1   &   Test2   &   Test3   \\     Test1   &   Test2   &   Test3   \\ \bottomrule     \end{texttab*}%     %     \blindtext     \end{document}      * * * I created three new environments: `texttab`, `tabspaces` and `texttab*`. They implement `tabu`s (not to be embedded in floating bodies) in the text. As a result of the question mentioned before I made two environments for either normal `tabu`s (`texttab`) or `longtabu`s (`texttab*`). `tabspaces` is just for demonstration-use. Now, if you take a look at the `tabspaces`-environment (second table in the example), you see it produces **way too much vertical space above and below** the environment. I tried to use the commands `\LTpre=0pt` and `\LTpost=0pt`(provided by the `longtable`-package) in the `texttab*`-environment - you see, there's still way too much space below! **Where does it come from and how do I get rid of it?** _Note:_ `\tabulinesep=0.6ex` seems to affect those spaces! Nevertheless, removing it doesn't change the fact that the vertical spaces still differ from the ones in my (satisfying) `texttab`-environment.


title: Conditional \endinput

text: I want to prevent processing rest part of a package in case if it is loaded not from lualatex. For some reason I cannot load ifluatex package, so I borrowed definition of `\ifluatex` from that package and invented the following chunk of code:               \expandafter\ifx\csname luatexversion\endcsname\relax % = not \inluatex       %\typeout{^^J********************** not LuaTeX^^J}       \PackageError{babel}{         ^^J\space\space * Option russianu is intended for LuaTeX only.                  ^^J\space\space * Option russian  is used instead.                         }       \relax       \input{russianb.ldf}         \let\@next@action\endinput     \else       %\typein{^^J********************** LuaTeX^^J}       \let\@next@action\relax     \fi     \@next@action      It seemed to work but **Is there a better solution**. In particular, it is desirable to avoid introduction of `\@next@action` because it is used the only time. Just to explain: my goal is to hack babel with option russian to make it working painlessly with LuaLaTeX without any additional hacks (as described, eg, in \tableofcontents encoding issue with lualatex and LuaTeX cyrillic hyphenation problems)


title: Equation-reference with cleveref

text: I am using cleveref, which seems to be working fine, except for my equation references, which are referenced as ??. My equation is:               \begin{equation}\label{ex2eqn}     Y_{t} = \epsilon_t + 1.8Y_{t-1} + 0.8Y_{t-2} + 0.2Y_{t-6} - 0.36Y_{t-7} + 0.16Y_{t-8}     \end{equation}      and my reference is               This transformation is done by inserting $Y_{t-1}$ into \Cref{ex2eqn}, then $Y_{t-2}$ and so on.      A minimal working example is:               \documentclass[11pt]{article}     \usepackage{amsmath}     \usepackage[thmmarks]{ntheorem}     \usepackage{cleveref}     \begin{document}     \begin{equation}\label{ex2eqn}     e=mc^2     \end{equation}     A reference: \Cref{ex2eqn}.     \end{document}


title: Removing extra space after itemize environment in longtable in memoir

text: I have a macro that creates itemize environment in it. The issue is that I have extra space after the itemize environment when used in longtable. How to remove the space?               \documentclass{memoir}     \usepackage{enumitem}     \usepackage{longtable}     \usepackage{booktabs}          \newcommand{\fuda}[2]{%     Functions:%     \begin{itemize}[nosep]     #1%     \end{itemize}     Data:%     \begin{itemize}[nosep]     #2%     \end{itemize}     }     \begin{document}     \begin{longtable}{p{0.3\textwidth}|p{0.7\textwidth}}     \caption[List of components]{List of functions and data allocated to each component} \label{d_plan} \\     \toprule     \textbf{Components} & \textbf{Functions and Data} \\\midrule     \textbf{Registration} & \fuda{     \item Register capabilities of the device     \item Unregister capabilities of the device     \item Register context representation      }{     \item  Interface List      \item Capability List     \item  Protocol List     \item Representation List}     \\\bottomrule     \end{longtable}     \end{document}      ![enter image description here](http://i.stack.imgur.com/7ed9m.png) ## ADDED The solution that uses `-\baselineskip:` works with article class, but not with memoir class.


title: Vertical alignment of image an text within tabular environment placed in header using fancyhdr package

text: The adjustbox package provides a way to vertically align image and a paragraph of text within the tabular environment; I have included an example which shows this: mwea.tex               \documentclass{article}     \usepackage{lipsum}     \usepackage{booktabs}     \usepackage[demo]{graphicx}     \usepackage[active,tightpage]{preview}     \usepackage[export]{adjustbox}     \PreviewEnvironment{tabular}     \setlength\PreviewBorder{5pt}     \newlength{\parboxwidth}     \setlength{\parboxwidth}{8.0cm}     \begin{document}     \begin{tabular}[t]{rl}     \midrule         \adjustbox{valign=t}{\includegraphics[height=2.0cm, keepaspectratio=true]    {image.png}} & %         \adjustbox{valign=t}{%         \parbox[t]{\parboxwidth}{%         \lipsum[1]}     } \\     \midrule     \end{tabular}     \end{document}      Which gives the following output: ![ouput from mwe a](http://i.stack.imgur.com/RoFIQ.png) Ultimately, I'd like to place a feature very similar to the above as a header using the fancyhdr package. I have included my attempt at this below, however, as the output will attest, I cannot seem to align both the image and the text such that their tops meet the top of the header area. They are aligned to the same vertical position, however, this position is not at the top of the header. mweab.tex               \documentclass{article}     \usepackage{lipsum}     \usepackage{booktabs}     \usepackage[demo]{graphicx}     \usepackage[export]{adjustbox}     \usepackage{fancyhdr}     \usepackage[showframe,textwidth=245.0pt,%     top=2in,     headheight=1.0in,     headsep=0.20in]{geometry}     \newlength{\parboxwidth}     \setlength{\parboxwidth}{8.0cm}     \begin{document}     \fancypagestyle{plain}{%     \fancyhead[R]{%         \begin{tabular}{rl}         \adjustbox{valign=t}{\includegraphics[height=1.0cm, keepaspectratio=true]    {image.png}} & %         \adjustbox{valign=t}{%         \parbox[t]{\parboxwidth}{%         content content content content content content content content content content     content content content content content content content content content content content     content content content content content content content}     }     \end{tabular}     }%     \renewcommand{\headrule}{}%     }%     \makeatletter     \let\ps@firstpage\ps@plain%     \makeatother     \thispagestyle{plain}     \section*{Body}     \lipsum[1]     \end{document}      This gives the ouput: ![output from mwe b](http://i.stack.imgur.com/r1KgU.png) Any comments or suggestions are most appreciated. Supplementary material: ![supplementary material](http://i.stack.imgur.com/DRE4Q.png) ![second attempt supplementary material](http://i.stack.imgur.com/gsYvR.png)


title: Resume option similar to enumitem package for paralist package

text: I would like to know if it is possible to generate a `resume` option similar to that in the `enumitem` package for the paralist package. Note that it is not possible to add something like `[resume]` or `[start]` to the environments defined in the `paralist` package. See MWE below:               \documentclass{article}          \setlength{\parindent}{0mm}          \usepackage{paralist}     \usepackage{tabto}     \usepackage{multicol}     \usepackage{amssymb,amsmath}          \newenvironment{tabbedenum}[1]      {\NumTabs{#1}\inparaenum\let\latexitem\item       \def\item{\def\item{\tab\latexitem}\latexitem}}      {\endinparaenum}          \begin{document}     \begin{multicols}{2}     Some long text to be used for sampling.     \begin{tabbedenum}{2}     \item text     \item text     \item text     \item text     \item text     \item text     \end{tabbedenum}\\[1cm]     Some long text to be used for sampling.     \begin{tabbedenum}{1}         \item Some long text to be used for sampling.     \end{tabbedenum}\\[1cm]     Some long text to be used for sampling.     \begin{tabbedenum}{3}     \item text      \item text     \item text     \item text     \item text     \item text      \end{tabbedenum}     \bigskip     Some long text to be used for sampling.     \NumTabs{3}     \begin{inparaenum}     \item text     \tab\item text     \tab\item text     \tab\item text     \tab\item text     \tab\item text        \end{inparaenum}     \end{multicols}     \end{document}      ![enter image description here](http://i.stack.imgur.com/L1vzH.png)


title: How to left-align text

text: How to left-align text into the second `column`?               \documentclass{beamer}          \begin{document}          \begin{frame}     \begin{columns}     \column{4.7cm}     \hspace{0.6cm}     \includegraphics[width=2.3cm,height=1.7cm]{images/t}     \column{\dimexpr\textwidth-4.7cm\relax}     \hspace*{-20pt}\parbox{\dimexpr\linewidth+20pt\relax}{%     \begin{itemize}     \item C.     \begin{itemize}     \item B.     \item A.     \end{itemize}     \end{itemize}     }     \end{columns}     \end{center}     \end{frame}          \end{document}      I've tried to surround the content of the second column using this `\begin{flushleft}...\end{flushleft}`. But nothing has changed. Thanks!


title: Page break after every section

text: The skeleton of my document is:               \documentclass[11pt]{article}     \usepackage{amsmath,textcomp,amssymb,geometry,graphicx}          \begin{document}     \maketitle          \section*{1.}          \begin{itemize}     \item[(a)]     \item[(b)]     \end{itemize}          \section*{2.}          \begin{itemize}     \item[(a)]     \item[(b)]     \end{itemize}          \section*{3.}          \begin{itemize}     \item[(a)]     \item[(b)]     \end{itemize}          \end{document}      I want each section to be on a separate page. How do I do that?


title: Catcodes of unicode characters with \usepackage[utf8]{inputenc}

text: I don't understand why this is generating an error message...               \documentclass{article}     \usepackage[utf8]{inputenc}          \begin{document}     \catcode`ẟ=\active     \end{document}      As the `inputenc` suggests, I'm using `pdflatex`.* Shouldn't the `inputenc` import cause ẟ to behave like any other letter? *I need features `xelatex` doesn't support.


title: How to specify font size less than 10pt (or more than 12pt)?

text: I'm trying to make a document that has a very small font throughout, I tried this:               \documentclass[0.5mm, a4paper]{article}     \documentclass[7pt, a4paper]{article}      But it doesn't seem that they allow me to go anything below 10pt. This hack make it work, but not for the section headers:               \fontsize{4mm}{5mm}\selectfont      Does anyone know any better ways to do this?


title: Making default font size 16pt

text: I want to write a document which has the default font size as 16pt. But I believe `\documentclass[a4paper,16pt]{report}` will not do it. What will be the correct way to make the default font size as 16 pt


title: How to change default font size with XeLaTeX compiler and style file

text: > **Possible Duplicate:**   >  Making default font size 16pt I need to change font size to 14 points with XeLaTeX. I used:               \documentclass[a4paper, 14pt]{report}      But the result is still `10pt`. I checked `.sty` file, nothing there is specified. Can someone help me on it?


title: How can I set a document font size to 14, 16 or 18 pt?

text: I usually start with               \documentclass[12pt,a4paper,landscape]{article}      but, How can I set a document font size to 14, 16 or 18 pt ? I had used `{\fontsize{16}{1} all document }` and have no desired results.


title: How to use Koma-script only to change font size?

text: I've been using `\documentclass{article}`, but would like to set a default font outside the range of that document class. The recommended solution I found on tex.exchange was to use KOMA-script, but this has changed the default font and somehow made my document longer. **Is it possible to change the document font size** (using KOMA-script or otherwise) **in such a way that does not require additional tweaks?** If not, how can I at least make the font in KOMA-script `scrartcl` match the default in `article`? **EDIT** In my defence, the linked answers are somewhat lacking:   1. First solution suggests `\usepackage{scrextend}` but the example\commands\syntax are not commented or explained, nor is any reference linked. While providing a starting point, this would require one to find appropriate documentation for this package that addresses this particular use (= v. difficult for novice).    2. Second solution suggests `extsizes` followed by a quote from the documentation (again without linking to it so that one could read further for clarification) _discouraging_ its use for ambiguous reasons (nb this is at least the second place `extsizes` was discouraged w/o explanation, even though it was the solution I was personally looking for (as far as I know!)). Related to the lack of linked reference, no examples are provided, which leaves a novice to continue searching w/o knowing what exactly they are looking for.    3. Third solution suggests changing the document class (`scrreport`), which does not address the question posted here.   4. ibid. (change to memoir) It seems to me, from my limited vantage point, that there are likely many tangential, more advanced, issues related to this problem; a problem very likely to present itself to novice users ill-equipped to understand, sort or evaluate the various solutions as they are stated. To clarify: **I believe the primary audience for this question is relatively novice users; whereas the proposed solutions, IMHO, are not well suited to that audience**. This problem seems like a great stepping stone for users to advance their knowledge, I'd suggest a well-documented Q&A that facilitates that process (& would be happy to take this on, if anyone can point me to the appropriate resources).


title: How to change font size in the entire document?

text: How should I change font size for the entire document? I want to design a presentation and fonts should be larger, all of them.


title: Need smaller than \tiny

text: I use the following to reduce the size               {\tiny     $$     \begin{array}{|c||c|c|c|c|c|c|c|c|c|c|c|c|}      but it is still too large. How can I further reduce the size?


title: Unused Global Option (Point Size)

text: I've been trying to configure the margins on my file for 6x9 paper size, but ended up using the layout for a5 paper. For some reason I have not been able to set the point size since I have made those changes. I get an Unused Global Option error. Is there something I am missing or not seeing? As far as I can see, I simplified the codes by using a5 paper.               \documentclass[16pt]{book}%Compile with xelatex     \usepackage{polyglossia}     \usepackage[a5paper]{geometry}     \setdefaultlanguage{hebrew}     \newfontfamily\hebrewfont{Times New Roman}     \newlength\iiindent \setlength\iiindent{20pt}      \newcommand\secindent{\parshape 3 0pt \linewidth 0pt\dimexpr\linewidth-\iiindent\relax 0pt \linewidth }      \setlength\parindent{0pt}     \begin{document}     \leftskip=0cm plus 0.5fil \rightskip=0cm plus -0.5fil     \parfillskip=0cm plus -1fil     \sloppy     \everypar{\secindent}     הקדמת הרב המחבר          אמר המחבר החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו אלא להזכירם את  הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי אלא  דברים  שרוב  בני  האדם  יודעים אותם ולא מסתפקים בהם כלל. אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל. כך ההעלם מהם מצוי מאד וההשכחה רבה. ע"כ אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת. כי כבר אפשר שלא ימצא הקורא בשכלו חידושים אחר קריאתו שלא היו בו לפני קריאתו אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע. וישים אל לבו חובתו אשר הוא מתעלם ממנה. ותראה אם תתבונן בהוה ברוב העולם כי רוב אנשי השכל המהיר והפקחים החריפים ישימו רוב התבוננם והסתכלותם בדקות החכמות ועומק העיונים איש איש כפי נטיית שכלו וחשקו הטבעי. כי יש שיטרחו מאד במחקר הבריאה והטבע. ואחרים יתנו כל עיונם לתכונה ולהנדסה. ואחרים למלאכות. ואחרים יכנסו יותר אל הקדש דהיינו למוד התורה הקדושה. מהם בפלפולי ההלכות. מהם במדרשים. מהם בפסקי הדינים. אך מעטים יהיו מן המין הזה אשר יקבעו עיון ולמוד על עניני שלמות העבודה.          \end document      This is part of the output from the console:               LaTeX Warning: Unused global option(s):         [16pt].               ("C:\Documents and Settings\Compaq_Owner.HOME\My Documents\Documents\mesilat\me     silat.aux") ("C:\Program Files\MiKTeX 2.9\tex\latex\tipa\t3cmr.fd")     *geometry* detected driver: pdftex     [1]     Underfull \vbox (badness 10000) has occurred while \output is active [2]     Underfull \vbox (badness 10000) has occurred while \output is active [3]     [4]     Underfull \vbox (badness 10000) has occurred while \output is active [5]     [6] [7] etc. etc. etc.


title: How to change the font size of a document?

text: > **Possible Duplicates:**   >  How to change font size in the entire document?   >  How to specify font size less than 10pt in LaTeX Sometimes when I want to review a draft I need larger fonts. Is there a package or a command that I can use to increase the font of the entire document?


title: Changing font option in Latex document doesn't seem to change the font size

text: > **Possible Duplicate:**   >  How to specify font size less than 10pt I use Texmaker for most of my LaTeX-ing but I'm running into some trouble trying to change the default font for the whole document. From what I've read, changing the `??pt` in               \documentclass[12pt]{article}      Should do the trick but it doesn't seem to work for my document. Anything else I could try?


title: How can I have smaller font than \tiny?

text: I'm using tikz for drawing, and the label are to big, I'm using the `font=\tiny` parameter, but it's still to big. How can I reduce more the font size?               \draw [<->,line width=0.02cm] ($(first_joint.center) + (0.75, 0)$) node (yaxis) [above, font=\tiny] {$y_{_1}$}                     -| ($(first_joint.center) + (0, -0.75)$) node (xaxis) [left, font=\tiny] {$x_{_1}$};


title: How to set a default font to a page in latex?

text: > **Possible Duplicate:**   >  How to specify font size less than 10pt How to set those fonts to my page in latex: font is Computer Modern sans serif with normal size 8 pt?


title: Default font size to 13pt?

text: > **Possible Duplicate:**   >  Making default font size 16pt I have this header:               \documentclass[12pt,italian,a4paper,oneside,openright]{book}      When ever i try 13pt or greater i only get smaller font in my paper. Is there any way to get 13pt font size? My definition is:               \documentclass[12pt,italian,a4paper,oneside,openright]{book}     \usepackage{url,amsfonts,epsfig}     \usepackage[italian]{babel}     \usepackage{vmargin}     \usepackage{mathtools}     \usepackage{indentfirst}     \usepackage{graphicx}     \usepackage{caption}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}


title: Specifying font sizes

text: I am trying to change the font size of my document to 8pt. However I can not get it to take effect. I am trying it in the `\documentclass` declaration. Should it be specified elsewhere? I am using XeTeX and `fontspec`, if that is relevant.


title: Change font size through \documentclass

text: \documentclass[12pt]{article}     \begin{document}          Inductive step-\\     Assume the statement holds for $n \in \left\{ 1, 2, ... n\right\}$          \end{document}      Changing the 12pt in documentclass to something bigger doesn't change the size. Any idea what's wrong? ![Output pdf](http://i.stack.imgur.com/qDy8H.png) Am I the only one who thinks that the default font size is too small and the margins are too big?


title: Setting default font size to 13pt

text: > **Possible Duplicate:**   >  How to specify font size less than 10pt (or more than 12pt)? Many questions in this matter has been posted and most of the answers are related to either using `KOMA-script` class or using XeTeX, or using the `\documentclass{extreport}` which doesn't have a 13pt. So if a report class with default font size of 13pt is required, what should I do?


title: How to overlay a call-out box on text?

text: ![Image ](http://i.stack.imgur.com/WiTdn.png) I wish to achieve following. There may be many variant of this.


title: HTML to Latex: Converting CSS styles to respetive LaTeX functions

text:
I am using HTML to LaTeX programme to convert large quantity of HTML files. A typical example:                    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />     <title>Title</title>
Chapter One

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

     "I pass'd without the city gate,
     I linger'd by the way;
     The palm was bending to her mate,
     And thus I heard her say,

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
                     The conversion process is controlled by `config.xml` (view here) For `<elements>` conversions, it works brilliantly, i.e. `<h1>` `<blockqoute>` etc. However, as the above sample show, I would like to convert the Poem into LaTeX's `Verse`. In the Property I set up this following:                   <property name='margin'>       <value name='1em 0em 1em 0em' start='\begin{verse}' end='\end{verse}' />     </property>      The output doesn't have the verse tag at all but this:               \\I linger'd by the way;     \\The palm was bending to her mate,     \\And thus I heard her say,     \\      I play around of DIV tag a bit, still no luck. any suggestions?


title: special axis distribution

text: The bar chart below is what I have at the moment. As you see there is a huge difference between the y-values. I could use a logarithmic x-axis, but this is not readable for non-scientists. I want to make the x-area between 0 and 500 twice as big and the rest shrinks accordingly. How do I change the distribution on an axis? I hope you understand what I mean, it is difficult for me to explain it. ![plot](http://i.stack.imgur.com/fTa0b.png) edit: I tried to apply the answer of this question https://tex.stackexchange.com/questions/46422/axis-break-in-pgfplots but unfortunatelly i wasn't able to do it with bar charts.               \documentclass[]{article}          \usepackage{pgfplots}     \usepackage{pgfplotstable}          \begin{document}          \title{Title}     \author{Author}     \date{Today}     \maketitle          \pgfplotsset{width=15cm, compat=4}          \begin{tikzpicture}         \begin{axis}[xbar stacked, nodes near coords,                     xbar=30pt,                     bar width=5,                     xmajorgrids = true,                     yticklabel style={/pgf/number format/1000 sep=,font=\tiny},                       ytick=data,                     bar width= .2cm,                         nodes near coords align = {horizontal},                             nodes near coords,                             nodes near coords align=right,                             every node near coord/.style={color=black,font=\tiny}                   ]                  \addplot[draw=green,fill=green!50,enlargelimits=0.25]                 coordinates{                       (3133,1)  (731,2)  (1196,3)  (273,4)  (83,5)  (312,6)  (40,7)  (36,8)  (76,9)  (15,10)  (8,11)  (38,12)  (9,13)  (7,14)  (20,15)  (3,16)  (2,17)  (13,18)                       (2,19)  (4,20)  (3,21)  (2,22)  (2,23)  (2,24)  (1,26)  (1,27)  (1,28)  (1,30)  (2,31)  (2,33)  (1,35)  (1,36)                  };         \end{axis}     \end{tikzpicture}          \end{document}


title: Making the bibliography appear in the table of contents

text: I need to make my (BibTeX) references section appear in the table of contents of my LaTeX document (documentclass: article), with section numbering too. My approach until now has been making a new section and including the bibliography (`references.bib`) at that point:               \section{References}     \bibliography{references}      However, the final document shows both the section title that I have written and the section title that BibTeX writes, which is quite redundant and I definitely dislike. How can I either remove BibTeX's section title, or make the BibTeX bibliography appear in the table of contents without making a new section? If I were to make the BibTeX bibliography appear in the table of contents without making a new section, how could I assure that the section title that BibTeX writes looks exactly like sections typeset with `\section`?


title: How can I add the bibliography as a numbered entry in the table of contents?

text: My table of contents currently looks as follows: > 1 Introduction   >  2 Related Work   >  3 xyz   >  …   >  …   >  …   >  8 conclusions   >  References However, I would like "References" to be numbered (9). How can I do that?


title: Appendices and Bibliography in Table of Contents

text: My document class is report. I am using chapters and sections within those chapters. I have used the `\begin{thebibliography}` to create my bibliography, can someone tell me how I can add this to the table of contents? Also I will be adding an appendex, can someone tell me how to create an appendix so that it shows in the table of contents?


title: Compile with TikZ external library

text: As explained in the `pgf` manual under 32.4 and in various other questions/comments here on TeX.sX (http://tex.stackexchange.com/a/44508/9077, http://tex.stackexchange.com/a/32363/9077, http://tex.stackexchange.com/a/23565/9077), it's possible to export a TikZ picture as a pdf with document like this:               \documentclass{article}     % main document, called main.tex     \usepackage{tikz}     \usetikzlibrary{external}     \tikzexternalize % activate!     \begin{document}     \begin{tikzpicture}     \node {root}     child {node {left}}     child {node {right}     child {node {child}}     child {node {child}}     };     \end{tikzpicture}     \end{document}      The problem, however, is that neither the manual nor these answers provide any detailed explanation for how to compile this document. I'm using texlive in Windows 7 with TeXworks, so please do not suggest command line compilation procedures. I need to compile with XeLaTeX since I'm using `fontspec`. My XeLaTeX compilations look like the following: ![enter image description here](http://i.stack.imgur.com/82lG3.png) ![enter image description here](http://i.stack.imgur.com/RQXYG.png) What do I need to change to be able to use the external TikZ library?


title: Entering the title in the footer

text: How do I insert the title in the footer? And decide if it is set or not?               %preteste.sty     \usepackage{fancyhdr}     \usepackage{lipsum}          \renewcommand{\title}[1]{\gdef\@title{#1}\gdef\mytitle{#1}}     \newcommand{\mytitle}{%        \PackageErrorNoLine{pkgname}          {No \protect\title\space given}          {You have to provide a title}%        \gdef\mytitle{You have to provide a title}%        \mytitle     }     \fancyfoot{}     \fancyfoot[C]{\mytitle}      See the error if no define `\title` and no use `\maketitle`               %titulo.tex     \documentclass[a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage{preteste}          % \title{Title}     % \author{R\'egis S. Santos}     % \date{\the\year}          \begin{document}     \pagestyle{fancy}     % \maketitle          \lipsum     \end{document}      fix my code, please.


title: Insert a TeX file created with knitr into a main TeX file

text: I want to insert a knitr output file (created in RStudio as `.rnw` file, then I compiled, it creates the `.tex` file) into my main `.tex` file. But I got an error, how we can do this? Knitter Tex file:               \documentclass{article}\usepackage[]{graphicx}\usepackage[]{color}     %% maxwidth is the original width if it is less than linewidth     %% otherwise use linewidth (to make sure the graphics do not exceed the margin)     \makeatletter     \def\maxwidth{ %       \ifdim\Gin@nat@width>\linewidth         \linewidth       \else         \Gin@nat@width       \fi     }     \makeatother          \definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345}     \newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}%     \newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}%     \newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}%     \newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}%     \newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}%     \newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}%     \newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}%     \newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}%     \newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}%          \usepackage{framed}     \makeatletter     \newenvironment{kframe}{%      \def\at@end@of@kframe{}%      \ifinner\ifhmode%       \def\at@end@of@kframe{\end{minipage}}%       \begin{minipage}{\columnwidth}%      \fi\fi%      \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep      \colorbox{shadecolor}{##1}\hskip-\fboxsep          % There is no \\@totalrightmargin, so:          \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%      \MakeFramed {\advance\hsize-\width        \@totalleftmargin\z@ \linewidth\hsize        \@setminipage}}%      {\par\unskip\endMakeFramed%      \at@end@of@kframe}     \makeatother          \definecolor{shadecolor}{rgb}{.97, .97, .97}     \definecolor{messagecolor}{rgb}{0, 0, 0}     \definecolor{warningcolor}{rgb}{1, 0, 1}     \definecolor{errorcolor}{rgb}{1, 0, 0}     \newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX          \usepackage{alltt}     \IfFileExists{upquote.sty}{\usepackage{upquote}}{}          \begin{document}          The log returns are calculated from the theoritical distrbutions. Then we consider the autocorraltion of the entire series.           \begin{knitrout}     \definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}     \includegraphics[width=\maxwidth]{figure/acf}           \end{knitrout}               The lag 1 significnat autocorrelation -0.5053 found.           \end{document}      * * * Main TeX file:               % edited by JG on 31/10/13 to 6/11/13     \documentclass[12pt,a4paper]{article}          \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{multirow}      \usepackage{lscape}     \usepackage{graphicx}     \usepackage{hyperref}     \usepackage{lettrine}     \usepackage{setspace}     \usepackage[authoryear]{natbib}     \usepackage{caption}     \usepackage{subcaption}          \doublespacing     % page layout     \addtolength{\topmargin}{-20mm}     \addtolength{\textheight}{35mm}     \setlength{\textwidth}{150mm}     \setlength{\oddsidemargin}{8mm}     \hyphenation{Shew-hart}          \begin{document}          \title{Applying quality improvement techniques to analyze the asymmetric behavior in stock returns}          \section{ACF}          \input{ThirdPaper_Autocorrelation} % name of the knitter file                                      \end{document}


title: Building TeX file from knitr Rnw as child of larger parent TeX file to use R objects and output

text: Here's my general problem: I'm writing my dissertation using a LaTeX template (http://www.latextemplates.com/template/masters-doctoral-thesis). The template is a parent file with multiple chapters as children. For some of the chapters, I want to include objects and output from R, whereas for other chapters (e.g., Introduction) I don't want to use R. For the chapters without R, I've created the .TeX files as part of the template. Here's my specific problem: Right now I'm using knitr to create .TeX files with R objects and output. I'm open to using other options (e.g., sweave) if they'll work better for what I'm trying to do. I have some .TeX files without R objects from a dissertation template that I want to combine with .Rnw (or other) files with R objects. I want the .Rnw files to be created as child .TeX files of the larger parent .TeX file. The parent-child structure works for my .TeX files as part of the template using \input{}. However, I'm having trouble getting the .TeX files created from the .Rnw files to be included as child .TeX files. I've seen resources for combining .Rnw files as child files of a larger parent .Rnw file (here), but they appear to be combining only .Rnw files, not .Rnw files (with R) with .TeX files (without R). Because my template structure has a parent file, that's where I specify the documentclass, begin document, etc. As a result, the child .TeX files don't have headers. Thus, I first tried to create a .Rnw file without the documentclass and begin document headers, but when I knit the .Rnw file into .TeX and build the LaTeX files from all of the .TeX files, I receive the following error:               ! LaTeX Error: Environment knitrout undefined.      However, if I include the header in the .Rnw file with documentclass and begin document, I receive the following error:               ! LaTeX Error: Can be used only in preamble.      Below is the .Rnw file I'm using (with the header):               \documentclass{article}          \begin{document}          Here is a code chunk.          >=     1+1     letters     chartr('xie', 'XIE', c('xie yihui', 'Yihui Xie'))     par(mar=c(4, 4, .2, .2)); plot(rnorm(100))     @          You can also write inline expressions, e.g. $\pi=\Sexpr{pi}$, and \Sexpr{1.598673e8} is a big number.          \end{document}      Below is the .TeX file generated from the .Rnw file:               \documentclass{article}\usepackage[]{graphicx}\usepackage[]{color}     %% maxwidth is the original width if it is less than linewidth     %% otherwise use linewidth (to make sure the graphics do not exceed the margin)     \makeatletter     \def\maxwidth{ %       \ifdim\Gin@nat@width>\linewidth         \linewidth       \else         \Gin@nat@width       \fi     }     \makeatother          \definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345}     \newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}%     \newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}%     \newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}%     \newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}%     \newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}%     \newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}%     \newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}%     \newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}%     \newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}%          \usepackage{framed}     \makeatletter     \newenvironment{kframe}{%      \def\at@end@of@kframe{}%      \ifinner\ifhmode%       \def\at@end@of@kframe{\end{minipage}}%       \begin{minipage}{\columnwidth}%      \fi\fi%      \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep      \colorbox{shadecolor}{##1}\hskip-\fboxsep          % There is no \\@totalrightmargin, so:          \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%      \MakeFramed {\advance\hsize-\width        \@totalleftmargin\z@ \linewidth\hsize        \@setminipage}}%      {\par\unskip\endMakeFramed%      \at@end@of@kframe}     \makeatother          \definecolor{shadecolor}{rgb}{.97, .97, .97}     \definecolor{messagecolor}{rgb}{0, 0, 0}     \definecolor{warningcolor}{rgb}{1, 0, 1}     \definecolor{errorcolor}{rgb}{1, 0, 0}     \newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX          \usepackage{alltt}     \IfFileExists{upquote.sty}{\usepackage{upquote}}{}          \begin{document}          Here is a code chunk.          \begin{knitrout}     \definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}     \begin{alltt}     \hlnum{1} \hlopt{+} \hlnum{1}     \end{alltt}     \begin{verbatim}     ## [1] 2     \end{verbatim}     \begin{alltt}     \hlstd{letters}     \end{alltt}     \begin{verbatim}     ##  [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q"     ## [18] "r" "s" "t" "u" "v" "w" "x" "y" "z"     \end{verbatim}     \begin{alltt}     \hlkwd{chartr}\hlstd{(}\hlstr{"xie"}\hlstd{,} \hlstr{"XIE"}\hlstd{,} \hlkwd{c}\hlstd{(}\hlstr{"xie yihui"}\hlstd{,} \hlstr{"Yihui Xie"}\hlstd{))}     \end{alltt}     \begin{verbatim}     ## [1] "XIE yIhuI" "YIhuI XIE"     \end{verbatim}     \begin{alltt}     \hlkwd{par}\hlstd{(}\hlkwc{mar} \hlstd{=} \hlkwd{c}\hlstd{(}\hlnum{4}\hlstd{,} \hlnum{4}\hlstd{,} \hlnum{0.2}\hlstd{,} \hlnum{0.2}\hlstd{))}     \hlkwd{plot}\hlstd{(}\hlkwd{rnorm}\hlstd{(}\hlnum{100}\hlstd{))}     \end{alltt}     \end{kframe}     \includegraphics[width=\maxwidth]{figure/foo}           \end{knitrout}               You can also write inline expressions, e.g. $\pi=3.1416$, and \ensuremath{1.5987\times 10^{8}} is a big number.          \end{document}      FYI, I'm pretty new to LaTeX and knitr/sweave.


title: Why exactly is \linespread{1.05} appropriate for Palatino?

text: Section 1.4 of l2tabu, _Changing inter-line space using`\baselinestretch`_, contains a remark about the Palatino font: > [I]f you only want to use fonts other than Computer Modern you may use > `\linespread{<factor>}`. For example, when using Palatino > `\linespread{1.05}` would be appropriate. A factor of 1.05 for Palatino is also recommended in, e.g., this posting at `comp.text.tex` and (by implication) in section 2.1 _Fundamentals of Page Layout_ of the KOMA-Script manual. A possible reasoning is that the increased `\linespread` compensates for Palatino's larger x-height (height of lowercase letters without ascenders) and hereby avoids "cramped" text lines. Palatino's x-height is about 9% larger than that of Computer Modern (4.69pt v. 4.31pt for a fontsize of 10pt, see MWE below). That is, the "recommended" Palatino `\linespread` factor of +5% is about half as large as the difference in x-height. I'd like to know the following:   * Who exactly came up with `\linespread{1.05}` for Palatino? The authors of `l2tabu` or someone else?   * Is the factor of +5% just a rule of thumb, or is it the result of some (unknown to me) established typographic formula? * * *               \documentclass{article}          \begin{document}          Computer Modern's x-height: \the\fontdimen5\font          \fontfamily{ppl}\selectfont          Palatino's x-height: \the\fontdimen5\font          \end{document}


title: Footnotes: Label in paragraph, text somewhere else?

text: TL;DR: Is there a package that allows writing the text of a footnote after the position where the mark should be inserted? Note that I'm asking about positioning of source code, _not_ about positioning of the note in the output document. * * * When writing LaTeX I find the inline character of footnote source somewhat distracting.               This is some text\footnote{That for     whatever reason contains a long      footnote. The main text becomes split      apart} so far that it is barely readable.       Doing tricks with newlines like               This is some text\footnote{       That for whatever reason contains a long       footnote. The main text becomes split       apart}     so far that it is barely readable.      Also helps only so much. I'd much prefer to write               This is some text\fn{1} that contains a     couple\fn{2} footnotes yet remain readable.          \text{1}{Here is the text of the first     footnote, conveniently readable while reading     the main source, yet not disrupting it.}          \text{2}{-/2}      I know that some tricks are possible with `\footnotemark` and `\footnotetext`. When having more than one footnote in a paragraph however this would require manually changing the footnote counter, which is too inconvenient to make this a sensible alternative. Also if I'm not mistaken, it carries the risk of causing footnotes to be displayed on the wrong page, when the paragraph stretches to the next page but the `\footnotemark` is in text on the current page.               +---------------+  +---------------+     |...            |  |end of the page|     |               |  |...            |     |               |  |               |     |some text with²|  |—————          |     |footnote on the|  |²The FNText    |     +---------------+  +---------------+      Is there maybe some package that automates such a style? As a quick hack I sometimes used constructs like               \def\fnlater#1#2{\def#1{\footnote{#2}}}     ...     \fnlater\myfnI{The footnote text must be     defined before the paragraph.}     ...     Here is some textparagraph\myfnI that refers     to the previously defined footnote.       Sadly this custom solution has two major flaws:   1. It requires defining the footnote _before_ using it, while intuitively footnotes are expected _after_ the surrounding text.    2. It should cause a compilation error, when the footnote is accidentially used twice.    3. It should also cause a compilation error, when the footnote isn't used at all. Since I don't think that these issues are easily fixed, especially the requirement to define the footnote before the surrounding text, using custom hacks is undesireable. If such a package exists for LaTeX, availability of a corresponding module for LyX would be even better. * * * As a minimal compileable example put any of these code examples into a skeleton               \documentclass{article}     \begin{document}     ...     \end{document}


title: Phantom spaces in listings (pdf)

text: I have a problem with SQL code in a PDF document. For code representation I'm using the `listings` package. Everything works perfect until I copy-paste that code from the created PDF document. I get some phantom spaces in string type. When people are reading my PDF document, they need to copy-paste some of the code. Visually the code looks good in PDF, but when I try to copy-paste my code to NotePad or any other editor I get some unexpected spaces in strings. In the example below, when I copy-paste my SQL code, instead of getting:               SELECT ST_Area(the_geom)       FROM katastar       WHERE kc_broj = '1414';      I get               SELECT ST_Area(the_geom)       FROM katastar       WHERE kc_broj = ' 1414 ';      See the spaces in between quotes.               \documentclass{article}     \usepackage{listings,xcolor}          \lstset{      tabsize=4,             basicstyle=\scriptsize,             %upquote=false,             aboveskip=\baselineskip,             columns=fixed,             showstringspaces=false,             extendedchars=true,             breaklines=true,             prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},      frame=single,             showtabs=false,             showspaces=false,             identifierstyle=\ttfamily,             keywordstyle=\color[rgb]{0,0,1},             commentstyle=\color[rgb]{0.133,0.545,0.133},             stringstyle=\color[rgb]{0.627,0.126,0.941},      language=SQL     }          \begin{document}     \begin{lstlisting}     SELECT ST_Area(the_geom)       FROM katastar       WHERE kc_broj = '1414';     \end{lstlisting}     \end{document}


title: Sources to be copied from PDF

text: > **Possible Duplicate:**   >  Phantom spaces in listings (pdf) I would like to create PDF using luatex and it's important that listings where copied from this PDF in the original form (to keep them working). For example, there is the row in SQL:               insert into msg_dictionary (MSG_TYPE, COMMAND_CODE, INTERNAL_PRIORITY, MIN_LEVEL, MAX_LEVEL, UNLOCK_SIZE, MAX_LOCKED_AMOUNT, DENIAL_BODY)     values ('0105404', '0100', 3, 0, 3, 1, 10, null);      using package `listings` created pdf, but when i select the code and paste it to editor i get:               i n s e r t i n t o m s g _ d i c t i o n a r y ( MSG_TYPE , COMMAND_CODE ,     INTERNAL_PRIORITY , MIN_LEVEL , MAX_LEVEL , UNLOCK_SIZE ,     MAX_LOCKED_AMOUNT , DENIAL_BODY )     v a l u e s ( ’ 0105404 ’ , ’ 0100 ’ , 3 , 0 , 3 , 1 , 1 0 , n u l l ) ;      How can this issue be solved?


title: Write an equation, but I have a word with an accent

text: I want to write this equation: Peso fibra=(1,266x500)/(média 3 pesos) I used the equation environment. But, the word "média" has an accent. So, I have problems to compile my main file. How I can resolve this problem?


title: LaTeX math whitespace

text: when I try to display a math equation with LaTeX, there is always whitespace to the right and left of the math equation. I am trying it with code like this:               \documentclass{standalone}     \begin{document}     %Math equation here     \end{document}      This method works for regular text, it just doesn't seem to work for math. Is there a solution?


title: Embedding Type 1C fonts using LuaLaTeX

text: As pointed out in the answer to PDF file size with LuaLaTeX vs XeLaTeX, the difference between using Type 1 and Type 1C fonts in two documents made a big difference in file size. File size is important in the PDF files I'm working with. So my question is can you force LuaLaTeX to embed a Type 1C font instead of Type 1? This is something XeLaTeX can do (and in the case of the question cited above, did automatically). The font I'm working with is Gill Sans MT (I believe it comes with Adobe CS). While I'm not opposed to changing fonts, I'd still like to know how LuaLaTeX decides how to embed fonts and how it can be changed.


title: Snow on tikz-qtrees

text: Is it possible to add some snow on the syntax trees drawn by `tikz-qtree`? A simple example:               \documentclass[11pt]{article}     \usepackage{fontspec}     \usepackage{savetrees}     \setmainfont[Mapping=tex-text]{DejaVu Sans}     \usepackage{tikz-qtree, tikz-qtree-compat}     \tikzset{every tree node/.style={align=center, anchor=north}}     \providecommand{\alert}[1]{\textbf{#1}}          \title{tree}     \author{}     \date{\today}          \begin{document}          \section{Tree}     \label{sec-1}          \begin{tikzpicture}     \tikzset{every tree node/.style={align=center, anchor=north}}     \Tree [.TP [.DP \edge[roof ];\\I ] [.T' ] [.T\\ø ] [.VP [.V' [.V\\eat ]           [.DP \edge[roof ];\\potatoes ] ] ] ]          \end{tikzpicture}          \end{document}


title: Incomplete Mailto in PDF with amsart

text: When I use the `amsart` class and run LaTeX => PDF, the `email` macro produces strange output. Namely, the PDF shows an incomplete mailto. For example:               \documentclass{amsart}          \email{a.b@c.d}     \email{b@c.d}          \begin{document}     \end{document}      In the output, the first link points to `b@c.d` and the second to `@c.d`. Interestingly, when I run LaTeX => PS => PDF, both links are correct. How do I fix this? This question is similar to email adress renders incomplete mailto in PDF. However, unlike in that case, I want to use the `\email` macro, or at least to simulate the behavior of `\email` in the `amsart` class (e.g., I want e-mail addresses to appear at the end of the article, etc.).


title: How to force line breaks within a fancyvrb verbatim environment?

text: Consider the following LaTeX document:               \documentclass{article}     \usepackage{fancyvrb}     \DefineVerbatimEnvironment{example}{Verbatim}{commandchars=\\\{\}}     \begin{document}     \begin{example}     Foo\\{}Bar     Foo\linebreak{}Bar     \end{example}     \end{document}      I would expect the `\\\` and `\linebreak` commands to produce a line break each, so the typeset output ought to look like               Foo     Bar     Foo     Bar      However, the actual output is               Foo               Bar     FooBar      How do I produce an explicit line break inside a fancyvrb-based verbatim environment? (Incidentally »Just hit Return« isn't the answer I'm looking for. I have lots of text based on the alltt environment which contains markup like               Foo\nextline Bar      I use this to introduce »typographic« line breaks in shell command output, where there is no actual line break in the output but I need to start a new line because there is no more room on the current line. In my document, these »typographic« line breaks can be distinguished from genuine line breaks because there is a special symbol before/after the line break, along the lines of               \newcommand{\nextline}{\ensuremath{\rhd}\linebreak\ensuremath{\lhd}}      I'd much rather not change a couple thousand pages' worth of documentation.)


title: Anti aliasing from latex to pdf

text: When rendered the text in my pdf is not anti alised. Anyone knows how to do this? The following example shows my text output compared with output from google docs pdf ![enter image description here](http://i.stack.imgur.com/jvt4D.png) Is it even possible with pdflatex? Header file:               \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english]{babel}     \usepackage{amsmath}     %\usepackage{icomma}     %\usepackage{units}     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage{color}     \usepackage[hyphens]{url}     \usepackage[breaklinks,pdfpagelabels=false]{hyperref}     %\usepackage{lettrine}     \usepackage[sort]{natbib}     \usepackage{caption}     \usepackage[final]{pdfpages}          %\usepackage{fancyhdr}     %\usepackage{fncychap}               \newcommand{\degC}{\ensuremath{\,\unit{^\circ C}}}     \newcommand{\mail}[1]{\href{mailto:#1}{\nolinkurl{#1}}}      Thanks!


title: What is the most appropriate tool to develop a new font for LaTeX?

text: I need to design a couple of fonts to supplement the archaic package. What is the most appropriate current tool to use? Is METAPOST/METAFONT still an option? I am neither a Bezier curve artist not a graphic designer, so anything that I can use programmatically is preferred.


title: Compiling documents online

text: I have heard rumors that you can compile documents online, and more specifically that Google has a free online compiler, but I have never been able to find any. Is there a way to compile documents online, so that I can write and compile documents even if I don't have a TeX distribution installed on my computer?


title: Can I find something like this online?

text: > **Possible Duplicate:**   >  Compiling documents online I can only use email to ask my mathematics teacher questions and that can be very unhandy. So I'm wondering if there is a site in which you can just basically paste a text written in LaTeX which then shows it as it would in LaTeX. Like a kind of google translate, but except for translating it shows the text in LaTeX. So I can mail me teacher a text in LaTeX and ask him to paste it on that site. With 'written in LaTeX' I mean just like in Math stack exchange, with dollar signs and such. ps - you may edit the title and tags, since I don't know a proper tags/title for this question


title: A resource for converting LaTeX within the browser

text: > **Possible Duplicate:**   >  Compiling documents online Does anyone know of a resource that converts LaTeX within the browser? Not using something I have to install like mathjax but something contained in the webpage like jsfiddle.net


title: Are any web base TEX editors with live collaboration available?

text: > **Possible Duplicate:**   >  Compiling documents online I have grown addicted to the live collaboration features of Google Docs. Any such solutions available for editing TEX files? Any web based TEX editors?


title: LaTeX on the go

text: I resently started to like Google docs. The ability to write every I am, anytime I want. Especially mobile, with a tablet. Because the best Ideas don't care what you are doing, they just pop in your head. I also started to use LaTeX. Is there anything in the LaTeX world, that provides the flexibility and freedom something like Google docs?


title: Is there a web-based LaTeX or TeX editor?

text: > **Possible Duplicate:**   >  Compiling documents online I would like to use a calculator that allows me to write formulas and questions in LaTeX or TeX. Is there anything JS based?


title: Comparison of browser-based latex processors

text: > **Possible Duplicate:**   >  Compiling documents online I want to be able to share, process, and preview latex files over computers that won't have TeX installed. How would you compare browser-based programs that perform such a task?


title: Creating a PDF file online from a LaTeX template

text: > **Possible Duplicate:**   >  Compiling documents online I would like to create a CV using this (moderncv) LaTeX template online. The output should be in PDF format. Is it possible to be done online (i.e. through a web site interface)?