title: Help for positioning text and picture?

text: I'm doing LaTex first time in my life and I need to position image and text in the following way:               TEXT HERE                                               IMAGE HERE          Lorem ipsum text text juubaa juubaa              ---------PICTURE---------------          Lorem ipsum text text juubaa juubaa              -                             -          Lorem ipsum text text juubaa juubaa              -                             -          Lorem ipsum text text juubaa juubaa              -                             -           Lorem ipsum text text juubaa juubaa              -------------------------------          AGAIN TEXT HERE          lorem ipsum etc etc      How to do this in LaTex? =) Thank you for any advice


title: Highlight R chunks in a Knitr document when working in Kile

text: When working on a knitr document in kile I can get highlights for the LaTeX parts of the document by adding the `*.Rnw` file extension in the `Modes & Filetypes` tab under `Open/save` configuration options. The question is, is there a way to get highlighting of the R parts of the document a la R-Studio?


title: Show knitr-RNW document structure in Kile

text: When working with a knitr file (RNW document) on Kile the document structure isn't shown in the structure view, even though it contains a valid LaTeX structure of parts, sections etc. If I change the file suffix into `.tex` then the structure is shown, but it's a bad idea because I need to compile it later into a real LaTeX document. Is there any way to trick Kile into showing the structure of an RNW file?


title: bibtex file does not recognize the citations

text: I am trying to compile "bibtex filename.aux" in latex. It does not compile and the errors are:   1. Package natbib Error: Bibliography not compatible with author-year citations ...mand\NAT@force@numbers{}\NAT@force@numbers   2. File ended while scanning use of \@@BOOKMARK \begin{document}   3. File ended while scanning use of \@@BOOKMARK \begin{document} The main problem is the first error. The command line with the problem in the filename.aux says: \providecommand\NAT@force@numbers{}\NAT@force@numbers (So apparently this is the line with a problem) Here are the lines in the .tex file \usepackage{natbib} text... \citep{author2002}...etc I have no idea how to make it run. PLEASE HELP!!!


title: Biblatex's \printbibliography not working

text: I am a beginner with LaTeX, so it might be something really obvious that I am missing. I am using TeXstudio as an editor if it makes any difference. I have the following code in my `.tex` file:               \documentclass[12p,twoside,a4paper]{report}     \title{My title}          \usepackage[style=numeric,backend=bibtex]{biblatex}     \addbibresource{citations.bib}          ....          \newpage         \printbibheading     \nocite{*}     \printbibliography      Inside my `citations.bib` file I have:               @book{rasmussen,         author    = "C. E. Rasmussen & C. K. I. Williams",         title     = "Gaussian Processes for Machine Learning",         year      = "2006",         publisher = "MIT Press",         address   = "Massachusetts Institute of Technology"     }      Inside my `.tex` document I am citing it as `\cite{rasmussen}`, but there is no citation at the end of my file. So, to sum up, my code looks like this:               \documentclass[12p,twoside,a4paper]{report}     \title{My Title}          % For the citations     \usepackage[style=numeric,backend=bibtex]{biblatex}     \addbibresource{citations.bib}          \begin{document}          \par     Lorem ipsum dolor sit amet. \cite{rasmussen}          \newpage     \printbibheading     \nocite{*}     \printbibliography          \end{document}      I get the following error message when running `bibtex myFile`:               This is BibTeX, Version 0.99d (MiKTeX 2.9)     The top-level auxiliary file: dissertation.aux     The style file: biblatex.bst     I couldn't open database file citations.bib     ---line 3 of file dissertation.aux      : \bibdata{dissertation-blx,citations      :                                    }     I'm skipping whatever remains of this command     Database file #1: dissertation-blx.bib     Warning--I didn't find a database entry for "F1:2010:Online"     Warning--I didn't find a database entry for "rasmussen"     Warning--I didn't find a database entry for "GP:Columbia"     Biblatex version: 2.8     (There was 1 error message)      What am I missing?


title: How to rotate text in multirow table?

text: I have a big table with a problem, when I want to rotate the text in a `\multirow` cell, the text is placed outside and is bigger than the dimensions of the cell, I took some advice from here, using`\parbox`, and then `\rotatebox`. But I don't get good results.                \documentclass{article}      \usepackage{array,multirow,graphicx}      \begin{document}      \begin{table}[H]      \centering      \begin{tabular}{|c|l|r|r|r|r|}      \hline      & \multicolumn{1}{|c|}{Text} & \multicolumn{1}{|c|}{Text} & \multicolumn{1}{|c|}{Text} & \multicolumn{1}{|c|}{Text} & \multicolumn{1}{|c|}{text}\\      \hline      \rotatebox{90}{\parbox{2mm}{\multirow{3}{*}{rota}}} & text &&&&\\      & text &&&&\\      & text &&&&\\      \hline      \end{tabular}      \end{table}      \end{document}      Which results in: ![rotate problem](http://i.stack.imgur.com/bDkN6.png)


title: Formatting FAQ lists in LaTeX

text:
I want to format a list of "Question + Answer" pairs in a TeX-document. In HTML I use the `<dl>` command: http://www.w3.org/TR/html401/struct/lists.html, e.g.:

Question?

         Answer

      In TeX I thought using the `description` environment would be good for those purposes.               \begin{description}     \item[Question?] Answer     \end{description}      But when the question becomes very long, it does not break into a new line. When the question is short, the answer begins directly behind the question and not in a new line. What environment should I use for this problem?


title: Package endfloat problem - Don't know how to make list of figure

text: I am trying to make a document and wish to place all the figures and tables at the end. However, this is giving the following error:               !Package endfloat Error: Don't know how to make list of `figure'.          See the endfloat package documentation for explanation.       Any clues about this? The working code example:               \documentclass{article}     \usepackage{graphicx}     \usepackage{endfloat}          \title{Working example}     \author{India}          \begin{document}     \section{Khajoorwala}     This is the first section without the graphics.           \section{Aaamwala}     Hello this is the section with the graphics.      \begin{figure}     \centering      \includegraphics{sample.jpg}     \end{figure}          \end{document}


title: Help needed in breaking a long equation which contains long sum

text: I have an equation which I want to split into two, but it always gives error when I use standard equation breaking techniques, like `\split`, `\gather` etc. The quation is given as               \vec{B}^{tra}(\textbf{r})  = \sum^{+\infty}_{n=-\infty}{j^{-n+1}\left[ \frac{k_{+2}c_{n}}{\omega}(\textbf{M}^{1}_{n}(k_{+2}r) +\textbf{N}^{1}_{n}(k_{+2}r))Cos(\theta)       -\frac{k_{-2}d_{n}}{\omega}(\textbf{M}^{1}_{n}(k_{-2}r)-\textbf{N}^{1}_{n}(k_{-2}r))sin(\theta)\right]}.      I want to write the sine term on second line. any help will highly appreciated. FA


title: Resetting counter

text: I have created two counters               \newcounter{problem}[section]     \newcounter{solution}[problem]      As expected, **problem** resets every time **section** increases. However, **solution** does not reset when **problem** increases. What is the problem?


title: Errors produces when using `\readline`

