title: `let` operation in tikz

text: Ηow can I separate options within brackets `[...]` so that is affected only the current command; For example, I want dashed lines only here `(0,0) |- (A) [dashed]` . Could someone give a detailed explanation of the use of `let` operation. The examples in the pgf manual at 150p. I think is not enough to understand the use of the `let` operation in-depth, at least for me.               \documentclass[11pt]{book}     \usepackage{tikz}     \usetikzlibrary{decorations.markings}      \usetikzlibrary{calc,intersections,through,backgrounds}          \begin{document}          \begin{center}       \begin{tikzpicture}[scale=1.25,cap=round,>=latex]         \draw[step=.5cm,gray,very thin] (-3.0cm,-3.0cm) grid (3.0cm,3.0cm);         \draw[->] (-2.5cm,0cm) -- (2.5cm,0cm);         \draw[->] (0cm,-2.5cm) -- (0cm,2.5cm);              \coordinate (center) at (0.cm,0.cm) ;         \coordinate (A) at (1.5cm,1.cm);         \filldraw [black] (center) circle (0.04cm) node [left] {$Ο$};              \draw let             \p1 = ($(A)-(center)$),           \n1 = {veclen(\x1,\y1)},           \n2 = {atan2(\x1,\y1)}         in           (center) circle (\n1)           (A) circle  (0.1cm)[fill color = black]           (0,0) |- (A) [dashed]           (center)  -- (A);            \end{tikzpicture}     \end{center}      ![enter image description here](http://i.stack.imgur.com/SCioX.png)


title: Multi-line equations with single operator referring to multiple lines

text: I need to include an equation similar to the following in my text and have failed doing so in various tries, including using the `align`-environment of the `amsmath`-package. ![example image](http://i.imgur.com/WF9Mi3l.png) Basically, the text before and after the delimiters is supposed to be centered, as well as the operator in the equation, the space between the delimiters and the operator however should consist of two lines. If I would transfer my current code to the example image, it would look like this:               \begin{equation}         \text{Ex} =         \bracevert         \begin{align}             a^2 + 300 * b\\             70 < c         \end{align}         -         \begin{align}             200 + 60 * a\\             a < 250 < b >= c         \end{align}         \bracevert     \end{equation}      ## Final Result: This is the LaTeX outcome of my own equation (which should make more sense than the example I provided) using the code found in the answers below. Thanks to both of you! ![final result](http://i.imgur.com/NbLTwH5.jpg)


title: Moderntimeline in Beamer Latex

text: I've just seen an amazing thing, created by               \usepackage{moderntimeline}      But this was only for a moderncv document. I am now trying to build up a beamer latex, where I do need a timeline and I'd wish to use this package. My header is as follows:               \documentclass{beamer}     \usepackage[german]{babel}     \usepackage[latin1]{inputenc}     \usepackage{xcolor}     \usepackage{graphicx}     \usepackage{amssymb}          \usepackage{beamerthemesplit}     \usetheme{PaloAlto}          \usepackage{tikz}     \usetikzlibrary{decorations}     \usepackage{textcomp}      \usetikzlibrary{snakes}          \begin{document} ... \end{document}      I would be super happy for any help. For an impression of what I am looking for, see Putting a timeline for dates in moderncv Thanks! Best, maad


title: How to make graph originally generated by stata look good?

text: I use stata to get an eps graph, then use pdfLaTeX to get a pdf file.                \documentclass{article}      \usepackage{graphics}      \begin{document}      \centering      \includegraphics{test}      \end{document}      When I zoom in the graph, we can see an ugly diamond.![enter image description here](http://i.stack.imgur.com/6TZGo.png) How to solve it?


title: How to put some special diagram in the subscript of a letter?

text: I'm a newer by using Latex. I don't know how to code the following equation. Can you give me some helpful suggestions?                 _____              ______         |                  |      |___               |____                      |    _______   .   |      ______    =0      |    |__|__|       |     |__|___|                  |__|__|


title: How can I make (La)TeX prefer to fill centered lines

text: My thesis formatting requirements ask for multiline chapter and section titles to be a maximum of 4.5 inches wide with any subsequent lines being wrapped such that they are sucessively shorter, forming an inverted pyramid. I found the `\parshape` TeX command that I am using to try and enforce this automatically. But, it doesn't always end up working because with centered text, the line breaks occur before the lines actually fill up in some cases. I've read up a bit on TeX's line-breaking algorithm and have tried playing around with a few penalties, but I can't figure out how it works when it's in centering mode. Does anyone know how I can encourage TeX to fill up lines when in centering mode? Any clues would be greatly appreciated. Here is a minimal working example of the difference in behavior in centered vs. non-centered modes:               \documentclass{book}          \newcommand{\headingparshape}%     {%         \parshape=6 % account for a maximum of six lines - thereafter all will have the final width             0.75in 4.5in             1.00in 4.0in             1.25in 3.5in             1.50in 3.0in             1.75in 2.5in             2.00in 2.0in     }          \begin{document}          In a centered mode:     \begin{center}         \huge\bfseries\headingparshape         Here is a title that needs to wrap over several lines and has short words     \end{center}          In normal (justified) mode:          {\huge\bfseries\headingparshape{}Here is a title that needs to wrap over several lines and has short words\par}          \end{document}      In the centered mode, the line breaks end up here (messing up the inverted pyramid layout): > Here is a title that needs   >  to wrap over several lines   >  and has short words In the normal mode, the line breaks end up here (inverted pyramid correct): > Here is a title that needs to   >  wrap over several lines and   >  has short words So, the words "Here is a title that needs to" all fit on the first line, but I can't figure out how to make that happen in the centered version without having to do a bunch of distasteful manual formatting with `~` and `\\` commands.


title: Distinguish space (ASCII 32) and return (ASCII 13) in \def's arguments

text: A related question can see here. I want the \mydef behavior is               \mydef{a b c d}      get a correct export but               \mydef{a b      c d}      or               \mydef{a b c d     }      get a incorrect export (like a warning message).


title: XYPic Frame with braces does not typeset correctly

text: I have a picture I am trying to typeset with xypic using pdflatex. As a minimal example there are basically a few boxes with a curly brace under them. I try to do this with the following code:               \usepackage[pdf,color,curve,all]{xy}     % ... (Other packages, begin{document}, content, etc.)      \xy         (0, -8)   *=(8,8){d^{(0)}_{2,0}}*\frm{-},         (8, -8)   *=(8,8){d^{(0)}_{2,1}}*\frm{-},         (16, -8)  *=(8,8){d^{(0)}_{2,2}}*\frm{-},         (24, -8)  *=(8,8){d^{(0)}_{2,3}}*\frm{-},         (12,-4)   *=(24,16)*\frm{_\}}     \endxy      The result is as follows: ![Curly Braces gone wrong](http://i.stack.imgur.com/EBFF2.jpg) This is clearly not what I intended to do... Furthermore, LaTeX gives the following error:               A <box> was supposed to be here.      The error vanishes once I remove the last line defining the curly brace. What am I doing wrong? Or is it because of some unloaded arguments. I have just no clue around here... Thank you for your help. ## Update 1: I just updated all packages to their current release, this did not solve the problem. Copying Exercise 21 from the XYPic reference guide to the document also fails with identical error message and similar output problems..               \xy          (0,0) *+++{A} ;          (10,7) *+++{B} **\frm{.}          **\frm{^\}} ; **\frm{_\}}     \endxy      Using `\frm{\}}` for vertical braces works fine, however `frm{_(}` does not work neither. I'm getting really clueless.


title: GnuplotTex: automatic plotting and vertical line indication

text: I am using pdflatex with the `gnuplottex` package, to plot a function with a local maximum; I'd like to find this maximum automatically and label it. For the most part, I'm already there ( _using the special "pseudo" file '`+`' in `gnuplot` >4.4_), apart from a couple of problems -- and I'm not sure whether the problem is in LaTeX or `gnuplot` ... Here is a minimal working example:               % build with:     % pdflatex -shell-escape test.tex          \documentclass{article}     \makeatletter\newwrite\verbatim@out\makeatother     \usepackage{gnuplottex}          \begin{document}          \section{Test}          Here a brief test...          \begin{figure}[h]     \centering     \begin{gnuplot}[scale=0.95]       # Define helper functions       ismax(x) = (x>max)?max=x:0       isxmax(x) = (ismax(f(x))!=0)?xmax=x:0 #            # Initialise the 'global' vars       max=-1e38       xmax=-1e38       min=1e38       ymaxrange=0.05 # added            set grid       set title 'gnuplottex test'       set ylabel '$y$'       set xlabel '$x$'       set xrange [0:2000]       set yrange [0:ymaxrange] # MUST set this!            # define the function       f(x) = (20*x)/(100000 + 50*x + x**2)            set multiplot            # plot f(x) # OK, works as usual            # to turn off the annoying label in the upper right corner - also f($0) will cause latex crash       set nokey            # plot the function - which will also calculate xmax (first pass)            plot '+' using ($1):(f($1)) with linespoints, \       '+' using ($1):(isxmax($1)) with lines linecolor 2       # '+' using ($1):(ismax(f($1))) with lines linecolor 2                 # second part of plot - which needs xmax            set grid noxtics noytics # prevent double plot ?!       set arrow from xmax,0 to xmax,3 nohead lt 1 linewidth 2 # linewidth doesn't change ?!            set label "X" at xmax,f(xmax)       set label "(%.0f;",xmax,"%f)",f(xmax) at 0.6*xmax,f(xmax)+ymaxrange/10            plot '+' using ($1)       # replot # nope, doubles       unset multiplot     \end{gnuplot}     \end{figure}               500 1000 1500 ... End of test.          \end{document}      This code results with a rendering like this (which is a screenshot of `evince` rendering the PDF): ![gnuplottex test](http://i.stack.imgur.com/aq4QN.png) And these are my problems:   * It seems that upon execution of the second `plot`, the labels and axes get repeated on top of each other, in spite of a `set grid noxtics noytics` ( _notice they are a bit darker in the screenshot_ ) -- can this be prevented?   * In principle, without the `set yrange ...` line, the second `plot` may contain a different automatic range (though that is not visible in this example). Is there a way to "copy"/duplicate a range of an axis that was computed automatically in `gnuplot`?    * the `linewidth` (`lw`) argument of `set arrow` (which is for implementing a vertical line) seems not to have any effect -- how can I manipulate that?    * The line from `set arrow` and the (very thin dotted) line from the `isxmax($1)` plot do not match; seemingly it is the `arrow` that is off -- how to fix this?    * The `linecolor` argument seems to have no effect -- how to fix this? ( _btw, color seems to work fine for`\begin{gnuplot}[terminal=pdf,...`, however, I'd like to keep the LaTeX 'terminal'_) References:   * Re: Calculate the minimum and maximum data with 'Gnuplot'   * Drawing vertical lines with gnuplot...impossible? - Ubuntu Forums   * How do I draw a vertical line in gnuplot ? - Stack Overflow   * Gnuplottex basic example fails with 'undefined control sequence' ?!   * Gnuplot tricks: Plot iterations and pseudo-files   * Gnuplot (notes)


title: What is considered a token for non-standard input encodings?

text: When I use an input encoding to (La)TeX that allows me to directly input characters such as é and ä (such as by declaring `\usepackage[utf8]{inputenc}`), how is a token defined? Specifically,   * is it possible to write things like `\^ä`; and for this case, would it matter to (La)TeX whether I represented this character      * as U+00E4 or     * with the combining sequence U+0061 U+0308 ,   * or must I use `\^{ä}` ? (This question was inspired by a comment from user @doncherry to this question on accented characters.)


title: Aligning paragraph inside a tabular

text: Consider the following code:               \documentclass{article}          \begin{document}          \begin{tabular}{|p{5cm}|}       \hline       \textbf{item 1:} These are some texts to just fill in the first line.        \tabularnewline        this is the second Item which still needs to be indented        \begin{itemize}         \item item 1     \item item 2        \end{itemize}      \\ \hline      \end{tabular}          \end{document}      when you run this you will get a table with one cell. My question is > How can I align the paragraph rows inside tabular except for the first line > to start from a specified margin? Said otherwise, how can I have a paragraph > indented for every line except for the first (say indented for 1 cm)? if it matters, my actual code has `p{\textwidth}`. And BTW I have a itemize in the cell which I'd like to keep.   Please do consider that I am using a right to left language (bidi package is used) and solutions that statically add margin to left are not useful. Actually I need the spacing in the right portion of text not the left.


title: How to use \CheckCommand with robust commands?

text: ## Question How can I use `\CheckCommand` with robust commands? ## Background LaTeX provides `\CheckCommand` (only for use in the preamble) so you can ensure that a command has the expected definition:               \newcommand{\hi}{hi}     \CheckCommand{\hi}{hi}      will work fine without any warnings, but               \newcommand{\hi}{hi}     \CheckCommand{\hi}{bonjour}      will cause LaTeX to emit a warning:               LaTeX Warning: Command \hi  has changed.                Check if current package is valid.      This warning system, however, is thwarted by the LaTeX protection mechanism for robust commands:               \DeclareRobustCommand{\hi}{hi}     \CheckCommand{\hi}{hi}      raises a warning because `\hi` is now `\protect\hi`, not `hi`. (See What is the difference between Fragile and Robust commands? for example.) How can I use `\CheckCommand` with robust commands? ## References   * \providecommand equivalent of \DeclareMathOperator: \ProvideMathOperator?


title: Customize headers without fancyhdr

text: I have strange, old book chapter to rewrite in LaTeX. The most iritating thing is the header. On odd pages the header should consist of the section name etc. But the problem is that if the page starts new section this sections name should appear in header (standard) and if the does not (the page is continuation of previous started section) and somewhere lower on this page the next section starts then header should show the name of this continuation section (the name of the section that first line of text on current page belongs to). I've googled a lot and stil have nothing. So simply - how to insert in the header the section name that the first line of text on current page belongs to instead of standard - the section name that starts somewhere lower on current page?


title: convert outcome of reference to regular number

text: Is it possible to transform the outcome of a reference (e.g., a line number) to a regular number that I can use in a calculation? I have this (and works fine):               \FPeval{\result}{clip(5+6)} $\result$      Now I want to do a calculation involving \lineref{myline}. However,               \FPeval{\result}{clip(5+\lineref{myline})} $\result$      doesn't work because `\lineref{myline}` is not recognized as a number, I guess. Any ideas?


title: Smaller font size of the algorithm description?

text: `\small` or other tag seems can not change the font size of the line number. The package I use is `\usepackage{algorithmic}`.


title: Patched version of pdftex does not see what kpsewhich sees

text: I have TeX Live version 2013.30973-7 running on ArchLinux. I want to use a patched version of pdftex to create valid PDF/A-1b documents. I have an issue using the patched version after compilation. I followed this and this instructions. However, I am stuck at the point when trying to create the format files:               pdftex2 -ini -translate-file=cp227.tcx '*pdfetex.ini'     pdflatex2 -ini -translate-file=cp227.tcx '*pdflatex.ini'      Output for first command (likewise for the other):               This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010) (INITEX)      restricted \write18 enabled.     entering extended mode     ! I can't find file `pdfetex.ini'.     <*> pdftex.ini      The files do exist in my `texmf-dist` tree and are found by `kpsewhich`:               # kpsewhich 'pdfetex.ini'     /usr/share/texmf-dist/tex/plain/config/pdfetex.ini      I also tried running the command with the full path and copying the files into the working directory, but nothing worked. When using the full path, it complained about the next file. Can someone point me to what I am missing? * * * _Update 1_ : As suggested in the source and instructions, I used `build- pdftex.sh` to configure and compile `pdftex`. An interesting flag set in there is `--without-system-kpathsea` which I figured might be the reason why the compiled `pdftex` does not see what the system `kpsewhich` sees. Also other system libs are disabled, which are all explicitly enabled in the gentoo ebuild. Unfortunately, the compilation fails when switching to `--with-system- kpathsea` \-- missing `kpathsea` header files. I downloaded also the TeX Live 2013 source. TeX Live has an updated version of `pdftex`: The latest standalone version of `pdftex` is 1.40.11 (at least I do not find another) at Sarovar, while TeX Live 2013 has 1.40.14. Is pdftex now developed in TeX Live? * * * _Update 2:_ I managed to compile (both patched and unpatched) pdftex 1.40.14 from TeX Live 2013, also using `--with-system-kpathsea`. However, when running the compiled pdftex, in any circumstances, the very same error occurs. * * * _Update 3:_ pdftex is in fact developed at supelec.fr (see here). Further, when putting the binary to `/usr/bin`, the compiled version works fine (see here). For the local installation I am still unsure how to do it correctly.


title: TikZ option for command or environment

text: I am learning TikZ. I am wondering where I can find information about options of command or environment. For example, for `\draw`, you can use `\draw[step=0.5]`, but it also has `\draw[xstep=0.5,ystep=0.7]`. For `\begin{tikzpicture}[scale=3]`, it also has many other options. I am reading the manual `pgfmanual.pdf` but don't finish reading yet, but it seems that it doesn't introduce all options for a command or environment.


title: Babel (French) does not translate the theorem environment in Beamer class

text: I'm using the beamer class, with the following preamble:               \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[french]{babel}     \usepackage{ae,aecompl,aeguill}     \usepackage{amsthm, amsmath, amsfonts}          \usetheme{Luebeck}     \usefonttheme{professionalfonts}      When I use the `proof` environment, the word `Preuve` appears in the document. This is the desired behaviour.               \begin{proof}         ...     \end{proof}      Conversely, the `theorem` environment produces the header `Theorem`, which is not wanted.               \begin{theorem}         ...     \end{theorem}      What did I do wrong?


title: Create an Appendix with sections for extra tables, and a Appendix with sections for demonstrations

text: I would like to include an "Annex" chapter named "Anexos", which would have several sections, in which extra tables would be exposed. In addition, demonstrations would be included in an "Appendix" chapter, named "Apéndices", that would have also have several sections. Here I show it: ![enter image description here](http://i.stack.imgur.com/JfEeT.png) Tables from Annex A and should be named as A.1, A.2, A.3. Tables form Annex B should be named as B.1, B.2, B.3 and so on. Equations form Appendix A and B should be named A.1, A.2 ... and B.1, B.2 ... respectively. Would it be a possible way to achieve this? **EDIT:** I have tried the answer posted in Adding appendix "chapters," without sections, in table of contents by @egreg. Several problems appear. So, having the code:               \documentclass[12pt,a4paper,twoside,openany]{report}     \usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}          \usepackage[toc,page]{appendix}          \begin{document}          \begin{appendices}     \addtocontents{toc}{\protect\setcounter{tocdepth}{1}}     \makeatletter     \addtocontents{toc}{%     \begingroup     \let\protect\l@chapter\protect\l@section     \let\protect\l@section\protect\l@subsection     }          \chapter{Demostración momento cuadrupolar}     \section{Q}          (All the info)          \addtocontents{toc}{\endgroup}     \end{appendices}     \end{document}      But, the result in the index is this: ![enter image description here](http://i.stack.imgur.com/oenga.png) The problem is that I would like to be said: **Apéndices** , instead of **Appendices** **First question** : Could it be possible to change **Appendices** for **Apéndices** in the index ? **Second problem** : The result is that the left page represented has also the word **Appendices**. Could it also be changed? ![enter image description here](http://i.stack.imgur.com/a4BAE.png) **Third problem** : As I said in the first image before the **EDIT** , I would like to include a "Annex" for extra tables and a "Appendix" for demonstrations. The "Appendix" part has been achieved except for the two above problems. **Third question:** So, how could the upper code be modified in order to include a **Anexos** part ? Here is my preamble:               \documentclass[12pt,a4paper,twoside,openany]{report}     \usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}     \parindent 1 true cm     \usepackage{graphicx}     \usepackage{eufrak}     \usepackage[spanish]{babel}     \usepackage[latin1]{inputenc}       \usepackage[T1]{fontenc}     \usepackage{times}     \usepackage{amsmath}     \usepackage{multirow}     \usepackage{float}     \usepackage{color}     \usepackage[longnamesfirst,super]{natbib}      \setcitestyle{square}     \usepackage{fancyhdr}        \pagestyle{fancy}                                             \renewcommand{\chaptermark}[1]{\markboth{\thechapter .\ #1}{}}                  \renewcommand{\sectionmark}[1]{\markright{\thesection .\ #1}{}}     \lhead{\nouppercase}     \rhead{\nouppercase}     \fancyhead[LE]{{\sf \leftmark}}                                  \fancyhead[RE]{}     \fancyhead[RO]{{\sf \rightmark}}     \fancyhead[LO]{}                                                     \fancyfoot[LE,RO]{\thepage}                                                \fancyfoot[CE,CO]{}                                                              \renewcommand{\headrulewidth}{0.0pt}                                     \renewcommand{\baselinestretch}{1.25}     \usepackage{adjustbox}     \usepackage{enumerate}     \usepackage{courier}     \usepackage{caption}     \usepackage[version=3]{mhchem}     \usepackage{rotating}     \usepackage[percent]{overpic}     \captionsetup{font={small}}     \begin{document}      Thanks.


title: bibtex + standalone: How can I include bibliographies in the individual docs *and* the main doc?

text: I'm trying to work on individual sections of a paper separately. In order to do this, I need to wrap the text in               \begin{document}     ...     \bibliography{bib}     \end{document}      The main file looks similar:               \begin{document}     \include{A}     \include{B}     ...     \bibliography{bib}     \end{document}      However, with the bibliography included in the sub-file _and_ the main file, I end up with these errors: `Illegal, another \bibstyle command`, `Illegal, another \bibdata command`. I think, had the builds worked, I would also have a duplicate bibliography. So, the question: How can I keep the individual sub-documents compileable (with bibliography), but also have the "main" document compile with a working bibliography?


title: Read in number of citations from aux file

text: In the aux file produced by latex, I see the following line: `\newlabel{LastBibItem}{{30}{10}{}{}{}}` How can I pull the 30 (the total number of citations) into a counter in the preamble of another document? Here is a sample document:               \documentclass{article}     \usepackage[numbers]{natbib}          \usepackage{etoolbox}     \makeatletter     \apptocmd{\thebibliography}{\global\c@NAT@ctr 30\relax}{}{}     \makeatother          \begin{document}          Here we cite reference \citealp{firstCite}.          \begin{thebibliography}{99}         \bibitem{firstCite} Dow, W. \& Jones, E.A.,          {\it Wall Street Journal},          March 29, 1929.     \end{thebibliography}          \end{document}      Running `pdflatex` on that document, the sentence reads "Here we cite reference 31." How can I replace the `30` on the `\apptocmd` line with a number taken by parsing the aux file from the other document for the `LastBibItem` number? (Or what is an alternate way of shifting the reference count by the number of items in the bibliography of another document?). (EDIT: I feel like it should possible to copy the contents of `xcite.sty` into the preamble of my document and make only a small change to increment a counter when `\bibcite` is found in `\XC@test`, but I have not been able to get the syntax right myself so far). I'll explain why I am trying to do this in case there is a different solution or in case someone trying to do the same thing finds this. I am trying to create a supplement to another document that continues the bibliography numbering of the main document but restarts the label numbering (and prepends an "S" to the labels). I use the `xr` and `xcite` packages to reference the labels and citations of the original document. I use a command with the `etoolbox` package to shift the natbib bibliography number to the right starting value (I don't totally understand the command -- I just took from another answer online). So here is the relevant part of my preamble:               \usepackage[numbers]{natbib}     \def\maindoc{mymaindoc}          \usepackage{xr}     \externaldocument{\maindoc}          \usepackage{xcite}     \externalcitedocument[M-]{\maindoc}          \renewcommand{\thefigure}{S\arabic{figure}}          \usepackage{etoolbox}     \makeatletter     \apptocmd{\thebibliography}{\global\c@NAT@ctr 30\relax}{}{}     \makeatother      with `mymaindoc.tex` being my main document and `mymaindoc.aux` already created. This works fine, starting the citation numbers in the document at 31. I'd just like to read the LastBibItem number from the aux file, so that I don't have to keep it updated by hand. I don't know if it matters, but I'd like the solution to work with pdflatex, natbib, and bibtex because those are what I use right now.


title: Stretchable vertical skip with mdframed

text: I created an mdframed-based theorem environment as follows:               \newmdtheoremenv[outerlinewidth=0pt,     leftmargin=0pt,rightmargin=0pt,     innerleftmargin=4pt,outermargin=0pt,     innermargin=0pt,innerrightmargin=4pt,     innerbottommargin=2pt,innertopmargin=3pt,     skipbelow=1.5ex plus2pt minus2pt,     skipabove=1.5ex plus2pt minus2pt]{theoreme}[dummy]{Théorème}      with, I think, an elastic vertical stretch when needed before and after the frame. What's strange is that the `\flushbottom` option is ignored when the frame is split across pages, as illustrated below: ![enter image description here](http://i.stack.imgur.com/V70zI.png) Is there an mdframed option that handles this issue? A MWE is suggested below:               \documentclass[11pt,fleqn]{book}     \usepackage{lipsum}     \usepackage{amsmath,amsthm}     \usepackage[framemethod=tikz]{mdframed}     \usepackage[showframe,top=3.2cm,bottom=3.2cm,left=3.25cm,right=3.25cm,headsep=12pt,a4paper]{geometry}     \theoremstyle{plain}     \newmdtheoremenv[backgroundcolor=red!10,%     innerbottommargin=2pt,innertopmargin=3pt,%     skipbelow=1.5ex plus2pt minus2pt,%     skipabove=1.5ex plus2pt minus2pt,linecolor=red!50]{theorem}{Theorem}     \begin{document}     \chapter{Title}     \lipsum[1-3]     \begin{theorem}\lipsum[1-2]     \end{theorem}     \end{document}


title: How to typeset boldface ell?

text: I know that `\ell` gives me this nice mathematical "calligraphic" letter l, which I want to use throughout my document. However, it is also a common typographic convention that vectors are typeset in boldface as opposed to having a little arrow on top of them. Hence: How do I get a boldface `\ell`? Simply enclosing it in `\mathbf` does not work...


title: ledmac: “Suppress linenumber in footnote” OR “add some text to the apparatus”

text: I’d like to typset a poem an need to get a note for the unnumbered Title. Is it possible to insert something in the footnote-aparatus without printing a linenumber? In this example the Note goes to the apparatus but with a wrong number. I need something like “Title: some note” instead of “1 Blindpoem ] Some note.”               \documentclass{article}     \usepackage{ledmac,ledpar}     \firstlinenum{1}\linenumincrement{1}     \begin{document}     \beginnumbering         \setstanzaindents{0,0,0,0,0}         \stanza             The \edtext{Blindpoem}%                 {\Bfootnote{Some note.}}         \skipnumbering\&         \stanza             This is &             a stupid &             and short &             \edtext{blindpoem.}{\Bfootnote{Yes, it is.}}         \&     \endnumbering     \end{document}      ps. It is not a solution to set linenumbers to the title!


title: Reference to figures in appendix is not printed properly

text: When citing a figure in a section in my report body, the reference prints the correct number:                Figure\ref{fig:UML} illustrates complexity arising from the non-modularity of the existing design:           Figure 5.1.1 illustrates complexity arising from the non-modularity of the existing design:      However, the reference in my appendices fails to print out the reference in the same manner:                \appendix      \backmatter      %...      Figure \ref{fig:mvcmodel} is a visual representation of the pattern:           Figure B is a visual representation of the pattern:      I am currently using `chngcntr` package to number my figures and tables in my `\listoffigures` and `\listoftables`, and I want the reference in appendices to follow the same numbering scheme as my table of contents. I am attaching my document class:                 \let\appendix@rig\appendix       \renewcommand{\appendix}{%          \@mainsect%              \ifthenelse{\boolean{uwwkrpt@math}}{%                  \renewcommand{\@secdotzerostart}[1]{\renewcommand{\dotzero}{}}                  \renewcommand{\@secdotzeroend}[1]{}           }{}%              \ifthenelse{\boolean{uwwkrpt@ece}}                  {\renewcommand{\@appendixtitle}{Appendix }}{}       \appendix@rig%       }       \newcommand{\backmatter}{%       \clearpage       \@notmainsect%       \ifthenelse{\boolean{uwwkrpt@math}}%          {\renewcommand{\section}{\clearpage\section@rig}}{}%        }


title: TeX Live 2013 updates after the release on June 18 (have the pretest version)

text: i downloaded the pretest of TeX Live 2013 in May and it installed fine and compiles my documents just fine. However, now i wanted to update the pretest version via `tlmgr` by specifying a normal CTAN mirror and when I do that, `tlmgr` tells me there are no updates. But I know there have been several new packages added to CTAN. So what can I do now?


title: How to draw a DC motor in circuitikz

text: I'm using `circuitikz` to create an electric circuit diagram. I'd like to draw a DC motor like this: ![DC motor symbol](http://www.expertsmind.com/CMSImages/2198_DC%20Motor%20Connections.png) or this one: ![IEC symbol for DC motor](http://symbols.radicasoftware.com/Files/DC-Motor- IEC2-M314.png) It looks like there's no symbol for motors in `circuitikz`. I'm using `\begin{circuitikz}[american]`. How I draw those symbols?


title: tikz circle operation and fill

text: I would like to add `circles` on paths. for all circles except one I want them to be filled, therefore I set `every circle node/.style={fill}`. However there is one circle I do not want to be filled, however `fill=none` does not give the desired result. MWE:               \documentclass{article}         \usepackage[english]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{tikz}     \usepackage{bm}     \usepackage[T1]{fontenc}          \usetikzlibrary{scopes}          \begin{document}     \begin{tikzpicture}             { [every circle node/.style={minimum width=.5ex, fill=black}]             \draw (0,0) node[fill=none, circle]{a}; %this should not be filled, but all other circles in the scope should.         }         \draw (0,1) node[circle, draw]{a};         \end{tikzpicture}     \end{document}


title: Is appending superscripts possible?

text: Let's say I want to write `N^{eT}`, but have `N^e` as a predefined command `\Ne`. Thus, I want to append the character `T` to the superscript of `\Ne`. Is this possible? (Note that I don't want to write `{\Ne}^T`, since that will result in the T being one level above the e. This was adressed in Trick LaTeX into doing double superscripts by the way)


title: Remove backgroundcolor of title bar in Rochester Beamer Theme

text: In the following minimal example, the title bar saying "Test frame" has a blue background:               \documentclass[compress, final]{beamer}         \usetheme[height=0mm]{Rochester}         \usecolortheme{dolphin}         \useinnertheme{rectangles}         \useoutertheme[footline=empty, subsection=true]{miniframes}          \begin{document}          \begin{frame}{Test frame}         \begin{block}<+->{Block}             Beamer is cool         \end{block}     \end{frame}          \end{document}      In my opinion, it really makes the slide look "heavy". How can I remove the background color?


title: Lining pictures up with Margins

text: I am adding photos into my documents with               \begin{wrapfigure}{r}{0.25\textwidth}     \includegraphics[scale=0.5]{uofw}         \caption{U of Windsor}     \end{wrapfigure}      but the only way I have found to line the picture up with the right margin is by adjusting the scale of the photo and adjusting the text width. Is there a way for me to have photos automatically line up with the margin so I do not have to mess around with scales?


title: Why does Listings package not display anything?

text: I'm writing a C++ course for secondary students and wanted to display some source code in a nice way (indenting, eventually coloration) and tried the Listings package. But I have a problem, the file compile with no problem and then, when I look at the place where my code is supposed to appear, it is empty. Neither code or spaces. Why? I am not really a LaTex expert, I just wrote my thesis with it (no source code in it), so maybe it is something very simple I missed... Working on a mac with texmaker in utf8. Thanks for your help Lucas


title: Two markings at one line with decorations in tikz

text: I would like to draw a path with an arrowtip at the beginning and the end. If there is only one arrowtip everything is perfect. But with a second mark only the first one is visible. Has anybody an idea what I do wrong?               \documentclass[         a4paper,         12pt,     ]{scrartcl}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}      \usepackage[english,ngerman]{babel}          \usepackage{tikz}     \usetikzlibrary{positioning,arrows,chains,matrix,scopes,fit,decorations.markings,decorations}          \begin{document}                   \begin{tikzpicture}                       \tikzstyle{vecArrow} = [thick,                     decoration={markings,                                  mark=at position 1 with {\arrow[semithick]{open triangle 60};}},                     double distance=1.4pt,                     shorten >= 5.5pt,                     preaction = {decorate},                     postaction = {draw,line width=1.4pt, white,shorten >= 4.5pt}]                  \tikzstyle{vecArrow2} = [thick,                         decoration={markings,                                     mark=at position 1 with {\arrow[semithick]{open triangle 60}},                                     mark=at position 0 with {\arrowreversed[semithick]{open triangle 60};}},                         double distance=1.4pt,                         shorten >= 5.5pt, shorten <= 5.5pt,                         preaction = {decorate},                         postaction = {draw,line width=1.4pt, white,shorten >= 4.5pt}]                       \draw[vecArrow] (0,0) to (1,0);                  \draw[vecArrow2] (0,-1) to (1,-1);                   \end{tikzpicture}               \end{document}


