title: Position text next to rectangle in TikZ

text: Consider the following `TikZ` code:               \filldraw[fill=black!40!white,thick] (0,1.5) node[above left] {start} rectangle (3.2,2) node[below right] {end} node [midway] {cp} ;      It produces a rectangle at the required co-ordinates, with text `cp` inside the rectangle. I require text labels to the left and the right of the rectangle. I have attempted to produce these with the text attached to the `above left` and `below right` nodes. However, the `end` label is positioned slightly lower than the `start` label. How can I fix this, or, is there a better/easier way to position text next to rectangles. I have looked through the tutorials in the first section of the 700+ `TikZ` manual. **Edit** : _Additional information in response to percusses's answer below_ :               \filldraw[fill=black!40!white,thick] (0,2.5) rectangle (3.2, 3) node [midway] {cp} ;     \node[fill=black!40!white,thick,draw,minimum height=0.5cm,minimum width=3.2cm,label=0:end,label=west:start] at (0,1.5) {cp};      Note the different x positions. Your code (the second line above) places the entire structure such that `start` is positioned at position 0. For some reason, the structure produced by my code is shifted to the right so that it starts in the middle of the rectangle relative to yours.


title: Text in the header with memoir

text: How do I put text in the header with the memoir class?


title: Define a color for \title, \address and \phone commands of a CV

text: How can I define colors for a `moderncv` LaTeX file, for the following commands?   * `\address`   * `\title`   * `\phone`   * `\mail`


title: Is it possible to run LuaTeX from a USB flash drive

text: I am looking for ways to install and run LuaTeX on a USB flash drive (Windows operating system).


title: Ploting a function using mplib in lualatex

text: This question asked about ways to generate a nice function graph in LaTeX. There are several great answers, however, most of the either rely on an external program to generate the plot, or, if they use TeX to calculate the coordinates of the graph, are restricted to only fairly simple functions. I wanted to come up with an answer using luatex, using lua to do the calculations, and mplib to actually draw the graph. However, I could not figure out how to use lua and mplib together. Generating the graph in lua is not hard, and I can pass the generated path to tikz for rendering:               \documentclass{article}     \usepackage{luacode}     \usepackage{tikz}          \begin{luacode}        require("math")        sin=math.sin;cos=math.cos;pi=math.pi        point = function (f,x) return "("..x..","..f(x)..")" end;        path = function (f,a,b,n)       local step = (b-a)/n; local s = "";      for x = a, b - step/2, step do s = s .. point(f,x) .. "--" end;       s = s ..  point(f,b);       return s         end;     \end{luacode}          \def\plot#1#2#3#4{%         \directlua{      do local f = function (x) return #1 end;      tex.print(path(f,#2,#3,#4)) end;        }%     }          \begin{document}     \begin{tikzpicture}        \draw[thin,->] (-.2,0)--(6.5,0)node[right]{$x$};        \draw[thin,->] (0,-2.2)--(0,2.2)node[above]{$y$};        \draw[thick] \plot{sin(2*x)+cos(x)}{0}{2*pi}{40}node[above]{$y=\sin(2x)+\cos(x)$};     \end{tikzpicture}     \end{document}      I would like to know what would be a best way to generate a drawing using lua and render it using mplib.


title: Math Input Panel in Windows 7 and LaTeX writing

text: I just found out about the Math Input Panel in Windows 7,and now there is commercial software using it for LaTex writing. For example Inlage. If you have a look of their first demo video, you know what I am talking about: http://www.inlage.com/videos I had a try with the Math Input Panel myself, and it seems you can basically write all math stuff, integration, super(sub) scripts, tensor, arrows (even with labels over them!), and matrix! The only big problem is there is NO commutative diagram. And it probably has trouble recognizing some math fonts, like \mathfrak or \mathcal. But in all, it really recognize handwritings pretty well. I don't have a writing pad, so I just tried writing with a mouse. I know there are people taking math notes using a tablet PC. Won't this tool drastically improve the quality of our note-taking? It basically changes all handwriting into TeX files! Maybe I am too late on this, are there more mature product for such purposes? I think handwriting math could actually be slower than typing LaTeX codes. But one good reason for doing handwriting is because sometimes I just don't like to make math writing into code writing (or something like programming). I would like to hear about your comments. Thank you!


title: Package or tool for visualizing differences

text: > **Possible Duplicate:**   >  What is a good way to show changes between two versions I done a bunch of updates in an article. I have a copy of an old revision of the paper. Now I would like to generate a PDF/DVI illustrating the updates I've done. Is there any tool or package that would help me with this? (The article is under SVN version control, if that helps.)


title: Word-like colors for different versions of one file

text: > **Possible Duplicate:**   >  What is a good way to show changes between two versions I was wondering if there is any package that can accomplish a Word-like color scheme for different versions of the same file. So, if I have the `doc.tex` and then modify it to be `doc-v2.tex`. I can somehow tell the package in question that this file is actually a different (newer) version of `doc.tex`. And then it will put different color to the text that is new/modified in the `doc-v2.tex`. Just like Word does when you have different revisions. Is there any package that does something like that? Or do I have to manually change the color for each and every line that is different?


title: `pgfmathresult` in a command

text: The following code doesn't work :               \documentclass{standalone}     \usepackage{pgfplots}          \usetikzlibrary{positioning, calc}          \newcommand\machin{     \pgfmathparse{1}     \pgfmathresult     }          \pgfmathsetmacro\truc{\machin}          \begin{document}          \end{document}      Does anybody know how I could have my command `\machin` return a result that I could use in a `\pgfmathsetmacro`? Thanks for your help EDIT : I wanted to do something like :               \newcommand\longueur[4]{     \pgfmathparse{((#1-#3)^2+(#2-#4)^2)^0.5}     \pgfmathresult     }          \newcommand\setEchelle[6]{     \pgfmathsetmacro\Echelle{500*(#6)/3.6/\longueur{#1}{#3}{#4}{#5}}     }


title: How to put \algorithm and \algorithmic environments inside a box?

text: I want to put an algorithm inside a box. Here is the code               \fbox{\parbox{0.8\linewidth}{     \begin{algorithm}     \caption{My algorithm}     \begin{algorithmic}[1]       \scriptsize     ...     \end{algorithmic}     \end{algorithm}          }}      I am getting this error:                Not in outer par mode      following other error at the line where the two ending curly brackets are. The problem is solved when i remove the `algorithm` environment and i have only the `algorithmic`. But i want to have algorithm environment to put the caption.


title: TeX Live error on Ubuntu 10.04: pdflatex.fmt doesn't match pdftex.pool

text: I recently installed Ubuntu 10.04 over-top of Ubuntu 9.04, preserving my /home partition, but aside from that partition, it was a fresh install. I installed the texlive package (2009-7) from Ubuntu's main repository. Now, when I try to run latex or pdflatex on a `.tex` file, I get the not so helpful error:               brian@thoralf:~/tmp$ pdflatex test.tex      This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)      restricted \write18 enabled.     ---! /home/brian/.texmf-var/web2c/pdftex/pdflatex.fmt doesn't match pdftex.pool     (Fatal format file error; I'm stymied)      What can I do to fix this problem?


title: Subsection not showing up in toc

text: I am including chapters (comprised of sections and subsections) in a main file and then compiling the entire file from there. I am using a `"thesis.cls"` file provided to me. The only problem is that the subsections inside the chapters do not show up in the table of contents while all the sections do (`introduction` is a chapter and has subsections inside it). Now, I have made sure that the subsections do not have a `*` (i.e., `subsection*{methods}`) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% **Question:** **Hi...Can some please help me as to how I can make the font size of the subsections the same as that of section? My thesis needs to have the same font throughout...many thanks again**


title: How do I get italic texts figures in ConTeXt?

text: Inside an italic section I want to place text figures (which should be italic as well). How do I achieve this? (The document is in ConTeXt MKII.) Both of the following examples produces non italic (regular) text figures:               {\em Poppy Heavy with Seed. Video, {\os 17}:{\os 52}.}     {\em Poppy Heavy with Seed. Video, {\em \os 17}:{\em \os 52}.}      Here are two tests with images: # Test 1               \setupbodyfont [10pt]     \starttext     {\em Poppy Heavy with Seed. Video, {\os 17}:{\os 52}.}     \stoptext      **ConTeXt (PDFTeX):** ![Pdftex](http://i.stack.imgur.com/mzSPS.jpg) **ConTeXt (LuaTeX)** : ![Luatex](http://i.stack.imgur.com/oBY0A.jpg) # Test 2               \setupbodyfont [10pt]     \starttext     {\em Poppy Heavy with Seed. Video, {\em \os 17}:{\em \os 52}.}     \stoptext      **ConTeXt (PDFTeX):** ![enter image description here](http://i.stack.imgur.com/JzndE.jpg) **ConTeXt (LuaTeX)** : ![enter image description here](http://i.stack.imgur.com/Kvxlt.jpg)


title: Finely control line spacing when already using the setspace package?

text: I'm using `setspace` to double-space an article (as it's widely known, this package behaves more intelligently than `\linespread`, Double line spacing alread covers the details).               \usepackage{setspace}     \doublespacing      However, I'd like to finely adjust the "double" spacing so I can control the overall length of the paper. If I use `\linespread`, I go back to the less intelligent mechanism. Is there a way to fine tune what the `setspace` package does? My question is specific to the `article` and, perhaps, `report` document classes. I'm saying this because some googling found some tricks specific to the `memoir` class.


title: Why is this let expression not working in TikZ (calculating a midpoint)?

text: I have a rectangle in TikZ and the top left and bottom right corners are called (topleft) and (bottomright) respectively. I wanted to have a label midway down the left hand side of the rectangle, so I tried the following, both of which failed with cryptic error messages:               \draw let \p1 = (topleft), \p2 = (bottomright)      in (\x1,\pgfmathparse{0.5*(\y1 + \y2)}\pgfmathresult) node[right]{6 metres};      and               \draw let \p1 = (topleft), \p2 = (bottomright)      in (\x1,{0.5*(\y1 + \y2)}) node[right]{6 metres};      I got the desired result in a roundabout way:               \draw let \p1 = (topleft), \p2 = (bottomright)      in ($(\x1,\y1)!.5!(\x1,\y2)$) node[right]{6 metres};      But why did the first two attempts not work? EDIT (in response to request for more detail): If it helps, you can assume that the context of the command above is something like:               \usetikzlibrary{calc}     \begin{tikzpicture}     \draw (0,10) coordinate (topleft) rectangle (6,0) coordinate (bottomright);     %% relevant let statement would go just below here     \end{tikzpicture}      but I do not want a solution that uses the knowledge that the coordinates are (0,10) and (6,0).


title: How to align terms in alignat environment

