title: How do you say Happy New Year with LaTeX?

text: Title says it all. How do you wish "Happy New Year" to a TeXie? Compile the code below with pdfLaTeX, view it with "PDF Reader" or "Adobe Acrobat Pro" and press the "Happy New Year" button on the second page. Please suggest ways to internationalize the "Happy New Year" string by adding translations in the comments in your language.               \documentclass{scrartcl}     \setcounter{secnumdepth}{0}     \usepackage[T1]{fontenc}     \usepackage{textcomp}     \usepackage{mathptmx}     \usepackage[scaled =.92]{helvet}     \usepackage{soul}     \setlength{\paperwidth}{5.2075in}     \setlength{\paperheight}{4.90in}     \renewcommand*{\familydefault}{phv}     \usepackage[pdftex,margin=0.5in]{geometry}     \usepackage{fancyhdr}     \lhead{A Sample Calculation}\chead{}     \rhead{Area of Circle}     \lfoot{}\cfoot{}\rfoot{}     \pagestyle{fancy}     \usepackage{graphicx}     \usepackage{xcolor}     \usepackage[pdftex,pdfpagelayout=SinglePage,     pdftitle={Wishing you a happy year},pdfsubject={Invest your new year improving your TeX skills}%     ]{hyperref}          \definecolor{background}{rgb}{0.99,0.98,0.90}     \pagecolor{background}     \setlength{\parindent}{0.0cm}     \usepackage[pdftex]{insdljs}               \begin{insDLJS}[test]{test}{JavaScript}          function doCalculation()     {     var radius=0.0 + this.getField("radius").value;      this.getField("diameter").value=radius*2;      this.getField("areacircle").value=  Math.PI * Math.pow(radius, 2);     }          function HappyNewYear()     {      app.alert("Happy New Year!",3);     }               \end{insDLJS}          %% This must be here     %\OpenAction{/S/JavaScript/JS(docOpen();)}          %% Short hand commands     \newcommand{\textforlabel}[2]{%     \TextField[name={#1}, value={#2}, width=9em,align=2,%         bordercolor={0.990 .980 .85},%      readonly=true]{}%     }               %% Define the heading     \newcommand{\heading}[1]{\so{#1}}     \def\spacer#1{\multicolumn{2}{|c|}{}\\*[#1]}          \begin{document}     \topskip=0pt     \vphantom{-Z}     \vfill     \begin{center}     \textbf{\Huge Have a Happy New Year\\ with JavaScript\\*[4pt] and LateX!}          \end{center}     \vfill     \newpage          \begin{Form}     \begin{tabular}{|rl|}     \hline     \multicolumn{2}{|c|}{}\\*[-0.8em]\multicolumn{2}{|c|}{%     \heading{Area of Circle}}\\          %%      %%% Input field radius          &\\*[-0.8em]\textforlabel{l01}{Radius:}&\TextField[name=radius,width=10em, bordercolor={0.650 .790 .94}]{}%     ~m\\                    &\\ \hline          \multicolumn{2}{|c|}{\heading{Calculate}}\\     \spacer{-0.8em}     \multicolumn{2}{|c|}{     %% Push button is defined here     \PushButton[name=start,onclick={doCalculation();},bordercolor={0.650 .790 .94}%     ]{Calculate}           %% Push button is defined here     \PushButton[name=hello,%     onclick={HappyNewYear();}, bordercolor={0.650 .790 .94}%     ]{Happy New Year!}      }\\          \spacer{-0.8em}     \hline          \multicolumn{2}{|c|}{\heading{Results}}\\          %% RESULTS     %% Diameter     \multicolumn{2}{|c|}{}\\*[-0.8em]\textforlabel{name=l04, bordercolor={0.650 0.790 0.94}}{%     Diameter :}&\TextField[name=diameter,width=10em,bordercolor={0.650 .790 .94},%     readonly=true]{}~m\\     \spacer{-0.8em}          \textforlabel{name=l05, bordercolor={0.650 0.790 0.94}}{Area:} & \TextField[name=areacircle,width=10em,%     bordercolor={0.650 .790 .94},readonly=true]{}~m$^2$\\*[-0.8em]     \spacer{1em}     \spacer{1em}     \hline     \end{tabular}     \end{Form}     \bigskip          \parindent0.5em     As proved by Archimedes, the area enclosed by a circle is $\pi$ multiplied by the radius squared \(\pi r^2\). Apollonius of Perga showed that a circle may also be defined as the set of points in a plane having a constant ratio (other than 1) of distances to two fixed foci, A and B.          Early science, particularly geometry and astrology and astronomy, was connected to the divine for most medieval scholars, and many believed that there was something intrinsically \textit{divine} or \textit{perfect} that could be found in circles. Some people still believe that the earth is still flat and is circular.               Some highlights in the history of the circle are:     \begin{enumerate}     \item 1700 BC -- The Rhind papyrus gives a method to find the area of a circular field. The result corresponds to \(\frac{256}{81}\) (3.16049\dots) as an approximate value of $\pi$.     \item 300 BC -- Book 3 of Euclid's Elements deals with the properties of circles.     In Plato's Seventh Letter there is a detailed definition and explanation of the circle. Plato explains the perfect circle, and how it is different from any drawing, words, definition or explanation.     \item 1880 -- Lindemann proves that $\pi$ is transcendental, effectively settling the millennia-old problem of squaring the circle     \item 1978 -- Donald Knuth develops \TeX\ in order to enable future generations to typeset Mathematics in a beautiful way, including all the equations that one can associate with circles.     \end{enumerate}          \end{document}


title: \tkzGetAngle strange behavior

text: I want to draw several different triangles ABC with the angles marked and the angle value written in it. Thanks to answers on on another question, I've managed to get this code:               \documentclass{article}     \usepackage{tikz}     \usepackage{tkz-euclide}     \usetkzobj{all} %% om allerhande objecten te gebruiken zoals gradenboog...     \usetikzlibrary{calc,intersections,through,backgrounds,snakes}     \usepackage{pgfplots}     \pgfplotsset{compat=1.8}     \usepgfplotslibrary{statistics}               \begin{document}          \makeatletter     \newcommand\ddToddmmss[1]{%     \pgfmathtruncatemacro\deg@tmp{#1}%     \pgfmathsetmacro\min@tmp{(#1-\deg@tmp)*60}%     \pgfmathtruncatemacro\Min@tmp{\min@tmp}     \pgfmathtruncatemacro\sec@tmp{(\min@tmp-floor(\min@tmp))*60}%     \ensuremath{\deg@tmp^\circ \Min@tmp ' \sec@tmp ''}}     \makeatother               \begin{tikzpicture}     \tkzInit[ymin=0,ymax=9,xmin=0,xmax=15]     \tkzClip     \tkzGrid     \tkzDefPoints{1/3/A, 7/8/B, 12/1/C}     \tkzDrawPolygon(A,B,C) \tkzDrawPoints(A,B,C) \tkzLabelPoints(A,B,C)          \tkzMarkAngle[fill= red,size=1.5cm, opacity=.4](C,A,B);     \tkzFindAngle(C,A,B) \tkzGetAngle{angleCAB};     %\FPround\angleBAC\angleCAB{2}     \tkzLabelAngle[pos = 2.3](C,A,B){\ddToddmmss{\angleCAB}};            \tkzMarkAngle[fill= red,size=1.5cm, opacity=.4](A,B,C);     \tkzFindAngle(A,B,C) \tkzGetAngle{angleABC};     %\FPround\angleABC\angleABC{2}     \tkzLabelAngle[pos = 2.3](A,B,C){\ddToddmmss{\angleABC}};          \tkzMarkAngle[fill= red,size=1.5cm, opacity=.4](B,C,A);     \tkzFindAngle(B,C,A) \tkzGetAngle{angleBCA};     %\FPround\angleBCA\angleBCA{2}     \tkzLabelAngle[pos = 2.3](B,C,A){\ddToddmmss{\angleBCA}};     \end{tikzpicture}               \begin{tikzpicture}     \tkzInit[ymin=0,ymax=9,xmin=0,xmax=15]     \tkzClip     \tkzGrid     \tkzDefPoints{1/3/A, 7/8/B, 12/5/C}     \tkzDrawPolygon(A,B,C) \tkzDrawPoints(A,B,C) \tkzLabelPoints(A,B,C)          \tkzMarkAngle[fill= red,size=1.5cm, opacity=.4](C,A,B);     \tkzFindAngle(C,A,B) \tkzGetAngle{angleCAB};     %\FPround\angleBAC\angleCAB{2}     \tkzLabelAngle[pos = 2.3](C,A,B){\ddToddmmss{\angleCAB}};            \tkzMarkAngle[fill= red,size=1.5cm, opacity=.4](A,B,C);     \tkzFindAngle(A,B,C) \tkzGetAngle{angleABC};     %\FPround\angleABC\angleABC{2}     \tkzLabelAngle[pos = 2.3](A,B,C){\ddToddmmss{\angleABC}};          \tkzMarkAngle[fill= red,size=1.5cm, opacity=.4](B,C,A);     \tkzFindAngle(B,C,A) \tkzGetAngle{angleBCA};     %\FPround\angleBCA\angleBCA{2}     \tkzLabelAngle[pos = 2.3](B,C,A){\ddToddmmss{\angleBCA}};     \end{tikzpicture}          \end{document}      ![triangles 1 and 2](http://i.stack.imgur.com/C92y9.png) Problem is, in version 2, where point C is higher than point A, he takes the wrong angle. Any suggestions?


title: How can I import matrix data (2d function) from matlab into pgfplots?

text: This question arised in Spectrum colormap for multiple curves, but since it is of general interest, I add a separate question and my answer here. Suppose you have a matlab figure which needs to be converted to `pgfplots`. The matlab figure contains a 2d function `f(x,y)` which is typically visualized as a matrix. Suppose it is given as               [X,Y] = meshgrid( linspace(-1,1,3), linspace(4,5,5) );     Z = X + Y;     surf(X,Y,Z)     shading interp      such that               octave:7> Z     Z =             3.0000   4.0000   5.0000        3.2500   4.2500   5.2500        3.5000   4.5000   5.5000        3.7500   4.7500   5.7500        4.0000   5.0000   6.0000      and the outcome is ![enter image description here](http://i.stack.imgur.com/rJkum.png) I would like to reproduce that in `pgfplots`. To this end, I saved the `Z` matrix as ascii and imported it into an `\addplot3 table` statement:               \documentclass{standalone}          \usepackage{pgfplots}          \pgfplotsset{compat=1.9}               \begin{document}          \begin{tikzpicture}         \begin{axis}         \addplot3[surf] table {       3.0000   4.0000   5.0000        3.2500   4.2500   5.2500        3.5000   4.5000   5.5000        3.7500   4.7500   5.7500        4.0000   5.0000   6.0000              };         \end{axis}     \end{tikzpicture}     \end{document}      which leads to the unexpected result ![enter image description here](http://i.stack.imgur.com/7NNUw.png) How can I reproduce my intented surface plot?


title: how to change position of \Rightarrow

text: In the following example, how can I shift the \Rightarrow slightly towards left so that the first terms of both equations are vertically aligned?               \documentclass[10pt]{article}          \usepackage{mathtools}          \usepackage{mathtools}     \usepackage{amsmath}     \usepackage{amsthm} %for proof                \begin{document}              \begin{align*}         \frac{\partial V(u)}{\partial b}&=2.b.\sigma_{X}^{2}-2.\sigma_{XY}=0 \\          \Rightarrow b &=\frac{\sigma_{XY}}{\sigma_{X}^{2}} = \beta^{*}         \end{align*}                         \end{document}


title: Tikz diagram: subnodes

text: I am trying to draw this diagram using tikz, but I am just a begginer and cant find out how to draw small nodes in those bigger. Anybody experienced in this? Text in image are not important, only shapes and arrows. Also I dont care about design so much, I mainly need shapes. ![enter image description here](http://i.stack.imgur.com/MNo0z.png)


title: How to use the space for \def argument's separator

text: Assume there is a line including some single letter like A, b, C, etc. and the letters separate by only one white space, which ASCII code is 32, say,               D B g A      I want the content for a \def's arguments, For example,               \def\mydef#1 #2 #3 #4{\textbf{#1}\textit{#2}\textsc{#3}\textsl{#4}}      the               \mydef{D B g A}      output bold D, italic B, smallcap g, and slanted A. Other situations export a warning message. Note: the \r\n (ASCII code 13) or \n (ASCII code 10) be seen as ending of \mydef.


title: How to cross a row in matrix with a line?

text: Is there an "easy" way to cross the row in a matrix with a line? I am trying to demonstrate to my students how to type in LaTeX their homework assignment on Boolean function. The below table is used during the construction of normal conjunctive and disjunctive form of a Boolean function. This is a "hand" made example. ![example table how it should look like](http://i.stack.imgur.com/CLaKn.jpg)


title: CJKvert affecting all CJK in document

text: My document has been compiling very well (thanks in no small part to Tex SX!), but I seem to have hit a snag. I added a more complicated dedication to the beginning of my thesis (using `\dedication \input{foo.tex}`). In the dedication I have some Chinese that I wanted to display vertically. I got that to work using the `CJKvert` package. However, now it seems that all of my Chinese text is displaying rotated! I think this MWE shows the problem:               \documentclass{report}     \usepackage{CJKutf8, CJKspace}     \usepackage[usebaselinestretch]{CJKvert}     \usepackage{rotating}          \begin{document}          \begin{center}     \vspace*{-2cm}     \parbox[c][5em][c]{15cm}{%     \small In order to properly understand the big picture, we should fear becoming mentally clouded and obsessed with one small section of truth. \\%     \\%     Chapter 21 ``Dispelling Obsession'' \\%     The \emph{Xunzi} \\ \\ \\ \\ \\ \\     }     \vspace*{3cm}     \begin{turn}{-90}     \parbox[c][3cm][c]{24em}{%     \begin{CJK}{UTF8}{gbsn}\CJKvert\CJKtilde\fontsize{12pt}{14pt}荀子\\%     解蔽篇第二十一\end{CJK} \\%          \begin{CJK}{UTF8}{bkai}\CJKvert\CJKtilde\fontsize{18pt}{20pt}凡人之患，蔽于一曲，而闇于大理。\end{CJK}     }     \end{turn}     \parbox[c][5em][c]{15cm}{To my Cousin's Brother's\\%     Flatmate.     }     \end{center}          \chapter{Some Chapter Title}          The modern name of the People's Republic of China in Chinese remains     \emph{Zhongguo} {[}\begin{CJK}{UTF8}{gbsn}中国\end{CJK}{]}     which translates most directly as ``central state'' or in literary     usage ``middle kingdom.''          \end{document}      Do I need to `\renewcommand` or some such after the dedication? Ps. Please ignore the gross use of `\\\` to get the spacing right. I am hardly concerned about that ATM. EDIT 1: I know this can perhaps be done more easily with xetex/xelatex and xeCJK, but that would break all of the rest of my Chinese, causing a great deal of recoding.


title: Moving text effect in presentation

text: please consider the following example:               \documentclass{beamer}     \usepackage{tikz}     \begin{document}        \begin{frame}           \begin{tikzpicture}[remember picture,overlay]              \only<1>{                     \node at(current page.center){test};                 }                 \only<2>{                     \node [anchor=north]at(current page.north){test};                 }           \end{tikzpicture}        \end{frame}          \end{document}      It produces two slides: the first with the centered text and the second with the same text in the northern part of the frame. I'd like to know if there is some technique to obtain a "moving text" effect: an animation that graciously moves the text north until it reaches the second slide position. **edit:** I just discovered the `animate` package that seems to be able to do what I want. But the examples in the manual involve very complicated figures while I need to move just tikz nodes (with text inside mostly). Is there anybody who'd like to show me how to `animate` my code? **disclaimer:** I know animation are considered bad practice but this is a very special use case.


title: Restrict macro to an environment

text: I am quite a noob when it comes to customising LaTeX/XeLaTeX. I would like to know if there's a way to limit the usage of a macro to a specific environment. Consider the following macro and environment:               \newcommand\myMacro[2]{#1 ... #2}     \newenvironment{myEnv}{...}{...}      I would like the following:               \begin{myEnv}       % The following two calls to \myMacro are valid.       \myMacro{...}{...} .... \myMacro{...}{...}     \end{myEnv}     % This one should not be valid and throw an error.     \myMacro{...}{...}      I know this might not be the best design. I just want to make sure that I can't use `\myMacro` outsite of `myEnv`.


title: Listings - Keyword with Regex

text: I would like to colorize in a special color all my constant which are all in capital letters in my code and all my method variables which begin with an @. Is it possible to use Regex to define keywords with listings package ? It will help me for a lot of things ! For example, I actually have in a `\lstdefinestyle`:               keywords=[3]{@someName,@anotherName,@aboutOneHundredMore}     keywords=[4]{SOME_NAME,ANOTHER_NAME,ABOUT_ONE_HUNDRED_MORE}      --> If I could replace this by:               keywords=[3]{/@.+/}     keywords=[4]{/[A-Z_]+/}      it will save me from a lot of work ! If not, is there another way to have all my constant in a special color without defining all of them one by one in a keywords list ? I first think about using `morecomment` or `moredelim` for the @ part but the ending character is problematic: it can be a space, a dot or a lot of other characters...


title: equation positioning problem

text: With this code:               \documentclass{article}          \begin{document}          \rm \setlength{\parindent}{1cm} Estimatorul nonparametric pentru functia de distributie cumulative, $F(x)$, in punctul $x$ este raportul de puncte intermediare care sunt mai mici sau egale cu $x$.     \begin{equation}     \mathop{F}\limits^{\wedge } (x)=\frac{\# \{ x^{t} \le x\} }{N}     \end{equation}          \end{document}      The equation is positioned at the center, but why? How can I align it to the left? And that (1) is automatically inserted?


title: In biblatex, make title sentence case but not journal name

text: To force reference titles to a sentence case I use the following line in my `.bbx` style file: `\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{titlecase}{\MakeSentenceCase*{#1}}` But this also causes the journal name to be written in sentence case, which is unwanted.   Why is that and how can I circumvent that? A minimal example:               \documentclass{article}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @article{ref1,       author = {Doe, J. and Dane, D., and Dewy, R.},       year = {2000},       title = {This and That},       journal = {Journal of Deep Understanding of Things},     }          @article{ref2,       author = {Doe, J. and Dewy, D., and Dane, R.},       year = {2000},       title = {The Other},       journal = {Journal of deep understanding of things},     }     \end{filecontents}          \usepackage[style=authoryear-comp,natbib=true,          maxcitenames = 2,          mincitenames = 1,          firstinits = true,         labelyear=true,           uniquename=false,          uniquelist=false,         terseinits = false,         backend=biber]{biblatex}     \DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{titlecase}{\MakeSentenceCase*{#1}}     \addbibresource{\jobname.bib}          \begin{document}          Some text and a ref \citep{ref1}.     Then another ref with same first author and year \citep{ref2}          \printbibliography          \end{document}      gives: ![is](http://i.stack.imgur.com/GcoMw.png) instead of: ![enter image description here](http://i.stack.imgur.com/OEEm9.png)


title: \ref to \label in other document?

text: I have a repository with one document, but I think of splitting it into two documents, whereas I want to cross-reference from one to eachother. Is there a way, to "rewrite" `\ref` to automatically expand to the chapter number (or whatever) if the current document contains the label, or to expand to something like `"<chapter name> in the document \someDocumentNameConstant"` and if yes, how to? All document names can be retreived via variables/constants. * * * Of course you cannot \ref to a chapter number in another document, as the chapter number gets generated. I also know that the chapter name of the referenced chapter wouldn't be in the current translation unit, but maybe someone knows a trick to do this kind of setup! I hope this question isn't to dumb!


title: Python variables not accesible in pyconsole (PythonTeX)

text: This MWE is self explanatory:               % Compile this with pdflatex -> pythontex.py -> pdflatex     \documentclass[a6paper]{article}          \usepackage{pythontex}     \usepackage{geometry}          \begin{document}          \pyb{pi=3.14159}          $\pi$ is \py{pi}          \begin{pyconsole}     pi     \end{pyconsole}          \end{document}      ![image](http://i.stack.imgur.com/AvIhJ.jpg)


title: How to trace errors one by one from the build-output reported by TeXnicCenter?

text: The problem I have at the moment is that, after the execution of "Build current file", TeXnicCenter displays a window (named _Build output_ ) in which you can read a short description of errors; each of them is "marked" by a white cross in a red disk. I don't see any information on the location of the errors in the text. How can I find them in a pretty long text-file (more than 1100 lines)?


title: How to make the dot in the mid of square?

text: \begin{tikzpicture}          \coordinate (1) at (0,0);     \coordinate (2) at (2,0);     \coordinate (3) at (2,2);     \coordinate (4) at (0,2);     \coordinate (5) at (0,0);     \coordinate (6) at ($(1)!.5!(2)$);     \coordinate (7) at ($(2)!.5!(3)$);     \coordinate (8) at ($(3)!.5!(4)$);     \coordinate (9) at ($(4)!.5!(1)$);               \foreach \i in {1,2}     \fill (\i) circle (1pt) node [below] {\tiny \i};     \foreach \i in {3,4}     \fill (\i) circle (1pt) node [above] {\tiny \i};     \foreach \i in {6}      \fill (\i) circle (1pt) node [below] {\tiny 5};     \foreach \i in {7}     \fill (\i) circle (1pt) node [right] {\tiny 6};     \foreach \i in {8}     \fill (\i) circle (1pt) node [above] {\tiny 7};     \foreach \i in {9}     \fill (\i) circle (1pt) node [left] {\tiny 8};                  \draw (1)--(2)--(3)--(4)--(5);          \end{tikzpicture}      The above code for right side square I want to make the mid point which is giving in left square point(9)? ![enter image description here](http://i.stack.imgur.com/3r5eF.jpg)


title: Stretching a framebox over the whole page

text: Does anyone know how to stretch a (framed) box down to the end of the page? In effect something like               \documentclass{scrartcl}          \begin{document}     sometext          \framebox[\textwidth]{somemoretext\vspace*{\fill}}     \end{document}      Only that this doesn't work, of course, because `\fill` doesn't work inside a box... I've also tried the `framed` package, that doesn't solve the problem either. (In case anyone is wondering why I'm trying to do this, think of a handout with a box for handwritten comments at the end...)


title: Citation problem in latex

text: I'm going to write citation in my paper. The reference is Master Thesis and I got this output ![enter image description here](http://i.stack.imgur.com/dQKdU.png) Here is the code               @MastersThesis{Paper10,       author    = "Hasan Fleyeh",       title     = "Traffic and Road Sign Recognition",       school    = "Napier University",       %type     = "diploma thesis",       %address  = "",       year      = "2008",       month    = "July",       %note     = "",        }      Do you know how to fix it?


title: Making outdented/grayed block in CV

text: This page has a tutorial for making CV, but it doesn't have the example to make grayed/outdented section as follows: ![enter image description here](http://i.stack.imgur.com/bsM0T.png) How can I make this? The copied code from the poster without the outdenting/grayed area is as follows.               \documentclass[a4paper, oneside, final]{scrartcl}          \usepackage{soul}     \usepackage{scrpage2}     \usepackage{titlesec}     \usepackage{marvosym}          \titleformat{\section}{\large\scshape\raggedright}{}{0em}{}[\titlerule]          \pagestyle{scrheadings}          \renewcommand{\headfont}{\normalfont\rmfamily\scshape}          % add the symbols for email and phone contact data     \cofoot{\so{Liefdestraat, 7 - 1234LI, Amsterdam, Nederland}\\     \so{ {\Large\Letter} jeff@gmail.com \ {\Large\Telefon} +31 (0)6 12345678}}          \begin{document}     \begin{center}          \textsc{\Huge{\so{Iulius Caesar}}}          \section{Experiences}     \section{Skills}     \section{Education}     \section{Publications}     \section{Personal Info}     \section{Languages}     \section{Interests}          \end{center}     \end{document}      ### Update package if necessary One needs to update enumitem package with `tlmgr update --self` when the output is as follows: ![enter image description here](http://i.stack.imgur.com/I0UMg.png)


title: Hindi characters in PDF file

text: Would you please provide me with a simple example of how to use pdfLaTeX (under MiKTeX) to generate a PDF file with Hindi Characters on it?


title: Tikz scale vs pgf scale

text: The following code shows that the tikz "scale" is different from pgf? Changing the scale values for x and y in the tikzset command will scale the tikz rectangle but not the pgf star. Any ideas how to reconcile this? I need to be able to to scale my tikz pictures easily but have pgf use the same scale and origin.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes.callouts,shapes.geometric}     \begin{document}     \tikzset{x=0.1in,y=0.1in}     \begin{tikzpicture}     \draw[top color= black!50] (-2,-2) rectangle (5,4);          \begin{scope}     \pgfset{minimum width=1.5cm,minimum height=1.5cm}     \pgftransformshift{\pgfpoint{2cm}{2cm}}     \pgfnode{star}{center}{}{}{\pgfusepath{clip}}     \pgftransformreset     % Back to drawing     \fill[yellow] (2cm,2cm) circle (0.65cm);     \end{scope}     \end{tikzpicture}     \end{document}


title: Undesired coloring of \graffito{...} in classicthesis and arsclassica

text: Is any of you familiar with the `classicthesis` and `arsclassica` packages? I am using them for my PhD thesis, they are great, but I encountered a minor problem. `classicthesis` defines the `\graffito{...}` command which is used to add a small note on the external margin of the page. These notes are usually formatted in a smaller black italic Times font. Unfortunately, as you can see in the top part of the attached picture, if you use `hyperref` (or other packages) to color links (or other things like acronyms) and you have one of them spanning across two lines in where a `\graffito(...)` is defined, the whole note gets the color of the link. ![enter image description here](http://i.stack.imgur.com/Mqf00.png) I often use LaTeX to compose scientific papers, so I do not know very well how things work under the hood. I managed to isolate the following code in `classicthesis` sources that is responsible for `\graffito{...}`. I thought it was enough to add `\color{black}` somewhere in the forth line of the following code: the note actually becomes black, but an empty line is added (see the bottom part of the attached picture). Could you please tell me how to modify it to avoid it being colored by links? Could you please also explain me why?               % Graffiti as in GKP's book "Concrete Mathematics"     % thanks to Lorenzo Pantieri and Enrico Gregorio     \def\graffito@setup{%        \slshape\footnotesize%  <=== I'm going to add \color{black} right here!        \parindent=0pt \lineskip=0pt \lineskiplimit=0pt %        \tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300%        \doublehyphendemerits=100000%        \finalhyphendemerits=\doublehyphendemerits}     %\DeclareRobustCommand{\graffito}[1]{\marginpar%     % [\graffito@setup\raggedleft\hspace{0pt}{#1}]%     % {\graffito@setup\raggedright\hspace{0pt}{#1}}}     \let\oldmarginpar\marginpar     \renewcommand{\marginpar}[1]{\oldmarginpar%      [\graffito@setup\raggedleft\hspace{0pt}{#1}]%      {\graffito@setup\raggedright\hspace{0pt}{#1}}}      I hope the following minimal working example will help you. Thanks in advance!               \documentclass[paper=a4,fontsize=11pt,BCOR=5mm,twoside,open=right,titlepage,         headinclude,footinclude,captions=tableheading,numbers=noenddot,fleqn,         cleardoublepage=empty]{scrreprt}          \usepackage[pdftex]{hyperref}     \usepackage[smaller,printonlyused,withpage]{acronym}     \usepackage[dvipsnames,svgnames,x11names,table,fixpdftex,hyperref]{xcolor}     \usepackage[eulerchapternumbers,eulermath,beramono,pdfspacing,linedheaders]{classicthesis}     \usepackage{arsclassica}          \renewcommand{\bflabel}[1]{{#1}\hfill}     \renewcommand*{\acsfont}[1]{\textsmaller{\textsf{\textsc{\textbf{\color{webgreen}{#1}}}}}}     \renewcommand*{\acffont}[1]{\textsf{\textsc{\color{webgreen}{#1}}}}          \areaset[current]{336pt}{750pt}     \setlength{\marginparwidth}{7em}     \setlength{\marginparsep}{2em}          \pdfcompresslevel=9     \pdfadjustspacing=1     \hypersetup{         colorlinks=true, linktocpage=true, pdfstartpage=3, pdfstartview=FitV,%         breaklinks=true, pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,%         plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,%         hypertexnames=true, pdfhighlight=/O,%nesting=true,%frenchlinks,%         urlcolor=webbrown, linkcolor=RoyalBlue, citecolor=webgreen, %pagecolor=RoyalBlue,%         pdftitle={The Title},%         pdfauthor={\textcopyright\ Stefano},%         pdfsubject={},%         pdfkeywords={},%         pdfcreator={pdfLaTeX},%         pdfproducer={LaTeX with hyperref and classicthesis}%     }          \begin{document}     \cleardoublepage     \acresetall     \chapter{A Chapter} % (fold)     \label{cha:a_chapter}     An application field\graffito{Technical domains} that is often cited      in this regard is that of \acp{WS} and \ac{SOA} in general.          \begin{acronym}[SOA]     \acro{SOA}{Service\--Oriented Architecture}     \acro{WS}{Web Service}     \end{acronym}     % chapter a_chapter (end)     \end{document}


title: Spacing in table of contents

text: I've a problem with my table of contents in LaTeX. For some reason it uses the entire page area. The problem is illustrated here: http://twpmedia.se/kilten/files/tableofcontent.pdf Anyone knows a solution to this, so that the second content page uses the same spacing as the first? Maybe I should point out that I'm using               \usepackage{parskip}


title: pdflatex producing dvi output instead of pdf

text: I have a template for a paper that I am using that produces dvi output when I run `pdflatex` on the input file. Whereas most of the papers that I have worked with produce pdf output when I run `pdflatex`. I was looking at the log files for the two different papers and the one that produces dvi output includes the line:               (/etc/texmf/tex/latex/config/graphics.cfg     File: graphics.cfg 2009/08/28 v1.8 graphics configuration of TeX Live     )     Package graphics Info: Driver file: dvips.def on input line 91.      Whereas the one that produces pdf output contains the lines:               (/etc/texmf/tex/latex/config/graphics.cfg     File: graphics.cfg 2009/08/28 v1.8 graphics configuration of TeX Live     )     Package graphics Info: Driver file: pdftex.def on input line 91.      I am trying to figure out what the setting in that would cause this difference. The packages that are included for the two different papers are very similar, but I'm guessing it's related to one of them. So basically I want to figure out how to make pdflatex produce pdf output, and I'm wondering if the different driver file gives a hint as to what I should be looking at.


title: Leftidx problem: upper indices have different height

text: When using the `leftidx` package to create the same upper index on both sides of `\Bbbk[G]`, the indices have different height and look ugly. Minimal example:               \documentclass{article}     \usepackage{leftidx}     \usepackage{amssymb}     \begin{document}     \[ \leftidx{^D}{\Bbbk[G]}{^D} \]     \end{document}      I tried wrapping `\Bbbk[G]` in `\left.` and `\right.`, which solves the height problem, but it creates undesired spacing on the left. I am opting against negative hspace, hoping that someone knows a good solution for this.


title: Drawing circular arcs on the surface of the sphere

text: I would like to draw circular arcs on the surface of a sphere to model as atoms intersect a probe atom in a molecule. I attach an example image that I would like to draw with either tikz or asymptote. ![atoms intersecting probe atom](http://i.stack.imgur.com/u2f7s.jpg) ![circular arcs for the intersection](http://i.stack.imgur.com/Nok4y.jpg) Thanks much for your help.


title: xxx-eps-converted-to.pdf

text: I'm using TeXworks with MiKTeX to make a LaTeX document. When I try to render the document as pdf at the place where my EPS figure is supposed to be displayed I get a white box with black borders with the text "filename-eps-converted-to.pdf" I have no idea what's causing this. I'm using `graphicx`, and the code to display is :               \begin{figure}[!ht]       \centering       \includegraphics{exfig}       \caption{Default}\label{fig:default}     \end{figure}


title: Reverse coordinate system/axis in TikZ

text: Consider the following image: ![enter image description here](http://i.stack.imgur.com/4uTOT.png) When creating a Tikz picture, the X and Y positions origin and continue as the picture A represents it. But what if I wanted it to work like picture B? I could use the negative values for the Y, but if I wanted it to be positive instead (so if the number increases, the represented point goes down)... Would that be possible? In other words, can I set the origin to be in the Top-left side of a page?


title: Decorate pgfplots mesh

text: In my quest to solve this question I'm trying to see if I can decorate a mesh- plot by drawing many circles or maybe rectangles with a radius determined by `\pgfplotspointmetatransformed`. But I can't seem to decorate a mesh-plot. The MWE below contains three tries, all commented out, because all fail with `! Package PGF Error: I cannot decorate an empty path.`. I'm using `pgfplots 2011/12/29 v1.5.1 (git show 1.5.1-4-g53e640f )` and `tikz 2010/10/13 v2.10 (rcs-revision 1.76)`.               \documentclass{standalone}     \usepackage{tikz}     \usepackage{pgfplots}     \usetikzlibrary{decorations.markings}     \usetikzlibrary{decorations.pathmorphing}     \usetikzlibrary{decorations.shapes}     \pgfplotsset{compat=1.5}%     \begin{document}%     \begin{tikzpicture}     \begin{axis}     % all three attemps fail with:     % ! Package PGF Error: I cannot decorate an empty path.     %\addplot[mesh,point meta=y,decorate,decoration={triangles}] {x^2};     %\addplot[mesh,point meta=y,every path/.append style={decorate,decoration={triangles}}] {x^2};     %\addplot[mesh,point meta=y,every path/.append style={postaction={decorate},decoration={triangles}}] {x^2};     \end{axis}     \end{tikzpicture}%     \end{document}        * How do I decorate a mesh-plot?


title: Adding column space with a specific setting

text: with the following settings how can I add space between columns or just move them in the middle as they're positioned on the left side? The table looks great but I do not find a way to move column or just add space. I tried some of your suggestion but doesn't seem to work in my case! New user: sorry. Many thanks for your help!               {     \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}     \begin{tabular*}{1.0\textwidth}{l*{2}{cc}}     \toprule                         &\multicolumn{3}{c}{Test table}                                  \\\cmidrule(lr){2-4}                         &\multicolumn{1}{c}{(1)}         &\multicolumn{1}{c}{(2)}         &\multicolumn{1}{c}{(3)}         \\     \midrule     Treatment         &       -0.06         &       -0.03         &        0.00         \\                         &      (0.07)         &      (0.05)         &      (0.03)         \\     \addlinespace     Controls           &          No         &          Sí         &          Sí         \\     \midrule     Observaciones       &        2446         &        2445         &        2417         \\     \end{tabular*}     }      ![enter image description here](http://i.stack.imgur.com/SMSZk.jpg)


title: Disable including of system files

text: > **Possible Duplicate:**   >  How can I safely compile other people's LaTeX documents? I've got a Linux server that is rendering LaTeX documents, I want to disable the access of LaTeX to system files such as `/etc/passwd` etc. Is it possible by anyway?


title: TEXINPUTS for ../ (parent directory) inputs

text: Is it possible to use something like `TEXINPUTS` to search files included with `\input{../path}` in a path not relative to the parent directory of the tex file? (use case is to compile previews of parts of a document in the tmp directory instead the actual document directory, without changing the parts) (this is not about setting a permission to allow access to the parent directory, but about having `..` point to a directory that is not the parent directory)


title: TikZ drawing order when using animate

text: I've have a problem when I use animations in TikZ images: I like draw a figure over another figure by               \path(fig) node[anchor = north, inner sep=0pt,outer sep=5pt] {     FIGURE1     }          \path(fig) node[anchor = north, inner sep=0pt,outer sep=5pt] {     FIGURE2 over FIGURE1     }      This works fine until I use an animation:               \path(fig) node[anchor = north, inner sep=0pt,outer sep=5pt] {     \begin{animateinline}[loop,autoplay]{2}       \multiframe{8}{ipic=1+1}{     FIGURE1_\ipic       }     \end{animateinline}     }          \path(fig) node[anchor = north, inner sep=0pt,outer sep=5pt] {     FIGURE2 over FIGURE1     }      The first FIGURE1 is now animated but FIGURE2 is beneath FIGURE1. Using pgfonlayer/background doesn't help. Does anyone have an idea? Here is a simple example. In the second frame, the animated background appears, but it should remain beneath the blue block. The only solution I know is to put the "animateinline"-environment around the entire tikz picture, but this is not what I want.               \documentclass{beamer}          \usepackage{animate}     \usepackage{tikz}          \begin{document}     \begin{frame}          \centering     \begin{tikzpicture}          \path (0,0) node[anchor = north] {%     BACKGROUND     };          \path (0,0) node[anchor = north,fill=blue] {%     \color{red}HOLLA DIE WALDFEE OVERLAY     };               \end{tikzpicture}          \end{frame}          \begin{frame}          \centering     \begin{tikzpicture}               \path (0,0) node[anchor = north,fill=green] {%     \begin{animateinline}[loop,autoplay]{2}       \multiframe{8}{inum=1+1}{     \color{green}\bf BACKGROUND \inum       }     \end{animateinline}     };          \path (0,0) node[anchor = north,fill=blue] {%     \color{red}HOLLA DIE WALDFEE OVERLAY     };               \end{tikzpicture}          \end{frame}          \end{document}


title: Numbering sections as 1A, 1B, 2A, 2B, etc

text: I use scrartcl. I would like the sections to be numbered 1A, 1B, 2A, 2B, etc. I would like subsections etc. to be numbered 1A.1, 1A.2, etc. the idea is to present theory in the "A" sections and examples in the "B" sections. Please ask if more clarity is needed.


title: How to output a new line in a .txt file with \immediate\write18

text: I am trying to create a text file `foobar.txt` using `\immediate\write18`, and can not figure out how to properly get the `\n` so that Unix puts these lines on a new line. The MWE below produces one line in the output file: > \n \n ---------\n Foo: foo \n Foo: foo \n Bar: bar \n What I want in the output file is a few blank lines followed by: > --------- > > Foo: foo > > Bar: bar ## Additional Question:   * This appears to always append to the file, where as I thought the normal Unix way is that single `>` overwrites the file, and the double `>>` appends to the file. How can I get it to overwrite the file if it already exists. Or is this a security feature that prohibits this. ## Notes:   * The values after the colon are not fixed, but are built during compile time. Otherwise a simple `cat` solution would have worked. ## Code:               \documentclass{article}          \begin{document}         \immediate\write18{%         echo "         \string\n" >  foobar.txt%         echo "         \string\n" >> foobar.txt%         echo "---------\string\n" >> foobar.txt%         echo "Foo: foo \string\n" >> foobar.txt%         echo "Foo: foo \string\n" >> foobar.txt%         echo "Bar: bar \string\n" >> foobar.txt%         }     \end{document}


title: line break in equation

text: How do I get the line to break in an equation like in the example below between starName=name and birthdate=1960. ![Relational Algebra exmaple](http://i.stack.imgur.com/xpi6J.jpg)               \begin{document}     $\Pi_{movieTitle} \sigma_{starName = name \wedge birthDate = 1960}(StarsIn \times MovieStar)$     \end{document}


title: Defining dynamic LyX shortcuts

text: I use LyX especially for writing math, and I created my own bind file for my preferred shortcuts. Among other commands, I defined shortcuts that insert a command-sequence, for inserting long data easily. for example, I have the following shortcut assigned: `\bind "C-S-L x 1 n" "command-sequence self-insert x; math-subscript; self- insert 1; char-forward; self-insert ,; math-insert \ldots; self-insert ,; self-insert x; math-subscript; self-insert n; char-forward;"` This sequence generates a list of variables, named x_1 to x_n, separated by dots and commas. As can be seen, I use a shortcut that defines exactly the variable type I want to insert, and the needed range for the sequeunce. Soon enough, I realized I want all sorts of these sequences that only differ in their variable name ('x', here) and their range (1 to n, here). My question is - is there any way to define a 'dynamic' shortcut, in that sense it will generate the wanted sequence according to three given arguments, instead of defining each of these as a separate shortcut? Thanks for the help.


title: Specifying the transformation matrix TikZ uses manually?

text: I'm creating some 3D graphics using TikZ, and I need to apply a transformation matrix to some coordinates I'm specifying in 2D so they end up in 3D. I am going to draw graphics on all three visible sides of a cube, and I have defined macros that work in 2D that I want to be able to use on those sides. Is there any way to do this? I saw that there are some primitive transformations in PGF, but they all work in 2D.


title: Are there any (La)TeX Easter Eggs?

text: Given Donald Knuth's legendary sense of humor, one cannot help but suppose he would have succumbed to the temptation to add in a "special" command or two that did something unsuspected or unusual just for the fun of it. (And I don't just mean some cute or funny source code comments, but something that actually does something.) And if not him, then surely _someone_ in the community who has made an extension, document class, package or subversion of TeX, LaTeX, ConTeXt, or a helper program like an editor, etc., decided to have a little fun and throw in an Easter Egg. Yet, at the moment, I cannot think of a single one. Does anyone know of any?


title: Long equals in tikz

text: How could I proceed to make an "equal" arrow in a diagram in tikz? To be clearer, what I would like to obtain is the equivalent of the following command in xy: > \ar@{=}[direction] Two examples of what I want (done in tikz): ![](http://i.stack.imgur.com/DIpDm.png) and ![](http://i.stack.imgur.com/JKYpk.png) Thank you for your help.


title: Possible conflicts with fixltx2e?

text: I only recently came across the fixltx2e package. Given that it patches aspects of LaTeX, my spidey-sense begins to tingle out of a concern for possible package conflicts. Are there known conflicts? Is it better to load fixltx2e early, or, like hyperref, as late as possible? (Yes, I am worrying about a problem I don't as yet have. But, the concern won't be fresh in my mind six months from now if some conflict produces a hard to figure out bug.) I'd originally thought that there was little documentation, as none is linked on the CTAN Catalogue page that I used as the package link. In light of the answer, I thought to run `texdoc fixltx2e1` in the terminal. It turns out there is an extensive amount of documentation available, just not where I am used to looking for a new package.


title: What is the minimal codes to create my own `\documentclass` derived from LaTeX's `book`?

text: I want to invoke my document class as follows:               \documentclass[cymk,dvips,dvipsnames]{mybook}      Internally `mybook.cls` includes my own packages such as `mytables.sty`, `mypstricks.sty`, etc. What is the minimal code to create this document class?


title: Linebreak without justification if remaining Text doesn't fit

text: I have a text (justified block paragraph) with an author attribution. If the last line of the text has enough space left to fit the author attribution and some space, then it should be put into that line flushed right. If the last line of the text doesn't have enough space, the author attribution should go to the next line flushed right, but the last line of the paragraph shouldn't be justified.               Foo bar foobar. Foo bar foobar. Foo bar foobar. Foo bar foobar.      Foo bar foobar. Foo bar foobar. Foo bar foobar. Foo bar foobar.      Foo bar foobar. Foo bar foobar. Foo bar foobar.   by the Author          Foo bar foobar. Foo bar foobar. Foo bar foobar. Foo bar foobar.      Foo bar foobar. Foo bar foobar. Foo bar foobar. Foo bar foobar.      Foo bar foobar. Foo bar foobar. Foo bar foobar.                                                   by another Author      How can I achieve this?


title: Bump right-aligned text to next line iff no room

text: I a chat discussion it was suggested that `\hspace*{\fill}` (with a space before it to allow for a line break) was sufficient to always get the text following aligned to the right. And indeed, it is aligned to the right. However, in one case it is inserting an additional line break where one should not be required as illustrated by the last example here. I want the text bumped to the next line if and only if ( _iff_ ) there is no room: ![enter image description here](http://i.stack.imgur.com/rLxFq.png) If I remove the space before the `\hspace*{\fill}`, there are cases (second and third) where a new line should have been inserted but is not: ![enter image description here](http://i.stack.imgur.com/CjBNH.png) ## Related Question:   * Bump right-aligned text to next line if no room I have tried the suggestions at the related question and:   * Martin Scharrer's suggestion of using `\hbox{}\hfill` results in the text being on the left for the last case.   * Herbert's `\When` macro exhibits a similar problem for the last case.   * Thorsten Donig's `\signed` macro does yield the correct number of lines, but portions of the file name for the middle two cases show up on the second line when they easily fit in the first line. * * * ## Notes: I believe that this is _unrelated_ to the problem, as I was able to reproduce the problem without it. But, am mentioning it here in case it causes an issue with the proposed solution. I am using `\texttt` for the file name. This resulted in an additional complication which I initially thought was the cause of the problem. So, my actual use case is commented out below and it incorporates a solution from   * How to automatically hyphenate within \texttt? * * * ## Code:               \documentclass{article}     \usepackage[paperwidth=7.0cm,showframe]{geometry}     \usepackage{xcolor}     \usepackage{xparse}               \newcommand*{\FillLine}[2]{%     \noindent\parbox{\linewidth}{%         \raggedright         File:~#2 % <-- Need space here         %Space before \hspace* allows for a break before it         \hspace*{\fill}\texttt{\small CONFIDENTIAL}%      }%     }          %\newcommand*{\EnableHyphenationInTexttt}{\hyphenchar\font=45\relax}     %     %\newcommand*{\FillLine}[2]{%     %    \noindent\parbox{\linewidth}{%     %       \raggedright     %       File:~\texttt{\EnableHyphenationInTexttt#2} % <-- Need space here     %       %Space before \hspace* allows for a break before it     %       \hspace*{\fill}\texttt{\small CONFIDENTIAL}%      %    }%     %}          \begin{document}     \FillLine{Name}{Value}          \bigskip     \FillLine{Name}{A-Long-Value}          \bigskip     \FillLine{Name}{iiiiiii-iiiii-iiiiiii}          \bigskip     \FillLine{Name}{Some-Really-Really-Long-Value}     \end{document}


title: Line break after \hfill

text: I hope this question is not a trivial one, but I was not able to find any answer to that. I found out that sometimes when I put an `\hfill` command in order to align some text to the right, there is a line break after the first word of the right-aligned text, even though there is surely enough space from the text on the left. After playing with it a bit, it seems to me that it happens after there was a line break within a word in the paragraph. I can't see any reason for that, but yet again I might not have a full understanding of how line breaking and `\hfill` work. Here is a minimal example:               \documentclass{article}     \begin{document}          If there is a line break within a word as a result of some verymuchsuperlongword,      then the text after hfill breaks: \hfill Some words.          If there isn't a line break within a word as a result of some very much super long word,      then everything looks fine: \hfill  Some words.          \end{document}      And that's how it looks: ![enter image description here](http://i.stack.imgur.com/Mu6n9.png) Does anyone have any idea what might be the problem and how I can avoid it?


title: How to add a predefined box flush right after a custom environment?

text: I want to construct an environment which prints enclosed text and add a predifined box flushright after the text. Here is MWE:               \documentclass{minimal}     \newenvironment{problem}{%         \bigskip          \textbf{Problem}         \begin{trivlist}         \item[]     }{         \mbox{}\hfil         \linebreak[2]\mbox{}\hfill\fbox{$>>$~Solution}         \end{trivlist}     }     \begin{document}          \begin{problem}       Shorttext. Shorttext. Shorttext. Shorttext.     \end{problem}          \begin{problem}       Shorttext. Shorttext. Shorttext. Shorttext.       Shorttext. Shorttext. Shorttext. Shorttext.     \end{problem}          \begin{problem}       Shorttext. Shorttext. Shorttext. Shorttext.       Shorttext. Shorttext. Shorttext. Shorttext.       Short.      \end{problem}     \end{document}       Unfortunately, the box is not always positioned as I want. Sometimes it extends beyond the right boundary of the text column instead of being pulled out to the next line. And the box is not flushed right when it is pulled out alone to the last line as the above MWE shows (see 3rd occurence of the `problem` environment): UPDATE: I found a solution in The TeXBook, on page 106. ![output of MWE](http://i.stack.imgur.com/kQkXd.png) Please advice how to achived desired positioneng of the end box.


title: How to get multiple multirows in a table?

text: I want to render a table with results of experiments. There are 6 experiments (multirows) described by 2 columns and each of them is performed 5 times (rows). My code:               \begin{tabular}{l r | l || r r}     Vzorka & Výskyty & Algoritmus & Porovnania & Prístupy \\ \hline      \multirow{5}{*}{Gabriel} & \multirow{5}{*}{8}     & NAIVE BINARY          & 158   & 44 \\     & NAIVE BINARY_LCP      & 174   & 92 \\     & NAIVE INTERPOLATION   & 168   & 78 \\     & LESS NAIVE BINARY     & 98    & 26 \\     & LESS NAIVE BINARY_LCP & 124   & 58 \\ \hline     ...     \end{tabular}      This code produces what I want only for the first row: ![The output of above code](http://i.stack.imgur.com/OEB5R.png) successful rows after the first one are shifted and overlapping the "8" number. Can you please help me?


title: Only 3 items in navigation bar, is that possible?

text: I saw a beamer presentation that shows only 3 items in navigation bar (the last one, the current -highlighted- and the next). How is that possible? I am using Warsaw theme, and I have (until now) 7 sections, so the navigation bar is _too_ long…


title: How to center the column headers in a Table?

text: In a hurry..               \begin{tabular}{p{.5in}|p{1in}|p{1in}|p{1in}}     \hline     \multicolumn{1}{|c|}{S. No.} & {|c|Book Name} & Author &       \multicolumn{1}{|l|}{Publisher}\\     \hline     a & b & c & d\\     \end{tabular}      ![enter image description here](http://i.stack.imgur.com/xMCbE.png)


title: Include another pdf in a box (and other details)

text: Some time ago I read a paper that was tightly based on another one. It was from the same authors so they included the previous papers as appendixes. I noticed (and liked) that these appendixes were enclosed in a box. In my case, I am writing a technical report ( _report-a_ ) that should include another report ( _report-b_ ) in its appendix. Both of the are generated by LaTeX. The result that I am looking for is that _report-b_ appears in the final section of the _report-a_ , inside a box. So far, I can include it with the `pdfpages` package. I have also managed to include it in a box with `fancybox`:               \documentclass[a4paper,10pt]{article}     \usepackage[final]{pdfpages}     \usepackage{fancybox}          \begin{document}     \section{Test}     hello     \pagebreak     world     \pagebreak          \section{Previous report}     \fancyput(3.25in,-4.5in){%     \setlength{\unitlength}{1in}\fancyoval(7,9.5)     }     \includepdf[pages=-]{reportb.pdf}          \end{document}      I have the following problems with this:   1. Page numbering is confusing: from the `includepdf` command, page numbering follows the numbering of _report-b_   2. I would prefer if _report-b_ was scaled down a little bit. I could not find how to do this with `pdfpages`   3. The _report-b_ is included in the page after the section title, which wastes a whole page. I would prefer if it would start right after the section title. Any ideas of how to achieve this? PS: I am not really sure how to tag this question.


title: Submatrix in LaTeX

text: I would like to create something like this:                      i      (           )      (           )      (______     )     j(      |    )      (      |    )      The matrix including its submatrix can be created by using `multicolumn`               \[     \left(     \begin{array}{p{3mm}p{3mm}p{3mm}p{3mm}p{3mm}}         &&&&\\         &&&&\\         \cline{1-3}         &&\multicolumn{1}{c|}{}&&\\         &&\multicolumn{1}{c|}{}&&\\         &&\multicolumn{1}{c|}{}&&\\         &&\multicolumn{1}{c|}{}&&     \end{array}     \right)     \]      but this doesn't work with `bordermatrix`.


title: How to combine Acronym and Glossary?

text: > **Possible Duplicate:**   >  How to combine Acronym and Glossary I'm using glossaries in LaTeX. I have an acronym (e.g. _API_ ) that should be explained in the glossary. Every occurrence of it should be linked to the glossary, and the very first occurrence should be expanded to the full form. How can I do that?


title: XeLaTeX size of Indic script in header

text: I am using XeLaTeX (TeX Live 2012 on Windows) and my Sanskrit document is entirely in Devanagari. Even the page numbers, section numbers and section names are in Devanagari. I use `fancyhdr` but quite strangely, the size of the output of `lhead` and `rhead` is different. While `lhead`'s text is small, that of `rhead` is large except for the subsection numbers. How can I control the size of the `rhead` to make it the same as `lhead`? Here is a working example.               \documentclass{article}     \usepackage{lipsum}     \usepackage{polyglossia}     \usepackage{fancyhdr}     \setmainlanguage{hindi}     \setotherlanguage{english}     \setmainfont[Script=Devanagari]{Arial Unicode MS}      \newfontfamily\devanagarifont[Script=Devanagari]{Arial Unicode MS}     \newfontfamily{\englishfont}{Times New Roman}     \newcommand{\devanagarinumeral}[1]{%        \devanagaridigits{\number\csname c@#1\endcsname}}     \usepackage{hyperref}     \begin{document}     \pagestyle{fancy}     \renewcommand{\sectionmark}[1]{\markright{#1}}     \fancyhf{}     \lhead{\fancyplain{}{अमुकग्रन्थे}}      \rhead{\fancyplain{}{\rightmark}}     \cfoot{\fancyplain{}{\thepage}}     \renewcommand{\thesection}{\devanagarinumeral{section}}      \renewcommand{\thesubsection}{\small{\devanagarinumeral{section}.\devanagarinumeral{subsection}}}        \renewcommand{\thepage}{\Large \devanagarinumeral{page}}     \section[\texorpdfstring{\Large प्रथमोऽध्यायः}{Chapter 1}]{प्रथमोऽध्यायः}     \subsection[\texorpdfstring{\Large प्रथमः पादः}{Part 1}]{प्रथमः पादः}     \begin{english}     \lipsum[1-10]     \end{english}     \end{document}


title: How do I restrict delta here?

text: Prove that $\lim_{x\to 1}(x^2-1)=0$          $|(x^2 -1) -0| < \epsilon$     \\*     $|x^2 - 1| < \epsilon$     \\*     $|(x+1)(x-1)| < \epsilon$     \\*     $|x+1||x-1| < \epsilon$      I know I need to restrict delta now but how do I do that?


title: Drawing full nodes whose center is not clipped by some path

text: ### Goal I would like to draw full nodes whose center is not clipped by some path. ### How the solution would possibly work? To be better understood I would describe it in two steps:   * clip before drawing - "trim" each node which center is out of bounds,   * draw full nodes (whose center is not clipped by path), i.e. without any clipping. Is this possible? _At the bottom of the question there is two page document with normal clipping on the first page and what I want to achieve on the second page (but with manual clipping - easy in that case, but not in general, so shown code is obviously not what I am looking for)._ ### Decomposition It's worth to add that problem can be decomposed to:   * polygon approximation (for non-polygon paths),   * point in polygon problem. Crucial here is being able to iterate over points and curves in path. I looked for it in manual, but without much luck (or, as usual, I was wrongly searching). ### Example               \documentclass{minimal}     \usepackage[utf8]{inputenc}     \usepackage[paperwidth=6.25cm,paperheight=6.25cm,margin=0pt]{geometry}     \usepackage{ifthen}     \usepackage{tikz}     \begin{document}     \parindent=0pt     \pagestyle{empty}     \begin{tikzpicture}[remember picture,overlay]     \node at (current page.center) {%     \begin{tikzpicture}[overlay]         \clip[draw] (0.35,0) circle (3.45);         \foreach \y in {-3,-2,...,3}             \foreach \x in {-3,-2,...,3} {                 \node[draw] at (\x,\y) {};                 \draw[fill] (\x,\y) circle (0.1pt);             }     \end{tikzpicture}     };     \end{tikzpicture}     \newpage     \begin{tikzpicture}[remember picture,overlay]     \node at (current page.center) {%     \begin{tikzpicture}[overlay]         \draw (0.35,0) circle (3.45);         \foreach \y in {-3,-2,...,3}             \foreach \x in {-3,-2,...,3} {                 \pgfmathsetmacro{\radiusc}{3.45^2 - (\x - 0.35)^2 - (\y - 0)^2}                 \ifthenelse{\lengthtest{\radiusc pt>0pt}\OR\lengthtest{\radiusc pt=0pt}}{                 \node[draw] at (\x,\y) {};                 \draw[fill] (\x,\y) circle (0.1pt);                 }{}             }     \end{tikzpicture}     };     \end{tikzpicture}     \end{document}      ![normal clipping](http://i.stack.imgur.com/pUFRI.png) ![smart clipping](http://i.stack.imgur.com/sPfXG.png)


title: Columns width of array environment

text: I'm using the `array` environment and have something like this:               \begin{array}{|c|c|}        \hline         \textbf{x} & \textbf{y} \\         \hline        \hline        t_1 & lon_1 \\         \hline      \end{array}      I would like to have the two columns to have the same width. How can I do that?


title: How does LaTeX find package files?

text: On a fresh install of TeXlive on a Linux box (Linux Mint 11) I get the following error message:               ! LaTeX Error: File `scalefnt.sty' not found.      But the file is there:               $ find /usr/ -name 'scalefnt.sty'  -print     /usr/share/texmf-texlive/tex/latex/carlisle/scalefnt.sty      Why `pdflatex` did not find it? Is it a bug in the TeXLive installation process? Until now I have solved this problem by adding lines like this one :               export TEXINPUTS=$TEXINPUTS:/usr/share/texmf-texlive/tex/latex/carlisle/      in my `.bashrc` file. Now I have 20+ such lines in my `.bashrc`. There must be a better way to solve this problem. -- Update -- Running `texhash` did not solve the problem.               $ sudo texhash     [sudo] password :     texhash: Updating /usr/local/share/texmf/ls-R...      texhash: Updating /var/lib/texmf/ls-R-TEXMFMAIN...      texhash: Updating /var/lib/texmf/ls-R-TEXLIVE...      texhash: Updating /var/lib/texmf/ls-R...      texhash: Done.      I think the `ls-R` file in `/usr/local/share/` was created by `texhash`. It is empty. I found in the `kpathsea` doc how to log : `export TEXMFLOG=/tmp/texmf.log`. After running `pdflatex` I get in the log :               $ cat /tmp/texmf.log      1309254390 /var/lib/texmf/ls-R     1309254390 /usr/local/share/texmf/ls-R     1309254390 /usr/share/texmf/ls-R     1309254390 /usr/share/texmf-texlive/ls-R     1309254390 /var/lib/texmf/web2c/pdftex/pdflatex.fmt     1309254390 /usr/share/texmf-texlive/tex/latex/base/letter.cls     1309254390 /usr/share/texmf-texlive/tex/latex/base/letter.cls     1309254390 /usr/share/texmf-texlive/tex/latex/base/size10.clo     1309254390 /usr/share/texmf-texlive/tex/latex/base/size10.clo     1309254390 /usr/share/texmf-texlive/tex/generic/babel/babel.sty     1309254390 /usr/share/texmf-texlive/tex/generic/babel/babel.sty     1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.ldf     1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.ldf     1309254390 /usr/share/texmf-texlive/tex/generic/babel/babel.def     1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.cfg     1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.cfg       In the texlive setup I use, the files `/usr/share/texmf/ls-R` and `/usr/share/texmf-texlive/ls-R` are links to `/var/lib/texmf/ls-R-TEXMFMAIN` and `/var/lib/texmf/ls-R-TEXLIVE` respectively. I don't understand why it does not work since the style file is in one of the ls-R files:               $ grep scalefnt.sty /var/lib/texmf/ls-R-TEXLIVE     scalefnt.sty      This looks like a bug in the texlive package installation process (in Linux Mint/Ubuntu).


title: How to take \varkappa from XITS when using Asana math?

text: I don't like `\varkappa` in Asana math font and want to substute it with `\varkappa` from XITS math font. Here is MWE:               \documentclass{article}     \usepackage[math-style=ISO,bold-style=ISO]{unicode-math}     \setmathfont[version=xits,Color=006600]{XITS Math}     \setmathfont[version=asana,Color=000066]{Asana Math}     \setmathfont[version=lm,Color=660000]{Latin Modern Math}     \newcommand{\mykappa}{\mbox{\mathversion{xits}$\varkappa$}}     \renewcommand{\vec}[1]{\mathbf{#1}}     \begin{document}     \mathversion{asana}     \[       \vec{\varkappa}=\varkappa\vec{n}       \qquad       \vec{\mykappa}=\mykappa\vec{n}     \]          \mathversion{lm}     \[       \vec{\varkappa}=\varkappa\vec{n}       \qquad       \vec{\mykappa}=\mykappa\vec{n}     \]     \end{document}          **Is it a better solution? In particular, how one can redefine`\varkappa` instead of defining new command `\mykappa` as in the example above?** By the way, Latin Modern Math is missing bold varkappa as shows output generated with this MWE: ![enter image description here](http://i.stack.imgur.com/jHNLc.png)


title: How to resize a matrix?

text: I want to see How to reduce the size of a matrix ? I have this code:                   \begin{center}                     \[                     \begin{blockarray}{cccccc}                     {\{1\}\{2\}\{3\}} & {\{1,2\}\{3\}} & {\{1,3\}\{2\}} & {\{1\}\{2,3\}} & {\{1,2,3\}} \\                     \begin{block}{(ccccc)c}                       1 & 1 & 1 & 1 & 1 & {\{1\}\{2\}\{3\}} \\                       0 & 1 & 0 & 0 & 1 & {\{1,2\}\{3\}} \\                       0 & 0 & 1 & 0 & 1 & {\{1,3\}\{2\}} \\                       0 & 0 & 0 & 1 & 1 & {\{1\}\{2,3\}} \\                       0 & 0 & 0 & 0 & 1 & {\{1,2,3\}} \\                     \end{block}                     \end{blockarray}               \]         \end{center}      ![enter image description here](http://i.stack.imgur.com/Js7Gb.png)


title: Censor images and tables

text: My publication requires a public and non-public version. I have several figures and tables that I'd like to censor by placing a big colored block on top of it. One page suggested using `\colorbox`. Unfortunately, this doesn't work for pdf files. All of the images and tables are simple `\includegraphics`. Anyone have a clue? Update @doncherry, this:               \begin{figure}[h!]     \centering     \colorbox{black}{\includegraphics[width=1\textwidth]{\string"Image".pdf}}     \caption{Google Adwords - BoI}     \end{figure}      produces: ![Colorboxed image](http://i.stack.imgur.com/jfv2V.png)


title: Mhchem overfull boxes

text: I am using the `mhchem` package in-line and the equations don't break lines and thus cause overfull boxes. Any way to force them to follow the rules for line breaks. i.e. the following sentence:               Clays exist in groups with generalised formulae, these include:      the smectite group \ce{(A1/3D2-3[T4O10]Z2.nH2O)} and the serpentine group      \ce{(D2[Si2O5](OH4)\pm nH2O)} among others.      the formulae comes out lovely looking it just hangs over the margin. . .


title: Automatically adjusting the size table cells

text: Is it possible to automatically adjust the size table cells according to their content, or to make the size of all cells uniform ? This is an example:               \begin{table}[t]     \center     \footnotesize     \caption{resultsss}     \label{labss}     \begin{tabular}{ c c }          \begin{tabular}{ | c || c | c | c | c | } \hline     \multicolumn{4}{|c|}{\textbf{a text over here a text over here}} \\ \hline     \textit{Method 1} & 19923 & 123 & 123 \\ \hline     \textit{Method 2} & 1203 & 123 & 123 \\ \hline     \end{tabular}          &          \begin{tabular}{ | c || c | c | c | c | } \hline     \multicolumn{5}{|c|}{\textbf{another text over here}} \\ \hline     \textit{Method 1} & 789 & 789 & 789 & 789 \\ \hline     \textit{Method 2} & 789 & 789 & 789 & 789 \\ \hline     \end{tabular}               \end{tabular}     \end{table}


title: \lstinline!Foo! vs \lstinline{Foo}

text: I wonder what is the difference or correct usage of `\lstinline!...!` and `\lstinline{...}`? I like better `{}` because I feel there it's more consistent with other commands but for example in below example brackets don't work so I have to use `!!`.               \documentclass[]{article}     \usepackage{listings}     \begin{document}     This line is fine I can use \lstinline{inline listings with brackets}.     begin{center}       \begin{tabular}{ c l }         Example & Explanation \\ \hline         \lstinline!$#! & This works\\         \lstinline{$*} & But how come this doesn't? \\       \end{tabular}     \end{center}     \end{document}      Why is that? What would be the rule of thumb for `!!` and `{}` ?


title: Are the original CM fonts better than the current type1 fonts?

text: What are the differences between the original (rasterized) CM fonts and the current (smooth PDF-friendly) type1 versions of these fonts? It seems to me that the originals are much better looking. They are "thicker". You can clearly see the difference in printed output. The type1 ones are somewhat "thinner". Why is this? Why aren't they exactly the same? And final question: On a modern MacTeX distribution (on my Mac OS X), how can I compile my document with the older fonts? **Update:** I feel the current answers haven't answered some of the sub- questions and, more importantly, haven't provided the proper understanding that I'm looking for. The question can be rephrased: I look at "Digital Typography" by Knuth and a recent mathematics book on my shelf. Both are clearly printed in very high resolution—the fonts are smooth and look how they are supposed to look. But the font in Knuth's book is far more "thicker" and has a much more warmer, juicier, and nicer feel to it. On the other hand, I recognize the font in the mathematics book as the modern ubiquitous "smooth type1" CM font. In comparison to the font in Knuth's book, it looks thin and pale. I'm looking for some foundational understanding for why this is the case and why it turned out this way. Any font experts in here?


title: Add listings to list of figures

text: I am using the `listings` package to display code in my document. is it possible to add the listings to the List of Figures. Instead of Listing, there should be Figure in the caption and it should share the same counter as the figures.


title: Display a Ph.D. Thesis title when using biblatex-chem

text: I'm using `biblatex` with `biblatex-chem` and have I can't display the title of a Ph.D. thesis. I've dug around the documentation but have not found a solution. I've noticed biblatex treats a thesis differently to bibtex in the .bib but I don't know if this has an effect. Here is the entry in the .bib:                   @THESIS{xu_synthesis_2008,           author = {Xu, Shu},           title = {Synthesis of high quality {low-toxic} semiconductor nanocrystals},           institution = {University of East Anglia},           year = {2008},           type = {{Ph.D. Thesis}},           owner = {Paul},           timestamp = {2011.08.25}         }      Here is the document:                   \documentclass[a4paper, 12pt]{article}         \usepackage[utf8]{inputenc}                      \usepackage[T1]{fontenc}                         \usepackage{lmodern}                                  \usepackage[british]{babel}              \usepackage[backend=biber, style=chem-angew, articletitle, chaptertitle, language=auto, doi, defernumbers=true]{biblatex}          \addbibresource{si.bib}         \usepackage[autostyle]{csquotes}                  \begin{document}              \nocite{xu_synthesis_2008}              \printbibliography              \end{document}                The output looks like this. > [1] S. Xu, Ph.D. Thesis, University of East Anglia, 2008.


title: ltablex - Multi-column problem

text: I have a problem using a multicolumn command in an ltablex environment. When I insert a large amount of text into a multicolumn command the text (and the table) run off of the side of the page. I've included a MWE below to (hopefully) illustrate the problem including all the packages I am using to still get this problem and make the MWE work (my full thesis has many more packages but I went through taking each one out to see if the problem resolved...it didn't). If the text in the multicolumn command is deleted or replaced by only a few words, everything is fine.               % ************ Preamble ****************     \documentclass[a4paper,12pt]{report}     \usepackage[top=2cm, bottom=2cm, left=3.5cm, right=2cm]{geometry} % sets margins     \usepackage{natbib} % for harvard style referencing     \usepackage[margin=10pt, labelfont=bf, format=hang, textfont={small,it}]{caption} %for more interesting captions     \captionsetup[subfigure]{style=default, margin=0pt, labelfont=bf, textfont={small,it}, singlelinecheck=true} % makes subfigure captions a bit more interesting.     \usepackage{multirow} % allows merging of rows in tables     \usepackage{ltablex} % Combines tabularx and longtable functionality     \usepackage{booktabs} % For professional looking tables          % *********** BEGIN! ******************     \begin{document}          \begin{center}     \begin{tabularx}{\textwidth}{p{4cm} p{2.5cm} X}     \caption{My table which I would like to be a summary of some MATLAB\textsuperscript{\textregistered} functions. The table will span a number of pages.}\\         % First page header of table         \toprule         \textbf{Training function} &         \textbf{MATLAB\textsuperscript{\textregistered} code} &         \textbf{Description} \\         \midrule      \endfirsthead         %subsequent page header of table         \toprule         \textbf{Training function} &         \textbf{MATLAB\textsuperscript{\textregistered} code} &         \textbf{Description} \\         \midrule      \endhead         %footer for all but last page of table         \multicolumn{3}{r}{\small\sl continued on next page\ldots}\\         \bottomrule     \endfoot         %footer for last page of table         \bottomrule     \endlastfoot          % Table contents     Some text & \texttt{train} & null.\\     More text & \texttt{traingd} & null\\     A bit more text & \texttt{traingdm} & null\\     \multicolumn{3}{l}{Here is the text that is too long for the table. If I insert ``null'' instead of all this text, the table is fine. However, the text I would like to put in here is about 100 words long. Repeat: Here is the text that is too long for the table. If I insert ``null'' instead of all this text, the table is fine. However, the text I would like to put in here is about 100 words long. Repeat: Here is the text that is too long for the table. If I insert ``null'' instead of all this text, the table is fine. However, the text I would like to put in here is about 100 words long.}\\     \multirow{3}{*}{Multirow Text} & Text & Blah \\     & blah & blah \\     & more blah & blah \\     \label{label}     \end{tabularx}     \end{center}          \end{document}      I'm using Texniccenter (allegedly) Stable Release 1.0 with Miktex 2.9 on a PC running XP SP3. I've also asked this question over on the LaTeX Community forum. I'll be sure to update one or the other if I find a solution.


title: Is there a program that converts a drawing to latex?

text: > **Possible Duplicate:**   >  What GUI applications are there to assist in generating graphics for TeX? Is there an analogue of detexify for, say, pictures of curves intersecting? E.g., something that will take a picture of an n-gon and output tex code (in whatever package) for the n-gon?


title: GUI for PGF/TikZ

text: I am looking for a GUI (Graphical User Interface) for PGf/TikZ, where I should be able to draw the diagrams by hand or generate a graph of a function, and the LateX code should be generated.


title: What vector based graphic software with LaTeX support is good for Linux?

text: For a long time now, I am searching a good vector based graphic software with LaTeX support for Linux. What I considered so far: **- Xfig:** eps export support, native LaTeX formula support, but not state- of-the-art when it comes to usability (some may disagree with me on that point) **- Inkscape:** eps export support, support for LaTeX formulas via Plugin and not very comfortable since a once written formula can not be re-edited later, good usability **Question:** Other recommendations?


title: Software to draw block diagrams in a GUI and then translate them into LaTeX code?

text: Is there a piece of software to draw block diagrams in a graphical user interface, diagrams that can then be translated to LaTeX code?


title: Latex footnote refers to the Titlepage

text: My footnotes refer unfortunately on the wrong Page (on the Titlepage), when I click on it. I do not use any footnote-packages. Any solutions?


title: How to make footer stick close to the text on the last page?

text: I want footer to appear immediately after text on the last page, without huge gap. I used `showframe` package and know that white space comes from the body (is tex adding some sort of `\vskip` or similar so that body height is exactly `\textheight`?). I'm also able to shift footer manually by decreasing `\textheight` for the last page using `changepage` package:               \changepage{-10cm}{}{}{}{}{}{}{}{}      But I need some way to get "true" text height automatically to substitute it as an argument for `changepage`. And of course there could be (should be!) some better and cleaner way to solve this problem.


title: Is there an equivalent to \ddot for MnSymbol?

text: In my bibtex file (in Jabref) I have several authors that require an umlaut. I was using \ddot which was doing the trick. Unfortunately I've needed to load some other symbols from MnSymbol that requires amsmath as well. As a result I can no longer use \ddot. Does anyone have any suggestions on how I can give my authors back their umlaut? I get the following error message when I use \ddot: `! Package amsmath Error: \ddot allowed only in math mode.`


title: Setting up your own LaTeX compile server?

text: I know services like TeX cloud and similar. My question is: Are there ready- made distributions of LaTeX that allow me to set up my own server? What are the best solutions? My goal is to have a nice editing environment on the iPad, and be able to use some remote compilation service.


title: Remove separator and change the placement of pages in biblatex' "incollection"

text: Following the style guidelines from a publisher, I need to tweak two aspects of `biblatex'` way of printing the `incollection` entry in the bibliography.   1. I need to remove the period `.` that appears between the title of the collection and the list of editors, which should start with the word `ed.` with a lowercase `e` (I personally find this very odd, but who am I to disagree).   2. The page sequence should directly precede the publisher's address, and the page sequence should be preceded be a comma. The entry should in other words look like this: > Flemming, Edward (2004). "Contrast and perceptual distinctiveness". > _Phonetically based phonology_ ed. by Bruce Hayes, Robert Kirchner, and > Donca Steriade, 232-276. Cambridge: Cambridge University Press.               \documentclass{article}     \usepackage[style=authoryear]{biblatex}     \renewbibmacro{in:}{}     \DeclareFieldFormat[article,incollection]{pages}{#1}     \begin{filecontents}{\jobname.bib}     @INCOLLECTION{flemming2004,         AUTHOR = "Edward Flemming",         BOOKTITLE = "Phonetically based phonology",         EDITOR = "Bruce Hayes and Robert Kirchner and Donca Steriade",         TITLE = "Contrast and perceptual distinctiveness",         YEAR = "2004",         LOCATION = "Cambridge",         PAGES = "232--276",         PUBLISHER = "Cambridge University Press"}     \end{filecontents}     \addbibresource{\jobname.bib}     \begin{document}     \nocite{flemming2004}     \printbibliography     \end{document}      ![enter image description here](http://i.stack.imgur.com/iEAWf.png)


title: Multiple bibliographies and one global bibliography - all with global labels

text: What I want is the following:   I have a tex file with several `\sections`, each with their own bibliography at the end and their own bib file. In every section several entries of the bib file are `\cited` BUT I also show all local bibliography entries at the end of each section.   At the end of the file is a global bibliography that shows all entries of all local bibliographies. I already tried different packages, e.g. `bibunits`and `chapterbib` (Link to both can be found here). The problem is not to generate multiple bibliographies in one document, but the labeling. The label of a local bibliography entry **has** to be the same as the one in the global bibliography. The packages I tried do show me local and global bibliographies, but use different labels. The last part is puzzling to me, because the `bibunits` documentation talks about an option `labelstoglobalaux` that should do just that.   As a sidenote, I use a modified plainnat.bst with alpha.bst labels, i.e. entries are labeled with initial of author name and year and entries with the same author and year get an character added to the label. (In the MWE I use alpha.bst) I do not want numbered labels. This is my MWE with the `bibunit` package:               \documentclass{article}       \usepackage[utf8]{inputenc} % Umlaut etc.       \usepackage{amssymb}       \usepackage{hyperref} % Link       \usepackage[labelstoglobalaux,globalcitecopy]{bibunits} % seperate bibliographies            \begin{document}       \nocite{*} % to cite global bibliography          % local bibliographies     \begin{bibunit}[alpha]     \nocite{*}     \putbib[biblio-test1]     \end{bibunit}          \begin{bibunit}[alpha]     \nocite{*}     \putbib[biblio-test2]     \end{bibunit}          % global bibliography     \bibliographystyle{alpha}     \bibliography{biblio-test_all}          \end{document}      and the three bib files biblio-test1:               @phdthesis{222,         author = {Author, Frank},         title = {{A long title: Number 2}},         school = {University T},         year = {2011},         pages = {III, 193},         type={Dissertation},         }          @phdthesis{333,         author = {Author, Frank},         title = {{A long title: number 3}},         school = {University T},         year = {2011},         pages = {93},         type={Dissertation},         }          @inproceedings{123,         author = {Bauthor, Bauth and Cauthor, Cauth},         title = {{This is the title}},         series = {A lovely series},         volume = {109},         booktitle = {A Long booktitel},         editor = {Editor, Ed and Beditor, Bed},         publisher = {Big Publisher},         address = {City},         year = {2010},         pages = {746--851},         }      biblio-test2:               @book{573,         author = {Name, N.},         title = {{An introduction to something interesting}},         pages = {9},         publisher = {Big important company},         address = {Hillcity},         year = {2005},         series = {Lecture notes},         volume = {27/2005},         url = {http://www.google.com/doodles/},         }               @phdthesis{222,         author = {Author, Frank},         title = {{A long title: Number 2}},         school = {University T},         year = {2011},         pages = {III, 193},         type={Dissertation},         }          @phdthesis{111,         author = {Author, Frank},         title = {{A long title: Number 1}},         school = {University T},         year = {2011},         pages = {978},         type={Dissertation},         }          @phdthesis{233,         author = {Author, Frank},         title = {{Some other title}},         school = {University T},         year = {2009},         pages = {3},         type={Dissertation},         }      biblio-test_all contains entries of biblio-test1 and biblio-test2 without additional entries. What I get in the end: Three bibliographies with local labels each, e.g. entry222 is in one bibliograhy [Aut11a] in another [Aut11b]. Help, or ideas will be much appreciated! EDIT 1: I compile   - latex biblio-test   - bibtex biblio-test (to get the global bibliographie)   - bibtex bu1   - bibtex bu2   - latex biblio-test   - latex biblio-test  EDIT 2: I have several bib files, because the bib files are generated for every `\section` through a program and have up to one hundred entries each.   I could put them in one files and call every section bibliography using `\nocite{...}` and I could then write a script that copies every section bibliography entry into `\nocite`. However, I tried using only one bib file and call those entries I need with `\nocite*{...}`. But: The labeling is still not global*. So until now, I haven't found a reason not to use seperate files. *When I then cite entries in a bibunit, the global label is used in the citation, but the local one is used in the bibliography.


title: TikZ externalisation in beamer

text: I want to use the TikZ externalization feature in my beamer document. Works fine, but when I use something like               path<1->[draw] (0,0) -- (0,1);     path<2->[draw] (0,0) -- (1,0);      … only the picture of the first frame will be externalized. Is there any way to fix that? I read the externalization part of the official documentation, but beamer is not mentioned anywhere and I am not sure I understand the “limitation” parts.


title: Subfloat caption in wrong position

text: My subfloat command is standard and simple:               \documentclass[12pt]{article}     \usepackage{graphicx,subfig,caption}     \begin{document}          \begin{figure}[h!]       \centering       \subfloat[illegitimate]{\includegraphics[width=4.5cm]{QR.eps}}       \qquad       \subfloat[legitimate]{\includegraphics[width=4.5cm]{anti02.eps}}       \caption{QR code}     \end{figure}          \end{document}      And I end up getting something like this, with the captions shifted away to the right:               p i c t u r e 1     p i c t u r e 2                                  (a) illegitimate     (b) legitimate        Why are the captions shifted so far away instead of staying under the pictures? The pictures are of equal and appropriate sizes and there're plenty of space to move around! **Edit:** I checked out the log file, which seems to say something's wrong with the picture anti02. What could be wrong, please?               LaTeX Warning: Label `' multiply defined.          ) ABD: EveryShipout initializing macros     (E:\CTEX\MiKTeX\tex\latex\amsfonts\umsa.fd)     (E:\CTEX\MiKTeX\tex\latex\amsfonts\umsb.fd) [1] [2]     (E:\CTEX\MiKTeX\tex\latex\base\omscmr.fd) [3] [4] [5] [6] <QR.eps>     Underfull \hbox (badness 10000) in paragraph at lines 291--291     []          Overfull \hbox (233.31259pt too wide) in paragraph at lines 291--291     []      <anti02.eps>     Underfull \hbox (badness 10000) in paragraph at lines 293--293     [][]          Overfull \hbox (233.31259pt too wide) in paragraph at lines 293--293     []      [7] [8] [9] [10] [11] [12] ("C:\Users\eric\Desktop\number guessing——test.aux"     )      * * * **2nd Edit:** I removed this command:               \setcaptionwidth{5in}      in preamble and it worked right. But why?


title: Exclude images for printing pdf

text: I have a document that has images that are very, very dark. As such, they _should not be printed_ when the user goes to print. Somebody I'm working with loves to print, and they use a lot of toner this way. Is there a way to make an image _not print_ in the hard copy paper view, but show up in the electronic view?


title: Beamer - Source code highlighting/annotation tips

text: How can I highlight and annotate source code in a beamer presentation like this one? For example, consider the following image from that .pdf file: ![enter image description here](http://i.stack.imgur.com/2x0rW.png) It looks to me that above presentation is made with beamer...


title: Breaking very long equations

text: This is a frequent question, so let me specify a bit more what the problem is. I have equations with very long fractions that are within integrals,               \begin{equation}     \int A \int \frac{A B C D E \ldots Z}{A' B' C' D' \ldots Z'} dx dy     \end{equation}      Any suggestions how to break these and still make the equations look alright? I must say I am almost ready to typeset the offending pages with text running vertically. EDIT: per @egreg's request, here is a typical form of the equation I am struggling with:               \int f(\vec x_{i})      \frac{\int A(\vec x_{0}) A(\vec x_{1} \mid \vec x_{0}) \ldots            A(\vec x_{i} \mid \vec x_{i-1}) d\vec x_{0} d\vec x_{1} \ldots d\vec x_{i-1}}     {\int A(\vec x_{0}) A(\vec x_{1} \mid \vec x_{0}) \ldots            A(\vec x_{i} \mid \vec x_{i-1}) d\vec x_{0} d\vec x_{1} \ldots d\vec x_{i-1}}      \left(\frac{B(\vec x_{i})}{C(\vec x_{i})}\right) d\vec x_{i}


title: Tex like formatting on blog posts

text: When I write reports for school I usually use an IEEE formatted LaTex document these days because I feel like it just looks so much better then anything I can seem to do in Word. I have a blog and would like to be able to make my posts look as high quality as my reports do, but I just don't know how to do it, is there a similar way to format blog posts to look like Latex (or shoot even use latex). I would like to avoid simply creating an "image" as that doesn't seem very search engine friendly. Does anyone have any tips or ideas how to format a blog post (I use blogger at this point) so it looks as high quality as latex? (I would love it if i could simply type in latex code and generate an actual blog post). I'm really not sure if this is the best place to post this question but since I am trying to duplicate Latex quality format I thought I would try here first, hoping someone else has ran into a similar stype.


title: Using "&" symbol to split and align multiple equations

text: I would like to use the "&" symbol:   1. to align multi-line equations as well    2. to use it as an index to mark the placement while splitting an equation. However, when I do so, I don't want the split equation to be in alignment with rest other equation lines. Is there a better way to do this? Thank you for your suggestions. A minimal working example:               \documentclass[12pt]{article}     \usepackage{amsmath,amssymb,amsbsy}     \begin{eqnarray*}     \begin{split}     f(t_1,t_2|X_1,X_2) &=     \frac{\partial^2}{\partial{t_{1}}\partial{t_{2}}}\mathscr{L}\left[\Lambda_{01}(t_{1})e^{\beta^\top_{1}X_{1}}+\Lambda_{02}(t_{2})e^{\beta^\top_{2}X_{2}}\right] \\     &= \mathscr{L}^{\prime\prime}\left[\Lambda_{01}(t_1)e^{\beta_1^\top X_1}+\Lambda_{02}(t_2)e^{\beta_2^\top X_2}\right] \\     &= \frac{k+1}{k}\left(\nu_1\varphi_1{t_1}^{\varphi_1-1}e^{\beta_1^\top X_1}\right)\left(\nu_2\varphi_2{t_2}^{\varphi_2-1}e^{\beta_2^\top X_2}\right) \times\\      &\quad\left[\frac{k+\nu_1{t_1}^{\varphi_1}{e^{\beta_1^\top X_1}}+\nu_2{t_2}^{\varphi_2}{e^{\beta_2^\top X_2}}}{k}\right]^{-(k+2)}     \end{split}     \end{eqnarray*}     \end{document}


title: How to prevent TeX from stretching glue beyond a given maximum?

text: Is it possible to define a glue that TeX will not stretch any further than a given limit--under no circumstances? In the following MWE, I want to set a piece of text apart from the rest by half a line, and in case that piece of text lies on a page break, that half line should be allowed to be stretched to one full line, so that the whole text stays on the baseline grid and fills the page. However, I never want the glue to stretch more than one line, no matter if the page would become underfull or not.               \documentclass{memoir}          \usepackage{tikz, lipsum, everypage}          % show the baseline grid     \makeatletter     \newcommand{\left@margin}{}     \AddEverypageHook{         \ifodd\value{page}\relax%             \renewcommand{\left@margin}{\spinemargin}         \else             \renewcommand{\left@margin}{\foremargin}         \fi         % + \trimtop because it is also "\trimbottom"         \tikz[overlay, remember picture, background rectangle/.style={fill=none},                 shift={(current page.south west)},xshift={\left@margin + \trimedge},                 yshift={\lowermargin + \trimtop}]%         {%             \draw[red!20!white,thin] (0,0) grid[step=\onelineskip] (\textwidth,             \textheight);%             \draw[red,thin] (0,0) rectangle (\textwidth,\textheight);         }%     }%     \makeatother          \parskip=0pt          \begin{document}          \lipsum*[1-2]          \vskip .5\baselineskip plus .5\baselineskip % HERE should be the .5 limit          This is a test line of text to show my case, and I needed a few words to fill the line.          \vskip .5\baselineskip plus .5\baselineskip % HERE should be the .5 limit          \lipsum*[1-2]  Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis     Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis Morbi auctor     lorem non justo. Nam lacus libero, pretium at, lobortis Nam lacus libero, pretium at,     lobortis Morbi auctor lorem non justo. Nam          \section{Test}          \lipsum*[1]          \end{document}      The result looks like this: ![enter image description here](http://i.stack.imgur.com/4S7Ww.png) You can see that the two lines including the space before and after it occupy 5 lines instead of just 4 lines.


title: Bibliography sections without duplicate entries

text: I am creating a document using `biblatex`. The document needs multiple separate bibliographies, as provided by the `refsegment` environment. The same work may be cited in multiple `refsegment`s, but I want the citation to only appear in the first bibliography where it is used and not in latter ones. Citations in subsequent segments should point back to this previous bibliography. Is this possible to do automatically using `biblatex`?


title: Numbered, hanging paragraph without list environment

text: I often quote text (legal sources). Normally I use the `quoting`-package and `csquotes` (`block quote`). Often, the quotation contains some lists, and often with a non-standard numbering (f. ex. § 4-1(a)), or I have to start the numbering at a arbitrary level. I find it cumbersome to define `newlist` environments using `enumitem` because all I need is one or two paragraph of text. Inside a quoting environment, I often struggle to define the correct indentation with `enumitem`. What is the easiest and best solution? If the solution survives nested quoting-environment, it is a bonus (for me).               This is the quoted text that suddenly     and unfortunately contains some numbered     paragraphs:     11. Lorem ipsum Lorem ipsum Lorem ipsum          Lorem ipsum Lorem ipsum.      [...]     17. Lorem ipsum sucendium ipsum Lorem ipsum          Lorem ipsum.       To make my question clearer (maybe): What I am looking for, was a command (f ex `\hi` for hanging indent) to put in between the number and rest of the text, aligning the remaining text f. ex. at `parindent` from the last used left margin.               11.\hi Lorem ipsum Lorem ipsum Lorem ipsum          Lorem ipsum Lorem ipsum.       That is: Something similar to put a TAB between a character and rest of the text in a paragraph in M$ Word, and then press CTRL+T.


title: tikz positioning. How to place a node below of another only by y coordinate, leaving x alone

text: I have 2 chains in different columns of a table. I need to shift the second chain in a such way that the `{mv r0 <\- a}` would be below the `{br a = 0 $end}`, as it is depicted : right below the red line. How to do it without inserting a fake node and adjusting its length? ![Desired position](http://i.stack.imgur.com/Bk4kN.png)   EDIT[as @Werner suggested]: Here is the code to reproduce the example. In the picture above, the right column is allready shifted by a graphical editor, originally they were aligned.               \newcommand*{\ld}[2]{ld\ #1\gets \$#2}     \newcommand*{\st}[2]{st\ #1\to \$#2}     \newcommand*{\add}[2]{add\ #1\gets #2}     \newcommand*{\mul}[2]{mul\ #1\gets #2}     \newcommand*{\mov}[2]{mv\ #1\gets #2}     \newcommand*{\inc}[1]{inc\ #1}     \newcommand*{\brz}[2]{br\ #1=0\ \$#2}          \begin{tikzpicture}     [-,auto,     up/.style={draw=none,above=.5cm},     down/.style={draw=none,below=.5cm},     long/.style={minimum height=2.5cm}]     \matrix [matrix,row sep=0.2cm,nodes={draw,font=\footnotesize},every even column/.style={text centered,text width=2.3cm}]     {         \node (up1)[up]{};&&\node(up2)[up]{};&&\node (up3)[up]{};&&\node(up4)[up]{};&\\     &\begin{scope}         [node distance=1mm, start chain=going below];         \node [anchor=north, on chain] {$\inc a$};         \node [on chain, long] {$\ld a a$};         \node [on chain] {$\brz a{end}$};         \node [on chain] {$\inc a$};         \node [on chain, long] {$\ld a a$};         \node [on chain] {$\brz a{end}$};     \end{scope}&     &\begin{scope}         [node distance=1mm, start chain=going below];         \node [anchor=north, on chain] {$\mov {r_0}a$};         \node [on chain, long] {$\ld {r_1} {r_0}$};         \node [on chain] {$\mul {r_1}{r_1*r_1}$};         \node [on chain, long] {$\st {r_1} {r_0}$};     \end{scope}\\         \node (down1)[down]{};&&\node (down2)[down]{};&&\node(down3)[down]{};&&\node(down4)[down]{};&\\     };     \begin{scope}     \draw (up1) to (down1);     \draw (up2) to (down2);     \draw (up3) to (down3);     \draw (up4) to (down4);     \end{scope}     \end{tikzpicture}


title: bibtex - endnote - new references

text: I'm sure this has been answered somewhere else already, but still, I couldn't manage to find it out on the internet. In my group, I need to work with Endnote (on .doc files) to write shared papers. My Endnote library gets updated almost everyday with new references. I however use Latex (TexShop) to write personal books/essays. Since I'm updating my Endnote library everyday, I would also like to update my .bib file everyday in a parallel manner. Do I have to export the whole Endnote library everyday then, or is it possible to use some synchronization option between the two softwares? What would be the best solution you might have in mind? Do you think that Mendeley could be a good replacement for Endnote, and therefore easier to use/sync with Latex? I thank you all very much in advance for your attention. Sincerely, Udiubu.


title: which poster package should be used?

text: A rather strange requirement was mailed to me. The dimension of > 115 cm × 145 cm should be applied for a poster. According to various defined paper sizes, that's not a standard as far as I saw. Anyway, can you recommend any packages concerning this circumstance?


title: Bar only Booktitles from beeing cited

text: The Problem i'm facing is, that I must not cite booktitles in the text. However I have to cite shorttitles for articles and the like.   My question how is: How can I only switch off the booktitles of beeing cited?