title: Why does BibTeX sometimes recognize "quoted" field entries and sometimes just {braced} entries?

text: Consider the following BibTeX entry:               @article{kit11,       author = "Kit",       title = "My article",       journal = "2011 Journal",       year = "2011"}      BibTeX complains:               Warning--empty author in kit11     Warning--empty title in kit11     Warning--empty journal in kit11     Warning--empty year in kit11      So, I had to change the `"`quotes`"` to `{`braces`}`. **But:**   I downloaded a citation from a journal web site and copied it verbatim to my `.bib` file. It used `"`quotes`"` and BibTeX didn't complain at all. Why? **UPDATE:**   Here's a link from where I downloaded the citation. I used the _Export citation_ link near the top of the page, and chose BibTeX format. Also, in TeXShop preferences, in the Source tab, in the Encoding section in the lower right, I see Unicode (UTF-8). Could this be the problem? What would be a wise setting for this if I frequently use BibTeX? ![alt text](http://i.stack.imgur.com/U7b1i.png) **UPDATE:**   I started using BibDesk, and all those problems disappeared. To all who took the time to troubleshoot my problem, I appreciate the effort `:)`


title: Vertical space between Chapter # and Chapter title

text: How we give a vertical gap of 25 mm between the Chapter number (#) and chapter title lines and between chapter title line and the first paragraph.


title: How do I make every CheckBox the same size?

text: I'm using hyperref \CheckBox command to add checkboxes to a document for use on screen and in print. I'm specifying the size of the \CheckBox (as part of command definition):               \CheckBox[width=0.8em,height=0.8em]{#1}      However, when the document is compiled with pdflatex the exact height specified is not used (the width _does_ take effect). So, some of the checkboxes are square and some are not, which looks ugly. I've tried changing the order of parameters, using absolute dimensions (e.g. 3mm) and relative (0.5\baselineskip) without success.


title: How to number the letters of a sentence?

text: I need to number the letters of a sentence consecutively. Every letter should have the corresponding small number centered below it (see image below). Does anybody know how to do this? I tried `\underset` from `amsmath` but it didn't work. ![numbered letters](http://i.stack.imgur.com/PvyBu.png)


title: Setting up WinEdt 6.0 and MiKTeX to run biblatex and biber

text: There should be a simple solution to the following problem, but I have failed to find one. I have a fresh installation of WinEdt 6.0 and MiKTeX 2.9. I usually use SumatraPDF for preview, using PDFTeXify (`ctrl`+`shift`+`P` in WinEdt). I would like to invoke `biblatex` and `biber` while pdftexifying by pressing something similar to `ctrl`+`shift`+`P` in WinEdt. How do configure WinEdt to do this? More specifically: I would like WinEdt to run `pdflatex`, then `biber`, then `pdflatex` again, etc. I cannot find a way to instruct WinEdt to run `biber`. I have biber.exe in MiKTeX's bin directory (put it there myself) and I have tried following instructions found on the web. My LaTeX document is fine and has the `biblatex` package included (it compiles if I run everything manually from the command prompt).


title: Subfloating images with same margins left/middle/right

text: Currently I have the following code:               \begin{figure}[htb]     \centering     \subfloat[htb][left]{\fcolorbox{plotBord}{plotPadd}{\includegraphics[scale=0.3]{figs/bla1.png}}}     \hfill     \subfloat[htb][right]{\fcolorbox{plotBord}{plotPadd}{\includegraphics[scale=0.3]{figs/bla2.png}}}     \caption[bla]{foobar}     \end{figure}      Which displays the two images on the left and right end of the text (because of `\hfill`). If I use something like `\hspace{10px}` instead, the two images have a certain distance between them in the middle, but the margin to the left and right end of the text width is bigger than the one in the middle. Is there any way to always align two images so that they have the same margins left/middle/right like that: ![sketch](http://i.stack.imgur.com/cWTqr.png) The two images always have the same size, but I'll add a border and a certain padding to it by using `\fcolorbox{}`.


title: Vertical alignment

text: I've been able to vertically align some text with `\vspace*{\fill}` but below the aligned line is some more text and a figure which causes the aligned line to be above the middle of the page. How can I make sure it's at the center (horizontally and vertically aligned) while keeping the text below it? MWE:               \documentclass[11pt]{article}     \usepackage{graphicx}     \begin{document}     \begin{titlepage}     \topskip0pt     \vspace*{\fill}     \centering     \resizebox{\linewidth}{!}{\parbox{5cm}{\centering \textsc{Metafysica \\ \& \\Natuurfilosofie}}} \\     \vspace*{\fill}     \begin{figure}[H]     \includegraphics[trim={0, 0.65cm, 0, 0},clip,width=0.30\linewidth]{logozw}     \end{figure}     \vspace{-3ex}     Universiteit Gent \\     Faculteit Letteren en Wijsbegeerte \\     Vakgroep Wijsbegeerte en Moraalwetenschap \\     Notities bij de lessen van professor V. D.     \end{titlepage}     \end{document}


title: standard order for bold+italic?

text: It's a small, small matter, but when something has to be made both bold and italic, is there any reason to prefer               \textbf{\textit{text}}      over               \textit{\textbf{text}}      ?


title: How to make AUCTeX recognize asymptote environment for correct commenting out

text: Is it possible to make AUCTeX recognize the `asy` and `asydef` environments to use the correct symbol for commenting out? In latex-mode the command `comment- region` does add `%` at the beginning of the line. However inside of a asymptote environment this should automatically change to `//`.


title: How can I label subfigures sequentially with positive integers across figures?

text: I want to label subfigures, across many figures, with sequential positive integers. For example, the first figure may have two subfigures with label tags `{fig1:subfig1}` and `{fig1:subfig2}` and the second figure may have three subfigures with label tags `{fig2:subfig1}`, `{fig2:subfig2}`, and `{fig2:subfig3}`. Then, when referencing these labels,               {fig1:subfig1}     {fig1:subfig2}     {fig2:subfig1}     {fig2:subfig2}     {fig2:subfig3}      would display as               1     2     3     4     5.      How can I do this using the `subfigure` package? I didn't know how to use the `subfig` package yet. In the meantime, there is a MWE using the `subfigure` package.               \documentclass[12pt]{article}     \usepackage{subfigure}     \begin{document}     \begin{figure}[ht]      \subfigure[subfigure A]{This is a figure. \label{label1}}      \subfigure[subfigure B]{This is a figure. \label{label2}}     \end{figure}     \begin{figure}[ht]      \subfigure[subfigure A]{This is a figure. \label{label3}}      \subfigure[subfigure B]{This is a figure. \label{label4}}      \subfigure[subfigure C]{This is a figure. \label{label5}}     \end{figure}          Tesing referencing labels: \ref{label1} \ref{label2} \ref{label3} \ref{label4}          Desired result: 1 2 3 4 5     \end{document}


title: How we can use [noend] only in some places in algorithms?

text: for example we have three nested loop               \FORALL{ condition 1}                 \FORALL{condition 2}                      \FORALL{condition 3}                     \STATE {do sth}                       \ENDFOR                  \ENDFOR               \ENDFOR      if we use `[noend]` to be false then print 3 "endif" but I want to print only one, the first loop only!! Does anybody has experiences?


title: How to use \Pnodecount when there are more than one \curvepnodes invocations?

text: Assume that there are 2 `\curvepnodes` macros invoked as follows.               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pst-node,pst-plot}          \begin{document}     \begin{pspicture}[showgrid](-4,-3)(4,3)         \curvepnodes[plotpoints=6]{0}{360}{.5 t PtoC}{I}         \curvepnodes[plotpoints=6]{0}{360}{1 t 36 add PtoC}{O}         \def\points{}%         \multido{\i=0+1}{\Pnodecount}{\xdef\points{\points (I\i)(O\i)}}         \expandafter\pspolygon*[linecolor=red]\points     \end{pspicture}     \end{document}        1. How to use `\Pnodecount` in this case?   2. If `plotpoints` in the first is different from the last, how to reference to one of the `\Pnodecount` by a root node name?   3. Bonus question: How to make `\expandafter\pspolygon*[linecolor=red]\points` functional?


title: minted Environment Inside varwidth Environment

text: Is there a way to incorporate a `minted` environment inside a `varwidth` environment? I have colored backgrounds for code snippets, and I did manage to put a `minted` environment inside a `minipage`, based on the answer to my previous question: minted Environment Inside minipage Environment However, it is really frustrating to manually adjust the width of the minipage for each code snippet. I tried wrapping the `minted` environment with the `varwidth` environment in `minted.sty`, but am getting some weird errors.


title: TikZ: Why is the 2nd intersection not found?

text: I am trying to construct a tangent line to the dashed curve but TeX is telling me that No shape named intersection-2 is known.               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc, intersections, arrows}     \begin{document}     \begin{tikzpicture}[line cap = round, line join = round, >=triangle 45]       \coordinate (P1) at (2, -1);       \coordinate (P2) at (6, -1);       \coordinate (E) at (4, -1);       \draw (E) -- ++(150:6cm) node[pos =.5, scale = .7,         fill = white, inner sep = 0cm] {402,000 km} coordinate (M);       \draw[name path = line1, dashed] (3, -2) .. controls (5.8, -1.25) and       (5, 0) .. (M);       \draw (P1) -- (P2);       \draw[-latex] (5, -1) arc (0:150:1cm) node[above = 1pt, scale = .75]       at (4.25, 0) {\(150^{\circ}\)};       \path[name path = aux] (M) circle [radius = 1bp];       \draw[name intersections = {of = line1 and aux}, -latex, red, thick] (M)        -- ($(intersection-1)!.75cm!(intersection-2)$);     \end{tikzpicture}     \end{document}      The line `line1` should intersect the circle `aux` but apparently it is only intersecting once. What can I do to fix this?


title: Using the lips package

text: How do I use the `lips` package? Having the following line in my preamble:               \usepackage{lips}      produces the following error:               /usr/local/texlive/2010/texmf-dist/tex/latex/frankenstein/lips.sty:309: Undefined control sequence.     l.309 \newlet\lips                       \Lips      Why so?


title: SVN last commit number on cover : a minimal working example?

text: I read many posts containing the `svn`, `svninfo` or `svnmulti` packages, but I can not find a MWE on the web to get started with those. For example, I use these following first instructions of the package documentation on CTAN               \documentclass{article}     \usepackage{svn-multi}     \svnid{$Id$}     \begin{document}     rev: \svnrev ; date: \svndate ; author: \svnauthor     \end{document}      But, I receive only this output:               rev:-2 ; date: ; author:      My latex folder is under the sub-root of the SVN root like this:               my projet       - Code (folder, root of svn)       - .svn (folder)       - Documentation (folder)         -- Rapport(folder)            --- main.tex            ---- chapters (folder)                  some tex files         -- javadoc (folder)      Of, course I tried the `svn` under the root too. But with the same non- results. I use this software: tortoiseSVN 1.8 under Win7 (miktex 2.9) and my latex editor is TexnicCenter2 (alls in 64 bits). The package are loaded on the fly.


title: Define a new environment to combine tikzpicture and lstlisting

text: I would like to define a new environment to combine the `tikzpicture` environment from package `pgf/tikz` and the `lstlisting` environment from package `listings`. The result would be to first produce the picture, then, include verbatim code afterwards. It would be similar to the examples in the PGF manual. Till Tantau uses an environment `codeexample`, but it is too complicated for me to comprehend, and I don't need other functionalities such as extracting keywords etc.


title: Why characters UTF-8 encoded are ISO-8859-1 encoded when written in an external file

text: For an UTF-8 encoded file as follows:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     %     \newwrite\outtmp     \immediate\openout\outtmp=out.tmp     %     \begin{document}     \newcommand{\foo}{Résumé}     \foo     \immediate\write\outtmp{\foo}%     \end{document}      the `out.tmp` output file is ISO-8859-1 encoded. Why:   * not UTF-8?   * ISO-8859-1 and not something else?


title: Taking notes while reading a journal paper

text: I'm reading journal papers in physics/electrical engineering. What is a suitable document class or package to help with taking notes? My idea would be having direct quotes on one side and my opinions/ideas aligned horizontally on the other side. I want Margin 1 and Quote 1 to be aligned horizontally. ![alt text](http://i.stack.imgur.com/lzPub.png)               \documentclass{article}          \usepackage[marginpar=3in, left=4in, right=0.5in]{geometry}     \reversemarginpar          \begin{document}          Hey! \marginpar{Hello world! The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.}          Quote 1 \marginpar{Margin 1}          \end{document}


title: Customize the display of a theorem

text: I have a theorem for which I do not have a proof. What I mean is that I have a paragraph under it, but I do not want it to start with the word `Proof`. Instead I want that only the first line of the paragraph to be indented. This is what I have so far:               \documentclass[a4paper,12pt,twoside]{report}     \usepackage{mystyle}     \setlength{\headheight}{42pt}     \setlength{\parskip}{0.3cm}     \setlength{\parindent}{0pt}          \newtheorem{theorem}[lemma]{Theorem}          \begin{document}          \begin{theorem}     This is a theorem.     \end{theorem}     "Here begins the explanation     which is continued here     and here."          \end{document}       I have seen that I could use `\indent` in front of it, but this does not apply in my case since I have `\setlength{\parindent}{0pt}` before the start of the document. How can I indent only the first line?


title: Bottom left of Beamer Slide in LyX

text: Looking to fully customize the bottom left of all of my slides in LyX. I have three authors and it is trying to fit all of our full names while I want is "X et al. (Institution)" or just "X et al."               \documentclass{beamer}      \usetheme{Cambridge          \makeatletter     \begin{document}     \author{     LastName1, FirstName1\\     \texttt{first1.last1@xxxxx.com}      \and     LastName2, FirstName2\\     \texttt{first2.last2@xxxxx.com}     LastName3, FirstName3\\     \texttt{first3.last3@xxxxx.com}     }          \begin{frame}     Test     \end{frame}          \end{document}


title: copy file using \write18 that works on both Windows and Unix

text: I would like to make an exact copy of a file during a TeX run. It is important that the copy be exact, since I am also comparing files and taking action depending on whether they have exactly the same contents. The `\OldVerbatimCopy` command from the `verbatimcopy` package seems, so far, adequate to my purposes. But since I am already using `\write18` anyway, and operating systems are designed for this sort of thing, I'd like to pass the operation to the operating system. The trouble is that the copy command in unix/linux/mac osX is different from the copy command in Microsoft-based systems. How do I use `\write18` for this in a way that will work on either of these operating system families? Can I detect the operating system (or shell, e.g. cygwin) from within TeX?


title: pgfplot axis mark

text: This is my first try with pgfplots and I have two problems that I need help with. The code is the following:               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{verbatim}          \begin{document}          \begin{tikzpicture}     \begin{axis}[     width=10cm,     height=8cm,     ybar,     ymin=0,     ymax=12000,     ymajorgrids=true,     legend style={at={(0.5,-0.2)},     anchor=north,legend columns=-1},     ylabel={Query Response Time (in ms)},     xlabel={Queries},     symbolic x coords={SA1,SA2,SA3,GA1,GA2,GA3},     %xtick=\empty,     ytick={0,2000,4000,6000,8000,10000},     yticklabels={0,2000,4000,6000,8000,10000},     ]     \addplot coordinates {(SA1,192) (SA2,597) (SA3,21) (GA1,750) (GA2,1650) (GA3,489) };     \addplot coordinates {(SA1,300) (SA2,1000) (SA3,226) (GA1,2875) (GA2,8719) (GA3,2235) };     \addplot coordinates {(SA1,375) (SA2,1297) (SA3,360) (GA1,4500) (GA2,10871) (GA3,4580) };     \legend{AQ,CAA,Virtuoso}     \end{axis}     \end{tikzpicture}          \end{document}      This generates the following plot: Question 1: How do I get rid of the $*10^4$ at the top of the y-axis? Question 2: How do I get rid of the x-axis ticks? I tried to put in `xtick=\empty,` but that gave an error. ![enter image description here](http://i.stack.imgur.com/WjiZg.png)


title: Finding all widows and orphans

text: There have been several questions about how to avoid widows and orphans, so let me first state that that is not the question here. I know I can try and tweak the settings but that it's still possible to end up with widows and orphans. What I do want to ask is whether there is some easy way (package) to get a list of all the widows and orphans that are in the document. Written to a separate file or just outputted when the processing of the file is done.


title: regexp capturing issue

text: The following regexp code gives the result               \documentclass[11pt]{book} % use larger type; default would be 10pt               \usepackage{pgffor}     \usepackage{l3regex,xparse}     \usepackage{etextools}     \begin{document}            \ExplSyntaxOn     \seq_new:N \l_uiy_result_seq     \NewDocumentCommand {\UiySplit } { m }       {         %\regex_extract_all:nnN { \D+ | \d+(?:\.\d*)? } {#1} \l_uiy_result_seq         \regex_extract_all:nnN {(f)(\d+(?:\.\d*)?)(s)(\d+(?:\.\d*)?)} {#1} \l_uiy_result_seq         \seq_map_inline:Nn \l_uiy_result_seq { item:~##1\par }       }     \ExplSyntaxOff          \UiySplit{f234s222}          \end{document}      gives the following output               item: f234s222     item: f     item: 234     item: s     item: 222      Why is it capturing the whole string and outputting it? Similarly:               \regex_extract_all:nnN {(f|s)(\d+(?:\.\d*)?){1,2}} {#1} \l_uiy_result_seq      is outputing               item: f234     item: f     item: 234     item: s222     item: s     item: 222      the first and fourth shouldn't be there? (well, I don't want them captured)


title: Wrapfig places picture at end of document

text: I'm trying to use a wrap fig to place an image next to some text. But when it compiles the image gets placed at the very end of the document several pages away from where it is supposed to be. The LaTeX source I am using is:               \begin{solution}     (b) No: Because the graph looks like:              \begin{wrapfigure}{r}{0.5\textwidth}           \begin{center}             \includegraphics{4x4graph.png}           \end{center}         \end{wrapfigure}      The marked vertexes have odd degree.  As you draw a path the degree of the start and end vertex decrease by 1, and every vertex on the path in between decrease by 2.  This means that the only way to hit every edge, is for each of the odd degree vertices to be the start and end of a path, but as there are 5 strings, you can only start and end at 10 vertices and as there are 12 odd vertices  2 of them cannot be the start and end of a path, so it is not possible to make this graph.     \end{solution}


title: using tikz to draw a flattened polyhedron

text: I want to create the net of a flattened hexagonal based box. Each side of the box is a slight trapezium (so in 3D the sides will not be perpendicular to the base, but that's not important to the question). Since each side is the same but only positioned differently I tried the following MWE.               \documentclass{article}     \usepackage{tikz}         \begin{document}          \newcommand{\side}[1][10]{%     \begin{tikzpicture}     \coordinate (sO) at (0,0);     \path (sO)--++(-90:2) coordinate (sB);     \path (sO)--++({#1}:1) coordinate (sC);     \path (sB)--++({-1*#1}:1) coordinate (sD);     \draw (sO)--(sB)--(sD)--(sC)--(sO);     \end{tikzpicture}%     }               \begin{tikzpicture}     \coordinate (O) at (0,0);     \path (O)--++(0:2)  coordinate (A1);     \path (O)--++(60:2) coordinate (A2);     \path (O)--++(120:2) coordinate (A3);     \path (O)--++(180:2) coordinate (A4);     \path (O)--++(240:2) coordinate (A5);     \path (O)--++(300:2) coordinate (A6);          \draw (A1)     --node[sloped,rotate=90,anchor=west]{\side}(A2)     --node[sloped,rotate=90,anchor=west]{\side}(A3)     --node[sloped,rotate=90,anchor=west]{\side}(A4)     --node[sloped,rotate=-90,anchor=west]{\side}(A5)     --node[sloped,rotate=-90,anchor=west]{\side}(A6)     --node[sloped,rotate=-90,anchor=west]{\side}(A1);          \end{tikzpicture}          \end{document}      The sides are not flush on the sides of the hexagon. Is there a way to do this elegantly? Or perhaps my code could be improved, in particular to have the same node information (sometimes I needed `rotate=90`, other times `rotate=-90`). ![enter image description here](http://i.stack.imgur.com/X5ZkV.png)


title: How to make table's height smaller?

text: I have a document with 3 tables on it. The tables look really nice, but I have one problem: they are too tall and so they overlap the footnote! I have tried reducing the size of the letters inside the table but that does not work, and I am not allowed to change the font size of the document (must be 12pt). How can I fix this? Here is a MWE:               \documentclass[a4paper,12pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{microtype}     \usepackage[margin=2.54cm]{geometry}     \usepackage{graphicx,booktabs,tabularx}     \usepackage[table]{xcolor}     \usepackage{array}          %define some nice colors     \definecolor{middleware_green}{RGB}{82, 119, 17}     \definecolor{middleware_white}{RGB}{255, 255, 255}     \definecolor{middleware_light_gray}{RGB}{239, 239, 239}     \definecolor{middleware_dark_gray}{RGB}{153, 153, 153}          \renewcommand{\tabularxcolumn}[1]{>{\small}m{#1}}     \newcolumntype{L}{>{\leavevmode\ignorespaces\raggedleft\arraybackslash\sffamily}X}%     \newcolumntype{C}{>{\leavevmode\ignorespaces\centering\arraybackslash\sffamily}X}%     \rowcolors{2}{middleware_white}{middleware_light_gray}          \begin{document}               \begin{table}     \newcolumntype{L}{>{\leavevmode\ignorespaces\raggedleft\arraybackslash\sffamily}X}%     \newcolumntype{C}{>{\leavevmode\ignorespaces\centering\arraybackslash\sffamily}X}%     \rowcolors{2}{middleware_white}{middleware_light_gray}          \begin{tabularx}{0.45\textwidth}{|L|L|L|L|}     \hline\rowcolor{middleware_green}     \multicolumn{ 4}{|c|}{\small\textcolor{white}{\textbf{1 Source, 1 Session, 1 Client, Exp0}}} \\ \hline     \rowcolor{middleware_dark_gray}     \multicolumn{1}{|C}{\scriptsize\textcolor{white}{\textbf{Mes\-sa\-ges per mi\-nu\-te per sour\-ce}}} &      \multicolumn{1}{|C}{\scriptsize\centering\textcolor{white}{\textbf{Mid\-dle\-ware Exec. Ti\-me (s)}}} &      \multicolumn{1}{|C}{\scriptsize\centering\textcolor{white}{\textbf{De\-lay (s)}}} &      \multicolumn{1}{|C|}{\scriptsize\textcolor{white}{\textbf{Ave\-ra\-ge De\-lay (s)}}} \\ \hline         &   60  &   0   &       \\ \cline{ 2- 3}       60    &   60  &   0   &   0.00    \\ \cline{ 2- 3}         &   60  &   0   &       \\ \hline         &   60  &   0   &       \\ \cline{ 2- 3}       120   &   60  &   0   &   0.00    \\ \cline{ 2- 3}         &   60  &   0   &       \\ \hline         &   60  &   0   &       \\ \cline{ 2- 3}       240   &   60  &   0   &   0.00    \\ \cline{ 2- 3}         &   60  &   0   &       \\ \hline         &   69  &   9   &       \\ \cline{ 2- 3}       480   &   69  &   9   &   16.67   \\ \cline{ 2- 3}         &   92  &   32  &       \\ \hline         &   159     &   99  &       \\ \cline{ 2- 3}       1000  &   173     &   113     &   109.67  \\ \cline{ 2- 3}         &   177     &   117     &       \\ \hline         &   391     &   331     &       \\ \cline{ 2- 3}       2000  &   383     &   323     &   311.00  \\ \cline{ 2- 3}         &   339     &   279     &       \\ \hline         &   561     &   501     &       \\ \cline{ 2- 3}       4000  &   631     &   501     &   512.33  \\ \cline{ 2- 3}         &   595     &   535     &       \\ \hline     \end{tabularx}     \begin{tabularx}{0.45\textwidth}{|L|L|L|L|}     \hline\rowcolor{middleware_green}     \multicolumn{ 4}{|c|}{\small\textcolor{white}{\textbf{1 Source, 1 Session, 1 Client, Exp6}}} \\ \hline     \rowcolor{middleware_dark_gray}     \multicolumn{1}{|C}{\scriptsize\textcolor{white}{\textbf{Mes\-sa\-ges per mi\-nu\-te per sour\-ce}}} &      \multicolumn{1}{|C}{\scriptsize\centering\textcolor{white}{\textbf{Mid\-dle\-ware Exec. Ti\-me (s)}}} &      \multicolumn{1}{|C}{\scriptsize\centering\textcolor{white}{\textbf{De\-lay (s)}}} &      \multicolumn{1}{|C|}{\scriptsize\textcolor{white}{\textbf{Ave\-ra\-ge De\-lay (s)}}} \\ \hline         &   88  &   28  &       \\ \cline{ 2- 3}       60    &   88  &   28  &   28.00   \\ \cline{ 2- 3}         &   88  &   28  &       \\ \hline         &   89  &   29  &       \\ \cline{ 2- 3}       120   &   89  &   29  &   29.00   \\ \cline{ 2- 3}         &   89  &   29  &       \\ \hline         &   89  &   29  &       \\ \cline{ 2- 3}       240   &   89  &   29  &   29.00   \\ \cline{ 2- 3}         &   89  &   29  &       \\ \hline         &   108     &   48  &       \\ \cline{ 2- 3}       480   &   109     &   49  &   49.00   \\ \cline{ 2- 3}         &   110     &   50  &       \\ \hline         &   188     &   128     &       \\ \cline{ 2- 3}       1000  &   188     &   128     &   131.00  \\ \cline{ 2- 3}         &   197     &   137     &       \\ \hline         &   316     &   256     &       \\ \cline{ 2- 3}       2000  &   361     &   301     &   284.00  \\ \cline{ 2- 3}         &   355     &   295     &       \\ \hline         &   599     &   539     &       \\ \cline{ 2- 3}       4000  &   617     &   557     &   542.33  \\ \cline{ 2- 3}         &   591     &   531     &       \\ \hline     \end{tabularx}     \centering\begin{tabularx}{0.45\textwidth}{|L|L|L|L|}     \hline\rowcolor{middleware_green}     \multicolumn{ 4}{|c|}{\small\textcolor{white}{\textbf{1 Source, 1 Session, 1 Client, Exp7}}} \\ \hline     \rowcolor{middleware_dark_gray}     \multicolumn{1}{|C}{\scriptsize\textcolor{white}{\textbf{Mes\-sa\-ges per mi\-nu\-te per sour\-ce}}} &      \multicolumn{1}{|C}{\scriptsize\centering\textcolor{white}{\textbf{Mid\-dle\-ware Exec. Ti\-me (s)}}} &      \multicolumn{1}{|C}{\scriptsize\centering\textcolor{white}{\textbf{De\-lay (s)}}} &      \multicolumn{1}{|C|}{\scriptsize\textcolor{white}{\textbf{Ave\-ra\-ge De\-lay (s)}}} \\ \hline         &   118 &   58  &       \\ \cline{ 2- 3}       60    &   117 &   57  &   57.67   \\ \cline{ 2- 3}         &   118     &   58  &       \\ \hline         &   119     &   59  &       \\ \cline{ 2- 3}       120   &   119     &   59  &   59.00   \\ \cline{ 2- 3}         &   119     &   59  &       \\ \hline         &   119     &   59  &       \\ \cline{ 2- 3}       240   &   119     &   59  &   59.00   \\ \cline{ 2- 3}         &   119     &   59  &       \\ \hline         &   142     &   82  &       \\ \cline{ 2- 3}       480   &   147     &   87  &   85.67   \\ \cline{ 2- 3}         &   148     &   88  &       \\ \hline         &   245     &   185     &       \\ \cline{ 2- 3}       1000  &   243     &   183     &   183.63  \\ \cline{ 2- 3}         &   242     &   182     &       \\ \hline         &   386     &   326     &       \\ \cline{ 2- 3}       2000  &   363     &   303     &   313.67  \\ \cline{ 2- 3}         &   372     &   312     &       \\ \hline         &   647     &   587     &       \\ \cline{ 2- 3}       4000  &   677     &   617     &   608.33  \\ \cline{ 2- 3}         &   681     &   621     &       \\ \hline     \end{tabularx}     \label{1source_1session_1client_tables}     \caption{1 source, 1 session, 1 client middleware execution times}     \end{table}     \end{document}


title: Printing only the text that appears between two symbols

text: I have a macro which contains some text:               \textmacro{This is some text.}      Normally, when compiled, it should just print text, like this:               This is some text.      Sometimes, the text contains “①”and “②”, such as this:               \textmacro{①  This is some text. ② This is some other text.}      When that happens, I need it to only print the text appearing between “①”and “②”, like this:               This is some text.      How can I make the macro print the text between “①” and “②” in `#1`, if those symbols appear, otherwise, to just print all of the text?


title: Doing an interlinear text

text: I want to produce a three-line interlinear text with numbers and asterisks in the top line, Greek in the middle, and the vernacular (Portugese) in the bottom. An example is below: ![example](http://i.stack.imgur.com/RrIpT.png) The challenge, as I understand it, is to get TeX macros to produce it as pdf directly in the desired shape. Each word is to be something as a three-story fraction. And those fraction-like words must be joined by inter-word spacing or punctuation(commas, etc), and justified within the space available for each line. I will have to type in the two languages, and that suggests me the use of polyglossia TeX package. And here is my limit. The rest is for you, my helpers.


title: Using an overpic grid to crop a resized image in Beamer

text: I've caught wind of a trick for trimming/cropping images in LaTeX. I know I can use the `trim` or `viewport` option of `includegraphics` to crop an image as described here and here. Determining what coordinates to use with trim is very time consuming though. This answer mentions the `overpic` package and suggests its grid can help with determining coordinates. I've gotten this to work wonderfully with Tikz by setting the `overpic` units to 1mm (Tikz defaults to 1cm I think), but I can't get it to work with a resized image:               \documentclass{beamer}         \usepackage[abs]{overpic}         \usepackage{graphicx}         \title{Zoomed Image}     \begin{document}          \begin{frame}{With Grid}         \begin{center}             \begin{overpic}[height=0.75\paperheight,grid,unit=1bp,tics=20]{standardWheel}             \end{overpic}         \end{center}     \end{frame}          \begin{frame}{Cropped}         \begin{center}             \includegraphics[trim=120 0 0 0,clip,height=0.75\paperheight]{standardWheel}         \end{center}     \end{frame}          \end{document}      I set the units of `overpic` to be one big point (the default units for `includegraphics` according to this) but it's clear that the grid numbers don't match the crop numbers - according to the grid, trimming 120 off the left side should remove half the wheel. It barely removes anything from the left side. I read online somewhere that this probably doesn't work because I resized the image with `height=0.75\paperheight`, but it's hard to figure out without resizing because this image is huge. Does anyone know how to get the grid numbers to match the trim numbers for a resized image (I've resized both images the same way). ![With Grid](http://i.stack.imgur.com/wX4mU.jpg) ![Crop](http://i.stack.imgur.com/TH6iq.jpg) EDIT: This post on LaTeX community shows that it works well if no resizing is done, but warns that resizing renders it useless. As a side note, I'm compiling with pdflatex, which reports that it is               pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6)      and I unfortunately am not able to perform installations/updates on this machine.


title: The TPM file could not be parsed (MiKTeX)

text: Today i wanted to continue working on my paper on a different machine. I installed MiKTex and TexnicCenter the same way i did on my first machine. After loading the project i tried to compile it. I get this error:               pdflatex> initexmf.exe: The TPM file could not be parsed     pdflatex> initexmf.exe: Data: C:\Program Files (x86)\MiKTeX 2.9\tpm\packages\bidi.tpm     pdflatex> initexmf.exe: The operation failed for some reason.     pdflatex> initexmf.exe: Data: C:\Program Files (x86)\MiKTeX 2.9\bin\initexmf.exe      I need to finish up the paper today so i really appreciate your help! Edit: I just reinstalled MiKTeX and now it works again.


title: Tables: from Word to LaTeX

text: This question may have been asked in the past, but the answers do not satisfy me. Here is the thing. I have prepared a statistical table in Word, with stars indicating the significance level and the standard errors are under the coefficients in parentheses. I have the macro called `excel2latex` and I know how to make it work so I can obtain the TeX tables. The point is that, when I copy and paste the table (which is ready) from Word into excel, the parentheses are gone. I do not want this to happen, for I have to do the job once again. Is there any macro for word that can produce TeX tables like the one in Excel? The problem in simple terms:               \documentclass[12pt,a4paper]{article}     \usepackage[utf8x]{inputenc}     \usepackage{ucs}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{makeidx}     \usepackage{graphicx}               \begin{document}     From Word something like this           \begin{tabular}{|c|c|}     \hline var & 0.045*** \\      \hline  & (0.005) \\      \hline      \end{tabular}           when copied in Excel becomes this monstrosity where the standard error appears to be negative:          \begin{tabular}{|c|c|}     \hline var & 0.045*** \\      \hline  & -0.005 \\      \hline      \end{tabular}           \end{document}


title: Frenchspacing not working in footnote

text: I have               \footnote{\textit{Difesa della povera gente}, in: \textit{L’attesa}, p. 81; cfr. \textit{Ero disoccupato e mi hai trovato      lavoro}, in: Giovagnoli, \textit{op. cit.}, pp. 232--233.}.      which produces the following result: ![enter image description here](http://i.stack.imgur.com/0Nzg5.jpg) I am using \frenchsetting, as you can see in the text (after the period). However, the interword spacing in the footnote is not correct. it is too much. I could use \hbox, but I will not get correct hyphenation. Any hint?


title: Remove parentheses for event date

text: How can I remove the parentheses of event date? I have tried:               \documentclass{article}     \usepackage[style=ieee,backend=biber]{biblatex}     \usepackage{xpatch}     \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @INPROCEEDINGS{A,      author = {Z},       title = {testing},      eventdate = {2012-02-01/2012-02-04}     }          \end{filecontents}          \addbibresource{\jobname.bib}          \xpatchbibdriver{inproceedings}       {\printtext[parens]{\usebibmacro{eventdate}}}       {\printtext{\usebibmacro{eventdate}}}       {}       {}          \begin{document}       \nocite{*}       \printbibliography     \end{document}      or even               \DeclareFieldFormat{eventdate}{#1}     \renewbibmacro*{eventdate}{\printtext{#1}}      but to no avail


title: How to draw the structure with rectangles inside

text: I wish to draw the flow like in the picture using the code below, however, I found it is very hard to locate the rectangles by using Coordinate. Is there any better way to do this? ![enter image description here](http://i.stack.imgur.com/jjMjO.jpg) Here is the code I have tried:               \documentclass{minimal}     \usepackage{tikz}     \usepackage{pgf}     \usetikzlibrary{arrows,automata}      \usetikzlibrary{shapes}     \begin{document}               \begin{tikzpicture}     \draw (-4,-4) rectangle (4,4);     \draw (-0.5,0)  rectangle (-3,-3);     \draw (0.5,0)   rectangle (3,-3);     \draw (-1,0)    rectangle (-2,-1);          \end{tikzpicture}          \end{document}


title: error in compiling same file

text: So I have one tex file that compiles smoothly here at my office, but when I open it at home (I use google drive and dropbox), the same file shows an error in compiling. Another difference: Suppose I add a new package, at home I see a window opening asking me to load the package but here at office it does it automatically. I suspect something has to do with different MiXTeX versions but I am not sure so I thought maybe you guys could help me out with this?


title: Problem using XeLaTeX and fontspec with arial font

text: I'm using LaTeX to write my reports, recently I have discovered XeLaTeX as an alternative to use different fonts with LaTeX. I'm using MiKTeX 2.9 as LaTeX compiler and TeXnicCenter 2.0. I'm newbie in XeLaTeX and for this reason, I did a `.tex` file test:               \documentclass[11pt]{report}     \usepackage{ifxetex}          \ifxetex       \usepackage{fontspec}         \setmainfont{Arial}     \else       \usepackage[latin1]{inputenc}     \fi          \begin{document}     Hello world!     \end{document}      When I compile my `.tex` file (xelatex => PDF), my output pdf file has the next lines: > 000000FF 000000FF 000000FF 000000FF "Arial/ICU""Arial Bold/ICU"000000FF > 000000FF "Arial/ICU""Arial Italic/ICU"000000FF 000000FF "Arial/ICU""Arial > Bold Italic/ICU"000000FF 000000FF Hello World! What does that code mean in pdf file? Why are that lines with 00000FF into the document? Is this problem to relate with fontspec package? Any idea about how to fix this problem? Thank you.


title: fontenc vs inputenc

text: I just don't seem to get it. So I come from the german speaking part of Switzerland and naturally I need ä ü ö a lot when I write german texts. So in LaTeX I have the option to go via `"a "u "o` which isn't really comfortable, or I can use an additional package. So now the confusion starts. I can use either `\usepackage[T1]{fontenc}` or `\usepackage[latin1]{inputenc}` So now if I create a new document and save it as a latin-1 encoded .tex file it seems it doesn't matter which option I chose they both work. Now why should I pick one over the other or use both? Which problems could occur (Do they occur if I use the same .tex file on another OS depending on which option I have chosen?)? If I save the .tex encoded as lets say the mac os latin then the first option compiles but shows the wrong characters for the ä ü ö's. Is it then like latex maps the ä according to the latin1 to a character and since the document is encoded as something different than latin1 then gets encoded to something different again? So if the last 2 paragraphs have been confusing (mainly because I'm confused) the main question is: What does fontenc what inputenc doesn't do and vice versa?


title: Math-type in y-label repeating; ghost line appearing

text: When I run the below code, my intended graph is created but with two issues:   1. there is an odd grey line at the bottom which I can't track down and delete   2. the math type from the y-label is repeated near the origin. If you could work out why this is happening and how to stop it I would be much obliged. Thanks.               \documentclass[twocolumn]{revtex4}     \usepackage{amsfonts,amssymb,amsmath,mathbbol,graphics,graphicx,epsfig,ulem,epstopdf,pgfplots,xfrac}     \pgfplotsset{compat=1.9}          \begin{document}          \begin{figure}     \begin{tikzpicture}[trim left=-7]     \begin{axis}[width=9cm,axis x line=box, axis y line=box, tick align=outside, enlargelimits=true, xlabel={Separation of Charges, cm}, ylabel={F$_E^{-\sfrac{1}{2}}$, N}, ylabel,  yticklabel style={/pgf/number format/fixed,/pgf/number format/fixed zerofill,/pgf/number format/precision=0,scaled ticks=false}, style={yshift=-0.2cm}, axis line style={-}, tick pos=left, legend pos=north west]     \addplot[only marks, mark=x, color=olive] coordinates {         (4.55,16.91774221)         (4.65,15.82338302)         (4.65,16.02527474)         (4.85,15.26061779)         (4.85,15.62893444)         (4.85,15.82338302)         (4.95,15.62893444)         (4.95,16.02527474)         (5.35,18.27589266)         (5.95,20.43824264)         (5.95,20.87897442)         (6.55,21.34950572)         (6.55,21.85335349)         (7.35,25.04749438)         (8.35,27.79990209)         (8.35,30.23455951)     };     \addlegendentry{One occurence}     \addplot[only marks, mark=x, color=cyan] coordinates {         (4.55,17.16516758)         (4.55,17.42377643)         (4.75,16.45338269)         (4.85,15.44148262)         (5.15,16.45338269)         (5.35,18.58897266)         (5.35,18.91871426)     };     \addlegendentry{Two occurences}     \addplot[only marks, mark=x, color=orange] coordinates {         (4.65,16.23509691)         (4.75,16.02527474)         (4.95,15.82338302)         (5.15,16.68071682)         (5.95,21.34950572)         (6.55,22.39464462)         (8.35,28.94070541)     };     \addlegendentry{Three occurences}     \addplot[only marks, mark=x, color=purple] coordinates {         (7.35,25.87222104)     };     \addlegendentry{Four occurences}     \addplot[only marks, mark=x, color=black, error bars/.cd, x dir=both, x explicit] coordinates {         (4.65,16.10822318) +- (0.2,0)         (4.75,16.19247315) +- (0.2,0)         (4.85,15.51565074) +- (0.2,0)         (4.95,15.82338302) +- (0.2,0)         (5.15,16.58865761) +- (0.2,0)         (5.35,18.65354171) +- (0.2,0)         (5.95,21.06342629) +- (0.2,0)         (6.55,22.06512210) +- (0.2,0)         (7.35,25.70075935) +- (0.2,0)         (8.35,28.94070541) +- (0.2,0)     };     \addlegendentry{Average}     \addplot[only marks, mark=x, color=gray, error bars/.cd, x dir=both, x explicit] coordinates {         (4.55,17.21596818) +- (0.2,0)     };     \addlegendentry{Unused}     \addplot[domain=4.55:8.35] {3.70070829*x-1.76190677};     \coordinate (pt) at (axis cs:6.45,12.55);     \draw [black] (axis cs:4.5,15.05) rectangle (axis cs:5.2,17.65);     \draw [dashed] (axis cs:5.2,15.05) -- (axis cs:6.82,14.38);     \draw [dashed] (axis cs:5.2,17.65) -- (axis cs:6.82,19.89);     \end{axis}     \node[pin=70:{%         \begin{tikzpicture}         \begin{axis}[tiny, xmin=4.5,xmax=5.2, ymin=15.05,ymax=17.65, enlargelimits=false, ylabel near ticks, yticklabel pos=right, xlabel near ticks, xticklabel pos=upper, xtick={4.55,4.75,4.95,5.15}]         \addplot[only marks, mark=x, color=olive] coordinates {             (4.55,16.91774221)             (4.65,15.82338302)             (4.65,16.02527474)             (4.85,15.26061779)             (4.85,15.62893444)             (4.85,15.82338302)             (4.95,15.62893444)             (4.95,16.02527474)         };         \addplot[only marks, mark=x, color=cyan] coordinates {             (4.55,17.16516758)             (4.55,17.42377643)             (4.75,16.45338269)             (4.85,15.44148262)             (5.15,16.45338269)         };         \addplot[only marks, mark=x, color=orange] coordinates {             (4.65,16.23509691)             (4.75,16.02527474)             (4.95,15.82338302)             (5.15,16.68071682)         };         \addplot[only marks, mark=x, color=black] coordinates {             (4.55,17.21596818)             (4.65,16.10822318)             (4.75,16.19247315)             (4.85,15.51565074)             (4.95,15.82338302)             (5.15,16.58865761)         };         \addplot[only marks, mark=x, color=gray] coordinates {             (4.55,17.21596818)         };         \end{axis}         \end{tikzpicture}%     }] at (pt) {};     \end{tikzpicture}     \caption{Plotted is all data taken over the course of the experiment.  The coloured crosses represent the number of times a particular force was recorded.  The black crosses, which are evenly split along the line of best fit as expected, denote the average at each separation.  The error bars were calculated as detailed in the Error Appendix.}     \label{fig:1}     \end{figure}          \end{document}


title: Sectioning command that automatically creates label

text: I'm trying to define a custom section command that will also define a corresponding label after a bit of preparsing. Specifically, I want the command to define a section with the given name, and then define a label with the name lower-cased and having spaces replaced with dashes. So far I've come up with the following:               \NewDocumentCommand\startSection{m}     {       \section{#1}\label{\lowercase{\StrSubstitute{#1}{ }{-}}}     }      Which uses the `xstring` and `xparse` packages, but this yields an error:               ! Argument of \@sect has an extra }.      After a bit of playing around I would get:               ! Missing \endcsname inserted      around the `\lowercase` command. I seem to be missing some essential knowledge about how labels work, so does anyone have a good suggestion?


title: Can Texmaker, as I'm typing, automatically create a preview of the document's PDF output?

text: Currently, I have to use the `F1` key to get PDF output. I want to set up Texmaker so that it automatically shows me an in-IDE preview of the PDF file that my .tex file compiles to...as I type. **How would I go about doing this?**


title: Showing labels only at edge of grouped PGF plots

text: The options `xlabels at` and `ylabels at` in PGFplots' grouped plots library are supposed to show axis labels only at the corresponding sides of the complete set of plots, but they seem to have no effect. Am I doing something wrong in this example, or is this a bug?               \documentclass{standalone}     \usepackage{pgfplots}     \usepgfplotslibrary{groupplots}     \pgfplotsset{compat=1.10}     \begin{document}      \begin{tikzpicture}       \begin{groupplot}[group style={group size=2 by 2,ylabels at=edge left,xlabels at=edge bottom}]        \nextgroupplot[xlabel=a,ylabel=b]        \addplot {x};        \nextgroupplot[xlabel=foo,ylabel=b]        \addplot {x};        \nextgroupplot[xlabel=a,ylabel=fdsio]        \addplot {x};        \nextgroupplot[xlabel=foo,ylabel=fdsio]        \addplot {x};       \end{groupplot}      \end{tikzpicture}     \end{document}      which produces ![output](http://i.stack.imgur.com/cwItr.png) but that's not what I want. Only the labels along the bottom and left edges should appear. I seem to remember this working in the past, so perhaps something changed in PGFplots 1.10?


title: Can't move footer up on page

text: I'm trying to write a letter using the scrlttr2 document class. My footer is 3 lines and as such is touching the bottom of the page. I've been trying to move the footer up by using the geometry package (varying footskip and margins) but I'm not having any luck. Any help would be appreciated: my code is below. I should mention that this is a template I found on the internet that I have been trying to edit. Thanks               \documentclass{scrlttr2}          \usepackage{fontspec} % Allows font customization     \usepackage{marvosym} % Allows the use of symbols     \usepackage[english]{babel} % Required to compile in Windows          \setlength\parindent{0pt} % Removes all indentation from paragraphs          \defaultfontfeatures{Mapping=tex-text}     \setmainfont {Garamond} % Main document font     \setsansfont {Garamond} % Used in the from address line above the to address          \renewcommand{\normalsize}{\fontsize{12.5}{17}\selectfont} % Sets the font size and leading          %----------------------------------------------------------------------------------------     %  PERSONAL INFORMATION     %----------------------------------------------------------------------------------------          \setkomavar{fromname}{John Smith} % Your name     \setkomavar{fromaddress}{123 Broadway\\City\\Country} % Your address     \setkomavar{fromphone}{(000) 111-1111} % Your phone number     \setkomavar{fromemail}{john@smith.com} % Your email address     \setkomavar{place}{} % City written before the date, put your city here if you want this     \setkomavar{signature}{John Smith} % Your name as you want it to appear in the signature          % These are not used in this document, uncomment if you would like to use them and refer to them as \usekomavar{name}     %\setkomavar{fromfax}{+1 (1)23 456789} % Your fax number     %\setkomavar{fromurl}{http://www.johnsmith.com} % Your personal website     %\setkomavar{frombank}{Postbank 9307157}          %----------------------------------------------------------------------------------------     %  HEADER SECTION     %----------------------------------------------------------------------------------------          \firsthead{     \centering     {\addfontfeature{LetterSpace=20.0}\fontsize{36}{36}\selectfont\scshape \usekomavar{fromname}}\\[5mm]     \fontsize{21}{21}\selectfont\scshape Programmer at Initech } % Your current job title          %----------------------------------------------------------------------------------------     %  FOOTER SECTION     %----------------------------------------------------------------------------------------          \firstfoot{     \centering     \addfontfeature{LetterSpace=20.0}\scshape     {     \renewcommand{\\}{\ {\large\textperiodcentered}\ }     \usekomavar{fromaddress}     }\\     {\Large\Letter} \usekomavar{fromemail} \\ {\Large\Telefon} \usekomavar{fromphone} % If you want your fax number or website URL showing, add it here; you may need to play around with spacing     }          %----------------------------------------------------------------------------------------          \begin{document}          %----------------------------------------------------------------------------------------     % COVER LETTER CONTENTS     %----------------------------------------------------------------------------------------          \begin{letter}{ % Address of the company you are applying to     HR Dept. --- Corporation\\     123 Pleasant Lane\\     12345 City, State     }          \setkomavar{subject}{Cover Letter} % This is the bold text saying 'Cover Letter', remove it if you don't like it          \opening{Dear Recruiter,}          PARAGRAPH ONE: State the reason for the letter, name the position or type of work you are applying for and identify the source from which you learned of the opening.\\          PARAGRAPH TWO: Indicate why you are interested in the position, the company, its products, services - above all, stress what you can do for the employer. If you are a recent graduate, explain how your academic background makes you a qualified candidate for the position. If you have practical work experience, point out specific achievements or unique qualifications. Try not to repeat the same information the reader will find in the resume. The purpose of this section is to strengthen your resume by providing details which bring your experiences to life.\\          PARAGRAPH THREE: Request a personal interview and indicate your flexibility as to the time and place. Repeat your phone number in the letter. End the letter by thanking the employer for taking the time to consider your credentials.\\          Sincerely yours, \\ \\ \\     \usekomavar{signature}          %----------------------------------------------------------------------------------------          \end{letter}     \end{document}


title: lyx with background won't load unless I type \newpage after the text

text: I try to write a document with a background in lyx, I made sure it works on Texmaker, on Texmaker it needed to be built a couple of times and then it got it right but when I try to preview or export it on lyx it fails and I get blank pages, but when I put in ERT `\newpage` it's capable of showing only the page from above (but only one) but if I want it to show me all of the pages I need to check page by page when It needs to break. I add my Latex code, my lyx code and it's preamble. (It's easy for me to work with lyx because I need to put a lot of equations and other languages so keep doing stuff with latex alone is not an option for me) Thank You. **Latex code**               \documentclass{article}     \usepackage{culmus}     \usepackage{ amssymb }     \usepackage{tikz}     \usepackage{lastpage}     \usetikzlibrary{calc}     \usepackage[placement=top,angle=0,color=black,scale=4,hshift=60,vshift=-5]{background}     \backgroundsetup{contents={\begin{tikzpicture}[overlay,remember picture]              \draw [xshift=4mm,color=black,line width=1pt,rounded corners=7pt]             ($ (current page.north west) + (.5cm,-.5cm) $)             rectangle             ($ (current page.south east) + (-.5cm,.5cm) $);         \end{tikzpicture}         \begin{tikzpicture}[overlay]         \draw[color=black] (0,-2.5) rectangle (-1.3,-0.7);         \draw[color=black] (-0.9,-1.1) node {\large\thepage};         \draw[color=black] (-0.4,-2.1) node {\large\pageref{LastPage}};         \draw[color=black] (-0.2,-0.9) -- (-1.1,-2.3);     \end{tikzpicture}},placement=center,angle=0,opacity=1,scale=1,position =current page.north west }     \pagestyle{empty}          \begin{document}     Here the text     \end{document}      **Lyx code**               Preamble:         \usepackage{tikz}         \usepackage{lastpage}         \date{}                         \usepackage[placement=top,angle=0,color=black,scale=4,hshift=60,vshift=-5]{background}                        \usepackage[a4paper,top=3cm,bottom=0.5cm,right=2cm,left=2cm,heightrounded]{geometry}          ERT:     \usetikzlibrary{calc}     \usetikzlibrary{backgrounds}     \backgroundsetup{contents={\begin{tikzpicture}[overlay,remember picture]     \draw [xshift=4mm,color=black,line width=1pt,rounded corners=7pt]($ (current page.north west) + (0.3cm,-0.3cm) $) rectangle ($ (current page.south east) + (-0.3cm,0.3cm) $);             \end{tikzpicture}              \begin{tikzpicture}[overlay]             \draw[color=black] (0,-2.5) rectangle (-1.3,-0.7);              \draw[color=black] (-0.9,-1.1) node {\large\thepage};             \draw[color=black] (-0.4,-2.1) node {\large\pageref{LastPage}};             \draw[color=black] (-0.2,-0.9) -- (-1.1,-2.3);             \end{tikzpicture}},placement=center,angle=0,opacity=1,scale=1,position =current page.north west }             \pagestyle{empty}                     some text out side ERT             ERT: \newpage


title: How to control the left margin for the formatted text produced by LTXexample?

text: I want to use both LaTeX code snippet using `LTXexample` and C# code snippet using `lstlisting` in my book. If you see my screenshot below, `lstlisting` behaves well but `LTXexample` does not. How to prevent `LTXexample` from expanding its left frame rule beyond the document left margin? ![alt text](http://i.stack.imgur.com/8L1QE.png) My minimal code is given as follows:               \documentclass[dvips,final,dvipsnames]{book}     \usepackage[showframe=true,a4paper,margin=20mm,twoside]{geometry}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{xcolor}     \usepackage{showexpl}     \lstset{%         breaklines=true,%default: false         basicstyle=\ttfamily\scriptsize,         keywordstyle=\color{blue}\sffamily\bfseries,                                                                         commentstyle=\color{ForestGreen}\itshape,                                            stringstyle=\rmfamily,                                                               showstringspaces=false,%default: true         backgroundcolor=\color{Yellow!25},         %---------------------------------------------------------         frame=single,%default: none          framerule=0.2pt,%expands outward          rulecolor=\color{red},         framesep=3pt,%expands outward         %---------------------------------------------------------         %make the frame fits in the text area.          %not affect  LTX when numbers=none.         xleftmargin=3.2pt,%does not affect LTXexample, why? I don't know!         xrightmargin=3.2pt,%does not affect LTXexample, why? I don't know!         %----------------------------------------------------------         tabsize=2,%default: 8 only influence the lstlisting and lstinline.         explpreset={}%to remove the default setting of LTXexample.     }          \begin{document}     \chapter{Bug or Feature?}     I don't like line numbers because they will make copying the codes      no longer convenient for the readers---the readers will be forced       to do an  extra job to remove the line numbers later after pasting       the copied codes to their editors. Line numbers will be useful if       the author make references to code snippet. In my book, I will not       make references. Why? Because I believe you have a good sense to       understand the context.          \section{LTXexample}     \begin{LTXexample}[pos=b,language={PSTricks}]     \LaTeXe\ is fun! But \LaTeXe\ without PSTricks looks like a soup      without salt.     \[     E\not=mc^2     \]     $E=E$ and $mc^2=mc^2$. $E$ is not equal to $mc^2$.      \end{LTXexample}               \section{lstlisting}     \begin{lstlisting}[language={[Sharp]C}]     using System;     public static class Foo     {             public static void Main()             {                 Console.WriteLine("Hello Universe, I am E.T.");             }     }     \end{lstlisting}          \end{document}


title: pdflatex raise error when \paragraph inside quote environment

text: Why I get a error when there is a `\paragraph{}` (or `\subparagraph{}`) inside a `quote` environment? For the example below               \documentclass[]{article}     \begin{document}     \begin{quote}     \paragraph{My header}          Some text.     \end{quote}     \end{document}      I got               $ pdflatex --version     pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013)     $ pdflatex bug-sample.tex     ...     ! LaTeX Error: Something's wrong--perhaps a missing \item.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.7 \end{quote}


title: Contour plot of arbitrary R^3 function without gnuplot

text: Is there a way to make pretty contour plots of arbitrary functions in R^3, like the one below for example, without the use of the gnuplot contour-stuff? The reason I'm asking is I prefer a simple setup of the TeX environment, and since gnuplot isn't included in the Mactex bundle, and requires some adjustments to command line calls etc. I prefer to just solve things with what's available, if feasibly possible. One obvious way would be to manually calculate the contours, but I saw this solution below and really liked that it took a single function for the surface and produced the contours on its own. ![Contour plot](http://i.stack.imgur.com/yC0Uz.png) URL: How to coherently combine 3D and contour plots with pgfplots


title: Side bearings of Minion Pro quotes

text: I'm using Minion Pro with XeLaTeX. However, quotes are much too tight. I know the MinionPro package, for use with LaTeX, has a loosequotes option which slightly increases the side bearings of the ‘quote’ character. Does anyone know whether it's possible to do the same with fontspec — and how to do it? Thanks in advance


title: multirow table, error

text: I'm trying to create a table which some of the cells are `multirow` and this is my code:               \begin{table}[!htb]     \centering     \small\addtolength{\tabcolsep}{4pt}     \caption{""}     \label{table3}     \begin{tabular}{*{7}{|c}|}     \hline      \multirow{2}{*}{H}& \multicolumn{3}{c|}{K@10} & \multicolumn{3}{c|}{K@20}\\\cline{2-7}      & P & R & TFFR &  P & R & TFFR  \\\hline      H\textsubscript{01}  & \multirow{2}{*} & \multirow{2}{*} & \multirow{2}{*} & \multirow{2}{*} & \multirow{2}{*}  & \multirow{2}{*}  \\\hline     H\textsubscript{02} & & & & & &  \\     H\textsubscript{03}  & \multirow{2}{*}  & \multirow{2}{*} & \multirow{2}{*} & \multirow{2}{*} & \multirow{2}{*}  & \multirow{2}{*}   \\\hline     H\textsubscript{04} & & & & & &  \\     H\textsubscript{05}  & \multirow{2}{*}  & \multirow{2}{*}  & \multirow{2}{*} & \multirow{2}{*} & \multirow{2}{*}  & \multirow{2}{*}  \\\hline     H\textsubscript{06} & & & & & &  \\\hline      \end{tabular}     \end{table}      I don't know what's wrong with this code. This is the error which I got:               ! LaTeX Error: Something's wrong--perhaps a missing \item.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.487 ... & \multirow{2}{*}  & \multirow{2}{*}  \\


title: How to draw triangular grid in TikZ?

text: Is there an easy way to draw a triangular grid in TikZ, like this? ![](http://i.stack.imgur.com/SB1JJ.png)