text: This question, while related to this earlier question of mine, is less about removing content from the beginning of each line and more about how to preprocess lines of a file as it is read in. Here is the file I want to preprocess:                 The character of the First Caesar has perhaps never been worse       appreciated than by him who in one sense described it best; that is,            \textbf{This is the first line.}\par     *  \textbf{This is the second line.}     *     *     *  Great as Caesar was by the benefit of his original nature, there can be       no doubt that he, like others, owed something to circumstances; and      The basic idea is that somewhere I have a boolean set which determines how to process the lines that begin with `*`. If the boolean is false, these lines are ignored: as if they had been commented out. If the boolean is true, then these lines are processed as though they did not start with a star. In this MWE I don't have any booleans. This MWE is supposed to represent how things will be processed had the boolean been set true. MWE:               \documentclass{article}          \makeatletter          \newread\file     \def\@gobblethree#1#2#3{}     \newcommand\myaccumulatedfile{}     \long\def\aegobbleinput#1{%       \IfFileExists{#1}{%         \openin\file #1         \begingroup         \endlinechar\newlinechar         \loop\unless\ifeof\file           \readline\file to\foo     %<a>%     \edef\myaccumulatedfile{\myaccumulatedfile\expandafter\@aegobble\foo\@nil}%%     %<b>%     \aftergroup\edef\myaccumulatedfile{\myaccumulatedfile\expandafter\@aegobble\foo\@nil}%%         \repeat         \closein\file         \expandafter\endgroup         \scantokens\expandafter{\myaccumulatedfile}       }{%         \errmessage{File `#1' doesn't exist!}%       }%     }          \def\@aegobble{%%'       \@ifnextchar*{\@@aegobble}{\@@nogobble}%%'     }          \def\@@aegobble*#1\@nil{Star}     \def\@@nogobble#1\@nil{#1Major}          \makeatother          \begin{document}          Try:          \aegobbleinput{test_file/star_test}          \end{document}      As written, this MWE will compile, but I've commented out the crucial lines. If the line starting with `%<a>%` is uncommented, then I get the fatal error               ! TeX capacity exceeded, sorry [input stack size=5000].     \foo ->              The character of the First Caesar has perhaps never been worse     l.7 \aegobbleinput{test_file/star_test}                                            ^^M     !  ==> Fatal error occurred, no output PDF file produced!      If the line starting with `%<b>%` is uncommented, then I get the non-fatal error               Runaway definition?     \edef \edef \edef \edef \edef \edef \edef \edef      ! File ended while scanning definition of \edef.     <inserted text>                      }     l.7 \aegobbleinput{test_file/star_test}          ?       This last approach seems somewhat correct. At least the produced pdf is approaching something like what I want. What am I doing wrong here? **UPDATE** Per @jfbu 's suggestion, the following seems to work:               \makeatletter     \newif\ifaeshowall     \aeshowallfalse     \long\gdef\aegobbleinput#1{%%'       \begingroup       \ifaeshowall\catcode`\*=9\relax\else\catcode`\*=14\relax\fi       \input{#1}\endgroup}     \makeatother


title: Adjust the caption to figures on minipage

text: Using minipage, is posible to split the (a) (b) letters above any figures, in order to perfectly center them? ![enter image description here](http://i.stack.imgur.com/Ia55v.png)               \begin{figure}[tpb]                 \subfloat[]{                    \begin{minipage}{0.45\linewidth}   %tamaño                        \includegraphics[width=1\columnwidth,keepaspectratio]{matlab/pdr_12345_p.pdf}                     \end{minipage}}                   \subfloat[]{                 \hspace{5mm}    \begin{minipage}{0.45\linewidth}                         \includegraphics[width=1\columnwidth,keepaspectratio]{matlab/pdr_11111_p.pdf}                          \end{minipage}}          \end{figure}      thanks in advance!


title: Bibliography order

text: I have some problems with the bibliography's ordering. I need the bibliography's elements to be ordered by author first and then by year. This is how some articles appear in my document now: ![Bibliography](http://i41.tinypic.com/2aguvq1.jpg) As you can see, they are ordered by author first and then by title. How can I modify the ordering? This is a MWE:               \documentclass{report}     \usepackage[autostyle,italian=guillemets]{csquotes}     \usepackage[backend=biber,bibstyle=numeric,citestyle=numeric]{biblatex}     \addbibresource{biblio.bib}     \begin{document}     \addcontentsline{toc}{chapter}{\bibname}     \printbibliography     \end{document}


title: centering figure

text: I want to put this figure (Matrix) at the center but I can't, even though the title is centered: ![](http://i.stack.imgur.com/SXDpB.png) How to do this please? I have this code :               \begin{center}     \begin{figure}[H]             \begin{center}                         \[                         \begin{blockarray}{cccccc}                         123 & 12,3 & 13,2 & 1,23 & 1,2,3\\                         \begin{block}{(ccccc)c}                           0 & 1 & 1 & 1 & 0 & 123 \\                           1 & 0 & 0 & 0 & 1 & 12,3 \\                           1 & 0 & 0 & 0 & 1 & 13,2 \\                           1 & 0 & 0 & 0 & 1 & 1,23 \\                           0 & 1 & 1 & 1 & 0 & 1,2,3 \\                         \end{block}                         \end{blockarray}                         \]             \end{center}           \caption{ Matrice d'adjacence de treillis de 5 partitions de $E = \{1,2,3\}$}     \end{figure}     \end{center}


title: How do you put in a graphical abstract?

text: I tried adding figure environment inside the abstract area but it generates an error. How do I add a graphical abstract as well as a textual one?


title: image inside columns inside block in beamer

text: I try to put an image in `columns` environment inside a `block` environment in `beamer`. Somehow my image is shifting outside the block. Here's an example               \documentclass{beamer}     \usetheme{Darmstadt}     \begin{document}     \begin{frame}{Problem}     \begin{block}{look at that}     \begin{columns}         \begin{column}{.4\textwidth}         \rule{.3\textwidth}{.3\textwidth}         \end{column}         \begin{column}{.6\textwidth}         Nothing of great importance         \end{column}     \end{columns}     \end{block}     \end{frame}          \end{document}      I tried an ugly hack with a `flushright` environment around the image, however then the image is shifting downwards which only looks slightly better. (How) can this be solved?


title: Generating links from citations for bibliography using BibTeX and Hyperref

text: I created a LaTeX document on Windows using TeXworks with the MiKTeX package. When I copied the same .tex file over to Linux (Ubuntu 9.10) and tried to compile using TeXLive everything worked fine except the citations no longer linked to the bibliography. My build process was pdflatex > bibtex > pdflatex > pdflatex. My imports in the preamble are:               \usepackage{cite}     \usepackage{graphicx}     \usepackage[pdftex]{hyperref}     \usepackage[all]{hypcap}      I'm not sure what differences there could be that would cause the citation links not to work, all other links work fine (links to figures and websites). Any ideas would be great.


title: Adding numbers to Author Year citations in list of references

text: I am new to latex so please excuse any beginner errors.. I am using lyx to write a paper (article class) and i am using bibtex to generate my bibliography (kluwer style). My citations need to be referred to in text as Author (Year) or (Author, Year) and in my list of references as Author (Year) title etc..which I have managed to do. but...i need to number the citations in the list of references. is there any way to change a list of references to an itemised list? thanks!


title: String/vector concatenation symbol

text: I'm looking for a math symbol to represent the concatenation of two vectors: if **_x_** = ( _x_ 1, _x_ 2) and **_y_** = ( _y_ 1, _y_ 2) then **_x_** ? **_y_** = ( _x_ 1, _x_ 2, _y_ 1, _y_ 2). I'm not very much at home in vector calculus, so I don't know if there's a standard symbol for this. If not, then I remember from formal language theory that there's a round caret-like symbol for concatenating two strings, which would be fine for my purposes. I can't find it, though; the sources I've found online all recommend using juxtaposition for concatenation, but I'm afraid this would be mistaken for the dot product. I'm using `elsarticle.cls`, so `amsmath` and `amssymb` are both available.


title: Draw set mapping diagrams

text: I'm trying to draw some set mapping diagrams with LaTeX. Do you know any packages that can do this? I tried searching online but I couldn't find anything useful.


title: Fancy style, cleaning and improving

text: I was given the following style:               % Style definitions     \usepackage{fancyhdr}          \renewcommand{\chaptermark}[1]%      {\markboth{\MakeUppercase{\chaptername\ \thechapter.\ #1}}{}}      \renewcommand{\sectionmark}[1]%      {\markright{\MakeUppercase{\thesection.\ #1}}}     \newcommand{\helv}{%      \fontfamily{phv}\fontseries{b}\fontsize{9}{11}\selectfont}           \newcommand{\cp}[0]{\clearpage{\thispagestyle{empty}\cleardoublepage}}     \fancyhf{}           %\fancyhead[LE,RO]{\helv \thepage}      \fancyhead[LO]{\helv \rightmark}      \fancyhead[RE]{\helv \leftmark}     \renewcommand{\headrulewidth}{0.5pt}           \fancyfoot[R]{\helv \thepage}     \renewcommand{\footrulewidth}{0.5pt}          \fancypagestyle{plain}{%      \fancyhf{} % clear all header and footer fields      \fancyfoot[R]{\helv \thepage} % except the center      \renewcommand{\headrulewidth}{0pt}      \renewcommand{\footrulewidth}{0.5pt}}      When I look at it, it seems to have very redundant commands. However I don't understand this well enough to be certain. Could someone suggest a "cleaning" to this style? Anyways, this style always marks the page number on the right side. Is there anyway to make the page number always on the outer side of the page.


title: Configuring a biblatex bibliography style

text: I just switched from natbib to biber + biblatex, and the closest bibliography style to my preferred style is "ieee" (by Joseph Wright). I am using it with the citation style "authoryear". This makes the numbers in the bibliography useless; how do I remove them?


title: Place entries without a date at the end of a chronological bibliography

text: I'm using BibTeX with the plainyr style. I'm referencing some websites, but these of course don't have a date. I would like them to be placed at the end of my bibliography and not at the start (as is currently the case). When running BibTeX I get the following warning:               Warning--to sort, need year or key in siteA      This suggests that I might add some key to influence sorting, but I don't know how this should be done. Adding a year seems wrong to me. Here is how such a site entry looks like in my database:               @MISC{siteA,       title = {http://www.site.com},       owner = {nvcleemp},       timestamp = {2012.04.06}     }


title: How to adjust multi-lined cell entry with multirow

text: When I try this code:               \documentclass{article}     \usepackage{multirow, }          \begin{document}          \begin{table}[htb]     \centering     \begin{tabular}{|c|c|c|c|c|c|}     \hline       & \multirow{2}{*}       {\begin{tabular}{@{}c@{}} 1, 2, 3, 4, 5,\\ 6, 7, 8, 9, 10, \\ 11, 12, 13, 14, 15, \\16, 17, 18, 19, 20,\\ 21, 63, 64, 65, 66,\\ 72, 75, 76, 78, 79 \end{tabular}} & &  &  & \\ \cline{3-6}         &  &  &  & &  \\     \hline     \end{tabular}     \end{table}          \end{document}      it produces this: ![](http://i.stack.imgur.com/NSJdl.png) and               Overfull \vbox (48.0pt too high) detected      Removing `\multirow{2}{*}` causes the cell vertically mis-aligned. How to fix this?


title: Long underscore in LaTeX

text: In LaTeX, how would I make a long underscore? For example,               Name _______  Signature _______


title: How to leave underscored white space?

text: > **Possible Duplicate:**   >  Long underscore in LaTeX I am not even sure if there isn't a proper typographical term for this thing. I use it for a questionnaire, where I have questions like: > I have worked ___ _ years in this job position If I write the questionnaire in Word, I can use 3-4 underscores in row, and it will appear to be an uninterrupted horizontal line in the middle of the sentence. But if I try the same thing in LaTeX, I get discrete underscores, which look ugly. There must be a better way to do this. What can I use?


title: How to create long underscore before the text?

text: > **Possible Duplicate:**   >  Long underscore in LaTeX a sample output would be like:               __________ hello          __________ hello


title: Writing clean long underscores

text: > **Possible Duplicate:**   >  Long underscore in LaTeX I'm writing a document in which I encourage the reader to "fill in the blanks" in order to be actively engaged with the proof. Is there any way to write a clean, long underscore? Currently I'm using `\underline{\hspace*{2cm}}`, but it doesn't look so great... Here's a sample of my text:               \begin{thm}          $A \subset B$ if and only if $A \cap B = A$.          \end{thm}          \begin{proof}          Assume $A \subset B$.     We want to show $A \subset (A \cap B)$ and \underline{\hspace*{2cm}}.     The first fact is true since: $A \subset B \Rightarrow$     if $x \in A$ then \underline{\hspace*{2cm}} $\Rightarrow$     if $x \in A$ then $x \in A \textrm{ and } B$.     The second fact is true by \underline{\hspace*{2cm}}.          Conversly, assume \underline{\hspace*{2cm}}.     By the first property again, $B \supset$ \underline{\hspace*{2cm}},     so we have \underline{\hspace*{4cm}}.          \end{proof}


title: Unable to run ConTeXt (pdfTeX) after upgrading to Mac OS X 10.9 Mavericks

text: I recently upgraded to Mac OS X 10.9 (Mavericks) and tried to run a old ConTeXt document using TeXWorks. I got the following error:               /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:212: warning: Insecure world writable dir /usr/local in PATH, mode 040777     /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': /usr/local/texlive/2013/texmf-dist/scripts/context/ruby/base/switch.rb:501: invalid multibyte escape: /\xFF/ (SyntaxError)         from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'         from /usr/local/texlive/2013/texmf-dist/scripts/context/ruby/texexec.rb:11:in `<main>'      I had earlier loaded MacTeX 2012. I got the same error as above. So I thought may be it has to do with my TeX installation. I removed MacTeX 2012 and installed MacTeX 2013. But ended up with the same problem (error message as above). I am kind of lost. I am new to Mac and was enjoying the TeX/LaTeX/ConTeXt experience. Would appreciate help.


title: XeTeX (I think) problem with Mac OS X.9

text: Just upgraded to Mac OS X.9 Maverick and `XeTeX` (at least us used from `TexWorks`, which is all I've tried) now seems to be broken though it was working before. Error message when I try to typeset with `ConTeXt/XeTeX`: > > /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in > 'require': /usr/local/texlive/2013/texmf- > dist/scripts/context/ruby/base/switch.rb:501: invalid multibyte escape: > /\xFF/ (SyntaxError) from > /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in > 'require' from /usr/local/texlive/2013/texmf- > dist/scripts/context/ruby/texexec.rb:11:in `' Anyone else having this? Any ideas? (I'm relatively new to both TeX and Macs, as well as this site, so apologies if this is inappropriate, poorly asked or a stupid question. :) ) **Edit:** The problem occurs even on minimal files with both ConTeXt/XeTeX and ConTeXt/pdfTeX but not with ConTeXt/LuaTeX. Complete reinstallation of MacTeX has not helped.


title: How to give a kick to a pie chart?

text: The pie chart:               \documentclass{article}          \usepackage{calc}      \usepackage{ifthen}      \usepackage{tikz}     \begin{document}      \newcommand{\slice}[5]{ %% use 5 arguments here        \pgfmathparse{0.5*#1+0.5*#2}        \let\midangle\pgfmathresult          % slice %% I changed !10 to !30 to get darker color        % use the fifth argument #5 to pass the color          \draw[thick,fill=#5!30] (0,0) -- (#1:1) arc (#1:#2:1) -- cycle;          % outer label        \node[label=\midangle:#4] at (\midangle:1) {};          % inner label        \pgfmathparse{min((#2-#1-10)/110*(-0.3),0)}       \let\temp\pgfmathresult        \pgfmathparse{max(\temp,-0.5) + 0.8}       \let\innerpos\pgfmathresult        \node at (\midangle:\innerpos) {#3}; }          \begin{tikzpicture}[scale=3]          \newcounter{a} \newcounter{b}      %% -------------- use the new variable \c to pass the color      \foreach \p/\t/\c in {20/type A/red,         4/type B/blue, 11/type C/red,        49/type D/green, 16/other/yellow}   {         \setcounter{a}{\value{b}}         \addtocounter{b}{\p}         \slice{\thea/100*360}                {\theb/100*360}                {\p\%}{\t}{\c}  %% here we use the fifth variable                 }          \end{tikzpicture}          \end{document}      But how to make it look a bit more awesome just to give it a kick?


title: Getting less space in "$V$,"

text: If I think there's too much space between the `$V$` and the `,` in `$V$,`, what's the best way to reduce it? It seems safe to use `\kern` and not safe to use `\hspace`, since if you use `\hspace` the line might break between the `$V$` and the `,`:               \documentclass{article}          \begin{document}          %line broken between $V$ and ,     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%     For all $V$\hspace{-1pt}, the theorem holds.          %line broken between "all" and "$V$\kern-1pt,"     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%     For all $V$\kern-1pt, the theorem holds.          \end{document}      But is there a better way?


title: How can I add flowchart in WinEdt?

text: I am beginner and writing paper using **WinEdt**. I used tikz package to draw the diagrams in **TeXworks** which generated `.tex` and `.pdf` files. But I can't add it to the **WinEdt**. Help?


title: Page dimensions using geometry package

text: Long time listener; first time caller here at TEX, so go easy on me. Can someone please tell me if there are any advantages of using               \usepackage{geometry}     \geometry{a4paper}      instead of defining the size in the paper size in the document class               \documentclass[a4paper,11pt]{article}      Thank you.


title: Unable to display an url leading to a *.pdf document

text: Basically, I have an url in the form of "http://website.com/folder/this_is_a_pdf_document.pdf" which I want to display in my document in TeXStudio, however, an error pops up. It seemingly interprets the link as something to do with the math environment; i.e., what I get is this: > "Math command outside of math environment" whenever I hover, with my mouse, > over the "_" symbols in the url, which TeXStudio have colored red. In the "Errors" panel it says that a "$" is missing; which I take that it wants me to go into math mode, again. When the document is compiled and viewed by me, the link that I am trying to display has a crippling "this_is_a_pdf_document.pdf" part; namely, some of the letters are displayed as subscripts, which has, in all probability, have to do with those "_" that TeXStudio is not able to interpret in a non-math environment mode. So, the question: How do I display the link without TeXStudio thinking that it has anything to do with math environment? NB! It is not necessary for me to have the url linked _a la_ `hyperref` usepackage; that is, I do not care that the url is not interactive and takes you to the actual website. Some of the urls that I've successfully displayed have no problems whatsoever (they do not have the "_" symbol in them). The working urls are displayed simply by:               \begin{center}http://www.website.com/setion\end{center}          In respect to the `hyperref` usepackage, I've tried the following versions, none of which worked (TeXStudio interprets the "this_is_a_pdf_document.pdf" part of the url as containing math symbols):               \href{URL}{text}, \url{URL}, \nolinkurl{URL}, \hyperref{label}{text},      \hypertarget{name}{text}, and \hyperlink{name}{text}       Thanks a lot!


title: How can I get straight double quotes in listings?

text: My question is related to the following two   * How to have straight single quotes in lstlistings   * In the minted package, how do I enforce straight single quotes? but I'm specifically asking about double-quote characters (ASCII decimal code 34). They appear curly in my listings. How can I get straight double quotes instead? MWE:               \documentclass{article}     \usepackage{textcomp,upquote,listings}     \lstset{upquote=true}     \begin{document}     \begin{lstlisting}     echo "Hello, world!"     \end{lstlisting}     \end{document}      produces > ![Output of the provided MWE; contains closing curly > quotes](http://i.stack.imgur.com/6Ivht.png) I understand that the `upquote` package only applies to single quotes. How can I make it apply to double quotes as well?


title: Drawing on a 3d cone with tikz

text: I can draw a cube as:               \documentclass[12pt]{standalone}     \usepackage{tikz}              \begin{document}         \begin{tikzpicture}         \pgfmathsetmacro{\cubex}{2}         \pgfmathsetmacro{\cubey}{1}         \pgfmathsetmacro{\cubez}{3}         \draw[draw = brown!30!black, fill = brown] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,-\cubey,0) -- ++(\cubex,0,0) -- cycle;         \draw[draw = brown!30!black, fill = brown] (0,0,0) -- ++(0,0,-\cubez) -- ++(0,-\cubey,0) -- ++(0,0,\cubez) -- cycle;         \draw[draw = brown!30!black, fill = brown] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,0,-\cubez) -- ++(\cubex,0,0) -- cycle;         \end{tikzpicture}         \end{document}      My question now is, how would I draw on top of this, i.e. I want to draw on this to extend the `x`, `y`, and `z` scale. An example of what I want to do is: ![](http://i.stack.imgur.com/NWRlK.jpg) Using the drawing that I have already defined, how would I draw the water part of the image? I realize that this was probably done using another software but I would like to slowly build it up using `tikz`, concentrating now on the water part.


title: Table of images with captions

text: I have a table with four images.               \begin{table}[ht]     \caption{table caption...}     \centering     \begin{tabular}{cc}     \includegraphics[width=45mm]{w.png} &\includegraphics[width=45mm]{x.png}\\     \newline     \includegraphics[width=45mm]{y.png}&\includegraphics[width=45mm]{z.png}\\     \end{tabular}     \end{table}      I want to caption each of the images. Normally I would do this by placing `includegraphics` within a `\begin{figure}` block using `\caption{...}`. But when I do this, the images disappear. What is the proper way to do this, so that I can caption each of the images.


title: Want to eliminate the automatic time stamp of pdflatex (or lyx?)

text: Whenever I create a document with lyx, and if there is title and author in the document, today's time is automatically put in the document. For example, if I pdf-fy the following code by WinEdt, or in lyx, the outcome is https://drive.google.com/file/d/0Bw2iKVlLwpjaNTNhS3drWFBPTEE/edit?usp=sharing               \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{babel}     \begin{document}     \title{Title}     \author{Author}     \maketitle     test     \end{document}      What's the code to remove that time stamp from the output document?


title: Save from LyX to PNG

text: I have a LyX file with a PSTricks picture. Currently, when I want to convert it to a PNG image, I save the file as PS, then open the PS in gimp, then save it as PNG. Is there a way to save to PNG directly from LyX?


title: Fill the area enclosed by multiple functions in a single plot

text: I wish to fill the area enclosed by four functions, as indicated by the hatching in red in the figure below: ![enter image description here](http://i.stack.imgur.com/0IqAG.jpg) So far I've been able to fill the area between each pair of functions, as shown below: ![enter image description here](http://i.stack.imgur.com/gLvix.jpg) The first was produced as follows:               \documentclass{standalone}     \usepackage{pgfplots}     \begin{document}          \pgfmathdeclarefunction{fun1}{0}{%       \pgfmathparse{ tan(x)/( cos(x)*( 1 + 3.3*((tan(x))^2) ) ) }}     \pgfmathdeclarefunction{fun2}{0}{%       \pgfmathparse{ 1.1*tan(x)*(1/cos(x)) }}     \pgfmathdeclarefunction{fun3}{0}{%       \pgfmathparse{ 0.145*( ( 1 + 3.3*(tan(x))^2 ) / sin(x) ) }}     \pgfmathdeclarefunction{fun4}{0}{%       \pgfmathparse{ 4 }}          \begin{tikzpicture}     %     \begin{semilogyaxis}[%     width=7cm,height=11cm,     scale only axis,     xmin=0, xmax=90,     xmajorgrids,     ymin=0.1, ymax=10,     ymajorgrids,yminorgrids]          % fun1 (start stacking)     \addplot[     domain=1:25.70,     draw=none,fill=none,mark=none,     stack plots=y]     { fun1 };     %     % stack difference between fun2 and fun1 on top of fun1     \addplot[     domain=1:25.70,     draw=none,draw opacity=0.0,     fill=gray,fill opacity=0.25,     stack plots=y     ]     { max( fun2 - fun1 , 0 ) }     \closedcycle;          % fun1     \addplot[domain=1:89,solid,line width=0.8pt,draw=black,mark=none]{ fun1 };          % fun2 (branch 1)     \addplot[domain=1:25.78,solid,line width=0.8pt,draw=black,mark=none]{ fun2 };     % fun2 (branch 2)     \addplot[domain=25.78:89,dashed,draw=black,mark=none]{ fun2 };          % fun3 (branch 1)     \addplot[domain=1:89,dashed,draw=black,mark=none]{ fun3 };     % fun3 (branch 2)     \addplot[domain=25.78:70,solid,line width=0.8pt,draw=black,mark=none]{ fun3 };     % fun3 (branch 3)     \addplot[domain=70:89,dashed,draw=black,mark=none]{ fun3 };          % fun4 (branch 1)     \addplot[domain=1:70,dashed,draw=black,mark=none]{ fun4 };     % fun4 (branch 2)     \addplot[domain=70:89,solid,line width=0.8pt,draw=black,mark=none]{ fun4 };          \end{semilogyaxis}     \end{tikzpicture}     \end{document}      The 2nd and 3rd were obtained, respectively, using:   * `domain=25.78:70` and `{ max( fun3 - fun1 , 0 ) }`   * `domain=70:89` and `{ max( fun4 - fun1 , 0 ) }` How can I display them on a single plot?


title: How to locally reduce the vertical space around a figure?

text: How can I reduce the space below and above a figure? I found the following answer, describing how I can reduce the vertical spacing for floats globally. How can I achieve this locally (on a single page)? I'm also satisfied with a solution without the floating environment (but including centering), as the figure is placed on a title page and is not really supposed to float. Below what I'm using now.               \documentclass[a4paper,11pt,twoside]{book}     \usepackage{graphicx}      \usepackage{epstopdf}        \usepackage{float}     \usepackage[nopar]{lipsum}                    \begin{document}          \noindent \footnotesize{\lipsum[4]\\     \begin{figure}[H]     \centering     \includegraphics[width=3cm]{CC_logo.eps}     \end{figure}     \noindent \lipsum[4]               \end{document}


title: LaTeX  template gallery

text: I know that there's CTAN but I would like to know if any **LaTeX template gallery** (commercial or not) exists on the web. I mean something where I have some PDF examples that I could preview, and a downloadable zip archive with the .tex source file and all the other resources needed (packages, sty, images...). The best would be something like the website templates industry does (Themeforest). I'm a non expert but happy LaTeX user. I use TextMate for editing .tex documents and the MacTeX distribution.


title: Suppress chapter creation by BibTeX

text: The title says it all really. I'm using the `rsc` bibliography style and placing the references will create the chapter heading "References". Now I do want that gone since this is for a poster and the box/frame will hold "references". In case a MWE is needed I supply one:               \documentclass{article}      \usepackage{rsc} %%basically loads natbib            \begin{document}           \bibliographystyle{rsc}           Some clever bloke came up with something\cite{cleverbloke2013}.           \bibliography{somefile}            \end{document}      There must be a way, the natbib documentation is huge and I didn't find something fitting. Since I assume it is possible to change the title of the references it should be possible to change it to an empty title.


title: remove colon from table name

text: I'm using two-column article document class. Long table Name is displayed in the following format: > Table 1: table caption goes here. But I want to change in this way: > Table 1 table caption goes here on the other words, I want to remove colon (:). How can I do it? I have to say that I tried the following topic: How to remove colon(:) on longtable suffix caption and I place that code below `documentclass[a4paper]{article}` and some `\usepakage...` but it did not work out. My template is as follows:                   \documentclass[a4paper]{article}         \usepackage{graphicx}         \usepackage[cmex10]{amsmath}         \usepackage[left=2cm, right=2cm]{geometry}         \begin{document}              \title{Title}         \author{author}         \linespread{1.6}         \renewenvironment{abstract}{%           \noindent\bfseries\abstractname:\normalfont}{}              \maketitle         \begin{abstract}         \end{abstract}         \section{Introduction}              \end{document}


title: how to install/use biblatex

text: I recently decided to change from `natbib` to `biblatex`, however I'm having some trouble using `biblatex`. My bare bones document looks like this:               \documentclass[12pt,a4paper]{report}     \pagestyle{myheadings}          %\pagestyle{empty}     \usepackage{epsfig}     \usepackage{amsmath}     \usepackage{titlesec}     \usepackage{lipsum}     \usepackage{tipa}     \usepackage{hyperref}     \usepackage[backend=biber,sorting=nyt,style=apa]{biblatex}     \addbibresource{myrefs.bib}     \usepackage[english]{babel}     \usepackage{csquotes}     \usepackage[export]{adjustbox}     \usepackage[toc,page]{appendix}     \usepackage{float}     \usepackage{amssymb,amsmath}     \usepackage{graphicx}     \usepackage{listings}     \usepackage{color}          \begin{document}          \textcite{dynamicCouplingMarketInst}          \printbibliography     \end{document}      and I have replaced all citations with `\textcite` however the bibliography now does not show up at the end of the document, and the citations now just show the citation alias in bold instead of the actual details. Basic question I know, but do you have to manually install `biblatex`? I was using `natbib` fine previously. I'm on a mac, and I have BibTeX installed. I'm using Texpad as an editor and have run BibTeX after the change. **UPDATE 2** : Thanks all for your help, I have added the option of `backend=bibtext` when loading the `biblatex` package, however that caused the following two errors: > `apa.bbx - datelabel undefined` and > `thesistemplate.tex - Package biblatex Error: backend=biber required by > style (\begin{document})` and my bib engine is **now Biber**! **these errors are now gone, I deleted the`.bbl` file and cleared the biber cache and the errors disappeared, however the bibliography and citations are still not showing.** In the log, for each of my citations, it says: > `LaTeX Warning: Citation 'citation name' on page x undefined on input line > y` .BIB file:               @article{flashBoys,       title     = {Flash Boys: Cracking the money code},       author    = "Michael Lewis",       year      = "2014",       publisher = "The Penguin Group, London, England"     }          @article{cohen2012limit,       title={A limit order book model for latency arbitrage},       author={Cohen, Samuel N and Szpruch, Lukasz},       journal={Mathematics and Financial Economics},       volume={6},       number={3},       pages={211--227},       year={2012},       publisher={Springer}     }          @article{LatencyArbitrageTheRealPower,       title     = {Latency Arbitrage: The Real Power Behind Predatory High Frequency Trading},       author    = "Sal Arnuk and Joseph Saluzzi",       year      = "2009"       publisher = "Themis Trading LLC"     }          @inproceedings{wah2013latency,       title={Latency arbitrage, market fragmentation, and efficiency: a two-market model},       author={Wah, Elaine and Wellman, Michael P},       booktitle={Proceedings of the fourteenth ACM conference on Electronic commerce},       pages={855--872},       year={2013},       organization={ACM}     }          @article{colocationAdvantage,       title     = {High-Frequency Trading: The Co-Location Advantage},       url       = "https://blog.lordabbett.com/blog/2014/05/high-frequency_trading_the_co-      location_advantage.html",       author    = "Ted Oberhaus",       year      = "2014"     }          @article{programmingInMiranda,       title     = {Programming with Miranda},       author    = "Chris Clack and Colin Myers and Ellen Poon",       year      = "2011"     }               @article{dynamicCouplingMarketInst,       title     = {Dynamic Coupling and Market Instability},       author    = "Chris Clack and Elias Court and Dmitrijs Zaparanuks",       year      = "2014"     }          @article{michaelLewisWrong,         title  = {Michael Lewis Is Entirely Wrong About High Frequency Trading Hitting The Little Guy},         author = "Tim Worstall",         publisher = "Forbes"         year    = "2014",         url     = "http://www.forbes.com/sites/timworstall/2014/03/31/michael-lewis-is-entirely-wrong-about-high-frequency-trading-hitting-the-little-guy/"             }            @article{naturalGasLeak,         title  = {Natural Gas Leak},         author = "Eric Hunsader",         publisher = "Nanex",         year      = "2013",         url       = "http://www.nanex.net/aqck2/4090.html"       }          @article{marketMakerInvestopedia,         title  = {Market Maker Definition},         author = "Investopedia",         year   = "2014",         url    = "http://www.investopedia.com/terms/m/marketmaker.asp"     }          @article{greatFedRobbery,         title  = {Einstein and The Great Fed Robbery},         author = "Eric Hunsader",         year   = "2013",         url    = "http://www.nanex.net/aqck2/4436.html",         publisher = "Nanex"     }               @article{flashTrading,         title  = {Flash Trading Definition},         author = "Investopedia",         year   = "2014",         url    = "http://www.investopedia.com/terms/f/flash-trading.asp"     }               @article{brunnermeier2005predatory,       title={Predatory trading},       author={Brunnermeier, Markus K and Pedersen, Lasse Heje},       journal={The Journal of Finance},       volume={60},       number={4},       pages={1825--1863},       year={2005},       publisher={Wiley Online Library}     }


title: Custom \def command that appends to the newly defined command

text: I have several macros with a similar structure, for example:               \def\firstmacro#1{\myinitializer ...actual code... \myfinalizer}     \def\secondmacro#1{\myinitializer ...actual code... \myfinalizer}     \def\thirdmacro#1{\myinitializer ...actual code... \myfinalizer}      (`\myinitializer` and `\myfinalizer` are only placeholders for more complicated initializer code.) I was thinking how I could simplify this common structure by defining a custom `\def` macro. I arrived at               \def\custom@def#1{       \def#1{\myinitializer\csname custom@#1\endcsname}       \expandafter\def\csname custom@#1\endcsname     }          \custom@def\firstmacro#1{...actual code... \myfinalizer}     \custom@def\secondmacro#1{...actual code... \myfinalizer}     \custom@def\thirdmacro#1{...actual code... \myfinalizer}      So `\custom@def` defines the wanted command to call `\myinitializer` and pass to an internal command that contains the actual definition. Everything after the first argument of `\def` is passed to the `\def` of that internal macro. However, with this approach, `\myfinalizer` still needs to be specified explicitly. Any idea how I could eliminiate this?


title: Learning LaTeX3

text: In my attempt to venture in the realm of LaTeX3 coding, I was wondering if a list of answers, in LaTeX3, can be made? That is, a list of links to answer in which users here at TeX.SX have used such coding. This will enable me to look at this post and look at samples instead of searching for examples everywhere on the website.


title: Spacing of brackets with unicode-math

text: Consider this example:               \documentclass{article}     \usepackage{unicode-math}          \setmainfont{Linux Libertine O}     \setmathfont{XITS Math}     \setmathfont[range=\mathit/{latin,Latin,greek,Greek,num}]{Linux Libertine O Italic}          \begin{document}     \textit{f}(\textit{q})     $f(q_i,p_i,t)     \left[ \int df \right]$     \end{document}      This uses _Linux Libertine_ for many math characters, but the brackets are still taken from _XITS Math_ and therefore the spacing is bad (the 'f' collides with the bracket). How can I use the brackets from _Linux Libertine_ in math mode? Additionally, is it possible to get the brackets that adjust to their content (like '\right]') from _Linux Libertine_ as well? Edit: To clarify, the example shows that the spacing is correct in textmode, but fails in mathmode. I wonder why this is the case and how it may be fixed.


title: Beamer color overlay in equation environment

text: I want to use this overly command               <2->\alert<2>      inside an equation environment to color some terms. How can I do this?


title: How to convince fancyvrb to give overfull warnings?

text: The following document               \documentclass{article}     \usepackage{fancyvrb}     \begin{document}     \hsize=1cm     \begin{Verbatim}     foo bar foo bar foo bar foo bar foo bar     \end{Verbatim}     \end{document}      does _not_ give a warning. But I _do_ want to see when something is bigger than it is supposed to be. What can I do? (The Verbatim environment is produced by pygmentize, so I'd prefer a solution that does not involve changing it.)


title: How to obtain PlainTeX in LaTeX environment?

text: In _The TeXbook_ it is written that `\char13` is `<return>` and `\char32` is space. But when I use this symbols I receive `fl` ligature for `\char13` and something like hyphen for `\char32`. What do I do wrong? upd: I expected that if I typed `Hello\char13\char13{}there` I'll receive the two delimited paragraphs. I thought that \char13 could be replacement for the real `0x0D` carriage return symbol in TeX file.


title: pdf objext/destinations/memory limits

text: At the end of the log file of the compilation run of a larger document I get               Output written on <\jobname>.pdf ( <a lot of> pages, <a lot of> bytes).     PDF statistics:      14055 PDF objects out of 15390 (max. 8388607)      3115 named destinations out of 3580 (max. 131072)      5096 words of extra memory for PDF output out of 10000 (max. 10000000)      What happens when the "out of" numbers are reached? What happens when the "max." numbers are reached? There seems to be a difference. (Why else two different numbers?) eTeX is not contained in my TeX distribution, there is no newer version of the distribution (yet), and the eTeX package can neither be used without eTeX. **EDIT** : I compiled               \documentclass{article}     \begin{document}     x     \end{document}      and got               PDF statistics:      12 PDF objects out of 1000 (max. 8388607)      0 named destinations out of 1000 (max. 131072)      1 words of extra memory for PDF output out of 10000 (max. 10000000)      and when compiling the recent version of the larger document, which triggered my question in the first place, I got               PDF statistics:      20057 PDF objects out of 22161 (max. 8388607)      5013 named destinations out of 5155 (max. 131072)      91295 words of extra memory for PDF output out of 106986 (max. 10000000)      i.e. the numbers before "max." have just been increased by TeX as needed, as was explained in the answer of Lev Bishop, which therefore is confirmed. Compilation with TeX Live 2011 even resulted in               named destinations max. 500000 instead of only 131072.


title: How can I use the algorithm package with the memoir class

text: Currently there are no compilation issues. However, `\listofalgorithms` does not work. Additionally, my algorithms are missing titles. This is the most important thing for me. How can I get the algorithm titles to appear when I am using algorithms with `memoir`?


title: Looking for HAML and CoffeeScript support

text: I need support for HAML and CoffeeScript like other languages already got with the `listings` package. Do you know any solutions?


title: Can the vspace below a list environment be decoupled from the one above?

text: Can the vspace below a `list` environment be decoupled from the one above? Specifically, when I start a theorem with an `enumerate`, I still would like to have `\topsep` placed between the `enumerate` and any text following (within the theorem), but it looks like I have to insert `\vspace{\topsep}` by hand to achieve this. I wouldn't mind inserting it by hand in my own documents, but I'm in charge of a group of editors, so it would be much better if I could solve the problem in the class file that I provide for them.


title: beamer with notes displayed while giving a presentation

text: What are people currently using to have notes available while giving a presentation? This post shows how to have a notes section for taking notes (audience oriented). I guess the presenter could also have a copy and with their notes written in on what they would like to say. However, that's manual writing. I'm also aware of the \note feature of Beamer (see this) where you can generate slides of notes. However, to make it useful, I have to have \note section after each slide, including the title slide, in order to print say 6 slides per page (3 main slides on left, 3 notes slide on right), or something like that. I'm curious on what other people are using for notes. Thanks! Anyone using dual screen, where the main screen shows the presentation, and where the second screen shows the presentation and notes? It is outlined here but I'm not sure how to follow.


title: Add equations to text

text: I've got a really simple question. I'd like to write a mathematical proof in LaTeX, so my document will contain both text and formulae embedded in it. For example, I want to add this to it: ![enter image description here](http://i.stack.imgur.com/2Sfqh.png) How can I write this efficiently, without putting the entire text into an `\mbox{}` element?


title: How to draw stack diagram with TiKz?

text: I want to draw a stack diagram looks like this with TiKZ. ![enter image description here](http://i.stack.imgur.com/CQjpg.png) I wonder is there way to draw this diagram with automatic positioning like drawing Automaton? Any idea? Thanks in advance.


title: subfig Caption Number is 1a, How to Modify it to 1(a)?

text: In the following document, the sentence `in Figure \ref{fig:loop}` in the source produces `in Figure 1a` in the output, but I want it to be `in Figure 1(a)`. How do I achieve my goal?                   \documentclass[conference]{IEEEtran}              \usepackage[demo]{graphicx} % demo is just for this example, remove it         \usepackage{subcaption}         \usepackage{caption}         \usepackage{subfig}         \begin{document}              \title{0000}                   \maketitle         \begin{abstract}         X         \end{abstract}              \IEEEpeerreviewmaketitle              \section{0000}              \begin{figure}         \centering         \subfloat[]{\includegraphics[width=.5\linewidth]{pic/loop.png}\label{fig:loop}} \hfill         \subfloat[]{\includegraphics[width=.3\linewidth]{pic/twopath.png}\label{fig:twopath}}         \caption{xx}         \label{fig:routing}         \end{figure}              in Figure \ref{fig:loop}, we have xx              \end{document}


title: Avoid a weird error with ltablex

text: I'd like to have an table over many pages with the same headline. I use the `tabularx` package, and the `ltablex` is required according to link. However if I use `ltablex` I get sticky errors `! LaTeX Error: There's no line here to end.` Any idea how to solve it? A minimal example follows.               \documentclass[11pt]{article}     \usepackage{booktabs}     \usepackage{tabularx} % for tables http://www.lapomori.com/     %\usepackage{ltablex}      \begin{document}          \begin{table}     \caption{Example of an table}     \label{tab:daypack}          \begin{tabularx}{\linewidth}{@{}cX@{}}       \toprule     \textbf{Column 1} & \textbf{Column 2} \\[6pt]     \midrule     %\endhead     $R$ & 1This is an example sentence \\[6pt]     $R$ & 2As well as the line before \\[6pt]     $A$ & 3Also this is an example \\[6pt]     $R$ & 4This is an example sentence \\[6pt]     $R$ & 5As well as the line before \\[6pt]     $A$ & 6Also this is an example \\[6pt]     $R$ & 7This is an example sentence \\[6pt]     $R$ & 8As well as the line before \\[6pt]     $A$ & 9Also this is an example \\[6pt]     $R$ & 10This is an example sentence \\[6pt]     $R$ & 11As well as the line before \\[6pt]     $A$ & 12Also this is an example \\[6pt]     $R$ & 13This is an example sentence \\[6pt]     $R$ & 14As well as the line before \\[6pt]     $A$ & 15Also this is an example \\[6pt]     $R$ & 16This is an example sentence \\[6pt]     $R$ & 17As well as the line before \\[6pt]     $A$ & 18Also this is an example \\[6pt]     $R$ & 19This is an example sentence \\[6pt]     $R$ & 20As well as the line before \\[6pt]     $A$ & 21Also this is an example \\[6pt]     $R$ & 22This is an example sentence \\[6pt]     $R$ & 23As well as the line before \\[6pt]     $A$ & 24Also this is an example \\[6pt]     $R$ & 25This is an example sentence \\[6pt]     $R$ & 26As well as the line before \\[6pt]     $A$ & 27Also this is an example \\[6pt]     $R$ & 28This is an example sentence \\[6pt]     $R$ & 29As well as the line before \\[6pt]     $A$ & 30Also this is an example \\[6pt]     $R$ & 31This is an example sentence \\[6pt]     $R$ & 32As well as the line before \\[6pt]     $A$ & 33Also this is an example \\[6pt]     $R$ & 34This is an example sentence \\[6pt]     $R$ & 35As well as the line before \\[6pt]     $A$ & 36Also this is an example \\[6pt]     $R$ & 37This is an example sentence \\[6pt]     \bottomrule     \end{tabularx} \\        \end{table}               \end{document}


title: Suppress symbol in nomenclature after first use

text: I have a probably strange requirement. Normally in `nomenclature` using `glossaries` package, the symbol is the only thing printed after the first use onwards, but i need the opposite. After first use onwards, only the symbol definition should be printed, not the symbol. Example: I have defined the following nomenclature               \newacronym[user1={--}]{a}{\textit{a}}{lattice constant}      now when I use it like `\gls{a}`, it expands like `lattice constant (a)` in the first use and after the first use onwards, it only prints `a`. I want opposite. I want `lattice constant` to be printed after first use onwards and suppress `a`. Because these symbols are used in equations and in the text, I need to say what the symbol is (yes, I have a separate list of Nomenclatures, but I need to explain the symbol once in the text). Now, occasionally, I have to use same symbol for different variables, so to use the symbol in text like the usual nomenclature creates confusion, so I need to use the full form. Is it possible? MWE               \documentclass[12pt,a4paper]{report}          \usepackage{hyperref}     \hypersetup{         bookmarks=true,         % show bookmarks bar?         unicode=false,          % non-Latin characters in Acrobat’s bookmarks         pdftoolbar=true,        % show Acrobat’s toolbar?         pdfmenubar=true,        % show Acrobat’s menu?         pdffitwindow=false,     % window fit to page when opened         pdfstartview={FitH},    % fits the width of the page to the window         pdftitle={My title},    % title         pdfauthor={Author},     % author         pdfsubject={Subject},   % subject of the document         pdfcreator={Creator},   % creator of the document         pdfproducer={Producer}, % producer of the document         pdfkeywords={keyword1} {key2} {key3}, % list of keywords         pdfnewwindow=true,      % links in new window         colorlinks=true,       % false: boxed links; true: colored links         linkcolor=red,          % color of internal links         citecolor=blue,        % color of links to bibliography         filecolor=magenta,      % color of file links         urlcolor=cyan,           % color of external links         anchorcolor=green     }               \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage[english]{babel}     \usepackage[round]{natbib}                    %glossaries and acronym     \usepackage[acronym,xindy,sort=def,toc,numberline,indexonlyfirst,nomain]{glossaries} %nomain, if you define glossaries in a file, and you use \include{INP-00-glossary}                         \newglossary[nlg]{nomenc}{not}{ntn}{Nomenclature}     \newglossary[slg]{abbrev}{sot}{stn}{Abbreviations}                    %custom glossary style     \newglossarystyle{long6col}{%     % put the glossary in a longtable environment:     \renewenvironment{theglossary}%     {\begin{longtable}{lp{\glsdescwidth}cccp{\glspagelistwidth}}}%     {\end{longtable}}%     % Set the table’s header:     \renewcommand     *     {\glossaryheader}{%     \bfseries Symbol & \bfseries Description & &     \bfseries Units & & \bfseries Page List     \\\endhead}%     % No heading between groups:     \renewcommand     *     {\glsgroupheading}[1]{}%     % Main (level 0) entries displayed in a row optionally numbered:     \renewcommand     *     {\glossaryentryfield}[5]{%     \glsentryitem{##1}% Entry number if required     \glstarget{##1}{##2}% Name     & ##3% Description     & ##4% Symbol     & \glsentryuseri{##1}% Units     & \glsentryuserii{##1}% Dimensions     & ##5% Page list     \\% end of row     }%     % Similarly for sub-entries (no sub-entry numbers):     \renewcommand     *     {\glossarysubentryfield}[6]{%     % ignoring first argument (sub-level)     \glstarget{##2}{##3}% Name     & ##4% Description     & ##5% Symbol     & \glsentryuseri{##2}% Units     & \glsentryuserii{##2}% Dimensions     & ##6% Page list     \\% end of row     }%     % Nothing between groups:     \renewcommand     *     {\glsgroupskip}{}%     }     %END: custom glossary style                    %custom glossary1 style     \newglossarystyle{long6col1}{%     % put the glossary in a longtable environment:     \renewenvironment{theglossary}%     {\begin{longtable}{lp{\glsdescwidth}cccp{\glspagelistwidth}}}%     {\end{longtable}}%     % Set the table’s header:     \renewcommand     *     {\glossaryheader}{%     \bfseries Term & \bfseries Description & &      & & \bfseries Page List     \\\endhead}%     % No heading between groups:     \renewcommand     *     {\glsgroupheading}[1]{}%     % Main (level 0) entries displayed in a row optionally numbered:     \renewcommand     *     {\glossaryentryfield}[5]{%     \glsentryitem{##1}% Entry number if required     \glstarget{##1}{##2}% Name     & ##3% Description     & ##4% Symbol     & \glsentryuseri{##1}% Units     & \glsentryuserii{##1}% Dimensions     & ##5% Page list     \\% end of row     }%     % Similarly for sub-entries (no sub-entry numbers):     \renewcommand     *     {\glossarysubentryfield}[6]{%     % ignoring first argument (sub-level)     \glstarget{##2}{##3}% Name     & ##4% Description     & ##5% Symbol     & \glsentryuseri{##2}% Units     & \glsentryuserii{##2}% Dimensions     & ##6% Page list     \\% end of row     }%     % Nothing between groups:     \renewcommand     *     {\glsgroupskip}{}%     }          %          \let\oldgls\gls     \renewcommand{\gls}[1]{%       \ifglsused{#1}%         {\glsentrylong{#1}}%         {\oldgls{#1}}%     }               %END: custom glossary style               \renewcommand*{\glspostdescription}{}%removes dot at end     \glssetwidest{AAAAAAA}% widest name     \renewcommand*{\glsnamefont}[1]{\textmd{#1}}                    \makeglossaries          %\loadglsentries[nomenc]{INP-00-glossary}     \let\oldacronymtype\acronymtype     \def\acronymtype{nomenc}     \loadglsentries[nomenc]{INP-00-glossary}     \let\acronymtype\oldacronymtype          \loadglsentries[abbrev]{INP-01-glossary}                         \begin{document}               \printglossary[style=long6col,type=nomenc]     \newpage     \printglossary[style=long6col1,type=abbrev]     \newpage          The first use of glossary \gls{MC}.          The second use of glossary \gls{MC}.          The first use of nomenclature \gls{a}.          The second use of nomenclature \gls{a}.     \end{document}      Nomenclatures are defined in file `INP-00-glossary`               \newacronym[user1={$\AA$}]{a}{\textit{a}}{lattice constant}      Abbreviations are defined in file `INP-01-glossary`               \newglossaryentry{MC}     {       name={MC},       description={Monte Carlo},       first={\glsentrydesc{MC} (\glsentrytext{MC})}     }      **Further Request:** The features like 3) to 7) would be great addition. The picture is used only to describe the new request. The further request is extension of previous feature (i.e., only print definition, not symbol, after second use onwards, only for Nomenclature, not for Glossary) . ![enter image description here](http://i.stack.imgur.com/EZ2fi.png)               1) The first use of nomenclature \gls{a}.          2) The second use of nomenclature \gls{a}.          3) The third use of nomenclature, plural \glspl{a}.          4) The fourth use of nomenclature, uppercase \GLS{a}.          5) The fifth use of nomenclature, reset definition \glsreset{a}\gls{a}.          6) The sixth use of nomenclature, first letter capital  \glsreset{a}\Gls{a}.          7) The seventh use of nomenclature, all capital letters \glsreset{a}\GLS{a}.


title: How to store the document's style file in a subdirectory?

text: I have a journal specific document style as two files `svglov3.clo` and `svjour3.cls`. I don't want to install them, so I keep them in the article's current directory. But I like to keep only the files that I can edit in the current directory. So I would prefer to put them in a sub-directory `./SVJour3` and use               \documentclass{SVJour3/svjour3}      This would actually work, but `svjour3.cls` has this command `\input{svglov3.clo}`. So I can put `svjour3.cls` in a separate dir, but I have to keep `svglov3.clo` in current dir. Is there a workaround for this? Some variable that I can set in a Makefile?


title: Proof package: lines too short

text: The `proof` package's `\infer` command automatically sizes the lines it draws. However, it isn't always right (pdflatex output): > ![enter image description here](http://i.stack.imgur.com/sDipB.png) The line is too short on the left. Is this a package bug/inaccuracy, or am I doing something wrong? Here is the code (MWE made) that produced the document above:               \documentclass{article}     %     \usepackage{proof}     %     \begin{document}     \[      \infer{\bot}{        \infer{P}{          \infer{P \vee P}{            P \vee Q            \quad            P \vee \neg Q          }        }       \qquad       \infer{\neg P}{        \infer{\neg P \vee \neg P}{          \neg P \vee Q          \quad          \neg P \vee \neg Q        }       }      }     \]     \end{document}


title: LaTeX packages for use with revision control

text: I use revision control (Subversion, to be exact) to keep track of the edits to my LaTeX documents. Is there a LaTeX package that interfaces with revision control? Specifically, it would be nice to see the revision number and time and date inside the document. (Obviously, I'd turn this off in the final version.) Also, it might be nice to get a PDF showing what was added and removed in a given revision.


title: Draw plots with tikz

text: I would like to do the following graphic in tikz. But I do not konw how to proceed... ![enter image description here](http://i.stack.imgur.com/pjyJr.png) How could I do that? **EDIT** So far, I have tried simpler things (before getting to this bigger problem). I have tried this for example, but I know that there are certain elements that I do not handle in the right way (like the $\times$ to do crosses...).               \begin{tikzpicture}     \foreach \x in {1,2,3,4} {         \foreach \y in {1,2,3,4} {             \path[draw, thin, dotted] (\x,\y) -- (\x,\y+1);             \path[draw, thin, dotted] (\x,\y) -- (\x+1,\y);         }     }     \path[draw, thick] (1,1) rectangle (5,5);               \node  at  (2.1,3.1) {$\times$};               \node  at  (3,0.5) {$X_1$};     \node  at  (0.5,3) {$X_2$};     \end{tikzpicture}


title: pdflatex does not overwrite existing PDF files upon compilation when using TikZ external

text: I have a LaTeX/`pgf`/TikZ file that I'm trying to compile. I included the library `external` so that I could export the file. However, the problem is that `\tikzexternalize` apparently doesn't have a command to overwrite existing files from previous compilations. So, my compiled things only get saved if I delete the originals first. That's really tedious, and not normal TeX behavior anyway. How do I get it to overwrite them automatically?


title: What are the most attractive themes in beamer?

text: I am preparing a presentation in Latex Beamer class. Previously I had used the themes Antibes, Berkeley, Warsaw and Progressbar. I want to try something different now. So, what are the best themes that I can use ?


title: List of symbols/abbreviations and macros

text: It's on my task list for a while now, and this post made me ask a follow up question which is, in my mind, a missing part when setting such a list. As an example, think of the standard notation of an n-dim space; I would use the following code to typeset it: `\mathbb{R}^n`. Then, in order to make things quicker, I would define a macro `\newcommand*{\Rn}{\mathbb{R}^n}`. So far so good. Now, I want to have a list of symbols as well. In short, the question is: _what is the best practice to generate a list of symbols for complicated symbols?_ Let me consider the `nomencl` package, but I think the question is valid when one is using other alternatives as well. Currently, I have a file where I define all the macros I am using in my document, similar to the one I gave as an example above. Then, in order to generate a list's entry I would add               \nomenclature{$\mathbb{R}^n$}{$n$-dimensonal real space}      where I use my macro `\Rn` for the first time. Is this the right/best way to go? One big drawback here is that when I would like to change the notation in the future, I will have to do it in two different places. Is there a smarter way to go? Somehow unify the two tasks of generating a list's entry and a macro which will be used in order to typeset the symbol later?


title: Input a figure between title and body in twocolumn form

text: I'm using a LaTeX to write a small paper using CVPR template. I'd like to put a figure between my title+name and body(which consists with two columns) like many CVPR papers do, but I don't find the way to do that. I tried:               \begin{figure*}     \begin{center}     \fbox{\rule{0pt}{2in} \rule{.9\linewidth}{0pt}}     \end{center}        \caption{some caption..}     \label{fig:short}     \end{figure*}      But it turned out figure-star only displays it's figure at the top of _next_ page, and when I just use figure like `\begin{figure}[htb]`, it's only located one of those two columns. Does anyone know how to put a long figure between my title+name and body context?


title: Use displaymath shorthand \[ \] for align and other amsmath environments

text: This question is closely related to this one: Using the displaymath shorthand \[ \] for equation or align instead. I use Multimarkdown (MMD) to generate my LaTeX documents. MMD uses the escape character set `\\\\[` and `\\\\]` to create displaymath shorthand `\\[` and `\\]` in LaTeX. I'd like to re-assign `\\[` and `\\]` to `\begin{align}` and `\end{align}`. The previous question had a solution for other environments (e.g., `equation`), but I would like to use the `align` environment. According to the amsmath technical notes, it's impossible to create abbreviations for its math environments. Does anyone know a work-around? I have tried               \renewenvironment{displaymath}{\align}{\endalign}      but this doesn't seem to work.


title: Tikz Pattern lines are not exactly straight

text: I do have a short problem with Tikz               \documentclass{article}     \usepackage{pgf,tikz}     \usetikzlibrary{patterns}     \begin{document}     \begin{tikzpicture}     \fill[pattern=north east lines] (0,0) -- (0,1) -- (1,1) -- (1,0) -- cycle;     \end{tikzpicture}     \end{document}      I simply want to fill differently shaped areas with north east lines. Which is done as is it's supposed to be. But the problem i can not figure out is why they are not exactly straight. Certainly nobody would notice in print but in the pdf it just looks distorted. Is there a way to improve this?


title: Shared line counter with \lstinputlisting

text: Using the `listings` package, you can name your listings to make them share a line counter: > On the other hand you can use firstnumber=auto and name your listings. > Listings with identical names (case sensitive!) share a line counter. However, this only seems to work when the `lstlisting` environment is used, not when using `\lstinputlisting`. After a closer examination of the manual, this seems to be documented: > `name=<name>` > > names a listing. Displayed **environment-listings** with the same name share > a line counter if firstnumber=auto is in effect. I was wondering if anyone knows some kind of "trick" to share line counters across `\lstinputlisting`s. Here is a MWE to demonstrate the issue:               \documentclass{article}     \usepackage{listings}     \lstset{numbers=left,firstnumber=auto}          \begin{document}     \begin{lstlisting}[name=bar]     ...     \end{lstlisting}     \begin{lstlisting}[name=bar] %first line number is the last of previous listing + 1     ...     \end{lstlisting}     \lstinputlisting[name=foo]{foo.c}     \lstinputlisting[name=foo]{foo.c} %first line number is 1     \end{document}


title: How to remove top and bottom whitespace of longtable?

text: I am using `longtable` instead of `tabular` environment and noticed that it puts some additional whitespace at the top and at the bottom of the table. Is there some way to remove it (something less hacky than `\vskip -\baselineskip` before the table)? Small piece of code for illustration:               \documentclass[12pt]{book}     \usepackage{longtable}          \begin{document}          Linelineline          \begin{longtable}{l l} cell1 & cell2 \end{longtable}          Linelineline          \begin{tabular}{l l} cell1 & cell2 \end{tabular}          Linelineline          \end{document}      And that's what I am getting: ![tables](http://i.stack.imgur.com/DA2vc.png) Common `tabular` environment does not have any additional margins, but `longtable` does.


title: What is the ConTeXt or plain TeX equivalent of \nolinebreak?

text: The command `\nolinebreak[4]`, if placed between two characters, should prevent a line break from appearing in that location. This command does not seem to be defined in ConTeXt. Is there an equivalent for this in ConTeXt, or for plain TeX which is also compatible with ConTeXt?


title: Large Objects Within Stackrel

text: Is there a possible way to create large objects inside of `stackrel`? This is how I tried to do it, but it gave many errors.               \( \stackrel{\large Paragraph}{1} \)      With a `LARGE` 1 as well.


title: Choosing what to \ref from a \newcommand

text: I have this definition in my class (thanks to this answer):               \newcommand\clause{%     \immediate\write\@auxout{\string\expandafter\gdef\noexpand\csname B@\the\c@subsection\string\endcsname{\the\c@paragraph}}%     ...     \def\thesubsection{Cláusula \arabic{subsection}ª.}      That I use as kind of special subsection in my context (clauses of a contract). I found that if I do the following:               \clause \label{conditions} Some conditions and obligations here.          \clause Acording to \ref{conditions} bla bla bla.      I will get the `\ref{conditions}` command replaced by the full text "Cláusula 3ª." (or whatever the number happens to be), instead only getting the clause number, as I am used to with other stock classes. How can I modify these definitions to get only the clause number when referencing to it?


title: Creating a postcard with LaTeX

text: I want to create a postcard with LaTeX, say 3x5 or 4x6 in. I use LaTeX for many things, but up to now I've used MS Word for postcards. Now I'd like to do more interesting things with postcards that would leverage LaTeX's capabilities. Where should I start? Is there already a package, or a simple setting, that will do the trick?


title: Oversized (A4 height, but much wider) pages in A4 document - header / footer alignment needs to be changed

text: I have to include a large graphic in a A4 document, the figure fits into an A4 height, but is much wider. I used `\pdfpagewidth=3.1\pdfpagewidth` to increase the paper size, and included the figure. I use `srcbook`(one-sided) with the header and footer aligned to the right. The problem with the oversized page is, that the header and footer are not moved to the final right end. Finally, the oversized page gets folded so that it fits in the printed thesis in A4, I want the header and footer on the page that you finally see when you open the book. That is how I did it so far:               % Example to show oversized page with figure          \documentclass[fontsize=12pt,DIV14,BCOR15mm,oneside, headings=small,headsepline, appendixprefix]{scrbook}          \usepackage{graphicx}       % Package for Pictures     \usepackage[bf,footnotesize,width=.9\textwidth,format=hang]{caption}              % Oneside option puts header and footer in centered alignment, this changes to right alignment     \usepackage{scrpage2}     \pagestyle{scrheadings}     \clearscrheadfoot     \ofoot[\pagemark]{\pagemark}     \ohead{\headmark}               \begin{document}          \chapter{Literature Review - Experimental Work}           A bit of text ….     \newpage     A bit of text again, just to show the header and footer on the usual A4 pages.          \newpage     \begingroup     \pdfpagewidth=3.1\pdfpagewidth     \begin{figure}[p]     \centering     {\includegraphics[height=227mm]{HistoricalOverview.pdf}}     \caption{Historical Overview}     \end{figure}     \clearpage     \endgroup          \end{document}      That is the output with the header and footer at the wrong horizontal position: ![Output](http://i.stack.imgur.com/CZVlN.png) How can I change the horizontal alignment of my header / footer? I had a look to `\changepage` and to Insert A3 page with figure into A4 document with active references but I don't get it working. Any advice helps, thanks. Gerlind


title: How can I center the caption above the table in "elsart" document class?

text: I am preparing a paper for Elsevier, then I used `elsart` document class. Tables are centered, but their captions are not centered. How can I solve this problem? This is my code:               \documentclass{elsart}         \usepackage{multirow}         \usepackage{rotating}          \begin{document}         \begin{table}[h!]         \caption{....}         \centering          \scalebox{1.5}{          \begin{tabular}{cc|c|c|c|c|c|c|c|l}          ...          ...          ...          \end{tabular}}         \label{tab:tab1}         \end{table}          \end{document}      I'll be glad if someone help me.


title: PGF loop variables in string comparisons

text: In a bigger context, I need to check whether an integer parameter is contained in a set of numbers. I decided to encode sets as strings; elements are separated by `!`. I don't know whether this is the best way to do this, but a curious thing happens:               \documentclass{article}     \usepackage{pgffor,xifthen}          \newcommand{\ifin}[1]{       \ifthenelse{\isin{!#1!}{!1!3!}}{T}{F}%     }          \begin{document}     \ifin{1}\ifin{2}\ifin{3}\ifin{4}          \foreach \n in {1,...,4} {%       \ifin{\n}%     }     \end{document}      The expected output is               TFTF     TFTF      but the actual output is               TFTF     FFFF      Note that `pdflatex` does not report any errors or warnings. I suspect that this is a more general issue (`\isin` checks whether strings are substrings of other strings; it probably fails because the parameter is a number) but I can not find material on this. How can I achieve the desired behaviour?


title: Force "axis on top" for plotmarks in pgfplots

text: The pgfplots manual says that `axis on top=true` won't affect the plot if using plotmarks as this usually doesn't make sense, which I agree with. However, in this case I'd prefer both the axis and tick labels to be on top of the plot marks; is there any way to force this, or any workaround available? At the moment, my output becomes as in the attached figure, ![enter image description here](http://i.stack.imgur.com/uxlS8.png) using the following options               \begin{axis}[%     axis on top=true,     view={0}{90},     axis y line = center,     axis x line = center,     xmin=-2,xmax=2,     ymin=-2,ymax=2,     xtick={-2,-1.5,-1,-0.5,0,0.5,1,1.5,2},     xticklabels={$-2c$,$-1.5c$,$-c$,$-0.5c$,$0$,$0.5c$,$c$,$1.5c$,$2c$},     ytick={-2,-1.5,-1,-0.5,0,0.5,1,1.5,2},     yticklabels={$-2d$,$-1.5d$,$-d$,$-0.5d$,$0$,$0.5d$,$d$,$1.5d$,$2d$},     width=4in,     height=3in,     scale only axis,     xlabel={$\phi_1$},     ylabel={$\phi_2$}]      Code for MWE:               \documentclass[12pt]{standalone}          \usepackage{amsmath}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}          \begin{document}          \input{sn2.tikz}          \end{document}      sn2.tikz can be found in the link below Link to sn2.tikz: sn2.tikz


title: How to erase/delete a counter

text: I was wondering how does TeX manage counters. In particular, assuming I define a new counter in TeX by `\newcount\mycounter` and at some point I don't need it anymore, can I delete it and free the associated registry? This may be useful when one needs to use a sequence of counters `\c1`, `\c2`, ..., `\c<n>` where _n_ may become large, and at some point there is no need for some of the counters in the sequence (say, up to some index).


title: Using Greek letters in LaTeX tables

text: I have the following Rnw document which I intend should produce a small table with "a b c" and "α β γ". At the moment, the encoding seems to be causing problems. The funny thing is that the output in the pdf is different to that in the R console. The following example doesn't throw any errors, but doesn't have the Greek letters I want:               \documentclass{article}          \begin{document}     <<makegreek>>=     greek <- c("\U03B1", "\U03B2", "\U03B3")     greek     @          <<r grecoroman>>=     gr <- data.frame(roman=letters[1:3], greek=greek)     gr     @          <<gr-table, results='asis'>>=     library(xtable)     print(xtable(gr))     @          \end{document}      ![All Greek to me](http://i.stack.imgur.com/hTdPN.png) I also tried adding the line: `\usepackage[utf8]{inputenc}` to my preamble, but that simply throws an error: `Package inputenc Error: Unicode char \u8:? not set up for use with LaTeX.`


title: Problem with the block with the word wrap in algorithmicx

text: For a good word wrap, I use this code in algorithmicx:               \parbox[t]{\dimexpr\linewidth-\algorithmicindent}{<text>\strut}      But when the code contains several nested structure leaves a block of code. How to fix it?               \documentclass{article}          \usepackage{algorithm}      \usepackage{algpseudocode}          \begin{document}          \begin{algorithm}       \caption{Examples}\label{alg:Examples}       \begin{algorithmic}       \While{$Y<5$}            \If{$quality\ge 9$}       \State \parbox[t]{\dimexpr\linewidth-\algorithmicindent}{bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla \strut}       \EndIf            \EndWhile       \end{algorithmic}     \end{algorithm}          \end{document}      ![a busy cat](http://harrix.org/2013-04-24_013858.png)


title: Starting a line where the previous line finishes

text: I have been using LaTeX for standard things like letters and scientific reports. I recently came to visit my grandmother who writes some poetry and told her I could make a nice pdf from her handwritten verses -- which I start to regret :P... I used the package verse and it is going all right, but in some specific poems, she wants a very 'exotic' kind of positioning. She wants some **lines to start exactly where the former line finishes** like in this example: ![verse](http://i.stack.imgur.com/wjrFT.png) Do you know how I could, for instance, write a magic command `\magicom{}` that would generate the text above when used like:               This is some\\     \magicom{}text I would\\     like to\\     \magicom{}format\\     How can I do this with\\     \magicom{}LaTeX?


title: How to set a first draft date and a current draft date?

text: I want to insert two dates into my article class TeX file: first draft date and current draft date, how can I achieve that? In most examples that I see in pdf form, it centers on the page the following:               First Draft: Date     Current Draft: Date


title: comment in algorithmic on a line beginning with if

text: I'm working with `algorithmic` to create some pseudo-code with comments. With a macro found on this site (see header), comments will be aligned on the right, which is wonderful. However, I don't get it how to have a comment on a line beginning with `\IF`. Below is a SSCCE, that shows a workaround.               \documentclass{report}     \usepackage{algorithm}     \usepackage{algorithmic}     \usepackage{array}     \usepackage{eqparbox}     \renewcommand\algorithmiccomment[1]{%       \hfill\#\ \eqparbox{COMMENT}{#1}%     }          \begin{document}       \begin{algorithm}[h]         \begin{algorithmic}[1]           \STATE $math$ \COMMENT{comment 1}           \IF{$moremath$}             \STATE \COMMENT{comment 2 one line up please}             \STATE $lastmath$           \ENDIF         \end{algorithmic}       \end{algorithm}     \end{document}      This modification does not work, pdflatex chokes up on `\STATE $lastmath$`.                 \begin{algorithm}[h]         \begin{algorithmic}[1]           \STATE $math$ \COMMENT{comment 1}           \IF{$moremath$} \COMMENT{comment 2 on line 2 please} %\STATE removed, won't work!             \STATE $lastmath$           \ENDIF         \end{algorithmic}       \end{algorithm}      I use `pdflatex`. How can I modify my code to have the comments in line 1 and 2, rather than having comment 2 on a separate line (workaround)?


title: Superscript citations with letters to denominate different pages

text: I've been using natbib in my thesis with the 'author year' citation style. By far the most common way of doing citations in my field of study is superscript, so I want to change to natbib's super option. I've used the functionality in natbib that allows page numbers to be added to a citation: `\citep[p. 104]{Eamon1994}` gives [Eamon, 1994, p. 104]. However, when I switch to `[super]{natbib}` This results in texttexttext1 p. 104. What I would like is to have something like this: texttexttext1a, and then have the different letters in the bibliography with the page numbers (or intervals) they represent: > William Eamon. _Science and the Secrets of Nature_. Princeton University > Press, Princeton, New Jersey, 1994. a: p. 104, b: p. 189, c: p. 254-261. I've seen one solution to this in the Superscript page numbers with natbib thread. Jan gave an answer that works if you write `\cite[a]{Eamon1994}`, which produces this1a, but you have to manually write every letter and page number into the BibTeX entry. Is there any way of doing this automatically? I still only have 20-30 entries in my bibliography, so if this is something that can be done in `biblatex` I would be interested to know.


title: Disappearing text in pdf image?

text: I want to insert a pdf image of a graph into a LaTeX document and rotate it by 90 degrees. The image is below: ![The graph I'm trying to insert](http://i.stack.imgur.com/wwVIF.jpg) To do this, I'm using the following code:               \begin{figure}[t]          \includegraphics[width=1.0\textwidth, angle=90]{z.pdf}          \caption{Test}          \end{figure}      However, when the image appears in the document, for some reason all of the text is removed, as this image shows: ![enter image description here](http://i.stack.imgur.com/V6xVF.jpg) How can I prevent this from happening?


title: Auto-hide Winedt Console

text: Is there anyway to make Winedt console invisible when you are writing the code, and when the compile starts the console shows the log and then disappears by itself? Also if there is an error it stays visible until the error is resolved? I change the setting for pdflatex, but I am using windows console instead of winedt console. It works as I described above, except that you don't see anything if there is no error. This gives you an impression that it winedt freezes or taking more than normal as you don't see any activity when you start the compile. Here is a snapshot of the pdflatex setting: ![enter image description here](http://i.stack.imgur.com/Ep2vm.jpg) I am wondering if there is anyway to make the compilation more like TeXStudio which just shows a just the compile command in the console, unless there is an error? EDIT: It is funny! This is the issue: Let's say we have a paragraph with the word "research" in it. Put a \ before the word research and compile. If you have this setting that has --quiet option and is pretty what I want (fast compilation without lot's of texts in the console if no error): ![enter image description here](http://i.stack.imgur.com/B1R9U.jpg) Ctrl+E does not get you to the real error that is \research no matter how many times you press Ctrl+E. But if you have this setting: ![enter image description here](http://i.stack.imgur.com/m3K1t.jpg) when you compile, it highlights \research with red color that is exactly true. Am I missing something here? or --quiet is doing something wrong?


title: Referencing to CD content

text: I am moving alot of appendix material to an attached CD with my report. I was wondering if there was a right or wrong way to reference to CD content. In this case how can this be accomplished? Would you just cite to a reference which points to the CD?


title: pgfplots: Set exponent of scientific number format for nodes near coords

text: As you can see, my plot currently has node labels with scale factors of both 10^6 and 10^5: ![enter image description here](http://i.stack.imgur.com/dsFDg.png) My goal is to specify a scale factor of 10^6 for every node label: ![enter image description here](http://i.stack.imgur.com/FSSFy.png) So my question is: How can I explicitly set the exponent in scientific number formatting?               \begin{tikzpicture}     \begin{axis}[         width=6cm,         xtick=\empty,         ybar,         ymin=0,         ymax=3e6,         bar width=1cm,         scaled y ticks=base 10:-6,         ymajorgrids,         nodes near coords={\pgfmathprintnumber[sci,precision=1]{\pgfplotspointmeta}}     ]     \addplot+[blue] coordinates {(0, 100 000)};     \addplot+[teal] coordinates {(0, 200 000)};     \addplot+[orange] coordinates {(0, 2 500 000)};     \end{axis}     \end{tikzpicture}


title: Pgfplots, Legend Color

text: I have the following problem: I Have a TikZ Picture with two data plots, each with a different color. I want each one to appear in the legend, and I'm using `\addlegendentry`. The problem is that Latex compiles it showing the same color (that of the first plot) for both legend entries. I can't manage to get it right. Any help is much appreciated! Code Example:               \documentclass{article}          \usepackage{tikz}     \usepackage{caption}     \usepackage{pgfplots}          \begin{document}          \begin{figure}[t]          \centering     %\begin{figure}     \begin{tikzpicture}[trim axis left, trim axis right]         \begin{axis}[             %xlabel=Time,             %ylabel=$\Delta Z$,             %title={Arbitrage Decision},             yticklabels={,,},             xticklabels={,,},             xmax=20,xmin=0, xtick={0}, ytick={0},             ymin=-.8, ymax=0.8, width=\textwidth, height=8cm,                          ]             \addplot[red]                  plot coordinates {            (1,0)            (2,0.119098372908416)            (3,0.0587139912536361)            (4,-0.27031374415238)            (5,-0.321767788431161)            (6,-0.311970267679964)            (7,-0.321597306182755)            (8,-0.290922789133446)            (9,-0.295971286973468)            (10,-0.287426203316645)            (11,-0.306326196276815)            (12,-0.493603624276272)            (13,-0.274091233027778)            (14,-0.355035567724277)            (15,-0.307926381319453)            (16,-0.3723808555904)            (17,-0.465577005289438)            (18,-0.499906424048013)            (19,-0.580303015935037)            (20,-0.541777724182955)                     };           \addlegendentry{$\Delta Z$}           %node[above] at (axis cs:1.5,95) {$S^E$};                  \addplot[color=black, style=dashed]                      plot coordinates {                  (1,0)                  (2,0)                  (3,0)                  (4,0)                  (5,0)                  (6,0)                  (7,0)                  (8,0)                  (9,0)                  (10,0)                  (11,0)                  (12,0)                  (13,0)                  (14,0)                  (15,0)                  (16,0)                  (17,0)                  (18,0)                  (19,0)                  (20,0)                      };                     \end{axis}               \end{tikzpicture}               \captionsetup{format=hang, justification=justified, width=\textwidth}     \vspace{.1cm}     \caption*{\textbf{Panel A}: Sample Brownian Motion where $\Delta Z = \xi\sqrt{\Delta t}$; $\Delta t = 1/100$; $\xi \sim \mathcal{N}(0,1)$}          \begin{tikzpicture}[trim axis left, trim axis right]     \begin{axis}[     %xlabel=Time,     %ylabel=$\Delta Z$,     %title={Arbitrage Decision},     yticklabels={,,},     xticklabels={,,},     xmax=20,xmin=0, xtick={0}, ytick={0},     ymin=-.1, ymax=0.3, width=\textwidth, height=8cm,legend pos = north west]     \addplot[green] coordinates {     (1,0)     (2,0.0250244632386685)     (3,0.0554593278345405)     (4,0.0654368471373184)     (5,0.0522393053079004)     (6,0.056302957955299)     (7,0.0818373899525913)     (8,0.123643822846327)     (9,0.12530090609606)     (10,0.0892209109976901)     (11,0.071957710134649)     (12,0.0495597874988943)     (13,0.0578078951199786)     (14,0.0687186416973062)     (15,0.123940519634878)     (16,0.103015291916538)     (17,0.134159762952377)     (18,0.142495182864937)     (19,0.0874592151837793)     (20,0.014181052418952)          };     \addlegendentry{GWP1}               \addplot[green] coordinates {     (1,0)     (2,0.003)     (3,0.0045)     (4,0.006)     (5,0.0075)     (6,0.009)     (7,0.0105)     (8,0.012)     (9,0.0135)     (10,0.015)     (11,0.0165)     (12,0.018)     (13,0.0195)     (14,0.021)     (15,0.0225)     (16,0.024)     (17,0.0255)     (18,0.027)     (19,0.0285)     (20,0.03)          };               \addplot[blue] coordinates {     (1,0)     (2,-0.00853956850990679)     (3,-0.0171870248806746)     (4,-0.00548447253631596)     (5,0.00638491029571863)     (6,-0.0090966989367963)     (7,-0.000609747128328755)     (8,-0.00399157731385536)     (9,-0.00187457451809036)     (10,0.00420956011895954)     (11,0.0031221460646704)     (12,0.01260938678132)     (13,0.007824297608025)     (14,-0.00220727508765742)     (15,0.00554351691044548)     (16,0.0175169914115017)     (17,0.0174718949520942)     (18,0.0151757561241811)     (19,0.026384528315795)     (20,0.027525749190792)          };           \addlegendentry{GWP2}               \addplot[blue] coordinates {     (1,0)     (2,0.001)     (3,0.0015)     (4,0.002)     (5,0.0025)     (6,0.003)     (7,0.0035)     (8,0.004)     (9,0.0045)     (10,0.005)     (11,0.0055)     (12,0.006)     (13,0.0065)     (14,0.007)     (15,0.0075)     (16,0.008)     (17,0.0085)     (18,0.009)     (19,0.0095)     (20,0.01)          };     \end{axis}     \end{tikzpicture}     \captionsetup{format=hang, justification=justified, width=\textwidth}     \vspace{.1cm}     \caption*{\textbf{Panel A}: Sample Brownian Motion where $\Delta Z = \xi\sqrt{\Delta t}$; $\Delta t = 1/100$; $\xi \sim \mathcal{N}(0,1)$}     \end{figure}     \end{document}      Ok, here is a directly compilable code. I have truncated the series so it wouldn't be so long. If I compile this, on the second (lower) TikZ the legend for GWP1 and GWP2 is green. Hope this helps clarify my problem.


title: Parsing files through LuaTeX

text: This question has two parts:   1. How would one generally parse a file with LuaTeX, assuming the file only holds data that is delimited either by spaces, commas or semicolons.    2. How would you parse the file (if it includes (all)TeX code as well as text code), for example an `ini` file where some of the fields are written in TeX. This question aims at finding a solution that is also well documented in the post. As LuaTeX is still in heavy development, I find the documentation to be sparse and this is the first of a number of questions that I intend to post (with bounties) so that the answers can provide some form of documentation on the web (and on our favourite Site!). _Edit:_ The first part is a simple CSV file. If you want you can use the example in my answer in   Adding a list of bios to the book class. As the answer included alpha sorting using TeX, it might be a good example, where LuaTeX should have an advantage over normal (all)TeX. Ini files are normally used as configuration files, although I have used them for all sort of data capturing. If you wish you can also use a Yaml format.               [general]     languages=en,ngerman          ;This is a comment     [article]     pagewidth=15cm     pageheight=20cm     paper=a4          [book]     includeparts=true          ;defines chapter     [chapter]          ;packages     [graphicx]     keys="keya,keyb,keyc"      For TeX code, add one command to the `ini` file.               texcode="\def\test#1#2{}"