text: These are my math equations. ![enter image description here](http://i.stack.imgur.com/ZkoAq.png) To enhance readability, I'd like the third column to be aligned around the `+` sign; that is,   * I wish to place some horizontal blank in front of `$n\mathbf{A}_0$` (not behind it) in the first line so that there's no blank between `$n\mathbf{A}_0$` and `+` sign.   * And the same thing for the third line with the space behind `$\frac{n 2}\mathbf{A}_2$`.               \documentclass[10pt]{document}          \usepackage[english]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{mathtools}          \newcommand{\Abf}{\ensuremath{\mathbf A}}          \begin{document}          \begin{subequations}     \begin{alignat}{3}     \Abf\Abf_1 &= b_0\Abf_0 + c_2\Abf_2 = n\Abf_0 & &+ {\frac n 2}\Abf_2 \\     \Abf\Abf_2 &= b_1\Abf_1 + c_3\Abf_3 = (n-1)\Abf_1 & &+ (n-1)\Abf_3 \\     \Abf\Abf_3 &= b_2\Abf_2 + c_4\Abf_4 = {\frac n 2}\Abf_2 & &+ n\Abf_4     \end{alignat}     \end{subequations}          \end{document}


title: Why doesn't TeXstudio produce {} for my custom commands?

text: I'm having the following problem in TeXstudio 2.7.0. I have a template where I've declared some custom commands, such as               \newcommand{\myAnswer}[1]{ \begin{itemize}[leftmargin=*]  \item[\textbf{Lösung: }]~#1 \end{itemize}}      Now, when I type `\myAnwser`, Texstudio doesn't produce the `{}` for the parameter, altough it does for LaTeX commands, such as `\textit{}`. I don't know what is wrong, because it used to work on my old PC (on which I had TeXstudio 2.6.6 installed). Does that problem have to do with the version of TeXstudio I'm using (2.7.0)?


title: Environment for changing citations in tables

text: I am making citations with non-superscript numbers in square brackets, just as: ![enter image description here](http://i.stack.imgur.com/qieP4.png) with code:               y de los tres momentos de inercia \cite{Spec}. Para el caso de una      In the preamble I have declared:               \usepackage[longnamesfirst]{natbib}     \setcitestyle{square}      And then, inside the document:               \begin{document}          \bibliographystyle{ieeetr}     \bibliography{./bibliography}      Where I have a `bibliography.bib` file in the same folder. In tables, the non-superscript citation is not a good solution: ![enter image description here](http://i.stack.imgur.com/h9t7g.png) Code:               \begin{table}     \begin{tabular}{lllll}     \cline{2-3}     \multicolumn{1}{l|}{}   & \multicolumn{1}{l|}{CD}   & \multicolumn{1}{l|}{EF}   &  &  \\ \cline{1-3}     \multicolumn{1}{|l|}{a} & \multicolumn{1}{l|}{5.45\cite{Spec1,Spec2}} &      \multicolumn{1}{l|}{25.8 \cite{Spec3}} &  &  \\ \cline{1-3}     \multicolumn{1}{|l|}{b} & \multicolumn{1}{l|}{44.2} & \multicolumn{1}{l|}{3.21 \cite{Spec4,Spec5}} &  &  \\ \cline{1-3}                         &                           &                           &  &     \end{tabular}     \end{table}      It is preferred to make those citations with superscript square brackets. Would it be possible to make a special environment in every table in order to indicate that the citations should appear in superscript square brackets ? Here is my preamble:               \documentclass[12pt,a4paper,twoside,openany]{report}     \usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}     \parindent 1 true cm     \usepackage{graphicx}     \usepackage{eufrak}     \usepackage[spanish]{babel}     \usepackage[latin1]{inputenc}       \usepackage[T1]{fontenc}     \usepackage{times}     \usepackage{amsmath}     \usepackage{multirow}     \usepackage{float}     \usepackage{color}     \usepackage[longnamesfirst,super]{natbib}      \setcitestyle{square}     \usepackage{fancyhdr}        \pagestyle{fancy}                                             \renewcommand{\chaptermark}[1]{\markboth{\thechapter .\ #1}{}}                  \renewcommand{\sectionmark}[1]{\markright{\thesection .\ #1}{}}     \lhead{\nouppercase}     \rhead{\nouppercase}     \fancyhead[LE]{{\sf \leftmark}}                                  \fancyhead[RE]{}     \fancyhead[RO]{{\sf \rightmark}}     \fancyhead[LO]{}                                                     \fancyfoot[LE,RO]{\thepage}                                                \fancyfoot[CE,CO]{}                                                              \renewcommand{\headrulewidth}{0.0pt}                                     \renewcommand{\baselinestretch}{1.25}     \usepackage{adjustbox}     \usepackage{enumerate}     \usepackage{courier}     \usepackage{caption}     \usepackage[version=3]{mhchem}     \usepackage{rotating}     \usepackage[percent]{overpic}     \captionsetup{font={small}}     \begin{document}      Thanks.


title: High level digital design in TikZ

text: I am very new to TikZ and I have trouble making a diagram similar to the one here: ![enter image description here](http://i.stack.imgur.com/txiPc.jpg) My problems are specifically making `MUX` to get to inputs which would be on 1/3 and 2/3 of the width. Taking sigma signal outside of the border while still being above and to the right from the `X` block. Making all the lines bend with 90% to get to the final nodes. Adding the `dX` labels next to the operators. My current code is:               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{positioning,intersections,shapes.geometric,fit,arrows,decorations.shapes,decorations.markings}          \begin{document}     \tikzstyle{register} = [rectangle, draw, text centered]     \tikzstyle{multiplexor} = [rectangle, draw, text centered, minimum width = 4em, minimum height = 2em]     \tikzstyle{operation} = [circle, draw, text centered, minimum size=3em]     \tikzstyle{port} = [pin edge={to->,thin,black}]          \begin{tikzpicture}[node distance = 5em, auto]              \node (mux)     [multiplexor] {MUX};         \node (delay)   [register, on grid, below of = mux] {Delay};         \node (add_one) [operation, right of = mux] {$+1$};         \node (mult)    [operation, on grid, below right of = add_one] {$\times$};         \node (exp)     [operation, below of = mult] {$\exp$};         \node (xmin)    [port, above of =  mux, xshift=-1em] {$x_{min}$};         \node (sigma)   [port, above of = border, above right of = mult] {$sigma$};         \node (addr)    [port, below of = border, below of = delay] {$address$};         \node (data)    [port, below of = border, below of = mult] {$data$};              \node (border) [draw,  dashed,inner sep=3pt,fit = (xmin) (exp)] {};               \draw [->] (sigma)  |-  (mult);         \draw [->] (xmin)   ->  ([xshift=-2em] mux);         \draw [->] (add_one) -> (mux);         \draw [->]  (mux) -> (delay);         \draw [->] (mux) |- (add_one);         \draw [->] (add_one) |- (mult);         \draw [->] (delay) -> (addr);         \draw [->] (mult) -> (exp);         \draw [->] (exp) -> (data);          \end{tikzpicture}     \end{document}      which outputs: ![enter image description here](http://i.stack.imgur.com/7Uxhj.png) Any help would be appreciated.


title: How to get an even smaller font?

text: I wanted to amplify the effect of specifying the font size. So I tried:   `{\tiny\tiny Super tiny text!}`   But that doesn't seem to work. I needed suggestions to achieve the same goal.


title: Drawing to indicate algorithms

text: I'm looking for one good drawing so as to symbolise algorithms. The idea is to use this drawing like one symbolic icon. Have you some ideas ?


title: How to apply different background images for each page using PerlTeX

text: How do I apply a different background image for each page? I have an array of pdf's to apply. I have used the watermark package. However, I do not like the idea of manually adding a different watermark for hundreds of pages, I prefer the idea of using perltex --love Perl! I guess the question is really, how do I access each page's data structure, just before it is written to a file? Here is the perl code I have created so far:               \def\numbpgs{\getpagerefnumber{LastPage}}     \def\imgs{1 2 3 ... x}     \bkgrndimages{\numbpgs}{\imgs}          \perlnewcommand{\bkgrndimages}[2]{            my $numpgs = $_[0];       my @imgarray = split / /, $_[1];       my $return = ();            my $c = 1;       for (0 .. $numpgs) {         # Here I wish to modify each page's background to          $return .= WATERMARK[LATEXPAGE[$c]] $imgarray[$c]\.pdf;         $c++;       }       return $return;      }


title: Making polyglossia and zref-savepos or pdfsavepos work together

text: When I add the `polyglossia` package to use my Hebrew text, it breaks the writing of the coordinates to a file. If I remove the `polyglossia` package it works fine. Not sure if it is related to `zref`. And if you add a `\newline` in between each line it works fine, but I need the text to flow as a paragraph. MWE:               \documentclass{article}%     \usepackage{zref-savepos}%          \usepackage{polyglossia}%     \setmainlanguage{hebrew}%     \setotherlanguage{english}%          \defaultfontfeatures{Mapping=tex-text}     \setmainfont{Times New Roman}     \newfontfamily\hebrewfont[Script=Hebrew]{Times New Roman}     \newfontfamily\hebrewfontsf[Script=Hebrew]{Times New Roman}          \AtBeginDocument{%         \newwrite\myoutputfile%         \openout\myoutputfile=\jobname.yposout.txt%     }     \AtEndDocument{%         \closeout\myoutputfile%     }          \def\mywriting#1{%         \zsaveposy{#1}%         \typeout{#1:\zposy{#1}}% Write to log file to double check.         \write\myoutputfile{#1:\zposy{#1}}%     }%          \newcommand\writingpos[2][]{%         \mywriting{#2}%     }%          \begin{document}%     \begin{hebrew}     \writingpos{40001001} This is my very long sentence which spans a line or so and it's Y-position at the beginning will certainly have to be different from it's Y-position at the end of this line and I'll use it to test the output of the ZREF package.\writingpos{40001001L}     \writingpos{40001002} This is my SECOND very long sentence which spans a line or so and it's Y-position at the beginning will certainly have to be different from it's Y-position at the end of this line and I'll use it to test the output of the ZREF package.\writingpos{40001002L}     \writingpos{40001003} This is my THIRD very long sentence which spans a line or so and it's Y-position at the beginning will certainly have to be different from it's Y-position at the end of this line and I'll use it to test the output of the ZREF package.\writingpos{40001003L}     \end{hebrew}     \end{document}%      The log file shows this (which is correct):               40001001:42747166     40001001L:40518942     40001002:40518942     40001002L:38159646     40001003:38159646     40001003L:36586782      But the output file gives this (which is incorrect):               40001001:42747166     40001002:40518942     40001001L:40518942     40001003:38159646     40001002L:38159646     40001003L:36586782      Notice the difference in the order of the first numbers (ID). It should follow on such as ...001, ...001L, ...002, ...002L, ...003, ...003L etc.


title: Is there any textbook for XeLaTeX?

text: I usually use PdfTeX. Currently I have to learn XeLaTeX which I am not familiar with. So   1. Is there any textbook for XeLaTeX?   2. How to use numerous math fonts in one article? E.g. use mathrsfs, yfonts, amsmath, dsfont, amssymb, mnsymbol, mathabx together. It is the primary problem I am facing.   1. How to use `\fam`?


title: Compilation of bibliography

text: I have a latex document which is compiling properly. The message on compiling is _Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "template_Book_23June2014_V2".tex_ _This is makeindex, version 2.15 [MiKTeX 2.9] (kpathsea + Thai support). Scanning input file cases.idx...done (0 entries accepted, 0 rejected). Nothing written in cases.ind. Transcript written in cases.ilg._ _This is makeindex, version 2.15 [MiKTeX 2.9] (kpathsea + Thai support). Scanning input file legislation.idx...done (0 entries accepted, 0 rejected). Nothing written in legislation.ind. Transcript written in legislation.ilg._ _Process exited normally_                   \documentclass[]{book}         \title{Alpha}         \author{Beta \and Theta }         \usepackage[english]{babel}         \usepackage[style=oscola,eutreaty=alternative,ibidtracker=false, indexing=cite,           backend=biber]{biblatex}        \usepackage{geometry}        \usepackage{genmpage}        \usepackage{imakeidx}        \usepackage[style=british]{csquotes}         \makeindex[name=cases, title={Table of Cases}]        \makeindex[name=legislation, title={Table of Legislation}]         %Bibliography resource         \addbibresource{Bibliography.bib}        \begin{document}        \maketitle        \tableofcontents        \frontmatter        \mainmatter        \backmatter        \printbibliography[nottype=commentary,nottype=jurisdiction, nottype=legislation,        nottype=legal]        \end{document}      However when i try compiling the .bib file i am getting the following message: _Could not start default compiler: Pdflatex_ _Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "Bibliography".tex_ The code for my Bibliography.bib file is:                   \begin{thebibliography}{9}         \bibitem{Erdos01} P. Erd\H os, \emph{A selection of problems and           results in combinatorics}, Recent trends in combinatorics (Matrahaza,           1995), Cambridge Univ. Press, Cambridge, 2001, pp. 1--6.          \end{thebibliography}}      I am a complete newbie to latex am trying to get me head around it.


title: Stop Hyphenating Across Page Breaks

text: How to prevent hyphenation across page breaks? Here is my minexample:               \starttext     \dorecurse{200}{Aprikosengeschmacksrichtung }     \stoptext      What I mean is a feature, which many other typographic programms have, e.g. Adobe Indesign, see here: http://indesignsecrets.com/stop-hyphenating-across- columns-and-page-breaks.php Hyphenation across pages is really ugly and uncomfortable to read, how would you prevent them?


title: Keep chapter headings and related subheadings in the same page in ToC

text: I'm trying to finish my master's thesis and all I have left are some formatting issues. I'm trying to prevent LaTeX from breaking a chapter and its subheadings in between pages in my table of contents. My problem is the following:               Table of Contents          ... some stuff here ....          CHAPTER W         ...         ...          CHAPTER X     ----------- Latex inserts page break here -------     <end of page>          <next page>         chapter x subheading 1         chapter x subheading 2          And this is what I want to happen:          Table of Contents          ... some stuff here ....          CHAPTER W         ...         ...          <end of page>     <next page>          CHAPTER X         chapter x subheading 1         chapter x subheading 2      Basically, I want to make sure that the Chapter heading is not left "orphaned" in one page, while its subheadings are in another page. What would be the simplest enforce this in LaTeX? It's only one chapter heading that's being orphaned in my ToC. I've considered using the package to adjust the title spaces, but this might be overkill. Perhaps someone may have an elegant solution. :D


title: amsart.cls capitalizes the article title. How to disable it?

text: I am writing an article with `amsart.cls`. `amsart.cls` capitalizes the title of the article. I looked into `amsart.cls` and found that `\MakeUppercase` is used in `\maketitle`. I tried to turn off this, but I could not. As for the author, I could turn off it. Is there any clues? I am running TeX Live 2011 on an opensuse12.1 Linux box. `amsart.cls` is dated 2009, July.


title: How to use string.find from Lua in ConTeXt?

text: I am trying to make some conditionals with Lua, which check if some text is found within a string. Unfortunately, when I compile it, I get:               ! LuaTeX error <main ctx instance>:4: bad argument #1 to 'find' (string expected, got nil)     stack traceback:         [C]: in function 'find'         <main ctx instance>:4: in function 'hasnumber'         <main ctx instance>:1: in main chunk.      I thought my code must have a problem with Lua, but I confirmed at Stack Overflow (How to check if matching text is found in a string in Lua?) that I have used the write code to use `string.find` inside a conditional, so I consider the posibility that I have made some error in incorporating this code into a Lua function within ConTeXt. Here is an overly simplified version of my code, but which has the same error:               \startluacode         userdata = userdata or {}         function userdata.hasnumber()             if string.find(str, "2") then                 str = "Has 2."             elseif string.find(str, "1") then                 str = "Has 1."             else                 str = "Has none."             end             context(str)         end     \stopluacode          \starttext         \ctxlua{userdata.hasnumber("The number 1 is here, as is 2")}         \ctxlua{userdata.hasnumber("This has no numbers.")}         \ctxlua{userdata.hasnumber("This only has 1")}     \stoptext      Why is `string.find` reporting that it did not receive any string?


title: Style for biblatex

text: I need to realize a special style with `biblatex` for cites within a paragraph. The requirements are the following:   * General cite should be last name of first author and year: Smith (2012)   * More pubs in one year with Smith (2012a), Smith (2012b) etc.   * Having two authors, both are mentioned with last name and year: Smith and Paul (2009)   * More than two authors should be Chin et al. (2013) I would be more than happy to get that realized, since I need to prepare material for students at the present semester. With the one I tried below, the following issues appeared:   * Cite: the year is not set in parenthesis ("A. Author 2001" instead of "A. Author (2001)")   * Cite: I only would need the last name, like "Author (2001)"   * "`maxcitenames`"seems not to work...   * Bib: Authors should always listed with last name first and initials, like "Author, A. und Author, B. (2001). Alpha." and not "Author, A. und B. Author (2001). Alpha." Here is what I tried as minimal working example.               \documentclass{article}          \usepackage[%         style=authoryear,%         backend=biber,%         maxcitenames=2,%         language=ngerman]{biblatex}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {Alpha},     }          @misc{A01a,       author = {Author, A. and Author, B.},       year = {2001},       title = {Alpha},     }          @misc{A01b,       author = {Author, A. and Author, B. and Author, B.},       year = {2001},       title = {Alpha},     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          \cite{A01}          \cite{A01a}          \cite{A01b}          \printbibliography     \end{document}


title: Compilation fails in beamer class with newenvironment defining nested blocks

text: I'm failing to understand why this code compiles :               \documentclass{beamer}     \newenvironment{yyy}{\begin{frame} \begin{block}{youpi}  }{\end{block} \end{frame}}     \begin{document}      { \begin{frame} \begin{block}{youpi}   bonjour \end{block} \end{frame} }     \end{document}      while that one does not :               \documentclass{beamer}     \newenvironment{yyy}{\begin{frame} \begin{block}{youpi}  }{\end{block} \end{frame}}     \begin{document}       \begin{yyy}    bonjour \end{yyy}     \end{document}      ... resulting in               File ended while scanning use of \beamer@collect@@body      If anyone has got an idea, i'd be greatful!


title: LaTeX allows line break between concluding em-dash and comma before a new sub clause begins

text: I am surprised by LaTeX putting a comma which follows an em-dash on a new line when the previous line is flushed. My intuition and sense of style tells me that they should never be separated. For example:               \documentclass[a4paper]{book}     \usepackage[top=35mm, bottom=38mm, inner=40mm, outer=24mm]{geometry}     \usepackage[UKenglish]{babel}          \begin{document}          Foo bar. The erosion responsible for ‘residuals’ is less related to the material process of      creation---e.g., rewriting in the sense of Mondrian or blurring the edges in the sense of      Rothko---, but to the double nature of time\ldots          \end{document}      ![enter image description here](http://i.stack.imgur.com/QWWtk.png) Why isn't the second line ending with em-dash _and_ comma? Is this the correct way you would break lines in (British) English?


title: siunitx: How to get bold, aligned entries and how to align when units differ in length?

text: I tried my first steps with `siunitx`, but I have trouble achieving the following in the minimal example below: 1) aligning the entries in the first column with respect to the decimal dot 2) getting a bold entry in the second column 3) getting the entries in the second column aligned according to the decimal dot. The code is currently not running due to the `\rowcolor` command. I adapted this from the manual `siunitx.pdf`, why is it not working?               \documentclass{article}          \usepackage{siunitx, tabularx, etoolbox, xcolor}          \begin{document}     \begin{table}     \robustify\bfseries% see 7.15 in siunitx.pdf     \centering     \begin{tabular}{lS[table-format=2.3]S[table-format=1.4]}         \multicolumn{1}{c}{$a\ (b)$}&\multicolumn{1}{c}{col 1}&\multicolumn{1}{c}{col 2}\\\hline         0.05\ (0.1)&\SI{20.64}{s}&\rowcolor[gray]\bfseries\SI{3.0601}{s}\\         0.1\ \phantom{5}(0.2)&\SI{16.82}{s}&\SI{1.59}{s}\\         0.3\ \phantom{5}(0.4)&\SI{22.48}{s$^\ast$}&\SI{0.64}{s}\\         0.4\ \phantom{5}(0.5)&\multicolumn{1}{c}{$-$}&\SI{0.52}{s}\\       \end{tabular}     \end{table}     \end{document}      **Update** After Joseph's first suggestion, I changed the table like this:               \documentclass{article}          \usepackage{siunitx, tabularx, etoolbox, xcolor, booktabs}          \begin{document}     \begin{table}     \robustify\bfseries     \centering     \begin{tabular}{ScS[table-format=2.2]lS[table-format=1.4, detect-weight]}       \toprule       $a$ & $(b)$ & \multicolumn{2}{c}{col 1, unit} & {col 2/\si{\s}}\\       \midrule       0.05 & (0.123) & 20.64 & s & \bfseries 3.0601\\       0.1 & 0.2 & 16.82 & s2 & 1.59\\       0.3 & 0.4 & 22.48 & s$^\ast$ & 0.64\\       0.4 & 0.5 & {--} & kg & 0.52\\       \bottomrule     \end{tabular}     \end{table}     \end{document}      My remaining questions are: 1) How can I align the entries of the second column when one of the entries has surrounding parenthesis? [`(0.123)`] 2) Putting the unit in a different column creates a too large spaces between the units and the numbers (especially if some numbers have more digits such as `2.3 kg` vs `1.232525 kg`). Is there a solution which aligns the entries of the `col 1` according to the decimal point but allows entries to be specified by `\SI{}{}` to get proper spacing between numbers and units? 3) `\rowcolor` still does not work, I obtain an `Undefined control sequence` error. Do I need additional packages?


title: bottomrule option not working in beamer tcolorbox

text: I'd like to use the bottomrule option for the tcolorbox environment, as shown in the tcolorbox manual on page 12. Unfortunately, the option does not seem to work, and the following code creates a standard tcolorbox instead of a bottomruled tcolorbox.               \documentclass{beamer}     \usepackage{tikz}     \usepackage{tcolorbox}          \title{\color{white}{\textbf{Introduction}}}     \begin{document}     \begin{frame}     \begin{tcolorbox}[bottomrule=3mm]     This should be a bottomruled \textbf{tcolorbox}.     \end{tcolorbox}     \end{frame}     \end{document}      The option should set the bottom boundary height to 3mm instead of the standard value (0.5mm), but it does not seem to do nothing. Similar options like `toprule`, `rightrule` and `leftrule` do not work, while `boxrule` (which sets the height of all boundaries) works. ![enter image description here](http://i.stack.imgur.com/tep1B.png) Any idea what the problem may be? * * * After updating to the last version of `tcolorbox` the output is as expected ![enter image description here](http://i.stack.imgur.com/D1WJk.png)


title: How to make a package using sagetex and sage-commands

text: I am trying to make my own package building on `sagetex`. It starts with               \RequirePackage{sagetex}      and I want it to execute some 'sagesilent' code as for instance               \newcommand{\loadsagefunction}{     \begin{sagesilent}     def listofpoints(xlist,ylist):         A=matrix([xlist,ylist])         return A.transpose()     \end{sagesilent}     }      The above code doesn't work since it is NOT possible to place the 'sagesilent' environment inside a `\newcommand` as far as I know from what I have read in different places. I am looking for some nice way to execute 'sagesilent' code from a package I make myself. The point here is that I want to use my self-defined sage- commands in many different LaTeX-documents so it would be much nicer and cleaner to have a package than to spread around a file called `mysagefunctions.tex` and use               \input{mysagefunctions}      Any nice suggestions?


title: How to cross out a child of a node in a tikz tree?

text: Consider this simple tikz tree:               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{trees,shapes,snakes}          \begin{document}          \tikzstyle{mynode} = [text width=4em, text centered]     \begin{tikzpicture}[]          \node{My Root}     child{node[mynode]{Good Morning}}     child{node[mynode, cross out]{Good Afternoon}}     child{node[mynode]{Good Evening}}     \end{tikzpicture}          \end{document}      This code produces the following: ![enter image description here](http://i.stack.imgur.com/MxsbT.jpg) However, I was expecting that the "Good afternoon" node should be crossed out, since there was something similar here. How can I make a cancelling 'X' appear over that particular node?


title: Some problems using LyX RTL with equations

text: I'm really new to the whole LyX(2.0.5.1) thing I'm usually using LibreOffice Writer and it's Latex like "formulas". But I've heard so many good things about LyX, so I've decided to give it a try but I'm having some difficulties particularly when using Hebrew. Yes I've completed the tutorial, searched the Use guide, the internet and just tried to tinker with it but to no avail. I'm trying write homework answers(view image) that usually have the following format:                1.        a. (although it would be nice know how to replace this numbering with Hebrew letters).      The main problems are:   1. When generating a PDF it uses a very small portion of the page when in "Enumerate" area.   2. Equations that are too "long" for that tiny area are divided incorrectly as the Hebrew text is not "equal" to anything.   3. When I'm trying to use "Display Mode" the equation it simply cuts the equation. I've added something that's supposed to be a MWE, I apologize if it's long but as I said I've been trying to use LyX only for a few days so I wouldn't really know which Latex parts are more important then the others. % Preview source code               %% LyX 2.0.5.1 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[english,hebrew]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9,cp1255]{inputenc}     \usepackage{amsmath}     \usepackage{esint}          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.     \usepackage{theorem}     \theorembodyfont{\upshape}     \newtheorem{theorem}{\R{משפט}}[section]     \AtBeginDocument{\make@lr\thetheorem}     \usepackage{enumitem}       % customizable list environments     \newlength{\lyxlabelwidth}      % auxiliary length           \makeatother          \usepackage{babel}     \begin{document}          \title{ליקס}               \author{וקיפדיה}     \maketitle     \begin{enumerate}     \item רעיון הבסיסי של א שאין צורך לטפל בעיצוב. ישנה רשימה של עיצובים קיימים     וניתן לבחור מתוכה את אופי הטקסט (כותרת ראשית, כותרת משנית, הערת שוליים     וכו'). כך, התוצאה הסופית אמורה להיות עקבית ובעלת מראה מקצועי. בנוסף,     מא יבה נוחה של משוואות מתמטיות ולכן נפוץ בקרב קהילת האקדמאים העוסקים     במדעים מדויקים.     \item משתמש ב־ כמנגנון עיבוד הטקסט. \L{$\int\limits _{a}^{k}\int\limits _{0}^{\pi}2\pi\frac{\rho_{0}}{4\pi}\sin(\pi\frac{r-a}{b-a})\sin(\theta)d\theta dr=\int\limits _{a}^{k}\int\limits _{0}^{\pi}\frac{\rho_{0}}{2}\sin(\pi\frac{r-a}{b-a})\sin(\theta)d\theta dr=\rho_{0}\int\limits _{a}^{k}\sin(\pi\frac{r-a}{b-a})dr=\rho_{0}\left[-\cos\left(\pi\frac{r-a}{b-a}\right)\frac{b-a}{\pi}\right]_{a}^{k}$}היא     תוכנה ותיקה בעלת יכולות נרחבות, שבעזרתה ניתן להפיק מ־ יכול לייצא גם     \L{$\int\limits _{a}^{k}\int\limits _{0}^{\pi}2\pi\frac{\rho_{0}}{4\pi}\sin(\pi\frac{r-a}{b-a})\sin(\theta)d\theta dr=\int\limits _{a}^{k}\int\limits _{0}^{\pi}\frac{\rho_{0}}{2}\sin(\pi\frac{r-a}{b-a})\sin(\theta)d\theta dr=\rho_{0}\int\limits _{a}^{k}\sin(\pi\frac{r-a}{b-a})dr=\rho_{0}\left[-\cos\left(\pi\frac{r-a}{b-a}\right)\frac{b-a}{\pi}\right]_{a}^{k}$}     \item דורש מהמשתמש לימוד ארוך יחסית למעבד תמלילים דוגמת וורד אך מפיק בדרך     כלל תוצאות איכותיות יותר, ומאפשר עבודה מהירה יותר למשתמש המיומן.\L{     \begin{align*}     \int\limits _{a}^{k}\int\limits _{0}^{\pi}2\pi\frac{\rho_{0}}{4\pi}\sin(\pi\frac{r-a}{b-a})\sin(\theta)d\theta dr=\int\limits _{a}^{k}\int\limits _{0}^{\pi}\frac{\rho_{0}}{2}\sin(\pi\frac{r-a}{b-a})\sin(\theta)d\theta dr=\rho_{0}\int\limits _{a}^{k}\sin(\pi\frac{r-a}{b-a})dr=\rho_{0}\left[-\cos\left(\pi\frac{r-a}{b-a}\right)\frac{b-a}{\pi}\right]_{a}^{k} & s     \end{align*}     }\L{     \[     \int\limits _{a}^{k}\int\limits _{0}^{\pi}2\pi\frac{\rho_{0}}{4\pi}\sin(\pi\frac{r-a}{b-a})\sin(\theta)d\theta dr=\int\limits _{a}^{k}\int\limits _{0}^{\pi}\frac{\rho_{0}}{2}\sin(\pi\frac{r-a}{b-a})\sin(\theta)d\theta dr=\rho_{0}\int\limits _{a}^{k}\sin(\pi\frac{r-a}{b-a})dr=\rho_{0}\left[-\cos\left(\pi\frac{r-a}{b-a}\right)\frac{b-a}{\pi}\right]_{a}^{k}     \]     }\end{enumerate}          \end{document}


title: bibtex part of author missing

text: I'm having a problem with author display for a statute - the author is 'City and County of San Francisco' but the output (using the `apalike.bst` style file provided by Elsevier) gives the author as 'City and San Francisco', missing the 'County' in the authorname. Any suggestions?


title: What are the main advantages to using the multicol package over the twocolumn documentclass option?

text: I'm going to be writing my dissertation in LaTeX quite soon. Whenever I've done work in the past in LaTeX, I've always just used `\documentclass[twocolumn]{article}` but I've heard about `multicol`. What are the main advantages to the latter?


title: Beamer article mode + amsart freezes latex

text: If i try to get an article from my `beamer` slide using `article` mode and `amsart` style, my compiler (pdfLaTeX, LaTeX) gets stuck in an infinite loop:               \documentclass{amsart}     \usepackage{beamerarticle}     \title{Test}     \author{Test}          \begin{document}          \begin{frame}     \frametitle{Test}     Test frame     \end{frame}          \end{document}      Replacing `amsart` by `article` in `\documentclass{article}` makes everything work well. If I remove `\title` AND `\author` keeping `amsart` it also works... so   * is it a bug (from `beamer`)?   * is there a way to use `beamer` AND `amsart` AND keep the titlepage info?


title: Latex2html: How to make table of contents not use a bullet?

text: When I run LaTeX2HTML on a LaTeX file, the table of contents that is generated in the html file has bullets to the left of each section. Like this:               o  this_is_section_one     o  this_is_section_two      If I use the option `-show_section_numbers` then the bullets remain and next to them I see the section numbers, like for example:               o  1. this_is_section_one     o  2. this_is_section_two      What I want is a table of contents with section numbers. No Bullets, like the following:               1. this_is_section_one     2. this_is_section_two      I do not know how to get rid of the bullets. The commands I tried are               latex2html -split 4 KERNEL.tex      latex2html -split 4 -show_section_numbers KERNEL.tex       In the LaTeX file itself, I tried with `\tableofcontents` and without `\tableofcontents`. Nonetheless, I still get the bullets. The question is: how to get rid of the bullets? I hope there is an option or a flag to achieve this, but looking at the man page for LaTeX2HTML, I do not see it. Will keep trying, but I thought to ask here, in case someone knows.


title: Remove margin text from classic-thesis

text: How can I remove the margin text from classic-thesis style?


title: Funny but unreadable bookmarks with backslash in section

text: The following document gives me a "good" document, but garbled bookmarks.               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage{luacode}     \usepackage[unicode]{hyperref}     \begin{document}     \begin{luacode*}     tex.sprint("\\section{")     tex.sprint(-2,"Hellö \\wörld")     tex.sprint("}")     \end{luacode*}     foo bar baz     \end{document}      This is the document: ![enter image description here](http://i.stack.imgur.com/DKXrt.png) And this is what the bookmark looks like: ![enter image description here](http://i.stack.imgur.com/aFp1G.png) What can I do to get "correct" bookmarks?


title: What non-free books are available and recommended?

text: Once convinced, for example by this answer, that I should **buy** a book on (La)TeX and friends, its is time to decide which one... This big list misses some ranking, and make it hard to choose. This question and this one provides some details, but it seems that they mainly mention _free_ references. So, what would you recommend to **buy**?


title: Tell TikZ not to draw paths with least one coordinate outside clipping region

text: Using Paul Gaborit's code for drawing subregions of Penrose tilings, I've created this image: ![enter image description here](http://i.stack.imgur.com/FR1Yh.jpg) The code to produce this is:               \documentclass{article}     \usepackage[active,tightpage]{preview}     \usepackage{tikz}          \PreviewEnvironment{tikzpicture}     \usetikzlibrary{calc}     \pgfmathsetlengthmacro{\len}{10cm}     \pgfmathtruncatemacro{\recurs}{5}     \pgfmathsetmacro{\invphi}{2/(1+sqrt(5))} % phi = golden ratio = (1+sqrt(5))/2          \tikzset{       penrose line/.style={draw=black,line join=round},       penrose kite/.style={fill=teal,penrose line},       penrose dart/.style={fill=yellow,penrose line},       penrose common/.style={},       penrose path 1/.style={penrose common},       penrose path 2/.style={penrose common},       penrose path 3/.style={penrose common},       penrose rev path 1/.style={penrose common},       penrose rev path 2/.style={penrose common},       penrose rev path 3/.style={penrose common},     }          \newcommand\penrosedrawkite[3]{% ver = starting vertex, angle = direction of first edge, len = length of first edge       \path (#1)       +(#2+36:#3) coordinate (#1-b)       +(#2:#3) coordinate (#1-c)       +(#2-36:#3) coordinate (#1-d);       \path[penrose kite] (#1)       to[penrose path 1] (#1-b)       to[penrose rev path 2] (#1-c)       to[penrose path 2] (#1-d)       to[penrose rev path 1] (#1);     }          \newcommand\penrosekite[5]{% n = number of decompositions remaining, ver, angle, len, rot = sense of rotation (0 means anticlockwise, 1 means clockwise)       \ifnum#1=0 % i.e. if no decomposition cycles remain       \ifnum#5=1       \penrosedrawkite{#2}{#3}{#4}       \fi       \else % i.e. if at least one decomposition cycle remains       {         \edef\dep{#1}         \edef\ver{#2}         \edef\angle{#3}         \edef\len{#4}         \edef\rot{#5}         \pgfmathtruncatemacro{\n}{\dep-1}         \edef\namex{\ver\n}         \pgfmathsetlengthmacro{\newlen}{\len*\invphi}         \ifnum#5=1             \path (\ver) ++(\angle-36:\len) coordinate (\namex);         \pgfmathtruncatemacro{\newanglea}{mod(\angle+108,360)}             \penrosekite{\n}{\namex}{\newanglea}{\newlen}{1}             \penrosekite{\n}{\namex}{\newanglea}{\newlen}{0}             \penrosedart{\n}{\ver}{\angle}{\newlen}{1}         \else             \path (\ver) ++(\angle+36:\len) coordinate (\namex);             \pgfmathtruncatemacro{\newanglea}{mod(\angle-108,360)}             \penrosekite{\n}{\namex}{\newanglea}{\newlen}{0}             \penrosekite{\n}{\namex}{\newanglea}{\newlen}{1}             \penrosedart{\n}{\ver}{\angle}{\newlen}{0}         \fi       }       \fi     }          \newcommand\penrosedrawdart[3]{% ver, angle, len       \path (#1)       +(#2:#3) coordinate (#1-b)       +(#2-36:#3*\invphi) coordinate (#1-c)       +(#2-72:#3) coordinate (#1-d);       \path[penrose dart] (#1)       to[penrose path 3] (#1-b)       to[penrose path 2] (#1-c)       to[penrose rev path 2] (#1-d)       to[penrose rev path 3] (#1);     }          \newcommand\penrosedart[5]{% n, ver, angle, len, rot       \ifnum#1=0 % i.e. if no decomposition cycles remain       \ifnum#5=1       \penrosedrawdart{#2}{#3}{#4}       \fi       \else % i.e. if at least one decomposition cycle remains       {         \edef\dep{#1}         \edef\ver{#2}         \edef\angle{#3}         \edef\len{#4}         \edef\rot{#5}         \pgfmathtruncatemacro{\n}{\dep-1}         \edef\namex{\ver\n}         \pgfmathsetlengthmacro{\newlen}{\len*\invphi}         \path (\ver) ++(\angle:\len) coordinate (\namex);         \ifnum#5=1         \pgfmathsetmacro{\newanglea}{mod(\angle-144,360)}         \pgfmathsetmacro{\newangleb}{mod(\angle-36,360)}         \penrosedart{\n}{\namex}{\newanglea}{\newlen}{1}         \penrosekite{\n}{\ver}{\newangleb}{\newlen}{0}         \else         \pgfmathtruncatemacro{\newanglea}{mod(\angle+144,360)}         \pgfmathtruncatemacro{\newangleb}{mod(\angle+36,360)}         \penrosedart{\n}{\namex}{\newanglea}{\newlen}{0}         \penrosekite{\n}{\ver}{\newangleb}{\newlen}{1}         \fi       }       \fi     }          \begin{document}     \begin{tikzpicture}       \begin{scope}[yshift=-5.2*\len, rotate=342]         \foreach \level in {0,...,4}{           \begin{scope}[rotate=\level*72]             \coordinate (a) at (0,0);             \penrosekite{\recurs}{a}{0}{\len}{0}             \penrosekite{\recurs}{a}{0}{\len}{1}           \end{scope}         }         \draw[ultra thick,white] (0,0) circle (2.125in);       \end{scope}     \end{tikzpicture}     \end{document}      Now I'd like to modify this so that only those tiles are drawn whose vertices all lie within, say, 2.125 inches of the origin. (A white circle of that radius appears in the image above.) To do this, the natural idea is to modify the definition of the `\penrosekite` command by replacing the line               \penrosedrawkite{#2}{#3}{#4}      with some lines to the following effect: "If each vertex of the kite you're about to draw lies within 2.125 inches of the origin, then draw that kite, but otherwise don't draw it." Similarly for the command `\penrosedart`. I've tried to implement this idea in various ways, but I've failed. Is there an easy way?


title: Document isn't justifying after compilation

text: I am currently working on a report but for some reason, after I compile it, the text appears to be unjustified. I thought LaTex did this by default. Below is my code               \documentclass[12pt,a4paper,oneside]{report}          %%Label Equations According To Chapter     \usepackage{amsmath}     \numberwithin{equation}{chapter}          %% Enables Sub Sub Sections to be Numbered     \setcounter{secnumdepth}{3}          %% Format Header and Footer     \usepackage{fancyhdr}          %% Used to Insert Graphics     \usepackage{graphicx}     \usepackage{setspace}          %% Used to Convert EPS images to PDF     \usepackage{epstopdf}          %% Paragraph Formatting     \usepackage{parskip}          %% Used to Insert Blocks of Code     \usepackage{listings}          %% Used for Tables     \usepackage{tabularx}          % Use Numbers Libary for numbering     \usepackage{enumerate}     %\renewcommand{\labelenumi}{\arabic{enumi}. }          %% Used to Insert SI Units     \usepackage{siunitx}     \raggedright          %% Hyperlinks Formatting     \usepackage{hyperref}     \hypersetup{         colorlinks,         citecolor=black,         filecolor=black,         linkcolor=black,         urlcolor=black     }          %% Referencing Library     \usepackage{natbib}          %% Include Graphics from Multiple Folders     \graphicspath{{title_page/img/},{6_state_estimation/img/},{2_cannon_subsystem/img/}}          \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}     %\setlength{\parskip}{10pt}          %New Command: Diagram Scale - % of textwidth     \newcommand{\imgscale}{0.9\textwidth}          \begin{document}     \setkeys{Gin}{draft}          \input{title_page/title_page_prelim}     \pagestyle{fancy}          %% Header and Footer Setup     \fancyhead[L]{\slshape \leftmark}     \fancyhead[R]{\thepage}     \fancyfoot{}     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}     \setlength{\headheight}{14.5pt}     \setlength{\parindent}{0in}          \pagenumbering{roman}          \input{0_preamble/disclaimer}     \input{0_preamble/acknowledgements}          \onehalfspacing     \setcounter{tocdepth}{2}     \tableofcontents     \addcontentsline{toc}{chapter}{Contents}     \listoffigures     \addcontentsline{toc}{section}{List of Figures}     \listoftables     \addcontentsline{toc}{section}{List of Tables}     \clearpage     \pagenumbering{arabic}          \input{1_introduction/1_project_definition_and_goals}          \input{2_cannon_subsystem/2_literature_review}     \input{2_cannon_subsystem/2_preliminary_design}     \input{2_cannon_subsystem/2_detailed_design}     \input{2_cannon_subsystem/2_literature_review}          \input{6_state_estimation/state_estimation}          \renewcommand\bibname{References}     %\bibliographystyle{plainnat}     \bibliographystyle{custom_harvard}     \bibliography{prelim_ref}     \addcontentsline{toc}{chapter}{References}          \end{document}      The resulting PDF can be found at Report PDF Result Any help is appreciated.


title: How to subtract both very large numbers and numbers smaller than one?

text: In the context of Scientific Notation Only For Large Numbers have we been looking for a way to handle large numbers, as `pgfmathparse` can't cope with these. The only package we could find was `bigintcalc`, with the problem that it only works with integers. MWE:               \documentclass{article}     \usepackage{bigintcalc}     \begin{document}     \bigintcalcSub{1}{100}     \end{document}      works fine, but               \documentclass{article}     \usepackage{bigintcalc}     \begin{document}     \bigintcalcSub{0.1}{100}     \end{document}      gives an error:               ! Missing number, treated as zero.     <to be read again>                         .     l.4 \bigintcalcSub{0.1}{100}      So apparently `\bigintcalcSub` (or `bigintcalc` at all) is not the way to go. How can one handle large numbers that are not integers? **Edit:** of course one can use an if statement to check if a number is big, and then only use it in that case, but that would be a bit hacky, wouldn't it? **Edit 2:** to be more precise, we're trying to make a command that tests whether any number is greater than a certain threshold (and then do something if it is). There are both numbers as 0.01 and numbers as 1e75 fed to this command. `pgfmathparse` can do the first, `bigintcalc` can do the second, but is there something that can do both, so that the workarounds with if statements can be avoided and also large numbers that are _not_ integers can be processed?


title: Special conditionals (TeX)

text: Is there a way to compare strings rather than single tokens? Is there a way to check if a parameter in a command is a string or a single character? If there is either, how do I?


title: Externalised pgfplots figure.eps gets rotated 180 degrees

text: I am externalizing some plots by pgfplots in .eps format by using these two sizes case1:               width=0.55\textwidth     height=0.40\textwidth      case2:               width=0.6\textwidth     height=0.45\textwidth      which give a nice figure.eps in case1 but when I shift to the size in case2 it gives a 180 degree rotated figure.eps like here ![enter image description here](http://i.stack.imgur.com/v3zyo.jpg) If anyone has solved this problem plz give me a hint how to do it. My text file is this               \documentclass[a4paper,9pt]{article}     %----------------------------------------------------------------     \usepackage{ amssymb }     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{gensymb}     \usetikzlibrary{calc}     \usetikzlibrary{positioning}     \usetikzlibrary{shadows}     \usepgflibrary{shapes.geometric}     \usetikzlibrary{external}     \tikzexternalize[prefix=FigEllBeh/]     \tikzset{external/export=true}     \tikzset{external/system call={latex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"; dvips -o "\image".eps "\image".dvi}}     %     \begin{document}     \begin{tikzpicture}     \begin{axis}[     width=0.6\textwidth,     height=0.45\textwidth,     xmin=0, xmax=1.01,     ymin=0, ymax=90,     ytick={0,30,60,90},     yticklabels={0,30,60,90},     %xtick={0,0.2,0.4,0.6,0.8,1},     %xticklabels={0,,0.4,,0.8,1},     extra x ticks={1},     extra y ticks={},     extra y tick labels={},     extra x tick labels={},     extra tick style={grid=major},     legend style={draw=none},     xlabel={$\lambda$},     ylabel={$\alpha\,\, {\rm in}\,\, [\degree]$}]     %     \addplot[black, mark=, line width=0.8pt] table[x index=0, y index=1, each nth point={4}]{../../DataFolder/EllBehData/Ws31.txt};     %     \addplot[black, mark=, line width=0.8pt, each nth point={4}] table[x index=0, y index=1]{../../DataFolder/EllBehData/Ws32.txt};     %     \node at (axis cs:0.7,75){$\rho=3$};     %     \end{axis}     \end{tikzpicture}     \end{document}


title: typesetting according to the German traditions/standards for mathematical content

text: There are German standards documents for typesetting of math and science. As far as I can tell, of particular interest are DIN 1304 (symbols in formulas) and especially DIN 1338 (typesetting of formulas). As there are packages for citing according to German citation rules (DIN 1505), namely `din1505` and `dinat`, I was wondering **whether there are also packages facilitating German-style mathematical typesetting**. (I understand that some of the German traditions cannot be automated and are left to the authors. Examples, for those who are interested: We don't use the ∴/∵ symbols nowadays (even though they seem to have originated in Germany), we always use centered dots (and never `\times`) for multiplication in arithmetic, we don't write things like "3(4)(5)=60" (found in many US textbooks, though not at the university level), and we use "~" instead of "∝" to indicate proportionality between two physical quantities. As for these examples, I do not know to what extent they follow from DIN 1338.) An example given by a relevant German Wikipedia article would be that in German math typesetting, limits always appear below/above a sum symbol, though (disclaimer!) I have not verified this statement against the standard DIN 1338.


title: Move the footnote text away from the footnote command in code

text: I have some text with a couple of footnotes in tables which I handle with the `footnote` package. The footnote text is very very long and it makes the code unreadable, it happened already that I had to bisect the entire code to find small syntax error in tables which I missed because of the really ugly code. Is it possible to move the footnote text away from the footnote command in code? I know already about the `footnotemark-footnotetext` solution, but I would like a general solution that could be used for other commands to. For example with hyperlinks and similar stuff. Is there any way to achieve this? What I would like is something like this (this is not real code):               \begin{document}          main text here\footnote{1}     more main text\footnote{2}     more text\href{3}{name}     %%%%%%%%%%%%%%%%%%%%%%%%%%     % footnote contents     %%%%%%%%%%%%%%%%%%%%%%%%%%     [1] footnote 1 text     [2] footnote 2 text     %%%%%%%%%%%%%%%%%%%%%%%%%%     % email addresses     %%%%%%%%%%%%%%%%%%%%%%%%%%     [3] mailto:mail@server.com          \end{document}


title: fancyfoot on the last page

text: On the last page of my document, I need to add `Next Review Date: blah blah`. If I add the text at the bottom of the document, there is a possibility that the text might appear on a new page on its own. Ideally, I need something like `\fancyfoot[L]{Next Review Date: blah blah}`, which only appears on the last page. I wonder how this can be done.


title: Why does TeX attempt to insert 'missing' tokens?

text: * "Missing \cr inserted", but it looks to me like it's already there!   * Missing $ inserted   * ... Why does TeX attempt to insert missing tokens? Why doesn't it simply throw up and die? **More importantly** , is there any case where this insertion in fact _does_ go unnoticed?


title: Cell merging of a full row not working

text: I'm referring to this Merge columns in LaTeX. I simply can't find the error, here is my LaTeX code:                    \begin{tabularx}{\linewidth}{|X |X|}          \hline          Lorem ipsu &  dolor sit  \\ \hline          Lorem ipsu &  dolor sit \newline amet, consetetur  \\  \hline          Lorem ipsu &  dolor si \\ \hline          Lorem ipsu &  dolor si  \\ \hline          Lorem ipsu &  dolor si \\ \hline          Lorem ipsu &  Lorem ipsum dolor sit amet, consetetu / consetetur sadipscing  \\ \hline          Lorem ipsu & dolor si  - amet \\ \hline         \multicolumn{2}{ | X | }{       Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.               Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet,}  \\ \hline                \end{tabularx}      And i get the following, with the text should fill all the box, the green box shouldn't exitst. The green box is empty space. Where is my error? ![Picture of the output](http://i.stack.imgur.com/6yWBo.png) If I try setting `c` instead of `X`, my cell gets so long that it's out of paper.


title: Creating a PDF of version 1.5 and using the etexcmds-package

text: When I compile this MWE:               \documentclass{report}     \pdfminorversion=5     \usepackage{etexcmds}     \begin{document}     Hi!     \end{document}      with `pdflatex` from TeXlive 2011, then I get in the log-file:               (.../etexcmds.sty     Package: etexcmds 2011/02/16 v1.5 Prefix for e-TeX command names (HO)          (.../infwarerr.sty     Package: infwarerr 2010/04/08 v1.3 Providing info/warning/message (HO)     )     (.../ifluatex.sty     Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)     Package ifluatex Info: LuaTeX not detected.     )     Package etexcmds Info: Could not find \expanded.     (etexcmds)             That can mean that you are not using pdfTeX 1.50 or     (etexcmds)             that some package has redefined \expanded.     (etexcmds)             In the latter case, load this package earlier.     )      but Adobe Reader states at document properties: "PDF-Version: 1.5 (Acrobat 6.x)". Is that some bug in `[etexcmds][1]`, or did I make some mistake?


title: Vertical height of \longtable

text: How can I reduce vertical height of the \longtable. Note that all the document is double-spaced. I need the vertical spaces in the tables to be exactly adjusted as in the \tabular. Example:               \documentclass[a4paper,oneside,11pt]{book}     \usepackage[english]{babel}     \usepackage[super]{natbib}     \usepackage[LGR,T1]{fontenc}     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{delarray}     \usepackage{a4}     \usepackage{bbm}     \usepackage{epic}     \usepackage{eepic}     \usepackage{ecltree}     \usepackage{multicol}     \usepackage{indentfirst}     \usepackage{eurosym}     \usepackage{theorem}     \usepackage{graphicx}     \usepackage{fancyhdr}     \usepackage{vmargin}     \usepackage{rotating}     \usepackage{supertabular}     \usepackage{longtable}     \usepackage{array}     \usepackage{caption}     \usepackage{pgf}     \usepackage{float}     \usepackage{subfig}     \usepackage[dvips]{color}         \usepackage{mathenv}     \usepackage{setspace}     \usepackage{subeqnarray}     \usepackage[norule]{footmisc}     \usepackage{enumerate}     \usepackage{lscape}     \usepackage{tikz}     \usepackage[toc,page]{appendix}     \usepackage[pdftex]{hyperref}     \hypersetup{colorlinks,citecolor=black,filecolor=black,linkcolor=black,urlcolor=black}          \pagestyle{fancy} \fancyhf{}          \renewcommand{\headrulewidth}{0.5pt}     \addtolength{\headheight}{0cm}          \setlength{\doublerulesep}{\arrayrulewidth}     \setlength\unitlength{0.5cm}               \lhead[\fancyplain{}{\thepage}]{\fancyplain{}{ \scriptsize     \leftmark}} \rhead[\fancyplain{}{ \scriptsize     \leftmark}]{\fancyplain{}{\thepage}}          \renewcommand{\baselinestretch}{2}          \setmarginsrb{3cm}{3cm}{3cm}{3cm}{1cm}{1cm}{2cm}{0cm}     \makeindex % Composer l'index de fin de document.0          \bibliographystyle{authordate1} % Définit le style de la bibliographie     \setlength{\doublerulesep}{\arrayrulewidth} \makeatletter     \renewcommand\@makefntext[1]     {\noindent\makebox[2em][r]{\@thefnmark.\,}#1} \makeatother     \makeatletter          \renewcommand*{\@seccntformat}[1]{     \csname the#1\endcsname.\quad} \makeatother     \renewcommand {\theenumi}{\roman{enumi}}               \begin{document}     \scriptsize\begin{longtable}{lccc|ccc}       %     \centering      \caption{abc} \label{tab:result1}\\     \hline     %     & \multicolumn{3}{c|}{\textbf{1}} & \multicolumn{3}{c}{\textbf{2}}  \\%     VARIABLES & a & b & c & a & b & c  \\     \hline     \endfirsthead     %     \multicolumn{7}{c}     %     {{\textbf{Table} \thetable\ -- \textit{Continued from previous page}}} \\     \hline \noalign{\vskip-3pt}     %     & \multicolumn{3}{c|}{\textbf{1}} & \multicolumn{3}{c}{\textbf{2}}  \\%     VARIABLES & a & b & c & a & b & c  \\     \hline     \endhead     %     \textit{Continued on next page} \\     \endfoot     %     \hline     \endlastfoot          1 & 2 & 3 & 4 & 5 & 6 & 7 \\     1 & 2 & 3 & 4 & 5 & 6 & 7 \\     1 & 2 & 3 & 4 & 5 & 6 & 7 \\     1 & 2 & 3 & 4 & 5 & 6 & 7 \\     1 & 2 & 3 & 4 & 5 & 6 & 7 \\     1 & 2 & 3 & 4 & 5 & 6 & 7 \\     1 & 2 & 3 & 4 & 5 & 6 & 7 \\     1 & 2 & 3 & 4 & 5 & 6 & 7 \\     1 & 2 & 3 & 4 & 5 & 6 & 7 \\          \end{longtable}     \end{document}


title: Temporarily resetting figure counters within a chapter

text: The code below works perfectly in an `article` (permitting me to put two captions in the same figure and have one of them called _Table_ , picking up the table counter—there’s a sensible reason for doing this). However, in a `chapter`, the code ceases to work:   * an extraneous “0.” follows the first caption   * an extraneous “1.” follows the table,    * the figure and table are labeled “Figure 1.1” and “Table 1.2”, rather than what I want: “Figure 1.1” and “Table 1.1”.  I guess I don’t understand how the `figure` and `table` counters work within a chapter. How can I fix this? ![enter image description here](http://i.stack.imgur.com/eqKBM.png) (I also not that the code is incompatible with `pdfpages.sty`, but fine with `geometry.sty`, which is curious.)               \documentclass[11pt]{report}     \begin{document}     \chapter{Chapter}          \begin{figure}          \fbox{ABCDEFGHIJKLMNOPQRSTUVWXYZ}     \caption{Alphabet}      \renewcommand{\figurename}{Table}      \setcounter{figure}{\thetable}     \caption{Numerals}\medskip     \begin{tabular}{l}1\\23\\456\\7890\end{tabular}      \renewcommand{\figurename}{Figure}      \setcounter{figure}{\thefigure}          \end{figure}          \end{document}


title: Is a period after an abbreviation the same as an end of sentence period?

text: Does latex do anything special with periods? If so, is there a way to differentiate end-of-sentence periods from periods indicating abbreviation?


title: Creating Table: On Mastering LaTeX

text: Guys, I am one the process of mastering LaTeX, so that later when times come I shall be fully prepared to typeset almost anything without thinking twice. So during this awesome process, I am now encountering this tables on LaTeX. And they say that tables are the most boring, bad and worst aspect of the modern TeX-LaTeX.To quote- > However, if there is one area about LaTeX that I feel is the least > intuitive, then I am afraid that this is tables. So, after having read this statement from LaTeX wiki books, I stopped learning manually to type codes for LaTeX. I found the automated process of generating table codes for LaTeX from a Excel Add-in(Excel2LaTeX) and especially the LaTable by Alex Denisov are perfect for making tables. I tried some variations of tables and they seems to work perfectly and largely faster than the manual process **anyway**. Real Question: Should I learn to manually code any types of tables, that needs to be made OR Should I just skip this part as automated process is perfect and go on to explorer other areas of LaTeX. So all LaTeX Guru's out there, What do you suggest ? I am in an dilemma. Don't know what to do. Suggestion of any kind will be truly appreciated. ;)


title: JabRef - How can I jump from the search window to the list of results? (filter method)

text: I usually have the radio button set to _Filter_. When searching for an entry successfully, is there a keyboard shortcut which enables me to jump from the search window to the first result?


title: spherical coordinates in tikz 3d

text: Can we specify direction in spherical coordinates? I know we can do polar `(angle:radius)` but what is we are using `tikz-3d` and want to specify `(r, theta, phi)` where theta is the azimuthal angle?


title: How can I cleanly/efficiently insert *half* of an inter-word skip?

text: The title question is plainly posed—is there a simpler way of doing this (or at least one that actually _works_? When dealing with em-dashes (—), I've read that it's important to keep a small amount of space between the dash and the text it separates. I'm guessing at half of an inter-word skip, whatever that may be. (I might change it to 2/3 depending, but that's irrelevant to the core question.) With ideal inter-word spacing, it's recommended (though I can't recall _where_ ) that this spacing be a `\thinspace`. (Try `this---separation` vs. `this --- separation`—neither look very good.) However, as you can see from the (exaggerated) screenshot below, this can cause visual inconsistencies (particularly noticeable in the first line of the second paragraph). (I recognize that this is also influenced by the font used.) ![original problem screenshot](http://i.stack.imgur.com/3N810.png) My attempt to fix this problem:               \documentclass{article}          \newlength\halfinterwordspace     \newsavebox\interwordspace          \newcommand\Dash{%       \savebox\interwordspace{\ }       \setlength\halfinterwordspace{.5\wd\interwordspace}       \typeout{\the\halfinterwordspace}     %       \unskip                       % remove all previous skips       \hspace* \halfinterwordspace  % unbreakable half-interword space       \textemdash                   % dash, equivalent to "---"       \hspace \halfinterwordspace   % breakable half-interword space       % ^ also plays nice with microtype protrusion; see q/163116     }          % Uncomment to see the problem I am ultimately trying to fix.     % \def\Dash{\unskip\thinspace\textemdash\thinspace}          \sloppy     \hyphenpenalty=10000          \begin{document}     Lorem ipsum dolor sit amet \Dash consectetur adipiscing elit.  Fusce     pharetra velit in sem congue \Dash quis malesuada lectus     vulputate. Quisque eu scelerisque nunc. Nam at dui eget metus     ullamcorper rutrum quis et tellus.  Interdum et malesuada fames ac     ante ipsum primis in faucibus. Donec vitae augue vel nisi sollicitudin     tempus.  Nam neque sapien \Dash ullamcorper vitae sapien at \Dash     volutpat cursus nisi.  Nullam lorem ante \Dash fermentum sit amet     fermentum et \Dash rhoncus id ligula.  Pellentesque habitant morbi     tristique senectus et netus et malesuada fames ac turpis egestas.     Integer congue \Dash sem eu tincidunt pharetra \Dash mi nunc accumsan     neque \Dash in auctor elit eros eget eros. Vestibulum quis varius     lectus.          Curabitur faucibus \Dash feugiat porttitor.  Lorem ipsum dolor sit     amet \Dash consectetur adipiscing elit.  Vestibulum elementum ipsum id     nisl accumsan \Dash sed rutrum sapien tincidunt.  Cras sodales     sagittis neque vitae sollicitudin. Mauris at viverra quam. In nec     interdum diam \Dash ut ultrices velit. Nulla dapibus vulputate     luctus. Etiam vel faucibus augue \Dash ut aliquet massa. Vivamus eu     nunc at velit varius volutpat at eget eros.  Nulla at justo quis quam     sagittis aliquam eget in tellus.  Nunc est sem \Dash congue et tempus     a \Dash aliquet et nibh.  Sed malesuada \Dash nisi eu placerat porta     \Dash orci augue pellentesque ante \Dash ac sollicitudin urna nunc sit     amet tellus. Curabitur hendrerit et enim non vehicula. Donec in nibh     fringilla \Dash sodales arcu eu \Dash hendrerit massa.     \end{document}      Result: ![attempt screenshot](http://i.stack.imgur.com/LGQLP.png)


title: boxed equation but framed only some sides

text: I need to box part of an equation, but I need the frame to be open one side. In the following MWE I would need the left part of the equation not to have the right frame of the box and the right part of the equation not to have the left frame of the box.               \documentclass[12pt,a4paper]{article}     \usepackage{amsmath}     \begin{document}     This is my equation $\boxed{q_1^{\ast}}=\dfrac{26-2\cdot 1 -4\cdot 2}{2\cdot 1}=\boxed{8}$     \end{document}


title: How do I reference in appendix a theorem given in the body?

text: I have a theorem given in the body text of a paper, say Theorem 2 with label {theorem-abc}. I would like to provide the proof of this theorem in the appendix. 1) How do I cross-reference this theorem in the appendix section title? The section title that I want is "Proof of Theorem 2". 2) How do I restate the theorem again in the aforementioned section? What I want is "Theorem 2. xxxxxxx", followed by its proof. ADD: The document class file has following definitions regarding Appendix.               \def\appendix{\par     \section*{APPENDIX}     \setcounter{section}{0}     \setcounter{subsection}{0}     \def\thesection{\Alph{section}} }      I found similar issues here. But it did not solve my Problem 1) either. MWE: The class file is downloadable here.               \documentclass{vldb}     \usepackage{thmtools, thm-restate}     \usepackage{hyperref}     \declaretheorem{theorem}          \begin{document}     \section{Test Section}     \begin{theorem}     Test theorem     \end{theorem}          \begin{restatable}[Fundamental Theorem of Algebra]{theorem}{fta}     \label{thm:FTA}     Every non-constant single-variable polynomial with complex coefficients has at least    one complex root.      \end{restatable}          \appendix     \section[Proof of the Fundamental Theorem of Algebra]{Proof of Theorem~\ref{thm:FTA} (See page~\pageref{thm:FTA})}     \fta*     \begin{proof}     Assume...     \end{proof}          \end{document}


title: Too much space around quote environment

text: Sometimes, LaTeXput extra white lines around my `\begin{quote}`. I use just the basic `memoir` class without any customization. Any hint?


title: A bug in Winedt?

text: Reproducing:   1. Put caret in point A   2. Right-click on a citation from bibliography branch in tree panel and choose insert   3. Press `Ctrl`-`z` to undo the insertion.   4. Put caret in point B   5. Right-click on a citation from bibliography branch in tree panel and choose insert   6. The citation key is placed in point A, while it is supposed to be placed in point B. Is this a bug? or how it works? I also realized that if you double-click on the citation instead of right-click and insert, it works properly. PS: I am using Winedt 8.1 in Win7!


title: Citations undefined - Bibliography not compatible with with author-year

text: NOTE: Edited changes to bibliographystyle --> now \bibliographystyle{acm}               \documentclass{report}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{textcomp}     \usepackage{fixltx2e}     \usepackage[left=2cm,right=2cm,top=1cm,bottom=1.5cm]{geometry}     \usepackage{color}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{caption}     \usepackage{natbib}          \title{Literature Review: \\     \textbf{Farms: \\      Supply}}               \author{ Jane }     \date{\today}          \begin{document}          \maketitle          \chapter*{\textit{Introduction}}     Some Text\cite{Nielsen2011}.          More text \cite{Byrne2003}.               \bibliographystyle{acm}     \bibliography{literature_review_references}               \end{document}      The citation is causing me trouble. I have another citation in a different section that worked the first time but after adding the second citation and running again, I now get the error stated at the top. I have my compile settings as: Latex Bibtex Latex Latex View Pdf (evince) Ok so I have also removed the PdfLaTeX command in my compile line. The .bbl file looks like:               \begin{thebibliography}{1}          \bibitem{Byrne2003}     {\sc Byrne, B.~W., and Houlsby, G.~T.}     \newblock Foundations for offshore wind turbines.     \newblock {\em Philosophical Transactions: Mathematical, Physical and       Engineering Sciences 361}, 1813 (2003), pp. 2909--2930.          \bibitem{Nielsen2011}     {\sc Nielsen, J.~J., and Sorensen, J.~D.}     \newblock On risk-based operation and maintenance of offshore wind turbine       components.     \newblock {\em Reliability Engineering and System Safety 96\/} (2011),       218--229.          \end{thebibliography}      Ok I changed the bibliography style so now it gets past Process started. New errors!   * citations undefined (again, this was working originally but now are undefined?) Package natbib Error: Bibliography not compatible with author-year citations.


title: hyperxmp + xelatex bug: duplication of pdfkeywords

text: I found an annoying bug(?) relating to the `pdfkeywords` metadata field which `hyperref` allows to set. When `hyperref` is used in combination with `hyperxmp` and the document is compiled with `xelatex` the keywords are duplicated in the pdf metadata (both in the regular pdf properties and the XMP metadata). Here's an MWO:               \documentclass{article}          \usepackage[xetex]{hyperref}% remove "xetex" parameter when compiling with pdflatex instead of xelatex     \hypersetup{         pdfauthor = {Matthias},         pdftitle = {MWO},         pdfkeywords = {Test, MWO, This is a test, Lipsum}     }     \usepackage{hyperxmp}          \usepackage{lipsum}          \begin{document}     \lipsum[1-3]     \end{document} When I compile this with `pdflatex` (remove the `xetex` parameter in `\usepackage{hyperref}`) I get:   * in the keywords field of the PDF properties:               Test, MWO, This is a test, Lipsum   * in the keywords field of the XMP metadata:               Test; MWO; This is a test; Lipsum This is the intended behaviour (`hyperxmp` replaces commas with `;` in the XMP field, cf. `hyperxmp` documentation). However, when compiling the MWO with `xelatex` I get:   * in the keywords field of the PDF properties:               "Test, MWO, This is a test, Lipsum"; Test;  MWO;  This is a test;  Lipsum   * in the keywords field of the XMP metadata:               "Test, MWO, This is a test, Lipsum"; Test; MWO; This is a test; Lipsum As you can see the keywords are repeated. First the `,`-separated is put between `""` (and treated as a single keyword) and then the `;`-separated sequence follows. I have tried changing the package loading order and compiling with `xelatex` without specifying the `xetex` parameter on `\usepackage{hyperref}`, all to no avail. Any ideas on how to fix or work around this?


title: What causes \psxTick to no longer work?

text: I am using the latest `pst-plot`. When compiling the following, I got some errors as follows. > ![enter image description here](http://i.stack.imgur.com/ehWpu.png) ## MWE               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pst-plot}          \psset     {         xtrigLabels,         trigLabelBase=2,     }          \begin{document}     \begin{psgraph}[dx=\psPiH](0,0)(-\psPiH,-2)(\psPiTwo,2){5cm}{!}         \psxTick[labelsep=12pt](\psPiH\space 1.5 mul){A_1}     \end{psgraph}     \end{document}      What causes `\psxTick` to no longer work? And how to fix it?


title: Insert text below a figure with Tikz

text: I am making a newsletter, but I am not expert at all, especially with the new Latex features like 'tikz'. I want a big picture in the first page (the cover), with some written lines at the bottom of the page, and at the center, so that copyrights and years etc. can be specified. I am using the following code:               \documentclass{article}     \usepackage[lmargin=1cm, bmargin=0.2cm, tmargin=1cm, rmargin=1cm, centering, includefoot,heightrounded]{geometry}     \usepackage{tikz} %pagenodes}     \usetikzlibrary{calc}     \usepackage{lmodern}     \usepackage{multicol}     \usepackage{lipsum}     \usepackage{atbegshi}     \usepackage{mwe}     \usepackage{xcolor}     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{here}     \usepackage{color}     \usepackage{framed}     \usepackage{wrapfig}     \usepackage[none]{hyphenat}     \usepackage{textcomp}          \definecolor{boxgray}{RGB}{139,137,137}          \begin{document}          \thispagestyle{empty}          \begin{tikzpicture}[remember picture, overlay]         \node[anchor = north west, inner sep=0] (image) at (current page.north west)          {\includegraphics[width=\paperwidth,height=0.9\paperheight]{whatever.eps}};              \node[align = center, anchor = below] at (current page.south) {\textcopyright\, 2014 ... individual authors. All rights reserved.\\ Other bla bla words};     \end{tikzpicture}      I thought it was easy, but I can not manage to have a nice layout, unless I specify things and position by numbers, in a very artificial way. I don't know very well how 'nodes' work. I read a lot on this SE as well, especially this, but still seems I can't follow all the available options. A clear example would be very welcome. As a beside, I read from here some general rules about the blank margins: if anyone knows any useful advice on that it would be very good, since the guide says that it is better to avoid equally spaced margins on all sides, but it does not give any example numbers.


title: Report custom format

text: I'm new to LaTeX and I want create a report for my college. The format specified is as follows:   * Left Margin – 1.5 inch    * Right Margin - 0.5 inch    * Top Margin – 1 inch    * Bottom Margin – 1 inch    * Font - Times New Roman    * All main headings uppercase 14 (Bold)    * All Sub main headings uppercase 12 (Bold)    * Matter 12 (Regular)    * Line Spacing – 1.5    * Paragraph Spacing 1.5   * Each table and figure should be numbered  For margins I've used the following code:                \usepackage[top=1.00in, bottom=1.00in, left=1.50in,right=0.50in]{geometry}        But I don't know what to do for the rest.


title: Automatically position detailed information about an equation into appendix

text: How can I automatically position the details about a certain equation into an appendix? I've attempted this answer with some success. However, I would like the numbers to work as clickable cross-references like when I use `\ref{something}` inside text with the `hyperref` package. For instance:                       2x(3+3)=12             (1.1)         details: see page (clickable)123      and in the appendix:                   details of equation (clickable)1.1:              2x(3+3)             =2x3+2x3             =6+6             =12


title: \overline with weight of overlined text

text: I want to overline (/bar) a character. Depending on the font weight and font size of this character, though, I want the overline to be of different thickness – it should scale with both font size and font weight. How can I accomplish this? Ideally, the distance between the overline and the character should also be (auto-)configurable. Smaller characters need more space between character and overline, relatively, than taller ones. ### Background Our physics experiment is called PANDA, with an `\overline` on top of the P.   While this looks decently enough for usual text, as soon PANDA is printed bold or in a bigger text size (section headings), it starts looking wrong. ![PANDAs](http://i.stack.imgur.com/DETDk.png)   (The first always is a `\overline{P}`, the second `\bar{P}`. Here's the ShareLatex code (section 1).) ### Attempts I searched around and fiddled a bit, but I did not get the look I'm looking for. At section 2 of above ShareLatex file I summarized the three main possibilities I found. In the fntguide (ftp://ftp.fu- berlin.de/tex/CTAN/macros/latex/doc/fntguide.pdf, page 8) I also found the internal macros which hold the current font style. `\f@series` is responsible for the font thickness. I know too little TeX, though, for writing an `\if` using macro around this variable.


\documentclass{article}     \usepackage{CJKutf8}     \usepackage{ruby}     \renewcommand\rubysep{.05ex}     \renewcommand\rubysize{0.2}          \newcommand\神{\ruby{神}{かみ}}          \begin{document}     \begin{CJK}{UTF8}{min}     \神     \end{CJK}     \end{document}      How can I use Chinese characters (or more generally, Unicode characters) as a macro name? I can use either `pdflatex` (preferred) or `xelatex` (the last resort).


title: Capture output of bibentry for use before \nobibliography in text file

text: `\bibentry` does not work before the `\nobibliography` command, and since I use it in combination with `multibib` for the second bibliography in my thesis, this is a problem for me since I cannot use `\bibentry` before my second bibliography. So I tried to capture the output in a text file, but I seem to fail to do it correctly. How to I store the text representation of `\bibentry` in a text file? Below is what I tried:               \documentclass{article}     \usepackage{bibentry}     \usepackage{filecontents}     \begin{filecontents}{Dissertation.bib}         @article{Entry, Title="Title"}     \end{filecontents}     \usepackage{newfile}     \newoutputstream{myout}     \begin{document}          \section*{This does not work here}     -\bibentry{Entry}-          \section*{But we do want it!}     -\InputIfFileExists{temp.txt}{}{}-          \bibliographystyle{plainnat}     \nobibliography*     \bibliography{Dissertation}          \section*{But it does here}     -\bibentry{Entry}-          \section*{So the idea is to capture the output and use it above}     \openoutputfile{temp.txt}{myout}     % this works (but is not what I want)     %\addtostream{myout}{abc}     % this fails with a variety of error messages:     \addtostream{myout}{\bibentry{Entry}}     \closeoutputstream{myout}          \end{document}      The first run of `pdflatex` fails like this:               LaTeX Warning: Citation `Entry' undefined on input line 22.          ! Undefined control sequence.     \@citeb ->\@nil           l.29 \addtostream{myout}{\bibentry{Entry}}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \frenchspacing ->\sfcode `\.\@m \sfcode `\?                                                \@m \sfcode `\!\@m \sfcode `\:\@m...     l.29 \addtostream{myout}{\bibentry{Entry}}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.      And `temp.txt` contains this:               \relax \def Entry{Entry}\def {Entry}\relax {\sfcode `\.\@m \sfcode `\@m \sfcode `\mskip -\thinmuskip \@m \sfcode `\mskip \medmuskip \@m \sfcode `\mskip \thickmuskip \@m \sfcode `\,\@m \BR@r@Entry }      What do I need to do (I suspect I have to use a lot of `\expandafter` or other packages such as `filecontents`) to achieve what I want? My tool chain is pdflatex, bibtex, pdflatex, pdflatex.


title: Color changes cell height in tabular

text: The following code shows that a `\color{red}` command increases the height of a tabular cell. I want to use a switch, not a command as `\textcolor{red}{text}`.               \documentclass{article}          \usepackage{xcolor}     \usepackage{float}          \begin{document}          \begin{table}[H]     \begin{tabular}{*{2}{p{0.45\textwidth}}}     \hline     \color{red} header &     header \tabularnewline     \hline      %      content  & content \tabularnewline      content  & content \tabularnewline      content  & content \tabularnewline     \hline     \end{tabular}     \end{table}      \end{document}      ![enter image description here](http://i.stack.imgur.com/MVFpZ.png) How can I work around this problem?


title: Peek ahead a \vbox: \vsplit and reassemble again?

text: I'm wondering if it's possible to implement a _peek_ method to inspect the head of a `\vbox` without changing the content of the `\vbox`. It could be done by brute force using a `\copy` of the original `\vbox`, but I'm looking for a not so brutal method. With the following code, a `\bigbox` is constructed, its head split of as `\partbox`, and finally all is reassembled again as `\bigbox`. `\testmybox` serves for showing the boxes.               \documentclass{article}     \usepackage{blindtext}          \def\testmybox#1{%       \par%       {\fboxsep0pt\fbox{\copy#1}}\par%       \edef\myboxheight{\the\dimexpr\ht#1+\dp#1\relax}%       Total height: \myboxheight%     }          \begin{document}          \newbox\bigbox     \newbox\partbox          \setbox\bigbox=\vbox{\hsize 11cm%       \footnotesize\blindtext[1]}          \textbf{Original box}\par     \testmybox\bigbox          %\splittopskip=0pt     %\splitmaxdepth=0pt          \setbox\partbox=\vsplit\bigbox to 45pt%          \textbf{Splitted box:}\par     \testmybox\partbox          \textbf{Rest:}\par     \testmybox\bigbox          \setbox\bigbox=\vbox%     {%       \unvbox\partbox       \unvbox\bigbox     }          \textbf{Reassembled box:}     \testmybox\bigbox          \end{document}      ![enter image description here](http://i.stack.imgur.com/EF1Fz.png) The problem is that the reassembled box is not identical to the original box. Here, there is too much space between the two parts. This space depends on the `\splittopskip` value, but I don't know how to set this value such that it works with all thinkable situations. Is it possible to reassemble the original box without deviation?