title: How to force LaTeX to keep section/subsection headings with one line below it on the bottom of the current page?

text: By default, LaTeX allows a page break after the first two lines of paragraphs following section/subsection headings, but I would like to keep the section heading with even one line below it at the bottom of the current page. How to do it?   Please note that I'd prefer not to use any additional packages such as etoolbox or needspace.   Here is my MWE:               \documentclass{book}     \usepackage[showframe]{geometry}% just for this example     \usepackage{lipsum}     \newcommand{\dummy}{This is a test }     \begin{document}     \lipsum[1-6]     \section{bla}     This is a test  This is a test  This is a test This is a test      This is a test This is a test This is a test      This is a test      \end{document}


title: Giving an equation between \[ \]'s a number

text: I usually use `\[ ... \]` to typeset equations in latex and sometimes I come back and realize that I want to have an equation number and label. I have been coming back and editing it to `\begin{equation} ... \end{equation}` but this is annoying and time consuming. Is there a command to do something like `\[ \addeqnumber{} \]` which will work the same way as the equation environment? I am aware this probably isn't the best practice, but it would save me some annoyance.


title: Contents Table in beamer squeezing distances

text: I would like to squeeze the table of Contents in beamer from the top. Also, I would like to increase the horizontal distance for subtitles as the following picture ![here](http://i.stack.imgur.com/dobJB.png) This is my code. Please suggest simple codes because I'm an absolute beginner in beamer               \documentclass{beamer}          \usepackage{beamerthemesplit}          \setbeamertemplate{section in toc}[sections numbered]     \setbeamertemplate{subsection in toc}[subsections numbered]               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{document}          \frame{\titlepage}          \begin{frame}         \frametitle{Contents:}         \begin{minipage}[t][0.5cm]{\textwidth}         \tableofcontents         \end{minipage}     \end{frame}          %--------------------------------------------------------     %------------------/ Section 1 /-------------------------     \section{Abstract}     \begin{frame}         \frametitle{\textbf{1. Abstract:}}         The primary work of my research is      \end{frame}          %______________________________________________________     \subsection{ssssss}     \begin{frame}         \frametitle{\textbf{1.2. ssssssss}}         ssssssssssssssssssssssss     \end{frame}          %______________________________________________________     \subsection{fffffff}     \begin{frame}         \frametitle{\textbf{1.3. ffffff}}         ffffffffffffffffffffffffffffff     \end{frame}          %--------------------------------------------------------     %------------------/ Section 2 /-------------------------     \section{Introduction}     \begin{frame}         \frametitle{\textbf{2. Introduction:}}     \end{frame}               \end{document}


title: How do I move the x labels to the left but move origin label to the right?

text: See below for the code that generates the image below. How do I move the x labels out of the way to the left, but move the zero to the right?               \documentclass[border=12pt]{standalone}     \usepackage{pstricks,pst-plot}          \begin{document}     \psset{xunit=1,yunit=0.2}     \begin{pspicture}(-1.75,-12)(7,17)      \psaxes[ticks=y,Dx=2,Dy=10]{->}(0,0)(-1.7,-12)(5.9,13)[$t(s)$,0][$x$,90]     \psxTick(0){0}     \psline[linecolor=blue](-1,0)(0,0)(0,10)(2,10)(2,-10)(4,-10)(4,0)(5,0)     \end{pspicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/vJCuK.jpg)


title: Geometry package arguments not doing anything

text: For some reason in the following code, changing the margin argument for the geometry package line does nothing to the document. Even if I comment out the geometry package it doesn't go back to the defaults. I made sure I'm opening up the right PDF, I even deleted the pdf file to make sure I was opening up the correct PDF. I'm trying to get the space at the bottom of the page to be less (for some odd reason, it is way too much by default.)                \documentclass[12pt]{article}     \usepackage[showframe=false,headheight=1cm]{geometry}     \usepackage{fancyhdr} % for headers and footers     \usepackage{lipsum}   % for dummy text     \usepackage{setspace}     \usepackage[margin=1in,bottom=1in]{geometry}          \begin{document}          % headers     \fancyhead[L]{}     \fancyhead[C]{}     \fancyhead[R]{     \begin{minipage}{2in}      \raggedleft      \small Derper McDerp \\     \small Derponomics 101 \\     \small Dr. Derpy Derp     \end{minipage}}     \renewcommand{\headrulewidth}{0pt}          % footers     %\fancyfoot[L]{}     %\fancyfoot[C]{}     %\fancyfoot[R]{}          % need to specify the pagestyle as fancy     \pagestyle{fancy}     \doublespace          \section*{Essay 3}     \lipsum     \end{document}      Anyone know what is going on with the geometry package?


title: Align normal text inside a listing

text: I need a way to correctly align the escaped strings that I put inside of this listing. The problem is that they are presented right aligned. I want that this lines keep the indentation of the previous code. For example:                line of code       line of code             line of code             \vdots correctly aligned escaped string      what I have is something like                line of code       line of code             line of code                                \vdots right aligned escaped string      the real code is this:               \lstset{language=[Sharp]C,,basicstyle=\footnotesize, showspaces=false,showtabs=false,,breaklines=true,showstringspaces=false,breakatwhitespace=true,frame=trBL, escapeinside={(*@}{@*)}}     \begin{lstlisting}      namespace WindowsFormsApplication1     {         public partial class Form1 : Form         {             string oldName;             int index = 0;             public Form1()             {                 InitializeComponent();                 listView1.LabelEdit = true;                 listView1.MultiSelect = false;             }                  private void button1_Click(object sender, EventArgs e)             {                 listView1.Items.Add("xd"+index);                 index++;                 listView1.Items[listView1.Items.Count - 1].Selected = true;                 (*@  $\vdots$ @*)                 (*@  $\vdots$ Comparaciones similares a la anterior. Compactadas por brevedad. @*)                 (*@  $\vdots$ @*)                  }


title: What functions does 3dplot support for parametricfill input

text: I used 3dplot for tikz-pgf to draw an ellipsoid. Now I'd like to color the surface in dependence of it's mean curvature (I have calcuated this function.) But 3dplot does not seem to support sin and cos arguments as it's parameter to the parametric fill option. Is that right? I'm going to provide a testcase here:               \documentclass{minimal}          \usepackage{verbatim}          \usepackage{tikz}     \usepackage{3dplot}          \usepackage[active,tightpage]{preview}      %generates a tightly fitting border around the work     \PreviewEnvironment{tikzpicture}     \setlength\PreviewBorder{2mm}          \begin{document}             \tdplotsetmaincoords{70}{135}             \begin{tikzpicture}[line join=bevel,tdplot_main_coords, fill opacity=.7]                     \tdplotsphericalsurfaceplot[parametricfill]{40}{20}%                     {1/sqrt(%                             sin(\tdplottheta)^2*( (cos(\tdplotphi)/2)^2 + (sin(\tdplotphi)/1)^2 )%                             + (cos(\tdplottheta)/1)^2                     )}{black}%                     {%                                     sin(\tdplotphi)                             % 2*(5-3*sin(\tdplottheta)^2*cos(\tdplotphi)^2)/%                                     % sqrt((4-3*sin(\tdplottheta)^2*cos(\tdplotphi)^2)^3)                     }%                     {}%{\draw[color=black,thick,->] (0,0,0) -- (2,0,0) node[anchor=north east]{$x$};}%                     {}%{\draw[color=black,thick,->] (0,0,0) -- (0,2,0) node[anchor=north west]{$y$};}%                     {}%{\draw[color=black,thick,->] (0,0,0) -- (0,0,2) node[anchor=south]{$z$};}%             \end{tikzpicture}     \end{document}      Would like to know if I'm doing something wrong, or if that feature is not supported. In that case: Do you know a tool I could use to achieve my goal? Kind regards Konstantin


title: How to number equations and floating materials by page number

text: I am somewhat intrigued by question Something like \enumerate, but with custom numbers at each \item, which mentions a book where each question is numbered by its page number and the question number. That question is about manual numbering of list items, but how would one go about making each **equation** be **automatically** numbered by its page number + a sequential number for each page. For instance, the first equation on page 50 would be numbered 50-1 and the second 50-2, while the first equation on the following page would be numbered 51-1. Also, how can one extend this to cover floating material too, i.e., figures and tables. I’d prefer a numbering where each type of material (equation, figure, table) has a separate counter, so the first equation, the first figure and the first table on page 50 would all be numbered 50-1. (One would of course disambiguate between them by referring to ‘Equation 50-1’, ‘Figure 50-1’ and ‘Table 50-1’.) For anyone wanting to have a go at this problem, here’s a simple example document you can use:               \documentclass{article}          \usepackage{lipsum}          \begin{document}          \def\bodytext{          \begin{equation}      2 + 2 = 4     \end{equation}          \begin{equation}      e^{\pi i} = -1     \end{equation}          \begin{figure}[htbp]     First figure.     \caption{Figure caption one.}     \end{figure}          \begin{figure}[htbp]     Second figure.     \caption{Figure caption two.}     \end{figure}          \begin{table}[htbp]     First table.     \caption{Table caption one.}     \end{table}     }          \bodytext     \lipsum     \bodytext     \lipsum     \bodytext          \end{document}      By the way, I’m not sure ‘50-1’ is the best formatting to use. Other alternatives I can think of are (50-1), 50.1, 50(1) and 50a, and I actually think I prefer the last one. Any comments on this? (If so, please post them as comments, not answers.)


title: siunitx package use with tex4ht and generation of invalid mathml for units

text:
This file               \documentclass{article}     \usepackage{siunitx}     \begin{document}      \SI{10}{\square\meter}           $\SI{10}{\square\meter}$     \end{document}      Builds fine in padlatex, but fails in the HTML generated by tex4ht when using mathml. The HTML page displays an error parsing mathml message. The problem is when using the square meter in the math mode. In non-math mode it works. Below is the command used, the htlatex configuration file used, and the error message and the HTML generated. Is this a configuration issue, or a `mathml` bug in code generated by tex4ht? I spent many hours changing all my code to use the `\usepackage{siunitx}` and have lots of such code now changed and only noticed this problem now. The command used               htlatex foo.tex "my,htm,pic-align,charset=utf-8,notoc*" " -cunihtf -utf8"      where my.cfg is the configuration file. Please see it below. It has to be in the same folder (or in $HOME) This is the error ![Mathematica graphics](http://i.stack.imgur.com/XnNFo.png) Here is the HTML code generated               <!DOCTYPE html>             <title></title>      <meta charset="UTF-8" />      <meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" />      <link rel="stylesheet" type="text/css" href="foo.css" />
10 m2
   <math       xmlns="http://www.w3.org/1998/Math/MathML"       display="inline" ><mstyle      class="text"><mtext  >10</mtext></mstyle><mspace width="0em" class="thinspace"/><mstyle      class="text"><mtext  >m2</mtext></mstyle></math>                      This is my .cfg that I use with mathml mode               \Preamble{mathml}     \Configure{VERSION}{}       \Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}}       \Configure{HTML}{\HCode{\Hnewline}}{\HCode{\Hnewline}}       \Configure{@HEAD}{}       \Configure{@HEAD}{\HCode{<meta charset="UTF-8" />\Hnewline}}       \Configure{@HEAD}{\HCode{<meta name="generator" content="TeX4ht       (http://www.cse.ohio-state.edu/\string~gurari/TeX4ht/)" />\Hnewline}}       \Configure{@HEAD}{\HCode{<link                rel="stylesheet" type="text/css"                href="\expandafter\csname aa:CssFile\endcsname" />\Hnewline}}            \Configure{@HEAD}{\HCode{%                 }}            \Configure{@HEAD}{\HCode{\Hnewline}}       \Configure{@HEAD}{\HCode{\Hnewline}}          \begin{document}     \EndPreamble      When not using `mathml` then the error goes away (notice, not using my.cfg)               htlatex foo.tex "htm,pic-align,charset=utf-8,notoc*" " -cunihtf -utf8"      ![Mathematica graphics](http://i.stack.imgur.com/CkJwB.png) But I have to use mathml, since I use mathjax to render everything and I do not want to go back to using .png images for math. I am using texlive 2013 on Linux mint 16


title: Custom .sty directory with OSX 10.5 and pdfTeXk

text: I have a tex project using a custom `.cls` which builds in Windows 7 with TeXlipse + MikTeX. The `.cls` has a number of CTAN LaTeX contrib package dependencies, which I installed one-by-one with MikTeX (something is wrong with my auto-installer). This project has the directory structure:               src/ <- .tex files here     fig/ <- .pdf figures etc     style/ <- .cls file here      This project is checked into a CVS repo and a Mac user needs to be able to checkout and build the latest revision. This user has: `Mac OSX 10.5.8, pdfTeXk, Version 3.1415926-1.40.9`. What I'd like is to be able to check in these contrib packages into the `style/` directory, and then using some commandline arguments include the `style/` directory in pdfTeXk's search path so it can find the `.sty` files when the user builds `src/document.tex`. I don't have access to a Mac, but I did try to accomplish the same thing with CentOS 5.6 with no luck. It seems most `pdflatex` packages (ie `tetex- latex-3.0-33.8.el5_5.6.x86_64.rpm`) expect `.sty` files to be in a strict folder hierarchy. I tried the `-input-directory` argument and `TEXINPUT` environment variable with no avail. I'm aware that TeXShop has a package manager which could download and install the required packages for this user, but I'd like to avoid this for a couple reasons:   1. I'd rather not encourage messing with their already-working environment with pdfTeXk.   2. My understanding is that TeXShop won't auto-install packages during the build, which is painful because this `.cls` has like 10-20 contrib dependencies. Is there an easy solution here? Perhaps I am just spoiled by the ease of MikTex, but this seems to be a pretty basic functionality. EDIT: It's worth pointing out that I'm using the commandline on CentOS and I believe the user is doing the same in OSX.


title: pstricks output garbled on Ubuntu 13.04

text: I recently installed Ubuntu 13.04 and tried to recompile a pstricks document I had previously created on an older version of Ubuntu. However all the images came out wrong and consist of all the text contained in the image overlayed at a single position within the image. Lines and shapes are not rendered at all. Trying the basic pstricks example also does not render correctly in the dvi.               \documentclass{article}     \usepackage{pstricks}     \begin{document}     \begin{figure}     \begin{pspicture}(4,5)     \psframe(0.7,2)(3.3,3)     \rput(2,2.5){First Example}     \end{pspicture}     \end{figure}     \end{document}      It just prints the text without the surrounding frame. I've tried uninstalling texlive and pstricks and reinstalling everything (using apt-get) to no avail. I would appreciate any pointers as to how I can go about tracking down the issue. Edit: Solved thanks to JosephWright's answer. At first I was compiling using the quickbuild option in texmaker with               latex -> view dvi       which gave the garbled output. I then tried               latex -> dvips -> view ps      That just hangs indefinitely so I started compiling using just latex and checking the dvi. Using               latex -> dvips -> ps2pdf       works perfectly.


title: Unsetting a PGF/TikZ key

text: Is there any possibility of “unsetting” a PGF/TikZ key? By “unsetting” I mean to remove the key from the list of keys and make PGF/TikZ behave as if it was never specified. To clarify, consider this minimal working example:               \documentclass{minimal}          \usepackage{tikz}     \usetikzlibrary{shapes.misc}          \begin{document}     \begin{tikzpicture}       \tikz\node[draw=red, circle] {Short 1};       \node[draw, text width=3cm] (r1) {         \tikz\node[draw=blue, circle] {Short 2};       };     \end{tikzpicture}     \end{document}      In the resulting output, I would expect the two circles to be of equal size (except for a tiny difference because of “1” vs. “2”). However, the second (blue) circle inherits the text width property from the parent node. Now, I would like to have that (blue) circle behave as if text width was never specified for it. How do I achieve this? What’s working, of course, is manually specifying a different text width, but that’s not an option for me because I would like to have _dynamic_ node sizes inside another node. Using minimum width/height on the outer node instead of text width does not produce satisfactory results for my eventual use-case either (which is, BTW, to have nodes of the same size, some containing text, some containing other nodes) – I could manage to use that, but it would mean significant overhead of creating additional nodes, as far as I see it. The question might, of course, be generalized into something along the lines of “How do I put a `tikzpicture` inside a TikZ node that does _not_ inherit the keys set for the parent node?” I hope to have made myself clear and that there is an easy answer to my question ;-)


title: How do I apply both \mathbf and \left to a \langle?

text: I want text surrounded by a bold-face `\left\langle ... \right\rangle`. But when I use `\mathbf` or `\pmb`, I get errors, and when I use `\bm`, it doesn't seem to do anything. Is there a command that does this? I don't want to use `\big`, because I want this in a macro that I can use in many different places.


title: Accents not positioned correctly over rsfs letters

text: On my computer, the file               \documentclass{article}          \usepackage{mathrsfs}          \begin{document}          $\tilde{\mathscr M}$          \end{document}      renders as ![enter image description here](http://i.stack.imgur.com/RbraW.png) But shouldn't the tilde be shifted to the right, so that it's directly above the top points of the M? (I have similar problems with other accents and other rsfs letters.) What files do you think I need to update? My .log file says I'm using mathrsfs 1996/01/01 Math RSFS package v1.0 (jk)   ursfs.fd 1998/03/24 rsfs font definition file (jk) Edit: Here is my ursfs.fd file:               %% ursfs.fd     %%     %% (c) Copyleft 1995, 1996, 1998, 1999 J"org Knappen     %% Licence: GNU public licence version 2     %%     \ProvidesFile{ursfs.fd}[1998/03/24 rsfs font definition file (jk)]     \DeclareFontFamily{U}{rsfs}{\skewchar\font127 }     \DeclareFontShape{U}{rsfs}{m}{n}{%        <5> <6> rsfs5        <7> rsfs7        <8> <9> <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> rsfs10     }{}     \endinput          J"org Knappen, Barbarossaring 43, D-55118 Mainz, Allemagne     Author of the Book: Schnell ans Ziel mit LaTeX2e, Oldenbourg-Verlag     M"unchen, 1997, ISBN 3-486-24199-0.     % /ursfs.fd      Edit #2: Okay, I think the problem is with the rsfs10.tfm file that my MiKTeX looks at by default. I downloaded a rsfs10.tfm file from a website and put the file in the same directory as my test paper, and the `$\tilde{\mathscr M}$` rendered correctly. Is there a preferred website to get .tfm files from?


title: Setting fill color for TikZ arrow tips only (and not the path itself)

text: For many TikZ diagrams, I’d like to draw colored (often gray) arrows. I prefer the `latex`-style arrow tips (from the arrows library). These are filled by using the default background fill color. My problem is that complex paths cannot have a `fill=…` key because that would mean “fill the path (and the arrow tip)” rather than “fill the arrow tip” as in the following MWE:               \documentclass{minimal}          \usepackage{tikz}     \usetikzlibrary{arrows}          \begin{document}     \begin{tikzpicture}[>=latex, ->]       % okay: all black       \draw[] (2,0) to[bend left] ++(right:1cm);             % not okay: gray line, black tip       \draw[draw=black!50] (3,0) to[bend left] ++(right:1cm);             % not okay: gray line, gray tip, path filled       \draw[draw=black!50, fill=black!50] (4,0) to[bend left] ++(right:1cm);             % okay, but complicated: gray line, gray tip, path not filled       \begin{scope}[fill=black!50]         \draw[draw=black!50] (5,0) to[bend left] ++(right:1cm);       \end{scope}     \end{tikzpicture}     \end{document}      ![Output](http://i.stack.imgur.com/Srs6R.png) The last arrow actually achieves the correct result – i. e., gray arrow, gray arrow tip, no background fill for path – but it is a bit cumbersome to use a scope for every colored arrow that I'm drawing. So my question: Is there an easier way of influencing the arrow tip fill color? BTW, I’m aware of the solution using the marking library in How to make an arrow bigger and change its color in TikZ?, but I was hoping for a more elegant solution because using markings feels not very “natural” compared to using lines and arrow tips in TikZ.


title: how to control font and paragraph formatting in margins

text: i'm having a hard time to figure out how to control the exact appearance of margin text (such as is output by the `\marginpar` command). i'm using XeLaTeX with packages such as `geometry`, `fontspec`, `leading` and have managed to gain fine control over issues such as font faces, font sizes, paragraph indentation and line spacing, including how to set margin width and the distance of the margins from the main text. how can i control the font and paragraph formatting of margins?


title: How to create a Sierpinski triangle in LaTeX?

text: I have been trying to recreate the following image in LaTeX ![http://i.imgur.com/Ht9Gaow.jpg](http://i.stack.imgur.com/I2gXx.jpg) and for me personally it has to be done with pdflatex. Although answers using `pst-fractals` From Jake I got a good start which led to the following code               \documentclass{standalone}     \usepackage{tikz}     \def\level{5}     \usetikzlibrary{lindenmayersystems}          \begin{document}     \begin{tikzpicture}[l-system={step=5pt, order=\level, angle=120},rotate=180]         \pgfdeclarelindenmayersystem{Sierpinski triangle}{         \symbol{X}{\pgflsystemdrawforward}         \symbol{Y}{\pgflsystemdrawforward}         \rule{X -> X-Y+X+Y-X}         \rule{Y -> YY}         }         \draw [black] (3,2) l-system         [l-system={Sierpinski triangle, axiom=X, anchor=north east},fill=white];     \end{tikzpicture}          \end{document}      There are however two problems with the code.   * I layer a black triangle behind the lindenmayersystem?   * How do I keep the size of the triangle consistent with different number of recursion levels.


title: Node numbering problem?

text: \begin{tikzpicture}          \coordinate (1) at (0,0);     \coordinate (2) at (1,0);     \coordinate (3) at (0.5,1);     \coordinate (4) at (0,0);     \coordinate (5) at ($(1)!.5!(2)$);     \coordinate (6) at ($(2)!.5!(3)$);     \coordinate (7) at ($(3)!.5!(1)$);     \foreach \i in {1,...,3}     \fill (\i) circle (1pt) node [below] {\i};          \foreach \i in {5}     \fill (\i) circle (1pt) node [below] {\i};     \foreach \i in {6,7}     \fill (\i) circle (1pt) node [above] {\i};          \draw (1)--(2)--(3)--(4);          \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/3ZP0A.jpg)


title: How to make the length of a car moving on a roller coaster track remain unchanged?

text: For any arbitrary parametric smooth curve, how can I make the length of a car remain unchanged?               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pst-plot,pst-node}          \pstVerb     {         tx@Derive begin         /EvalVariable { 2 index (t) eq { (1) } { (0) } ifelse 4 -1 roll exch 6 2 roll } def         end      }               \def\x{t}     \def\y{2*cos(t)}          \def\xx{Derive(1,\x)}     \def\yy{Derive(1,\y)}     \def\rr{sqrt((\xx)^2+(\yy)^2)}          \def\Nx{-\yy/\rr}     \def\Ny{\xx/\rr}          \def\R{.2}     \def\xP{\x+\R*\Nx}     \def\yP{\y+\R*\Ny}          \begin{document}          \multido{\rx=.0+.3,\ry=.4+.3}{41}{%     \begin{pspicture}[algebraic](-.2,-2.2)(\dimexpr\psPiFour cm+.2cm,2.2)         \psparametricplot[linecolor=gray,plotpoints=100]{0}{TwoPi 2 mul}{\x|\y}         \curvepnodes[plotpoints=2]{\rx}{\ry}{\xP|\yP}{P}         \pspolygon*[linecolor=gray](P0)(P1)([offset=-.5]{P0}P1)([offset=.5]{P1}P0)         \qdisk(P0){\R}\qdisk(P1){\R}         \psparametricplot[linecolor=red,linewidth=2pt,plotpoints=100]{0}{\rx}{\xP|\yP}     \end{pspicture}}          \end{document}      ![enter image description here](http://i.stack.imgur.com/K3jhT.gif) ## Commenting Herbert's solution It is too long as comment. Herbert's solution apparently keeps the length of curve segment bounded by the wheels constant rather than the length of the car. The following animation shows it.               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pstricks-add}          \pstVerb     {         tx@Derive begin         /EvalVariable { 2 index (t) eq { (1) } { (0) } ifelse 4 -1 roll exch 6 2 roll } def         end      }               \def\x{t}     \def\y{2*cos(t)}          \def\xx{Derive(1,\x)}     \def\yy{Derive(1,\y)}     \def\rr{sqrt((\xx)^2+(\yy)^2)}          \def\Nx{-\yy/\rr}     \def\Ny{\xx/\rr}          \def\R{.2}     \def\xP{\x+\R*\Nx}     \def\yP{\y+\R*\Ny}          \begin{document}          \multido{\iA=1+1,\iB=10+1}{40}{%     \begin{pspicture}[algebraic](-.2,-2.2)(\dimexpr\psPiFour cm+.2cm,2.2)         \psparametricplot[linecolor=gray,plotpoints=100]{0}{TwoPi 2 mul}{ \x | \y }         \pscurvepoints[plotpoints=50]{0}{TwoPi 2 mul}{ \xP | \yP }{P}         \pspolylineticks[ticksize=0 0,metricInitValue=1,Os=1,Ds=.3]{P}{ ds }{1}{50}%         \pspolygon*[linecolor=gray](PTick\iA)(PTick\iB)([offset=-.05]{PTick\iA}PTick\iB)([offset=.05]{PTick\iB}PTick\iA)         \qdisk(PTick\iA){\R}\qdisk(PTick\iB){\R}     \end{pspicture}%     }          \end{document}      ![enter image description here](http://i.stack.imgur.com/7YQEl.gif)


title: How can I get a slimmer \textbar?

text: I use `\textbar` in my headers in order to separate the page number from the section.               \thepage\hspace{0.5ex}\textbar\hspace{1ex}\thesection\sectiontitle      But I want to slim the thickness of the `\textbar` and to set it to 0.15ex (to match the width of the head rule). The `\textbar` must be a bit higher than the page number and the title of the section (`\textbar` is like this already).


title: pgfplots - x unit, space between label and parantheses

text: Can I specify the space between the label and the parantheses when using x unit in pgfplots? In my example image, I want less space (\,) between the E and the [eV]. ![enter image description here](http://i.stack.imgur.com/ZH0Gp.png)


title: Unnumbered linguistic examples with glosses

text: I want to have an unnumbered and unindented linguistic example with glossing and free translation. In other words, I want what `\exg.` produces in `linguex`, but without the numbering and the indentation; or what `\sn` produces in `gb4e`, but without the identation. I wonder what would be the cleanest way to achieve this. Any help is appreciated.


title: How to sort a glossary by order of appearance?

text: In the **glossaries** package, how can I make the glossary print the entries by order of appearance? Some context: I'm using the glossaries package to generate a symbol index, and I'm interested to see whether the order in which I introduce the notation makes sense.


title: Bending snakes with xy-pic

text: This is a follow-up to this question: How do you draw the "snake" arrow for the connecting homomorphism in the snake lemma? I'm trying to emulate this snake diagram Aluffi does in his book "Algebra, Chapter 0" with xy-pic: ![enter image description here](http://i.stack.imgur.com/mS81r.jpg) but I can't modify correctly Matsaya's code to this avail. What I especially like about this diagram is the snake, crossing the diagram that way.


title: TeXing special japanese characters

text: I want to TeX the Japanese characters 因子の部屋 (lit. "factor rooms"). How do I do that with LaTeX?


title: Custom calendar using TikZ

text: I am trying to build a custom calendar using some features of TikZ. My starting point was a piece of code available in a comment of texample.net. I would like to know if it is possible to mark some days with symbols different than circles. If you compile the code below, you will see that circles can be easily inserted in the calendar. Now I would like to know if someone could show me how to insert diamonds or triangles or squares and if possible filled with some color. Thank you in advance for your help.               \documentclass[12pt]{article}     \usepackage{lscape,tikz}     \usepackage[brazil]{babel}     \usepackage[latin1]{inputenc}     \usepackage[margin=1in, paperwidth=15.8in, paperheight=8.5in]{geometry}     \usepackage{geometry}     \usepackage{amsmath,color,graphicx}     \usepackage{amsfonts}     \usepackage{amssymb}     \definecolor{Red}{cmyk}{0,1,1,0}     \def\red{\color{Red}}     \definecolor{Blue}{cmyk}{1,1,0,0}     \def\blue{\color{Blue}}          %%in preamble:     %     \Huge     \usetikzlibrary{arrows,shapes}     \usetikzlibrary{positioning,calendar,er}     \usetikzlibrary{decorations.markings}     \usetikzlibrary{shapes.geometric}          \newcommand{\calrow}[1]{\node[anchor=base east](seg){S};     \node[base right=of seg](ter){T}; \node[base right=of ter](qua){Q};     \node[base right=of qua](qui){Q}; \node[base right=of qui](sex){\ \!S};     \node[base right=of sex](sab){\ \!S}; \node[base right=of sab](dom){D};     \node[black,above=of qui]{\textbf{#1}};}     \newcommand{\calperiod}[1]{\calendar[dates=\the\year-#1-01 to \the\year-#1-last]     if(Sunday) [red] \holidays;}     \newcommand{\holidays}{% holidays in Italy     if (equals=01-15) {\draw (-0.348,0.135) circle (9.0pt);}%     if (equals=01-06) [black!50]%     if (equals=04-04) [black!50]%     if (equals=04-05) [black!50]%     if (equals=04-25) [black!50]%     if (equals=05-01) [black!50]%     if (equals=05-01) [black!50]%     if (equals=06-02) {\draw (-0.25,0.135) circle (9.0pt);}%     if (equals=08-15) [black!50]%     if (equals=11-01) [black!50]%     if (equals=12-08) [black!50]%     if (equals=12-25) [black!50]%     if (equals=12-26) [black!50]%     }     \colorlet{darkgreen}{green!50!black}               \begin{document}          \begin{tikzpicture}     [every calendar/.style={week list}]     %\node[star,draw,minimum size=.4cm,star point ratio=1.0,thick] at (calendar-\the\year-08-29){};     \sffamily     \matrix[%     row 1/.style={black,node distance=.3ex},%     row 3/.style={black,node distance=.3ex},     column sep=1ex,%     draw=black,thick,rounded corners=30pt,%     postaction={decorate,decoration={markings,mark=at position 0.51 with     {\node[fill=white,text=black,font={\bfseries\Large}] (year) {\the\year};}}}     % year on frame: decorations.markings library     ]{%     % first row: week day and month     \calrow{Janeiro} & \calrow{Fevereiro} & \calrow{Março} &     \calrow{Abril} & \calrow{Maio} & \calrow{Junho} \\     % second row: calendar     \calperiod{01} & \calperiod{02} & \calperiod{03} &     \calperiod{04} & \calperiod{05} & \calperiod{06} \\[0.4cm]     % third row: week day and month     \calrow{Julho} & \calrow{Agosto} & \calrow{Setembro} &     \calrow{Outubro} & \calrow{Novembro} & \calrow{Dezembro} \\     % forth row: calendar     \calperiod{07} & \calperiod{08} & \calperiod{09} &     \calperiod{10} & \calperiod{11} & \calperiod{12} \\     };     \end{tikzpicture}     \end{document}      **Edition.** To clean up the code, I remove the repetitions pointed out by Ulrike Fischer as well some useless comments.


title: How to make an annotated bibliography

text: I have to make an annotated bibliography but frankly this is my first time doing something like this and the solutions online either a) Don't work or b) fly right over my head as such the annotated bibliography needs to looks as follows: ![enter image description here](http://i.stack.imgur.com/vbPwG.png) PLEASE PLEASE help anyone!! How Do I achieve this? Here is my current bib file:               @inproceedings{marolt2002neural,       title={Neural networks for note onset detection in piano music},       author={Marolt, Matija and Kavcic, Alenka and Privosnik, Marko},       booktitle={Proceedings of the International Computer Music Conference},       year={2002}     }          @inproceedings{marolt2000transcription,       title={Transcription of polyphonic piano music with neural networks},       author={Marolt, Matija},       booktitle={Electrotechnical Conference, 2000. MELECON 2000. 10th Mediterranean},       volume={2},       pages={512--515},       year={2000},       organization={IEEE}     }          @inproceedings{bock2012polyphonic,       title={Polyphonic piano note transcription with recurrent neural networks},       author={Bock, S and Schedl, Markus},       booktitle={Acoustics, Speech and Signal Processing (ICASSP), 2012 IEEE International Conference on},       pages={121--124},       year={2012},       organization={IEEE}     }          @inproceedings{costantini2010svm,       title={SVM based transcription system with short-term memory oriented to polyphonic piano music},       author={Costantini, Giovanni and Todisco, Massimiliano and Perfetti, Renzo and Basili, Roberto and Casali, Daniele},       booktitle={MELECON 2010-2010 15th IEEE Mediterranean Electrotechnical Conference},       pages={196--201},       year={2010},       organization={IEEE}     }          @inproceedings{nava2004convolutional,       title={A convolutional-kernel based approach for note onset detection in piano-solo audio signals},       author={Nava, Gabriel Pablo and Tanaka, Hidehiko and Ide, Ichiro},       booktitle={Int. Symp. Musical Acoust. ISMA},       pages={289--292},       year={2004}     }          @inproceedings{dixon2001learning,       title={Learning to detect onsets of acoustic piano tones},       author={Dixon, Simon},       booktitle={Proceedings of the Workshop on Current Directions in Computer Music Research},       pages={147--151},       year={2001}     }          @article{poliner2006discriminative,       title={A discriminative model for polyphonic piano transcription},       author={Poliner, Graham E and Ellis, Daniel PW},       journal={EURASIP Journal on Advances in Signal Processing},       volume={2007},       year={2006},       publisher={Hindawi Publishing Corporation}     }      Here is my .tex file:               \documentclass{article}          \begin{document}     \maketitle     \newpage     \bibliographystyle{plain-annote}     \bibliography{sample}          \cite{marolt2002neural}          \end{document}


title: Making a line-separated left-margin in LaTeX

text: I'm trying to write a user guide in LaTeX, and I want to layout my page in a way that I can put in a left margin for comments / notes on the corresponding lines of text in the main portion of the page (eg. a pcture of an exclamation mark and some words of caution to the reader about something said in the content on the right). Furthermore it would be nice if I could somehow get a thin line separating the margin and the main body of text. I've tried playing around with minipage, but I don't know how to specify the placement of the columns: I can't make the "margin" column align to the left side of the page, minipage always splits the page in half. EG:                         |  main content of the page               |  ctd.....................     ! Warning |  ctd.....................               |  ctd.....................               |  ctd.....................     ? Note    |  ctd.....................               |  ctd.....................


title: Blank pages after \include in LaTeX report class

text: I'm writing my thesis as several separate chapters and incorporating them into one `.tex` file. Some of the chapters are pdfs of articles, and they are simply added to my `master.tex` using `\input`. However, 2 chapters are 'traditionally' written (not published articles) and include a bibliography at the end of each chapter. For this reason, I use `chapterbib` with `[sectionbib]` enabled. And in order for the separate bibliographies to appear, I have to `\include` these chapters, rather than `\input`.               \documentclass[a4paper,12pt,openany]{report}     \usepackage{pdfpages}     \usepackage[top=1.5in, bottom=1.5in, left=1.57in, right=1in]{geometry}     \usepackage[sectionbib]{natbib}     \usepackage[sectionbib]{chapterbib}     \bibliographystyle{apalike}          \begin{document}          \input{frontpage}     \input{abstracts}     \input{declarationandcopyright}     \input{acknowledgementsanddedictation}     \include{chapter1}     \input{chapter2}     \input{chapter3}     \input{chapter4}     \include{chapter5}     \input{chapter6}          \end{document}      The problem: I'm getting two additional blank pages before the start of chapter 1, one extra blank page before the start of chapter 2, but no extra blank pages in between chapters 2-3 or 3-4 etc. An example of one of my `\include` chapters:               \chapter{Introduction}          \addcontentsline{lof}{chapter}{Introduction}     \addcontentsline{lot}{chapter}{Introduction}     \section{A subtitle}     Some text here     \newpage     \bibliographystyle{apalike}     \bibliography{library}      An example of one of my `\input` chapters:               \chapter{chapter3}     \includepdf[pages=-, scale=0.9, offset=30 1]{paper2.pdf}      I have to compile each `\include` chapter individually in BibTeX, then run PDFLaTeX twice on my `master.tex`. I assumed it was a problem with LaTeX trying to keep the first page of each chapter on an odd numbered page. But actually it's putting them on odd or even. So perhaps it's something to do with the bibliographies? Any suggestions about how I can get rid of all these blank pages? Much appreciated.


title: Compiling partial documents (without document tags)

text: I am getting some colleagues to migrate from Word to LaTeX for technical documents, but old habits die hard. I am looking for a way to compile each LaTeX document partially without document tags, so that each document can be previewed easily, while still being capable of inclusion in a larger document which will in fact have a document tag. Is it possible to have document tags in all documents (read .tex files) to allow fragment compilation, then suppress them once an inclusion is performed?


title: Table footnotes without footnote marks

text: In my table I would like to use footnotes for more detailed description. Therefore I'm currently using `\parnotes`. Unfortunately `\parnotes` also creates footnote marks which I don't want to have. **Screenshot:** ![enter image description here](http://i.stack.imgur.com/5bGN3.png) How can I remove these footnote marks?


title: Code-trolling/prank questions for TeX.SX?

text: I have a friend who uses me for LaTeX support. He isn't very tech savvy but likes LaTeX and so I help him out when something he needs to do requires more than the standard stock of macros and environments. We like to play pranks on each other. I had the idea to prank him the next time he ask for LaTeX help by doing something relatively benign and easily reversible that would noticeably alter the PDF generated--- or do something else noticeable in normal (La)TeX usage, like prolonging compilation \---in an unwanted fashion where the source of the problem would be hard to detect (so it would be a case of code-trolling, I suppose). I'm not very good at LaTeX myself, though, and so thought about asking for creative suggestions from the TeXperts. How can I give my friend a (La)TeX related hard time?


title: Extra code in the beginning of all frames

text: I want to add at the beginning of all `beamer` `frame` environments some extra commands (for example, `\vspace{-0.5cm}`) and my trial with               \addtobeamertemplate{frame begin}{}{\vspace{-0.5cm}}      doesn't work at all. Which line should I add to solve this problem?


title: Why Windows API 5 error when running initexmf in MiKTeX?

text: I have a MiKTeX installation running on Windows Vista, and whenever I try to run initexmf, I get the following error message initexmf: Windows API error 5: Access is denied. initexmf: Data: C:\Users\Public\Documents\My Music The strange thing is, I don't have any latex documents in the My Music folder. Does anyone know what the problem might be? I don't have this problem on Windows XP computers, and I have tried disabling UAC, but to no avail.


title: Suppress link in first use of glossary entry

text: I'm trying to disable links in the first use of glossary entries. I've seen a number of questions asked regarding the formatting of first uses, e.g. here and here, and another question dealing with how to disable links for all items in a _type_ of entry. However, none of these seem to do what I want (and that last question, which seems like it would get the closest, has only one answer that hasn't been accepted, for whatever reason). So far, I've been using `\gls*{<label>}` for first uses. However, since I'm still in my draft phase, I'm not sure what entry will be the first, and I keep finding `\gls*` commands that were first at one point and that I've forgot to update to `\gls`. What I would like is to not have to worry about this, which would be easy if there was some sort of `nolinkonfirst` option, or something of the sort (some of you might say I shouldn't worry about this during the draft phase, but I kinda do, and I thought this might be easily fixed). I've checked the documentation, and thought maybe redefining `\glsdisplayfirst` or using `\defglsdisplayfirst` would be what I need. However, I cannot seem to understand how to use them.


title: Theorem environment with hanging indentation

text: I would like to define a theorem environment with custom layout. In particular, I want the body of the theorem to be indented, like this               Text body. Text body. Text body.          Theorem 1 (Pythagoras).         Let a,b,c the sides of a rectangular triangle.         Without loss of generality, we assume that  a<b<c .         Then, the following equality holds:                a^2 + b^2 = c^2          More text. And even more text.      This is similar to the `quote` environment, I believe. How can I do this? Preferably, I would like to use the existing `\newtheorem` command, but that's not mandatory.


title: Exact font size and leading

text: I read couple of suggestions about setting exact font size and leading in LaTeX and XeLaTeX, so my question is, simply put, the following: is it the correct way to use LaTeX's method to XeLaTeX too, like in this example:               \documentclass[12pt]{report}     \usepackage{fontspec}     \setmainfont{Minion Pro}          \usepackage{leading}     %\leading{16pt}          \begin{document}       \fontsize{12}{16}\selectfont       \chapter{A chapter}         Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo.       \end{document}


title: Macro to take a character as argument, make it active, then \def it.

text: I have a XeLaTeX document in which I want some unicode symbols to be auto- substituted, like ¼ → 1/4, » → >>, « → <<. But instead of a long list like               \catcode`\¼=\active\def¼{1/4}     \catcode`\«=\active\def«{<<}     ...      I want something more elegant, like               \subst¼{1/4}     \subst«{<<}     \subst—{---}      So, I need a macro which will take two parameters, make #1 active, and \def it with #2. The first part was easy:               \def\subst#1#2{       \catcode`#1=\active       ...     }      The tricky part is the nested \def: no matter how I try, I cannot come up with anything working. The closest I got so far is defining commands like \¼ with               \expandafter\def\csname #1\endcsname{#2}      Which is of course not sufficient :) How do I make it define those newly-made-active characters?


title: How to make some text take up the same amount of space as other text

text: I want some text to take up the same amount of space as other text. For example, in the script below, how do I make `BOB` take up the same amount of space as `MELISSA` so the beginning of their dialogue lines are aligned?               \documentclass{article}     \begin{document}     BOB Hello, Melissa.     MELISSA Hello, Bob.     \end{document}


title: How to set page display in pdflatex?

text: I've never used LaTeX before, but a few months ago I decided to write my thesis report in LaTeX, so I'm pretty new to it. I am using MiKTeX on Windows 7, and `pdflatex` as typesetting engine. The thing that is bugging me is that `pdflatex` flips page when scrolling. I would _really_ like to have it continuously "flipped" i.e. scrolling down the document as one whole column. I've searched the web and this forum without finding a solution (of course I've looked in `pdflatex` as well). Maybe I'm just missing out some simple preferences in `pdflatex` page somewhere? I can fix this for preview in my regular PDF viewer (Adobe Reader) by using the `hyperref` package and `\hypersetup` command, like this:               \usepackage[pdftex]{hyperref}     \hypersetup{       pdfpagelayout={OneColumn}}      Unfortunately this doesn't help me since it's `pdflatex` I'm using to quickly see the outcome of the code and I'm typesetting pretty often. Perhaps there's a better PDF previewer that is as fast and simple as `pdflatex`?


title: How to prevent line break in citation with an argument?

text: If I cite a bibliography item with an additional argument, for example `\cite[p.~6]{bib_item}`, it can happen that there is a line break before the automatically inserted argument, such as: > text text text [4, > > p. 6] or > text text text [5, pp. 11- > > 13] Is there a way to prevent this?


title: Bad formatting of Bibliography

text: I tried two ways to format a bibliography with lots of URL's:   1. Without 'RaggedRight'   2. With 'RaggedRight' In the first case, there are wide spaces between words in some items, that a really not acceptable. In the second case, the whole bibliography looks rather ugly for my taste. So I'm looking for a third way, without 'RaggedRight' and without the spaces between words. Here is a MWE:               \documentclass[fontsize=14pt, DIV=13, german, a4paper, table]{scrbook}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[ngerman]{babel}     \usepackage{url}     \usepackage{ragged2e}     \usepackage[hyphenbreaks]{breakurl}     \sloppy                  \begin{document}      \part{Part 1}     \label{part:part-1}          \chapter{Chapter 1}     \label{chap:chapter-1}          \section{Section 1}     \label{sec:section-1}               Here I cite two publications: first \cite{toll2009leibnitzMonaden},     then \cite{duarte2011jobsTrends}.                % \begin{RaggedRight}     \bibliographystyle{alpha}     \bibliography{literatur/literatur}     % \end{RaggedRight}          \end{document}      using the following .bib file:               @Misc{duarte2011jobsTrends,       author =   {Duarte, Gustavo},       title =    {{Programming Language Jobs and Trends}},       howpublished =                       {\url{http://duartes.org/gustavo/blog/post/programming-language-jobs-and-trends}},       year =     2011,       note =     {[Online; accessed 25-July-2011]}     }          @Misc{toll2009leibnitzMonaden,       author =   {Toll, Andreas},       title =    {{Leibniz' Philosophie der Monaden}},       howpublished =                       {\url{http://www.suite101.de/content/leibnitz-philosophie-der-monaden-a58452}},       year =     2009,       note =     {[Online; accessed 04-August-2011]}     }


title: Graphics file extensions and their order of inclusion when not specified

text: When using `graphicx`'s `\includegraphics` you can specify the file extension or not. For generic use and perhaps portability, extensions are commonly dropped. The types of "approved" inclusions and their order of precedence depends on the driver/compiler being used. What are these driver-defaults? Related: Which graphics formats can be included in documents processed by `latex` or `pdflatex`?


title: Hyphenate typewriter / avoid overfull \hboxes in code, using fontspec and XeTeX

text: I would like to avoid overfull `\hbox`es as a result of inline code, inserted with `\textt{foo}` or `\ttfamily`, e.g. in this MWE:               % compile with xelatex     \documentclass{article}     \usepackage[textwidth=4cm, showframe]{geometry}% to force hyphenation     \usepackage{polyglossia}         \setdefaultlanguage[variant=usmax]{english}     \usepackage{fontspec}         \setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}     \setlength{\overfullrule}{1mm}     \begin{document}     {\ttfamily Bla \textbackslash newcommand\{\textbackslash foo\}\{bar\}     \textbackslash setmonofont[Scale=MatchLowercase]\{DejaVu Sans Mono\}          For regular words, it works supercalifragilisticexpialidociously (or more like kind of ok),     but real code is tricky.}     \end{document}      ![xelatex output](http://i.stack.imgur.com/e9sCM.png) I'd like to have hyphenation points (manual instruction is ok) between `Match` and `Lowercase`, and between `{\foo}` and `{bar}`. However, I don't ever want a hyphen to appear at hyphenation points (in typewriter text). I've tried `\-`, which doesn't work (`babelshorthands` is not available for `english`). I also know about the `fontspec` option `HyphenChar`, but I don't know how to tell it "no hyphenation character, but hyphentation" (space / `32` is not an option because it appears in the OCR layer of the pdf; `None` would disable hyphenation altogether). I guess these might both be traces of the solution, but I can't figure out how to make use of them.


title: What is newline symbol in beamer?

text: If I use **\\\ or $\newline$** in beamer inside a tikzpicture, I get the following error: **Something's wrong--perhaps a missing \item. \end{frame}** What is correct use of it? My tikz code is as follows:               \documentclass{beamer}     \usepackage{color}     \usepackage{enumerate}     \usepackage{tikz}     \usepackage{verbatim}     \usepackage{pgf}     \usetikzlibrary{shapes,arrows,fit,calc,positioning,automata}     \usepackage{float}     \usepackage{wrapfig}     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{textcomp}     \usepackage{beamerthemesplit}     \usepackage{amsmath,hyperref}     \usetheme{CambridgeUS}     \usecolortheme{whale}     \useoutertheme{infolines}     \useinnertheme{circles}     \usefonttheme[onlylarge]{structuresmallcapsserif}     \setbeamercolor{title}{fg=red!80!black,bg=red!20!white}     \setbeamertemplate{footline}[page number]{}     \setbeamertemplate{navigation symbols}{}          \begin{document}          \begin{frame}{A}     \begin{tikzpicture}[->,shorten >=1pt,auto,node distance=7 cm,                     semithick, scale = 0.4, transform shape]               \node[initial,state] (A)                    {$s_0$};     \node[state]         (B) [above right of=A] {$s_1$};     \node[state]         (C) [below right of=A] {$s_2$};     \node[state]         (D) [below right of=B] {$s_3$};     \node[state]         (E) [above right of=D] {$s_4$};     \node[state]         (F) [below right of=D] {$s_5$};                 \path (A)          edge [left] node [blue, pos=0.5, sloped, above] {$0 \rightarrow [x = x.0.0]$} (B)         edge [left] node [cyan, pos=0.8]{$1 \rightarrow [x = x.0.1]$} (C)(B)          edge [loop above] node [align=center] {$0 \rightarrow$ \\ $[x = x.0]$ }   (B)         edge [bend right,left] node  {$1 \rightarrow [x = x.1]$ }   (C)         edge [] node [red, pos=0.2] {$\$  \rightarrow  [x = x.0.\$]$ } (D);             \end{tikzpicture}     \end{frame}                    \end{document}


title: Help me input a column vector

text: ![enter image description here](http://i.stack.imgur.com/7F73J.jpg)![enter image description here](http://i.stack.imgur.com/MFOsI.png) I'm trying to input an arrow vector (a column vector, see the picture) in an `align` environment, but it reports an error. Can someone show me the TeX code of it in an `align` environment?


title: Bibliography and listoffigures postion

text: Whatever I try, I cannot "force" listoffigures and bibliography to be rendered in wanted position. They allways end up on next page, even if there is enough space in previous (wanted) page. CODE:               \documentclass[a4paper, 12pt]{book}          \chapter{Appendix}     \section{List of figures}     \renewcommand*\listfigurename{}  % remove title     \listoffigures{}          \chapter{Bibliography}     \renewcommand\bibname{}   % remove title     \begin{thebibliography}{99}      RESULT: > Chapter 6 > > APPENDIX > > 6.1 List of figures > > * > > * > > * > > * > > * > > (ACTUAL LIST) (new page) > Chapter 7 > > Bibliography > > * > > * > > * > > * > > * > > (ACTUAL BIBLIOGRAPHY) WANTED RESULT: > Chapter 6 > > APPENDIX > > 6.1 List of figures > > (ACTUAL LIST) (new page) > Chapter 7 > > Bibliography > > (ACTUAL BIBLIOGRAPHY) I hope you get the picture, what am I trying to say (those asterisks represent blank spaces).


title: ntheorem thref not working in section titles

text: When I try to refer to a theorem in a section title with `thref`, I get the error message at the end of this question. Is there a way to fix this?               Latex Error: ./seppathq.tex:57 Argument of \@xtrplargoom has an extra }.          Runaway argument?     {\M@sect {subsection}{2}{\subsecindent }{\beforesubsecskip }{\aftersubsecskip \     Latex Error: ./seppathq.tex:57 Paragraph ended before \@xtrplargoom was complete.     Latex Error: ./seppathq.tex:57 Undefined control sequence.     Latex Error: ./seppathq.tex:57 Missing \endcsname inserted.          Runaway argument?          {{\M@sect {subsection}{2}{\subsecindent }{\beforesubsecskip }{\aftersubsecskip      Latex Error: ./seppathq.tex:218 TeX capacity exceeded, sorry [main memory size=3000000].     Latex Error: ./seppathq.tex:218 ==> Fatal error occurred, no output PDF file produced!


title: How to represent this data as a table?

text: I am trying to put this in a table inside my LaTeX document. How can I get this? `Ctrl`-`K` does it here but not sure how to do it in LaTeX.                              Left      Right     Bottom        Top   Diagonal     Left      0.1303394  0.1084274  0.2158028  0.1050394 -0.2093420     Right     0.1084274  0.1632741  0.2841319  0.1299967 -0.2404701     Bottom    0.2158028  0.2841319  2.0868781  0.1645389 -1.0369962     Top       0.1050394  0.1299967  0.1645389  0.6447234 -0.5496148     Diagonal -0.2093420 -0.2404701 -1.0369962 -0.5496148  1.3277163


title: Negative top margin

text: This is the header of a TeX file that I'm currently using:               \documentclass{article}     \topmargin -0.5in     \textheight 9in     \oddsidemargin 0in     \evensidemargin 0in     \textwidth 6.4in     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{hyperref}     \begin{document}     \large      Is it good practice to write `\topmargin -0.5in`, `\oddsidemargin 0in`, and `\evensidemargin 0in`? I find that these help me get the right margins, but I'm not sure if it's a "correct" way to do it.


title: KOMA-Script unequal left/right margin

text: I'm using the following header               \documentclass[fontsize=11pt]{scrbook}     \usepackage{amsmath,amssymb,amsfonts,hyperref}     \begin{document}     \large          %%% Header %%%     \title{My Title}     \author{John J. Johnson}     \date{December 2012}     \maketitle          \end{document}      I noticed that the title is placed toward the left side of the resulting PDF file rather than in the middle. Can I fix it?


title: EPS to PDF conversion done by pdflatex is blurry

text: I have done a figure using TikZ that uses the shadows.blur package. Using qtikz (my TikZ editor), I have exported the image as an eps file. In my document, I use `\includegraphics{theimage}` and pdflatex automatically convert my eps to a pdf (theimage-eps-converted-to.pdf). However, when there is a shadow, the image is not vectorial! (if I manually do epstopdf, I have the same issue in the pdf) If I export in pdf directly from qtikz, the image is exactly as expected. So my question is: is there a way to fix the way pdflatex converts my eps files?


title: How do I set the search path for MikTeX?

text: Simple question: I have a folder I'd like to add to my MikTex search path (containing a stack of include and `.sty` files.) For the life of me, I can't seem to figure out how to add a folder to the search path. (For the record, I'm on Windows 7, and using TeXWorks to generate pdf files via XeLaTex, all installed via MikTex 2.8 )


title: How can I sum two values and store the result in other variable?

text: In LaTeX2e,how can I sum two values and assign them to other variable? I want to compute something like:               var=\textwidth - 1cm       And if both were constants:               var=1+1


title: List of Algorithms header format

text: Does anyone know why the header of List of Algorithms is not equal to the format of List of Tables when both using with               \listoftables      or               \listofalgorithms      Here is a screenshot: ![screenshot](http://i.stack.imgur.com/TQJhR.png)


title: I can't find/fix the errors in order to be able to compile it

text: \documentclass{article}     \usepackage{amsmath}          \begin{document}               $These are two truth tables for the following:               $\neg (p \vee q)$ is logically equivalent to $(\neg p) \wedge (\neg q)$          \begin{tabular} {|c|c||c|c||c|c|c|}\hline     $p$ & $q$ & $p \vee q$ & $\neg (p \vee q)$ & $\neg p$ & $\neg q$ & $(\neg p) \wedge (\neg q)$\\ \hline     T & T & T & F & F & F & F\\     T & F & T & F & F & T & F\\     F & T & T & F & T & F & F \\     F & F & F & T & T & T & T\\ \hline     \end{tabular}  \vskip .5cm          $\neg (p \implies q)$ is logically equivalent to $p \wedge(\neg q)$          \begin{tabular} {|c|c||c|c||c|c|c|}     \hline     $p$ & $q$ & $(p \implies q)$ & $\neg (p \implies q)$ & $p$ & $\neg q$ & $p \wedge (\neg q)$\\ \hline     T & T & T & F & T & F & F\\      T & F & F & T & T & T & T\\      F & T & T & F & F & F & F\\      F & F & T & F & F & T & F\\ \hline     \end{tabular} \\ \vskip .5cm          $This is some practice using LaTex:     \[     \frac{x^4+5x^3-y}{\cos y-x^2}     \]     \[     \sqrt[\frac{x62}{3}]{\frac{\cos 4}{4.2}}     \]          \end{document}


title: How to put both chapter and section name in the header of the page?

text: I'm working on a one-sided LaTeX document with document class `scrreprt` and I'm using `scrpage2` to customize headers and footers of the pages. At the moment, the respective chapter name is shown in the upper right corner of each page using the following code in the preamble:               \usepackage[autooneside]{scrpage2}     \pagestyle{scrheadings}     \clearscrheadfoot     \automark{chapter}     \rohead{\headmark}      Now I want to change this such that, when a section begins inside a chapter, the `\headmark` should change to the format > chapter name - section name on all pages which contain text of this section until the section finishes. If I change `\automark` to `\automark{section}`, then only the section names get displayed but not the chapters names anymore. How can I display both? Is it maybe also possible to put the chapter name in the upper-left corner and the section name in the upper-right corner of each page?


title: How do I set the section and subsection fonts to Times New Roman as well as section font to be Times New Roman

text: How do I set the section and the subsection font to Times New Roman. I have done every trick in the book. But nothing works.


title: Macro to format text

text: Good morning, I have the following problem, I have a file with 8000 questions in the following format:               COD: 7     ¿A qué número de revoluciones se alcanza la potencia máxima de un motor?     A Al número de revoluciones a las que gira el motor en el momento de arrancarlo.     B A bajas revoluciones.     C A un número intermedio de revoluciones.     D A un número de revoluciones próximo al máximo.     RESPUESTA: D     NORMA: Sin referencia      and wanted to leave it in this format:               \begin{description}      \item[COD: 7] ¿A qué número de revoluciones se alcanza la potencia máxima de un motor?      \begin{enumerate}      \item  Al número de revoluciones a las que gira el motor en el momento de arrancarlo.      \item  A bajas revoluciones.      \item \textbf{A un número intermedio de revoluciones.}      \item A un número de revoluciones próximo al máximo.     RESPUESTA: D     NORMA: Sin referencia        \end{enumerate}     \end{description}      Can advise me any macro or other way to do it faster? Thanks in advance for your help.


title: Different symbols for square roots

text: Why are the square root symbols on this post different? Some of them have vertical bar and other ones have slanted bars. ![enter image description here](http://i.stack.imgur.com/IlnSv.png)


title: Bib page number in my index and bibtitle distance from the top

text: I've got two last questions. The first one is about the wrong page number for my bibliography in the table of contents. I've already tried the solution with `\cleardoublepage` and `\phantomsection` before or after my `\addcontentsline{toc}{chapter}{REFERENCES}`, but I can't obtain anything good. So I tried also the solution with `tocbibind` package, but in this case I lost some others properties of my bibliography. I give you my code for the bibliography, so you can understand better my situation:               \newpage     \thispagestyle{empty}     \addtocounter{page}{-1}          \cleardoublepage     \phantomsection     \renewcommand{\bibname}{\bf\Large{REFERENCES}\vspace{-20pt}}         \begin{flushleft}     \bibliographystyle{phd}     \addcontentsline{toc}{chapter}{REFERENCES}     \makeatletter\def\@biblabel#1{#1.}\makeatother     \bibliography{References}      I'm using book class. My second problem is more simple I think. The title of my bibliography (References) is farther from the top of the page than the other titles of my work. How can I correct this distance? Ok.I'm sorry for my late. Here is part of my code. I hope it's helpful:               \documentclass[10pt,a4paper,oneside,epsf,fleqn]{book}          \usepackage[pdftex,dvips]{graphicx}     \DeclareGraphicsExtensions{.png,.pdf,.jpg}     \pdfcompresslevel=9     \usepackage{epstopdf}          \usepackage[italian,english,german]{babel}          \usepackage{etoolbox}     \patchcmd{\thebibliography}{\advance\leftmargin\labelsep}       {\labelsep=0.7cm \advance\leftmargin\labelsep}{}{}          \usepackage[centertags]{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage[dvips]{graphics}     \usepackage{epsfig}     \usepackage{float}     \usepackage{geometry}     \geometry{verbose,a4paper,top=2.0cm,bottom=2.0cm,left=2.0cm,right=2.0cm}          \usepackage[titles]{tocloft}     \setlength{\cftbeforechapskip}{6pt}     \setlength{\cftbeforesecskip}{6pt}     \setlength{\cftbeforesubsecskip}{3pt}          \def\listofsymbols{\input{symbols} \clearpage}     \def\addsymbol #1: #2#3{$#1$ \> \parbox{6.5in}{#2 \dotfill \pageref{#3}}\\}      \def\newnot#1{\label{#1}}           \usepackage{fancyhdr}     \pagestyle{fancy}          \makeatletter     \renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi                         \thispagestyle{fancy}%                         \global\@topnum\z@                         \@afterindentfalse                         \secdef\@chapter\@schapter}          \newenvironment{abstract}[1][italian]       {\cleardoublepage\thispagestyle{fancy}        \iflanguage{italian}{}{\selectlanguage{#1}}        \vspace*{\fill}        \begin{center}        \bfseries\Large\MakeUppercase\abstractname\vspace{12pt}        \end{center}}       {\par\vfill}          \begin{document}          \begin{titlepage}     \include{Title}     \end{titlepage}     \clearpage\null\thispagestyle{empty}\clearpage          \frontmatter     \pagenumbering{Roman}     \renewcommand*\abstractname{SOMMARIO}     \begin{abstract}        %Sommario     \normalsize\emph{Tanto va la gatta al largo che ci lascia lo zampino}     \end{abstract}          \renewcommand*\abstractname{ZUSAMMENFASSUNG}         \begin{abstract}[german]        %Zusammenfassung     \normalsize\emph{Wenn die Katze geht zu viel zu verraten, kann verlor seine kleine Hand}     \end{abstract}          \renewcommand*\abstractname{ABSTRACT}        \begin{abstract}[english]       %Abstract     \normalsize\emph{If the cat goes too much away, can lost its little hand}     \end{abstract}          \renewcommand\contentsname{\bf\Large{TABLE OF CONTENTS}\vspace{-20pt}}     \tableofcontents     \chapter*{\bf\Large{LIST OF SYMBOLS}\vspace{-20pt}}     \listofsymbols          \selectlanguage{english}          \mainmatter     \setcounter{secnumdepth}{-1}     \include{Introduction}     \setcounter{secnumdepth}{3}          \include{Chapter1}          \setcounter{secnumdepth}{-1}     \include{Conclusions}     \setcounter{secnumdepth}{1}          \newpage     \thispagestyle{empty}     \addtocounter{page}{-1}          \cleardoublepage     \phantomsection     \renewcommand{\bibname}{\bf\Large{REFERENCES}\vspace{-20pt}}         \begin{flushleft}     \bibliographystyle{phdpisa5}     \addcontentsline{toc}{chapter}{REFERENCES}     \makeatletter\def\@biblabel#1{#1.}\makeatother     \bibliography{References}     \end{flushleft}     \end{document}      I don't know if this part of my code could be considered as a MWE, but I tried to leave the most important part of the code. With this code I'm obtaining the "REFERENCES" title farther from the top of the page than the usual distance of any other title. And in the Table of Contents, I have two times the word "REFERENCES", the first one at the wrong page (6 in my case) and the second one at the right page (7 in my case).


title: How to remove the "." in the proof environment?

text: Using `amsthm`, is there a possibility to remove the dot when typing `\begin{proof}...\end{proof}`? This would be typeset as "Proof." If you change your proofname `\begin{proof}[Proof:]...\end{proof}` you would get "Proof:"; but for typesetting without a dot or colon?


title: Problem with headings and book class

text: I have a the following document which uses the book class. For some reason, the page number is, on the first page, at the bottom of the page and centered (article like footer). The next page has the number up and on the left (with the chapter title on the right): book like heading. Why do I have two different ways to show the page number? I would like to have the normal book class heading (i.e. the page 2 heading) for the whole document. ![enter image description here](http://i.stack.imgur.com/unjVt.png) MWE:               \documentclass[12pt,twoside,a4paper]{book}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{setspace}     \usepackage{graphicx}      \usepackage{lmodern}     \usepackage{xspace}     \title{}     \author{}     \usepackage[english]{babel}     \usepackage{csquotes}     \usepackage[colorlinks]{hyperref}     \usepackage{lipsum}     \begin{document}     %\maketitle     \tableofcontents     \onehalfspacing          \frontmatter           %\include{fichiers/intro}          \mainmatter          %\include{fichiers/chap1}     %\include{fichiers/chap2}     %\include{fichiers/chap3}     %include{fichiers/chap4}     %include{fichiers/ccl}          \appendix     \backmatter                \end{document}


title: How to typeset a TikZ picture inside a node?

text: The contents of a node are drawn in text mode. Is there a way, short of introducing a `tikzpicture` environment, to draw a picture inside a node? Nesting `tikzpicture` environments is problematic, also because the inner environment inherits all TikZ attributes from the surrounding `tikzpicture` environment.


title: Missing delimiter (. inserted) }

text: Here is the tex file which I encounter to this error, the result has no problem but the software show this error and I can't understand what is wrong (as the pdf result is ok!). So I will be glad if somone say me what is wrong or if there is nothing wrong say me how I can make the software to don't show it again.               \documentclass[10pt,a4paper]{book}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage[all]{xy}     \begin{document}     \xymatrix{          & X\ar[r]^f\ar@{}[dr]|(0.35){\big\circlearrowleft} & Y\\          \exists Z\subseteq X\;s.t. & Bl_Z(X)\ar[u]^{\pi}\ar@{.>}[ur]_{\exists f'} &          }     \end{document}


title: Replacing an arrow with an inclusion symbol in Tikz

text: Instead of an arrow from one place to another, I'd like to have the `\subseteq` symbol. More specifically, the `\subseteq` symbol rotated, which I believe can be rendered `\rotatebox{90}{$\subseteq$}` .                \documentclass[10pt]{amsart}      \usepackage{tikz}               \usetikzlibrary{matrix, arrows, decorations.pathmorphing}          \begin{document}     \begin{tikzpicture}       \matrix (m) [matrix of math nodes,row sep=3em,column sep=4em,minimum width=2em]      {        G & H \\         G/\ker \varphi & \mbox{Im} \varphi \\};           \path[-stealth]     (m-1-1) edge node [left] {$q$} (m-2-1)             edge node [above] {$\varphi$} (m-1-2)         edge node [above] {$\hat{\varphi}$} (m-2-2)     (m-2-1) edge node [below] {$\overline{\varphi}$} (m-2-2) ;     \end{tikzpicture}     \end{document}      So, what I'd like to do is instead of having an arrow representing a map from the lower right node to the upper right node, I want the set inclusion symbol to show the relationship between the sets in question. Thanks!


title: TikZ does not use square coordinates but polar one, how to change it in order to use Cartesian coordinates?

text: Consider the following:               \begin{tikzpicture}[thick,scale=0.8]       \node  (v0) at (0,0) [label=right:$\emptyset$] {};       \node (v1) at (40:-2)  [label=right:$v_1$] {};       \node (v2) at (70:-1.6)  [label=right:$v_2$] {};       \node (v3) at (110:-1.6)  [label=right:$v_3$] {};       \node (v4) at (140:-2)  [label=right:$v_4$] {};       \node (v5) at (50:-3.5)  [label=right:$v_5$] {};       \draw  (v0)  --  (v1)       (v0)  --  (v2)       (v0)  --  (v3)       (v0)  --  (v4)       (v1)  --  (v5);     \end{tikzpicture}      Here coordinates are polar. How to use square?


title: How can I prevent koma-script from changing the font?

text: The following code doesn't use KOMA-script ans is able to generate title with small caps:               \documentclass{report}     \usepackage[T1]{fontenc}     \usepackage[frenchb]{babel}     \usepackage[utf8]{inputenc}          \begin{document}          text \textsc{small caps text}          \section{title \textsc{small caps title}}          \end{document}      However, if I change the `documentclass` to `scrreport` to use KOMA-script, the title is no longer in small caps. I took a look to the PDF properties and it looks like the fonts sfbx1728, and sfcx1728 were replaced by sfsx1728. How do I undo that ?


title: How to include all files within a directory relative to the edited *.tex-file?

text: I am writing my reports which need to reference complete *.java files with latex. I am using the Texlipse Eclipse plugin to do the editing. Right now I am referencing the complete path to each *.java file within the *.tex file like so:               \subsection*{Foo-class}     \lstinputlisting{/home/pathtoexlipse/workspace/Foo.java}      Since we are collaborating on the source files and the documentation with help of a VCS, it would be nice to have a means to reference a relative path within the latex document. The folder structure within the project-file always looks like this: ` Project_Folder/   |src/   |---Foo.java   |---Bar.java   |latex_documentation/   |--mydocument.tex` But since editing takes place under different systems, where the project-files are located at different absolute path on the filesystem, it would be nice to have a possibility to just reference the relative path when invoking `\lstinputlisting`. Also, it would be great, if it would be possible to automatically parse a directory for all *.java files, and automatically include them within the `\lstinputlisting`. Is there a means in latex to achieve these desired features?


title: Change float background colour

text: ## Background Including images within Algorithm floats. The images are trimmed to size automatically by a batch file. ## Problem In the following portion of the PDF, Listing 1.1 has a lot of space to the right of the source code [ **First Image** ]: ![enter image description here](http://i.stack.imgur.com/SkJxL.png) The result I am looking to achieve is [ **Second Image** ]: ![enter image description here](http://i.stack.imgur.com/1oKHS.png) Note that there is a small amount of space between the upper and lower lines surrounding the image that I would also like to remove. ## Code Relevant preamble code:               \definecolor{sourcecolour}{HTML}{F0F0F0}          % Determine if the image is too wide for the page.     \makeatletter     \def\ScaleIfNeeded{%       \ifdim\Gin@nat@width>\linewidth         \linewidth       \else         \Gin@nat@width       \fi     }     \makeatother          % Resize figures that are too wide for the page.     \let\oldincludegraphics\includegraphics     \renewcommand\includegraphics[2][H]{%       \oldincludegraphics[width=\ScaleIfNeeded]{#2}%       \graphicsalignment     }          % Change the background colour of algorithm boxes     \let\oldalgorithm\algorithm     \let\endoldalgorithm\endalgorithm     \renewenvironment{algorithm}[1][htbp]{       \let\graphicsalignment\relax       \oldalgorithm[#1]     }%       {\endoldalgorithm}          % Centre graphics within non-Algorithm floats.     \let\graphicsalignment\centering      ## Ideas Enclose the image in a `\colorbox`:               \colorbox{sourcecolour}{\parbox{\textwidth}{...}      This did not work as expected. The `\colorbox` added its own ~0.25em border around the image, pushing the right-side into the margin. Also, it had a side- effect of turning off the centering for Figure floats. (The Figure floats are centered whereas the Algorithm floats--showing source code listings--are left- aligned.) Another possibility is to not auto-crop the highlighted source code image, but then if I change the book width, I'd have to regenerate all images for the book. I'd rather just fill in the white space. Another try:               \setlength\fboxrule{0pt}     \setlength\fboxsep{0pt}          % Retain left-alignment, and change background colour of algorithm floats.     \let\oldalgorithm\algorithm     \let\endoldalgorithm\endalgorithm     \renewenvironment{algorithm}[1][htbp]{       \let\graphicsalignment\relax       \colorbox{sourcecolour}{\parbox{\textwidth}{%       \oldalgorithm[#1]}}}%       {\endoldalgorithm}      This results in a compile error. ## Question What LaTeX code is required in the preamble to make **First Image** resemble **Second Image** , without affecting the justification?


title: How do I tweak the output of tex4ht's latex-to-openoffice conversion?

text: Every now and then I am required to circulate a document in Word format; I write in LaTeX, of course. I use xelatex because I frequently need Unicode; I do bibliographies with biblatex; and I basically never write any equations. To my surprise tex4ht now does a pretty respectable job producing an OpenOffice document from my tex source if I reframe it with a minimal preamble as ordinary latex (with babel and inputenc for unicode), process it with pdflatex and biber to generate auxiliary files, and then invoke tex4ht with a command like htlatex chapter.tex "xhtml,ooffice,bib-,mathml-" " -cmozhtf" "-coo" But the styling of the resulting document is never good enough and needs to be fiddled with in OpenOffice itself before using OO to convert to Word. And, because the style sheet of the generated document is long and complex, even minimal tweaking requires modifying 10 or so styles in OpenOffice. That's too much to repeat every time I change the underlying TeX and have to reprocess everything. Unfortunately the tex4ht documentation is very sketchy and very confusing. How do I tweak the output--where do the relevant tex4ht configuration files live, and how do I change them? Or is there an alternative tool? I've been thinking tex4ht is the only conversion tool I can use, because I'm using biblatex, but maybe there's something else out there. Many thanks for any help.


title: How can I force an image and its caption to be on the same page?

text: I am using the `caption` package, now I have one problem: In one case an image is placed at the bottom of one page, while its caption is placed on the top of the following page. In this case I would prefer the image to be also moved to the next page. Actually my LaTeX code looks like this:               \begin{flushleft}         \includegraphics{sample.png}         \captionof{figure}{the caption}         \label{figure:sample}     \end{flushleft}      Is there some way to tell LaTeX that the graphic and the caption shall be seen as one unit and shall never be split up over 2 pages?


title: Two matrices side by side

text: I'm trying to typeset two matrices side by side, somewhat like:               A = (matrix)    B = (matrix)      I tried to next the matrices inside an `align` environment:               \begin{align*}       A &= \begin{pmatrix} ... \end{pmatrix} &       B &= \begin{pmatrix} ... \end{pmatrix}     \end{align*}      but I get when compiling: > Package amsmath Error: Erroneous nesting of equation structures Presumably the way I'm trying to do it isn't the right way; how should I be doing this?


title: Configuring minipage environment to incorporate width

text:
I'd like to configure tex4ht to set the width of a minipage div class based on the width specified in the LaTeX source. Here's what I have so far: The tex file is:               \documentclass{article}     \begin{document}     \begin{minipage}[c]{0.6\textwidth}       Some text     \end{minipage}     \hfill     \begin{minipage}[c]{0.3\textwidth}       some more text     \end{minipage}     \end{document}      and my cfg file (with inspiration from https://www.mail- archive.com/tex4ht@tug.org/msg00764.html) is:               \Preamble{html}     \Configure{HtmlPar}     {\EndP\Tg
}     {\EndP\Tg
}     {\HCode{
\Hnewline}}     {\HCode{
\Hnewline}}     \ConfigureEnv{minipage}{\ifvmode\IgnorePar\fi\EndP\HCode{
}}{\ifvmode\IgnorePar\fi\EndP\HCode{
\Hnewline}}{}{}     \Css{div.minipage {      float: left;       margin: 1ex 1em 1ex 0;      }      }     \Css{div.minipage:last-child {      clear: none;       float: right;       margin: 1ex 0 1ex 1em;      }     }     \begin{document}     \EndPreamble      For instance, I'd like the first minipage in the above tex example (with width of 0.6\textwidth) to result in a corresponding div with width 60%. So essentially, referencing this example, I'm looking for a way to:   * extract only the "0.6" from \begin{minipage}[c]{0.6\textwidth}   * multiply 0.6*100 = 60   * insert 60, along with a % sign, into the width of the div I may be a bit out of my element with this; I've been frantically trying to learn tex4ht and feel I have only a tenuous grasp of most aspects. This community's questions and answers have been tremendously helpful to me, and I'll sincerely appreciate any guidance on this issue.


title: Formatting the Listing

text: The listing I have in my paper is Java Code. When it is displayed through TeX I lose some of the formatting that I did inside my .java files. For example, all of my comments in my code were lined up, but now after incorporating the Java code in TeX the comments are no longer lined up. Here is a visual of this dilemna: ![enter image description here](http://i.stack.imgur.com/77S7A.png) Notice how all the comments are lined up except the first few at the top. Clearly there is room to the right for all of the comments to be shifted. Here is my TeX code for the listing:               \section{Code}               \lstset{language=Java, basicstyle=\tiny\ttfamily,         linewidth=\textwidth,         numbers=left,         columns=flexible,         numbersep=5pt,      % Abstand der Nummern zum Text         tabsize=3,         breaklines=true,         frame=bottomline,         showspaces=false,         showtabs=false,         xleftmargin=17pt,         breakatwhitespace=true,         framexleftmargin=17pt,         framexrightmargin=5pt,         framexbottommargin=4pt,         showstringspaces=false,         literate=%             {Ö}{{\"O}}1             {Ä}{{\"A}}1             {Ü}{{\"U}}1             {ß}{{\ss}}2             {ü}{{\"u}}1             {ä}{{\"a}}1             {ö}{{\"o}}1             }     \lstinputlisting{EncodingScheme.JAVA}        1. Are there ways to edit my code inside TeX manually?    2. How can I get page-breaks at certain points in the code? For example, if I wanted to see the for-loop that is at the bottom of the page in the picture what would I do?   3. Please give all related suggestions to formatting code inside TeX.


title: What are the forbidden characters in file name with XeLaTeX

text: I was wondering what are the forbidden characters in file name using XeLaTeX. I know that the forbidden characters for Windows files are `\` `/` `?` `:` `*` `"` `>` `<` `|` Also, I have found another character that is forbidden by XeLaTeX which is the apostrophe (`'`) because it generated an error. Anyone knows if there's a list of forbidden characters? **EDIT:** I think my problem might be when I call the XeLaTeX in command line `" -output-directory \"C:/Pdf\" \"C:/Pdf/Doe_John_BURCUS Gregoire (F) - 121217.tex\""` MiKTeX doesn't recognize the file name. If I delete the parentheses, MiKTeX is able to generate the pdf.


How can one avoid the error message "Authors Suppressed Due to Excessive Length" using LNCS (Lecture Notes in Computer Science) template? Would it be possible to change it to First Author et al. or similar?


title: How would I draw, in Tikz, the following diagram of the behaviour of gamma rays under the influence of a magnetic field?

text: ![behaviour of alpha particles, and beta and gamma rays under magnetic field](http://i.stack.imgur.com/H2A1c.jpg)


title: Fixing marginnote placement after adjusting margins

text: I am trying to take some notes in the margins, that will appear in the printed edition. I hope to use `adjmulticols` to adjust the margins for two column text in the document so I can save space. Unfortunately the causes the `marginnote` to collide with my text here is an example:               \documentclass{article}     \usepackage{lipsum,multicol}     \usepackage{marginnote}     \usepackage{adjmulticol}     \begin{document}     Here I have some text that is in a single regular column.      It is not very interesting, but it should illustrate the purpose here.      \marginnote{Here is a margin note, that should look fine}      I'm sure you can come up with something more interesting, but       that isn't the point here, it is just to have some text in a single column.      Just so you don't have to read this crap the whole time, I'll give you      something worth reading.     \begin{adjmulticols}{2}{-7.5 ex}{-7.5ex}     I had called upon my friend Sherlock Holmes upon the second     morning after Christmas, with the intention of wishing him the     compliments of the season. He was lounging upon the sofa in a     purple dressing-gown, a pipe-rack within his reach upon the     right, and a pile of crumpled morning papers, evidently newly     studied, near at hand. Beside the couch was a wooden chair, and     on the angle of the back hung a very seedy and disreputable     \marginnote{This is an ugly hat, and an ugly margin note}     hard-felt hat, much the worse for wear, and cracked in several     places. A lens and a forceps lying upon the seat of the chair     suggested that the hat had been suspended in this manner for the     purpose of examination.          "You are engaged," said I; "perhaps I interrupt you."          "Not at all. I am glad to have a friend with whom I can discuss     my results. The matter is a perfectly trivial one"--he jerked his     thumb in the direction of the old hat--"but there are points in     connection with it which are not entirely devoid of interest and     even of instruction."          I seated myself in his armchair and warmed my hands before his     crackling fire, for a sharp frost had set in, and the windows     were thick with the ice crystals. "I suppose," I remarked, "that,     homely as it looks, this thing has some deadly story linked on to     it--that it is the clue which will guide you in the solution of     some mystery and the punishment of some crime."          "No, no. No crime," said Sherlock Holmes, laughing. "Only one of     those whimsical little incidents which will happen when you have     four million human beings all jostling each other within the     space of a few square miles. Amid the action and reaction of so     dense a swarm of humanity, every possible combination of events     may be expected to take place, and many a little problem will be     presented which may be striking and bizarre without being     criminal. We have already had experience of such."          "So much so," I remarked, "that of the last six cases which I     have added to my notes, three have been entirely free of any     legal crime."     \end{adjmulticols}     \end{document}      This produces the following output, which is obviously not so good. As a side bonus, how do I get this note to be on the other side? I know it should be easy, but I haven't found it yet in the docs. ![Ugly Margin Note](http://i.stack.imgur.com/nBX8k.png)


title: How do I label and reference an Inkscape file using \input?

text: I have written the following code in TexShop:               \begin{figure}[h]     \begin{center}     \def\svgwidth{\columnwidth}     \input{<nameoffile>.pdf_tex}     \caption{figure 1}     \label{fig:no1}     \end{center}     \end{figure}      And yet, I cannot seem to make any kind of reference to my figure. It looks well in the preview, but it will not be referenced with neither \ref{fig:no1} or the likes. I have used the packages graphicx,xcolor, epsfig, svg, but I cannot seem to get it to work properly.


title: Reduce footer space

text: I am having trouble reducing the footer space. I have a list of contents that is printing below the page number appearing in the footer. How do I solve this issue? I tried setting the footskip length but it didn't work.


title: Uncovering Formatting?

text: Is there any way to have a slide show a block of text, and then by some `\uncover` type command, bold or underline a certain part of that text?


title: Tikz: Equal sized nodes with different text

text: I am new here to `Tikz` and I need to draw 2 rows of nodes that are identical in size but having different text of different length in it. Sure the upper and lower nodes should have enough room for the longest of the two texts. The upper nodes should be aligned to the lower ones and have the same size. To be specific, I need to draw the following picture using `Tikz`: ![enter image description here](http://i.stack.imgur.com/Mjuxy.png)


title: too much space with tabto and enumitem

text: The MWE below indicates the problem. The final item, number 6, isn't aligned correctly (it is pushed some extra space to the right!). This is also the case when I change the number of tabs to 2.               \documentclass{article}     \usepackage[inline,shortlabels]{enumitem}      \usepackage{tabto}          \begin{document}          \NumTabs{3}     \begin{description*}[before={\noindent},itemjoin={\tab}]     \item {1.}      \item {2.}      \item {3.}      \item {4.}      \item {5.}      \item {6.}      \end{description*}          \end{document}


title: Formatting a custom column in pgfplotstable

text: Following up on my question on PGF custom columns I've successfully created a column but now I'm struggling to format it to fixed, two digit precision. This seems a little hair trigger in terms of follow on questions, for which my apologies, but it seemed sufficiently different to justify a separate query. Thanks               \documentclass{article}     \usepackage{array}     \usepackage{pgfplotstable}          \begin{document}          \newcolumntype{x}[1]{>{\hspace{1cm}}p{#1}}          \pgfplotstableset{create on use/cagr/.style={create col/expr={(\thisrowno{3}/\thisrowno{0})^(1/3)*100-100}}     }          \pgfplotstabletypeset[string type,debug,     column name={},     columns={0,1,2,3,cagr},     format=inline,col sep=&,row sep=\\,header=false,ignore chars={\^^M},     columns/cagr/.style={column type={x{3cm}},precision={2},fixed,zerofill}]{     1&2&3&4\\     5&6&7&8\\     9&10&11&12\\          }          \end{document}


title: Floating and non-floating items in one document

text: till now my tables were like this:               \documentclass{article}          \usepackage{capt-of}          \begin{document}          \begin{table}         \begin{minipage}[h!]{\linewidth}         \centering         \begin{tabular}{p{2cm}p{2cm}p{2cm}}         \hline              \rule{0pt}{8pt}              \textbf{column a} & \textbf{column b} & \textbf{column c} \\                   \hline                 \rule{0pt}{8pt}                 text    &   text        & text   \\                 \rule{0pt}{8pt}                 text    &   text        & text   \\             \hline                 \rule{0pt}{8pt}                 text    &   text        & text   \\             \hline             \hline             \end{tabular}         \captionof{table}{text for the listing}{caption} \label{tab:table}              \end{minipage}             \end{table}          \end{document}      well, the problem is, that some table's appear above the caption. My idea was to put these ones in a non-floating environment. Since I have more than 60 figures and tables I don't want to change them all in a `tabular` or `tabularx`-environment. Is there a way to put some figures or tables in a non-floating-environment AND to leave the rest in a `table` \- environment. With: `\captionof`.... And they need to be numbered =(


title: How do you change table numbers in the title?

text: \documentclass{article}     \usepackage{booktabs}     \usepackage{dcolumn}          \begin{document}     \setcounter{page}{3}     % Table generated by Excel2LaTeX from sheet 'nipo'     \begin{table}[htbp]     \centering     \caption{Statistics of Initial Public Offering}     \begin{tabular}{rrr}     \toprule         Year  & Frequency & \% \\     \midrule     1975  & 10    & 0,1 \\     1976  & 27    & 0,3 \\     1977  & 17    & 0,2 \\     1978  & 21    & 0,3 \\     1979  & 47    & 0,6 \\     1980  & 69    & 0,8 \\     1981  & 183   & 2,2 \\     1982  & 80    & 1,0 \\     1983  & 524   & 6,4 \\     1984  & 219   & 2,7 \\     1985  & 258   & 3,1 \\     1986  & 523   & 6,3 \\     1987  & 383   & 4,6 \\     1988  & 161   & 2,0 \\     1989  & 161   & 2,0 \\     1990  & 146   & 1,8 \\     1991  & 334   & 4,1 \\     1992  & 459   & 5,6 \\     1993  & 557   & 6,8 \\     1994  & 457   & 5,5 \\     1995  & 479   & 5,8 \\     1996  & 635   & 7,7 \\     1997  & 443   & 5,4 \\     1998  & 273   & 3,3 \\     1999  & 401   & 4,9 \\     2000  & 340   & 4,1 \\     2001  & 83    & 1,0 \\     2002  & 68    & 0,8 \\     2003  & 65    & 0,8 \\     2004  & 179   & 2,2 \\     2005  & 180   & 2,2 \\     2006  & 191   & 2,3 \\     2007  & 236   & 2,9 \\     2008  & 29    & 0,4 \\          Sum   & 8238  & 100,0 \\     N     & 34    &  \\     \bottomrule     \end{tabular}%     \label{tab:addlabel}%     \end{table}%          \end{document}      How do you change the "Table 1" in the title to example "Table 2" or "Panel A" or something else? I'm very new to producing LaTex tables, and I realize that the answer to my question is probably very simple.


title: How to center one node exactly between two others with TikZ?

text: How can I center a TikZ node exactly between two others? Hypothetically,               \node (a) {a}     \node (c) [right of=c] {c}     \node (b) [between={a,c}] {b}


title: Overlap table cells

text: I use "multicol" to create a page with two columns and in one column I have a table. My problem is that the table is too wide and I get an "Overfull \hbox" warning. Example:               \documentclass{scrreprt}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[ngerman]{babel}     \usepackage{multicol}          \begin{document}     \begin{multicols}{2}\noindent     Text     \vfill\columnbreak\noindent     \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}@{}lr@{}}     \textbf{Textext extextext:} & Text \\     \textbf{Text:} & Text \\     \textbf{Text:} & Textextextete xtextextext \\     \end{tabular*}     \end{multicols}     \end{document}      I want that some of the cells overlap the cell next to it (see picture). Is it possible? ![Example picture: Overlapping cells](http://i.stack.imgur.com/Soxmx.png)


title: Polyglossia vs Babel

text: Could someone summarize features which are (1) common and (2) different for the `babel` and `polyglossia` packages? I know that `babel` 3.8 (current version) fails to run for some languages (eg, Russian) under LuaLaTeX and XeLaTeX (at least it was so 2 years ago). What will be the future of the `polyglossia` package if `babel` 3.9 (which is now `babel-alpha`) will manage to work with XeLaTeX? Will be any sense to use `polyglossia` as a replacement of `babel` in that case? **UPDATE** : I am sorry for mixing several questions in one post. Main question was about differences between `polyglossia` and `babel`. For example, `polyglossia` has options specific to some languages.


title: Glossary not printed issue on ShareLatex

text: Hi guys I'm having issues with the recently implemented Glossary in my sharelatex package. When using the glossary tags it works fine in the text but at the end the glossary won't get printed. I have to use a file from my university:               %     % University of Berne     %     % Bachelor thesis template     % Thomas Staub 14.04.2005     %          \documentclass[11pt,a4paper,twoside,openright]{rvsbachelor}          \usepackage[utf8]{inputenc}     \usepackage{graphicx}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \usepackage[a4paper,twoside]{geometry}          \sloppy          %% Additional packages     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          % for source code highlighting     % \usepackage{listings}     % \lstloadlanguages{tcl, Perl}     % \lstset{language=tcl, commentstyle=\it, basicstyle=\tiny, keywordstyle=\bf,     breaklines=true, frame=single}          % multiple figures with same general caption     \usepackage{subfigure}     \setcounter{lofdepth}{2}            % offers more possibilities in captions     \usepackage{caption}          % Commands for package caption     % - caption     \renewcommand{\captionfont}{\small}     \renewcommand{\captionlabelfont}{\bfseries}          % offers rotation of figures, ...     \usepackage{rotating}          % to support correct hyphenaten, add words with -     % \hyphenation{test-case}          % If a page has no content, make it an empty page (without page numbers ....)     \makeatletter     \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else     \hbox{}     \thispagestyle{empty}     \newpage     \fi\fi}     \makeatother          % check whether we are running pdflatex     \newif\ifpdf     \ifx\pdfoutput\undefined     \pdffalse % we are not running pdflatex     \DeclareGraphicsExtensions{.eps}     \else     \pdfoutput=1 % we are running pdflatex     \pdfcompresslevel=9     % compression level for text and image;     \pdftrue     \DeclareGraphicsExtensions{.pdf}     \fi     \ifpdf     %to make table of contents and index appear in bookmarks     \usepackage{tocbibind}     %refs also as links     \usepackage[pdftex,plainpages=false]{hyperref}     %plainpages=false: enable links although page numbering is reset after title     %backref, pagebackref]{hyperref}     %\usepackage[pdftex]{color}     %\usepackage[pdftex]{thumbpdf}     \else     %url must be escaped. (this works fine in dvi)     \usepackage{url}     \fi          \usepackage[nomain, acronym, toc]{glossaries}          \author{Adrian Kurt}     \title{title of the thesis}     \date{2014}          \makeglossaries     \input{acronyms}               % document start     \begin{document}     \maketitle     \thispagestyle{empty}     \mbox{}          \newpage     \pagenumbering{roman}     \tableofcontents{}     \listoffigures{}     \listoftables{}          \cleardoublepage     \setcounter{page}{1}    % Reset page numbering to 1     \pagenumbering{arabic}  % Arabic page numbers          % Advice: split up your thesis in multiple files, i.e. one file for one section     \input{intro}     \input{theory}     \input{practical}     \input{discussion}               \input{th_bibliography}     \printglossary[title=List of Terms,toctitle=Terms and abbreviations]     \printglossary[title=some title, type=\acronymtype]     % no output here of the glossary          \end{document}      any ideas what the problem could be?