title: Drawing tools regarding

text: I am using TikZ to draw pictures... Here i will give one of my drawing. I thing i used here is so lengthy. So is there any simple way of drawing this?               \begin{document}\begin{center}     \begin{tikzpicture}     \draw[pattern color=black,pattern=dots] (0,1) rectangle (3,1.2);     \draw (1.5,1.3) node[above] {0};     \draw[fill=black] (3,1) rectangle (6,1.2);     \draw[pattern color=blue,pattern=dots] (6,1) rectangle (9,1.2);     \draw (7,1.3) node[above] {2};     \draw[pattern=dots](0,0) rectangle (1,.2);     \draw (0.5,.3) node[above]{0};     \draw[fill=black](1,0) rectangle (2,.2);     \draw[pattern=dots](2,0) rectangle (3,.2);     \draw (2.5,.2) node[above] {2};     \draw[fill=black] (3,0) rectangle (6,.2);     \draw[pattern=dots](6,0) rectangle (7,.2);     \draw (6.5,.2) node[above] {0};     \draw[fill=black](7,0) rectangle (8,.2);     \draw[pattern=dots](8,0) rectangle (9,.2);     \draw (8.5,.2) node[above] {2};     \draw[pattern=dots](0,-1) rectangle (0.3,-1.2);     \draw (0.15,-1) node[above] {0};     \draw[fill=black](0.3,-1) rectangle (0.65,-1.2);     \draw[pattern=dots](0.65,-1) rectangle (1,-1.2);     \draw (.75,-1) node[above] {2};     \draw[fill=black](1,-1) rectangle (2,-1.2);     \draw[pattern=dots](2,-1) rectangle (2.3,-1.2);     \draw (2.15,-1) node[above] {0};     \draw[fill=black](2.3,-1) rectangle (2.65,-1.2);     \draw[pattern=dots](2.65,-1) rectangle (3,-1.2);     \draw (2.75,-1) node[above] {2};     \draw[fill=black] (3,-1) rectangle (6,-1.2);     \draw[pattern=dots](6,-1) rectangle (6.3,-1.2);     \draw (6.15,-1) node[above] {0};     \draw[fill=black](6.3,-1) rectangle (6.65,-1.2);     \draw[pattern=dots](6.65,-1) rectangle (7,-1.2);     \draw (6.85,-1) node[above] {2};     \draw[fill=black](7,-1) rectangle (8,-1.2);     \draw[pattern=dots](8,-1) rectangle (8.3,-1.2);     \draw (8.15,-1) node[above] {0};     \draw[fill=black](8.3,-1) rectangle (8.65,-1.2);     \draw[pattern=dots](8.65,-1) rectangle (9,-1.2);     \draw (8.85,-1) node[above] {2};     \draw (4,-2) node { Points of the Cantor Set pass through sieves};     \end{tikzpicture}\end{center}\end{document}


title: Is there a preference of when to use \text and \mathrm?

text: I'm unsure of when it is preferable to use `\text` versus `\mathrm`, is there some unwritten rule about the use of these? For example, I saw the following code in a math post:               \frac{\mathrm{lcm}(m,n)}{\mathrm{gcd}(m,n)}\quad\text{divides}\quad      \frac{\mathrm{lcm}(m,n)}{|\langle x\rangle\cap\langle y\rangle|}\quad     \text{divides}\quad \mathrm{ord}(ab)\quad\text{divides}\quad     \mathrm{lcm}(m,n).      and there is a mix of both. Is there a general reason why the author would choose to do so?


title: change page which is created for `\part`

text: Is there a way to change the style of the heading etc. for `\part`? I want to change the layout to leave out "Part 1." and instead just print out the part's name. Actually I could change the question a bit: I want instead of "Part 1. Title of part" to have there "semester 1" and in the TOC it should say semester 1 as well instead of "I semester 1"


title: Angle between external legs in one loop

text: ![enter image description here](http://i.stack.imgur.com/ZTPr6.png) I need to draw the following diagram, but I do not know how to change the angle between the external gluons and also the lengths of them, does anybody know?               \documentclass{article}     \usepackage{feynmp}     \DeclareGraphicsRule{*}{mps}{*}{}     \begin{document}     \begin{figure}[h]      \begin{fmffile}{fig}      \begin{fmfgraph*}(60,50)      \fmfleft{i1,i2} \fmfright{o}      \fmf{curly,tension=1/3}{i1,v1}      \fmflabel{$k_2,a_2,\mu_2$}{i1}      \fmf{curly,tension=1/3}{i2,v1}      \fmflabel{$k_3,a_3,\mu_3$}{i2}      \fmf{curly,tension=1/3}{v2,o}      \fmflabel{$k_1,a_1,\mu_1$}{o}      \fmf{curly,left,tension=1/10}{v1,v2,v1}     \end{fmfgraph*}     \end{fmffile}      \end{figure}     \end{document}


title: Bold the last name of the first author in a biblatex bibliography

text: I am new here, so please bear with me. I would like to make the **last name** of the **first author only** in the bibliography boldface, i.e., in the MWE I want "Fox" in the bibliography only (not the citation) to be bold. MWE:               \documentclass[a4paper,twoside,hidelinks]{article}     \usepackage[backend=biber,             natbib=true,             uniquename=false,             uniquelist=false,             firstinits=true,             style=authoryear,             sorting=nyt,             maxcitenames=2,             minbibnames=1,             maxbibnames=100,             block=none]{biblatex}          \bibliography{sample.bib}     \begin{document}        Here is some sample text \parencite{Fox2011}.     \printbibliography     \end{document}          \RequirePackage{filecontents}     \begin{filecontents}{sample.bib}        @ARTICLE{Fox2011,        author = {Peter Fox and Richard Rabbit and Franc Bird},           title = {Animals are the better humans},           journal = {Horse and Hound},           year = {2011},           volume = {10},           pages = {11--15}     }     \end{filecontents}


title: How to vertically align headers/footers in fancyhdr package?

text: I'm using `fancyhdr`package for headings and footers. I have defined left- header as a big image, and I want to vertically align (to the top or to the center, the default is to the bottom) the text from the right-header. How can I do that?               \usepackage{fancyhdr}     \pagestyle{fancy}          \lhead{\includegraphics[height=21mm]{some_fancy_logo.pdf}}     \chead{}     \rhead{I want to vertically align THIS text}


title: PS-or-PDF to tikz converter?

text: It is often the case that a postscript or PDF image used in a math paper consists mainly of a few lines and bezier curves. If there were an easy way to extract this information and convert it into tikz \draw commands, one could conveniently replace existing included graphics with tikz pictures. Does anyone know of a conversion program which does this? It would _not_ need to be a completely general solution -- if it extracted a majority of the useful information (lines, curves, labels(?), ...) from a majority of the files it was presented with, that would be quite useful. * * * ADDED: One of the commenters asked what the output of eps2pgf looks like. Here's a sample:               % Created by Eps2pgf 0.7.0 (build on 2008-08-24) on Sat Aug 28 14:14:16 PDT 2010     \begin{pgfpicture}     \pgfpathmoveto{\pgfqpoint{0cm}{0cm}}     \pgfpathlineto{\pgfqpoint{5.186cm}{0cm}}     \pgfpathlineto{\pgfqpoint{5.186cm}{4.092cm}}     \pgfpathlineto{\pgfqpoint{0cm}{4.092cm}}     \pgfpathclose     \pgfusepath{clip}     \begin{pgfscope}     \pgfpathmoveto{\pgfqpoint{0cm}{4.092cm}}     \pgfpathlineto{\pgfqpoint{0cm}{0cm}}     \pgfpathlineto{\pgfqpoint{5.186cm}{0cm}}     \pgfpathlineto{\pgfqpoint{5.186cm}{4.092cm}}     \pgfpathclose     \pgfusepath{clip}     \begin{pgfscope}     \begin{pgfscope}     \pgfsetdash{}{0cm}     \pgfsetlinewidth{0.317mm}     \definecolor{eps2pgf_color}{rgb}{0,0,0}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color}     \pgfpathmoveto{\pgfqpoint{0.044cm}{2.586cm}}     \pgfpathcurveto{\pgfqpoint{0.789cm}{2.747cm}}{\pgfqpoint{1.394cm}{3.29cm}}{\pgfqpoint{1.633cm}{4.014cm}}     \pgfusepath{stroke}     \end{pgfscope}     \begin{pgfscope}     \pgfsetdash{}{0cm}     \pgfsetlinewidth{0.317mm}     \definecolor{eps2pgf_color}{rgb}{0,0,0}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color}     \pgfpathmoveto{\pgfqpoint{3.538cm}{4.014cm}}     \pgfpathcurveto{\pgfqpoint{3.629cm}{3.205cm}}{\pgfqpoint{4.31cm}{2.592cm}}{\pgfqpoint{5.125cm}{2.586cm}}     \pgfusepath{stroke}     \end{pgfscope}     \begin{pgfscope}     \pgfsetdash{}{0cm}     \pgfsetlinewidth{0.317mm}     \definecolor{eps2pgf_color}{rgb}{0,0,0}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color}     \pgfpathmoveto{\pgfqpoint{0.046cm}{4.015cm}}     \pgfpathlineto{\pgfqpoint{5.126cm}{4.015cm}}     \pgfpathlineto{\pgfqpoint{5.126cm}{0.046cm}}     \pgfpathlineto{\pgfqpoint{0.046cm}{0.046cm}}     \pgfpathclose     \pgfusepath{stroke}     \end{pgfscope}     \begin{pgfscope}     \pgfsetdash{}{0cm}     \pgfsetlinewidth{0.317mm}     \definecolor{eps2pgf_color}{rgb}{0,0,0}\pgfsetstrokecolor{eps2pgf_color}\pgfsetfillcolor{eps2pgf_color}     \pgfpathmoveto{\pgfqpoint{0.046cm}{1.316cm}}     \pgfpathlineto{\pgfqpoint{5.126cm}{1.316cm}}     \pgfusepath{stroke}     \end{pgfscope}     \end{pgfscope}     \end{pgfscope}     \end{pgfpicture}


title: Error: Unicode char \u8 when importing bibliography

text: I have a LaTeX document in which I improt .bib database               \bibliography{LagrangianRelax}     \bibliographystyle{alpha}      I am getting an error (I know its quite common): `! Package inputenc Error: Unicode char \u8:�d� not set up for use with LaTeX.` when making a citation. I dont know why - my editor is set to UTF8, JabRef (in which I create the .bib database) is set to UTF and I use `\usepackage[utf8]{inputenc}` Any ideas how to solve this? Thanks for any tips...


title: IEEEtran command list along with example?

text: I am new to Latex and have started to write a paper in `IEEEtran` format. But i don't know which command to be used for which purpose. So, anybody could suggest me a link where i can get a complete example (about including images, references etc.) I have read this **link** which is quite good but it doesn't give a working example. My main confusions are about including images/figures and references. **What i need:** It would be so helpful if i could get the source code of the link mentioned above (i mean something similar) so that i can understand the role of each command and the proper way to use it.


title: Does a System.Drawing to TikZ solution exist?

text: Not sure if this belongs to here or to a .NET forum. Does anybody know of an implementation to reuse .NET coded drawings with TikZ? Or any ideas, how to do that? I just want to know, if it would be easy or doesn't worth the work. To give an example: Drawings in C# are done like this:               static Pen black = new Pen(Color.FromArgb(50, 0, 0, 0), 1);      gives us the line. The color and a thickness `1`.               SmoothingMode saveMode = SmoothingMode.AntiAlias;      some sample properties which can be ignored for the beginning.               int aVariable = 20;         Point startPos = new Point(0, 142);         Point curvePos = new Point(43, 134);         Point endPos = new Point(72, 116);         for (int y = 0; y <= aVariable; y++)         {             g.DrawCurve(black, new Point[] { startPos, curvePos, endPos });             startPos.Y = startPos.Y + 4;             curvePos.Y = curvePos.Y + 4;             endPos.Y = endPos.Y + 4;         }      or               Color color1 = Color.FromArgb(80, 132, 178, 223);     Color color2 = Color.FromArgb(132, 178, 223);     g.FillRectangle(new LinearGradientBrush(new Point(124, 19), new Point(124, 25), color1, color2), new Rectangle(124, 19, 29, 6));      demonstrate some drawings. I think, there are a lot of parallels to TikZ as everything is defined by coordinates, lines, curves or rectangles. So any idea about how to reuse this code is welcome.


title: short line in top right article titlepage using \maketitle

text: is it possible to have something like               \rightline{some short text}     \vspace{0.2cm}     \maketitle      without causing \maketitle to start a newpage, i.e. to have a short text placed top right on the title page, using standard article in latex?


title: Controlling the rotation direction of the sideways figure environment

text: > **Possible Duplicate:**   >  Inconsistent rotations with \sidewaysfigure Using the sideways figure environment how can one control whether the rotation is clockwise or counter-clockwise? I understand the default is clockwise on pages left of spine and counter- clockwise on pages right of spine, (so the caption is always facing out from the spine), This is logical for pictures / images, however, when plots are involved (with axes and labels), this can result in upside-down y-axis labels when the document is held in the natural position, as in the below sample, showing upside down Y-Axis Label. ![Output](http://i.stack.imgur.com/jaJyr.png) I personally think it is better to have the SAME rotation on every page, anyone with a different opinion?


title: TikZ: Defining and reusing complex objects?

text: (How) Is it possible to save some complex `TikZ` objects for reusing them (in the same and in different pictures)? I know it's possible to define own styles, but I'm not sure if it's the right thing I'm looking for (styles seems to be only for properties not for complex and done objects). And that it's possible to save whole images with `savebox`, but can it be used to save portions of pictures? Let's make an example: Someone's building several optical experiments. All experiments use the same kind of elements, like mirrors, lasers, polarizers, beam splitters and so on, but each experiment is in another configuration and setup. Each element has it's own picture (just like in electrical circuits where each type of element has it's own "icon"). How and where do I define my "kinds of elements" to be able to reuse them in my lots of TikZ pictures? In the end I want ideally be able to draw my pictures similar (not neccerssarily exact) like               \begin{tikzpicture}       \mirror at (0,0);       \laser at (1,0);       \draw (1,0) --(0,0) --(0,1);     \end{tikzpicture}


title: (ConTeXt MkIV) Text in PiechartMP

text: So I need to include some pie charts in my document. As I'm using Metapost for all graphics I tried using the `PiechartMP` Metapost package. But for some strange reason no text shows up, just a very tiny square. The minimal example:               \startMPinitializations     input piechartmp ;     \stopMPinitializations          \startreusableMPgraphic{pie}     u := 5mm;     r := 3u;     SetupPercent(this, "x") ;          Segment(32.5,"first",auto);     Segment(12.8,"second",auto);     Segment(22.4,"third",auto);     Segment(18.2,"fourth",auto);          beginfig(1);     PieChart(r, 0, 0, 0, 0);     SetupValue("{\tfd ", "}");     label (btex textext(Text) etex,origin);     endfig;     \stopreusableMPgraphic          \starttext     \reuseMPgraphic{pie}     \stoptext      I've tried with `TEX` (loading the Metapost `TEX` module), with `\sometxt` and `textext` commands without success. Setting a bigger or different font in Metapost just makes that square bigger, but it shows no text. Am I doing something wrong? Thanks in advance for your help.


title: Control line spacing of section headings

text: I use macro and `titlesec` package to create custom `\section` heading.               \documentclass[final]{book}     \usepackage{lipsum}     \usepackage{titlesec}          \titlespacing*{\section}{0pt}{1em}{0.3em}          \def \mysection#1{     \section*{\large{#1}}     }          \begin{document}          \mysection{Lorem ipsum dolor sit amet, consectetur adipisicing elit doloribus odio aliquid aut.}          \lipsum[2]          \mysection{Another section heading with very long text within it that wraps to second line}          \lipsum[3]          \end{document}      which produces ![custom section heading](http://i.stack.imgur.com/5sxyg.png) I want to be able to decrease or increase line spacing between lines of that `\section` heading. I have tried to do so, by changing `\mysection` macro to:               \def \mysection#1{     \section*{\baselineskip=2pt \large{#1}}     }      but it doesn't have any effect. (Note that I set `\baselineskip` to `2pt` only to spot it for sure when change happens, not because it is my target line spacing). I have also tried to change it to:               \def \mysection#1{     \section*{\linespread{0.1} \large{#1}}     }      which seems to have slight effect on line spacing, but produces nasty indent out of nowhere: ![custom section heading with indent](http://i.stack.imgur.com/mcbat.png) I have also tried using `setspace` package with its command `\singlespacing`:               \documentclass[final]{book}     \usepackage{lipsum}     \usepackage{titlesec}     \usepackage{setspace}          \titlespacing*{\section}{0pt}{1em}{0.3em}          \def \mysection#1{     \section*{\singlespacing \large{#1}}     }          \begin{document}          \mysection{Lorem ipsum dolor sit amet, consectetur adipisicing elit doloribus odio aliquid aut.}          \lipsum[2]          \mysection{Another section heading with very long text within it that wraps to second line}          \lipsum[3]          \end{document}      which decreases line spacing, but adds unexpected white space above `\section` headings: ![enter image description here](http://i.stack.imgur.com/AlvzJ.png) **Is there any reliable way to modify line spacing of`\section` headings?** I thought that `titlesec` should be able to do it, but I haven't found a clue how to do it in its documentation.


title: Cursor on build error and temp build directory with TexStudio

text: ## Cursor position on build error I am using TexStudio with Beamer and TikZ graphic. In general it does a good job to sync TeX and PDF. Anyway, when there is a build error, it tries to move the cursor to the point, but it only seems to go to the end of the guilty slide. For a general lecture build, going here seems enough. BTW, say I am playing with a complex TikZ figure, I do many intermediate builds just to check if I am mistyping something. If this happens, the fact that the cursor slides away every time there is an error results in a loss of productivity. So I'd like the cursor to remain where it is in case of build errors. How can I do this? ## Temporary build directory As many others, to reduce the clutter I set this temporary directory. I set the PdfLaTex command as:               pdflatex -synctex=1 -interaction=nonstopmode -output-directory temp-dir %.tex      and, checking `Additional search path` in the build dialog, I set both `Log File` and `PDF Viewer` to `temp-dir`. Everything is apparently fine, but by chance I noticed that, if, in the root of the TeX file I am going to compile, there is a PDF file with the same basename, then the internal viewer uses this one, despite temp-dir\%.pdf is properly built. This is not a great annoyance, but I wonder if I set up properly the temporary build directory. Could it be that TeXStudio searches in the TeX root directory first and on a "second thought" in the temp-dir? If this were the case, I suspect that this could slow down the compilation. There is not much documentation concerning temporary build directories, so I am seeking for your help.


I'm using TeXworks v. 0.4.3 r.857 (with MiKTex 2.9 64-bit). I am also using gvim on Windows to edit the source. Hence, I use the TeXworks source window only to ensure that the compiling is proceeding in a sane manner. When I'm editing in gvim, I frequently save the *.tex file, which causes the TeXworks source window to pop to the front. This is extremely annoying as it obscures the preview window. I look at the preview window contents while editing the source in gvim. I tried dragging the TeXworks source window out of the way, but it always goes back to its home position when it pops to the front. I know that I can change the home position by saving the document in TeXworks and exiting, but sometimes I _do_ want the TeXworks source window to be not tucked away mostly off-screen. What I really wish is for the TeXworks source window to simply comply with my wishes and stay put wherever I position it, even if it must come the front. Is this possible in TeXworks? This query has been posted at: http://latex-community.org/forum/viewtopic.php?f=56&t=25014 TeXworks: Moving source window and having it stay put


title: Customize appearence of citation of a specific bibliographic entry when using the alpha bibliography style

text: I use bibtex with `\bibliographystyle{alpha}` It works fine. My issue is with the following item.               @book{sga1,            key = {{SGA1}},          TITLE = {Rev\^etements \'etales et groupe fondamental},          NOTE = {S{\'e}minaire de G{\'e}om{\'e}trie Alg{\'e}brique du Bois               Marie 1960--1961 (SGA 1),               Dirig{\'e} par Alexandre Grothendieck. Augment{\'e} de deux               expos{\'e}s de M. Raynaud,               Lecture Notes in Mathematics, Vol. 224},          PUBLISHER = {Springer-Verlag},          ADDRESS = {Berlin},          YEAR = {1971},          PAGES = {xxii+447},      }      The tradition is to call this book SGA1. But in the text, it appears as SGA71, which is logical, but ugly. Is there a way to customize this specific item so that it appears as SGA1 in the text, without modifying its year?


title: order the list of reference by lead author(ignore others), then publish year

text: How to edit the .bst file to order reference by only lead author then publishing year. Most of refercence style order all the authors first. I try to edit the FUNCTION {sort.format.names} in .bst file, but not familiar with the syntax.


title: Project management tables (with cost "spread sheets") using spreadtab

text: I'm trying to create a simple project management table detailing costs per task and milestone, using spreadtab: ![enter image description here](http://i.stack.imgur.com/QVxll.png) The code for the latter is:               \begin{spreadtab}{{tabularx}{\textwidth}{lXllr}}     \toprule     @ \textbf{Task} & @ \textbf{Description} & @\textbf{Duration} & @\textbf{Hours} & @\textbf{Cost} \\     \midrule     @ 1         & @ \textbf{Foobar development} &  @ 4 weeks                    & 200 & \\     @ 1a        &   @ Doing this and that                   & 1         &  [-1,0]*35 & [-1,0]*200 \\     @ 1b        &   @ Reading papers                        & 2         &  [-1,0]*35 & [-1,0]*200 \\     @ 1c        &   @ Writing documents                     & 1         &  [-1,0]*35 & [-1,0]*200 \\     @ 2         &   @ \textbf{Acme development}     & @ 4 weeks     & 200  & \\     @ 2a        &   @ Writing Acme                                  & 2     &  [-1,0]*35 & [-1,0]*200 \\     \cmidrule[\heavyrulewidth]{1-2}     @ \multicolumn{2}{r}{\textbf{Total}} & sum(c2:[0,-1]) & sum(d2:[0,-1]) & sum(e2:[0,-1]) \\     \end{spreadtab}      At the moment, I'm trying to figure out the best method to:   * Make task input easier, avoiding code duplication for each row.   * Automatically generate totals for the milestone row, from its subtasks.   * Allow per-document or per-table settings for the hourly rates and hours-per-week.   * Automatically formatting milestone descriptions to be bold.   * Bonus: use fractions when the amount of weeks has non-zero decimals. Any help is appreciated :)


title: 2 column layout without using tabular

text: I'd like to write a 2 column layout page: one column at the left that should show the year, and one column at the right that should show text that goes along the year.               \documentclass[12pt]{article}     \begin{document}     \begin{table}[ht]       \begin{tabular}{l|c}     2012&Some text\vspace{5pt}\\     2011&Some other text\\       \end{tabular}     \end{table}     \end{document}      Now: I would like to avoid using `\begin{tabular}` .   * `\begin{tabular}` will not split across multiple pages   * footnotes are too tricky. My question: Is the a simple way to get this kind of 2 column layout without using `\begin{tabular}` ?


title: How to make a switch for print vs. display versions of a document with respect to links/URLs

text: I want the print version of a document have links or URLs written out but the online version have the abbreviated tag/name. So the switch, set at the beginning, will choose between two alternatives, e.g.                   \url{http://tex.stackexchange.com/questions/ask}         \href{http://tex.stackexchange.com/questions/ask}{Questions}


title: Tab limited exceeded? ‘Undefined tab position’

text: I'm using latex to do syntactical analysis, using the following specifications:                For super-script \tss{super-script}     \newcommand*{\tss}[1]{\textsuperscript{#1}}     \newcommand\tabspace{1cm}           % Adjust tab length here     \newcommand\mytabs{\hspace{\tabspace}\=\hspace{\tabspace}\=\hspace{\tabspace}\=\hspace{\tabspace}\=\hspace{\tabspace}\=}              \newenvironment{syntax}[1][\mytabs] % The syntax environment, used for syntactical analyses       {\begin{tabbing}#1\kill}       {\end{tabbing}}     \newcommand{\tab}[2][\>]{#1 #2}     % Tab command, used in syntactical analyses      Currently, I can make five times `\tab`. My question is how I can change the number of possible `\tab`(s), so at to make it larger.


title: Placing equation number on left with reqno option in amsart document class

text: Is there a way to force individual equations to place their equation numbers (or more specifically the result of a `\tag*{blah}`) on a specific side of the page regardless of the options to amsart. I sometimes wish to use the equation enviornment to define 'requirements' in my papers which should look like: R_e: equation stuff Where R_e is the equation tag. R_e should be on the left even when reqno is passed to the documentclass. How can I accomplish this?


title: In Auctex, bibtex cannot create reference

text: Everything goes well in TeXshop. In Emacs, I went through following steps:   1. `C-c C-c latex`   2. `C-c C-c bibtex`   3. `C-c C-c latex`   4. `C-c C-c latex` but it keeps saying insolvable reference. Log file says: `Package natbib Warning: There were undefined citations.`


title: Changing latex font in pdflatex

text: I have just started to use LaTeX (TeXworks, pdfLatex) and I´m using Windows 7. How can I change font to Garamond with math support? I found this from LaTeX font catalogue but it doesn't work:               \documentclass[danish,a4paper,11pt]{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage{babel}     \usepackage{slantsc}     \usepackage{array}     \usepackage{amsmath}     \setkomafont{subsection}{\usefont{T1}{fvm}{m}{n}}     \setkomafont{section}{\usefont{T1}{fvs}{b}{n}\Large}     \setcounter{secnumdepth}{0}     \pagestyle{empty}     \usepackage[urw-garamond]{mathdesign}     \usepackage[T1]{fontenc}          \begin{document}     \section*{Garamond}     \subsection*{\textbackslash normalfont}     \normalfont\normalfont     \input catalogue     \subsection*{\textbackslash itshape}     \normalfont\itshape     \input catalogue     \newpage     \normalfont\normalfont     \input fonttable     \section{Math}     \normalfont     \[     \mathbf{B}(P)=\frac{\mu_0}{4\pi}\int\frac{\mathbf{I}\times\hat{r}'}{r'^2}dl = \frac{\mu_0}{4\pi}\,I\!\int\frac{d\boldsymbol{l}\times\hat{r}'}{r'^2}     \]      It gives following errors:               garamond(1).tex     18     I can't find file `catalogue'.     l.18 \input catalogue          garamond(1).tex     15     LaTeX Font Warning: Font shape `T1/cmss/mb/n' undefined using `T1/cmss/m/n' instead on input line 15.      When I delete lines containing input, it gives following error:               garamond(1).tex     15     LaTeX Font Warning: Font shape `T1/cmss/mb/n' undefined using `T1/cmss/m/n' instead on input line 15.          garamond(1).tex     26     LaTeX Font Warning: Font shape `OT1/mdugm/b/n' undefined using `OT1/mdugm/m/n' instead on input line 26.          garamond(1).tex     26     LaTeX Font Warning: Font shape `OML/mdugm/b/it' undefined using `OML/mdugm/m/it' instead on input line 26.          garamond(1).tex     26     LaTeX Font Warning: Font shape `OMS/mdugm/b/n' undefined using `OMS/mdugm/m/n' instead on input line 26.          garamond(1).tex     26     LaTeX Font Warning: Font shape `OMX/mdugm/b/n' undefined using `OMX/mdugm/m/n' instead on input line 26.          garamond(1).tex     26     LaTeX Font Warning: Font shape `OML/mdugm/b/n' undefined using `OML/mdugm/b/it' instead on input line 26.          garamond(1).tex     26     LaTeX Font Warning: Font shape `MDA/mdugm/b/n' undefined using `MDA/mdugm/m/n' instead on input line 26.          garamond(1).tex     26     LaTeX Font Warning: Font shape `MDB/mdugm/b/n' undefined using `MDB/mdugm/m/n' instead on input line 26.          garamond(1).tex          LaTeX Font Warning: Some font shapes were not available, defaults substituted.


title: fontspec setmainfont working

text: Here is a minimal problem example               \ProvidesClass{cvMinimal}[2012/04/30 CV class]     \NeedsTeXFormat{LaTeX2e}          \LoadClass{article}               %%%%%%%%%%     % Colors %     %%%%%%%%%%          \RequirePackage{xcolor}     \definecolor{green}{HTML}{C2E15F}     \definecolor{gray}{HTML}{4D4D4D}          %%%%%%%%%     % Fonts %     %%%%%%%%%          \RequirePackage{fontspec}     \defaultfontfeatures{Mapping=tex-text}     \setmainfont[Mapping=tex-text, Color=gray]{Helvetica Neue Light}          %%%%%%%%%%     % Header %     %%%%%%%%%%          \RequirePackage{tikz}         \usetikzlibrary{positioning}          \newcommand{\header}[0]{%         \begin{tikzpicture}[remember picture, overlay]             \node[](name){\fontsize{24pt}{72pt}\selectfont\color{green}{My Name}};  %         \end{tikzpicture}           }      produces a gray "My name" wheras I would expect to produce a green one. Commenting the line setmainfont solves the problem. Can someone explain me what do I do wrong ? And how to get what I want without commenting the setmainfontline which is important in the rest of my document? I know it is possible since it is achieved in the cv here.


title: \fancypagestyle does not affect the first page of the chapter. Why? How to modify that?

text: \fancypagestyle{myfancy}{     \fancyhf{}     \fancyhead[LE,RO]{\slshape\nouppercase{\leftmark}}     \fancyfoot[LE,RO]{\tikz[baseline={(0,0)},anchor=center] \node[label={center:\thepage}]{\includegraphics[scale=.25]{apple}};}%     \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\footrulewidth}{0.4pt}     }      The above code generates the following output for chapters and sections (if needed): First is header and second is footer ![header](http://i.stack.imgur.com/EOlYK.png) ![footer](http://i.stack.imgur.com/s3IkB.png) However, when initializing a new chapter, these setting don't appear. I don't want the header to appear but the footer is compulsory. How do I add the footer when starting a new chapter as shown?


title: How can I draw this diagram of my function's domain?

text: How can I do this? ![enter image description here](http://i.stack.imgur.com/faw4R.png) I do not know how to do this. Is it possible to do it in LaTeX or should I create a figure with GeoGebra and insert it?


title: Figure in a letter

text: Is there any way to include a figure in a letter `\documentclass{letter}`? I am trying to include a signature eps:               \begin{figure}[!ht]     \includegraphics[width=4 cm]{Signature.eps}     \end{figure}       I went through another thread . But there is no quick and clear answer to this there.


title: How to remove the space between "pp." and the page numbers

text: I'm trying to create a preamble that matches the "interesting" form of Harvard that my University insists on using. I'm almost there but need a method to remove the space between pp. and the page numbers. In my Harvard guide it must be `pp.66-67` instead of `pp. 66-67` Please help! Code I have so far:               \documentclass[12pt]{report}          \usepackage[     firstinits=true,     useprefix=true,     maxcitenames=3,     maxbibnames=99,     style=authoryear,     dashed=false,      natbib=true,     isbn=false,     url=false     ]{biblatex}          \usepackage{csquotes}          \renewbibmacro*{name:andothers}{       \ifboolexpr{         test {\ifnumequal{\value{listcount}}{\value{liststop}}}         and         test \ifmorenames       }         {\ifnumgreater{\value{liststop}}{1}            {\finalandcomma}            {}%          \andothersdelim\bibstring[\emph]{andothers}}         {}}          \renewcommand*{\bibinitdelim}{}     \usepackage{xpatch}     \xapptobibmacro{date+extrayear}{\nopunct}{}{}     \usepackage[british]{babel}     \usepackage{csquotes}          \DeclareNameAlias{author}{last-first}     \renewcommand*{\bibnamedelimd}{\addlpthinspace}      \renewcommand*{\nameyeardelim}{\addcomma\addspace}      \setlength\bibitemsep{1.5\itemsep}      \renewbibmacro{in:}{}          \renewbibmacro*{volume+number+eid}{       \setunit*{\addcomma\space}         \printfield{volume}         \setunit*{\addnbspace}         \printfield{number}         \setunit{\addcomma\space}         \printfield{eid}}     \DeclareFieldFormat[article]{number}{\mkbibparens{#1}}               \addbibresource{references.bib}     \AtEveryBibitem{\clearlist{language}} % clears language     \AtEveryBibitem{\clearfield{note}}    % clears notes               \begin{document}          \printbibliography[title=References]          \end{document}


title: Write something below ampersand sign

text: I need to write something below and top of ampersand sign. I want it to be like `\sum`. I have tried               \&_{i = 0}^{n}      but it shows `i=0` in the index but not below ampersand sign.


title: How to anchor labels in tikz for baseline alignment

text: LaTeX handles subscripts and superscripts nicely, automatically correcting for various sizing and placement issues. I am trying to build a function that works like subscripts and superscripts, but the smaller sized items are placed directly above/below/left/right of the main symbol, rather than upright/downright/upleft/downleft. If such a command already exists, or you have suggestions for how to build one, I'd certainly appreciate a pointer or ideas. In the meantime, I have tried many things (for instance `\array` gymnastics), all of which have problems. At present I am considering a TikZ-based method, as follows.               \newcommand{\putaround}[5]{     \begin{tikzpicture}[inner sep=0ex]     \node [label={[label distance=.1ex]below:$\scriptscriptstyle #2$},      label={[label distance=-.15ex]left:$\scriptscriptstyle #3$},      label={[label distance=.1ex]above:$\scriptscriptstyle #4$},      label={[label distance=-.15ex]right:$\scriptscriptstyle #5$}]     {$#1$}; %[minimum height=1ex,minimum width=1ex] {$\mathfrak A$};     \end{tikzpicture}     }          \[     \putaround{\mathrm H}{n}{m}{p}{q}     \]      ![enter image description here](http://i.stack.imgur.com/kajDh.png) The first of many issues with this is that the baselines of the left and right entries are off (a situation made especially vivid if you replace the `m` by an `m'`). I tried to adjust the label anchoring by adding `anchor=mid` various places to no avail. My question then is, is there a way to anchor labels in a way that will correct this baseline/alignment issue?


title: Sketching conic sections as intersections of cone and plane?

text: I would have thought this would be trivial, but I still haven't found an easy method. All I want to do is draw a cone, a plane, and their intersection (which will be a conic section). Something similar to, for example: http://mathworld.wolfram.com/ConicSection.html or the picture here: http://www.ck12.org/book/CK-12-Algebra-II-with-Trigonometry- Concepts/section/10.0/ The same sort of standard pictures we've all seen a million times before. I don't mind if I use a LaTeX drawing package, or something else, but I want to do it myself, so I can play around with the cone and plane to get the best possible diagram. I've tried a few online things such as 3dtin and shapesmith, but they're a bit flaky. It would be nice to use a vector drawing package and then export the result into LaTeX, but at this stage I'll settle for an image. It can also be a black and white wire diagram rather than a surface plot. Has anybody created something like this before?


title: Set picture size to size of a given box

text: I would like to use the picture mode in latex, but need to set the size of the drawing region to the size of some other box. I would normally do               \begin{picture}(max_hor, max_ver)(ll_hor, ll_ver)       ...       \end{picture}        and I want max_hor, max_ver to be computed from the dimensions of a given box.


title: How to set what appears as a title in a document viewer menu bar?

text: This is a tricky question. Say I generate an image in gnuplot using the pslatex terminal:               gnuplot<plot.plt     latex dummy.tex     dvips -E -oimage.eps dummy      where 'plot.plt' contains:               set term pslatex     set output "graph.tex"     plot "..."      and where 'dummy.tex' reads:               \documentclass{article}     \pagestyle{empty}     \begin{document}     \input graph.tex     \end{document}      I then include this 'image.eps' file in a 'main.tex' document and compile it:               latex main     dvips main -o     ps2pdf main.ps      This generates a 'main.pdf' file. I find it quite strange but I have noticed that when I open 'main.pdf', the document title which will appear in the menu bar of the document viewer I use (evince) will be 'graph.tex' rather than 'main.pdf'. If I modify the .eps file with a text editor (say, vim), and replace the text 'graph.tex' by something else in the .eps file, then compile the latex file, this will change what appears in the menu bar when I open my 'main.pdf' file. Here, I would like to know if there is also a way to change the document title which appears in this menu bar using latex, when I do not have figures. Supposedly there should be I believe. How can I do that? Thank you in advance for your help.


title: multibib - hyperref doesn't work for my second bibliography

text: I am using the `multibib` and `hyperref` packages.   I would like to create clickable citations for my bibliographies.   It works for the first one (biblio.bib) but not the second one (awebsite.bib) Here is my minimal working example.               \documentclass[utf8]{article}     \usepackage[english]{babel}          \usepackage{multibib}     \newcites{awebsite}{Another bibliography}          \usepackage[colorlinks=true]{hyperref}          \begin{document}     The quick brown fox \cite[p.4]{article} jumps over     \cite[p.5]{articleweb} the lazy dog \citeawebsite[p.6]{articleweb}.          \bibliographystyle{plain}     \bibliography{biblio}          \bibliographystyleawebsite{plain}     \bibliographyawebsite{awebsite}          \end{document}      The two BIB files (biblio.bib and awebsite.bib) are herebelow.               @inproceedings{article, title = "{Title}", author = "Authors", booktitle = "{BT}"}      ...               @article{articleweb, author = {A}, title = "{Title2}", year = {2013}, note = {\url{URL}}}      And there is the result (PDF)... * * * The quick brown fox [ **1** , p.4] jumps over [2, p.5] the lazy dog [2, p.6]. **References** [1] Authors. Title. In _BT_. **Another bibliography** [2] A. Title2. 2013. URL. * * * The first link to References [1] is created but not the two others. Why ? Thanks in advance for any suggestions on how to fix this.


title: Issue with table and text width

text: I ask for help since I cannot cope with an issue occurring in the compilation of my LaTeX file. I put a table in a section (documentclass `cv`), but unfortunately the table starts from the middle of the text; I would like to fit the table to the width of the page. P.S. I have already tried centering, but it does not work. If you would have some advice or tips, I would be very grateful.               \documentclass[10pt,a4paper]{cv}          \usepackage[francais]{babel}      \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{lmodern}               \Language{francais}          \definecolor{urlcolor}{rgb}{0, 0, 0.5}          \geometry{     hmargin=1cm,                 vmargin=1cm}          \begin{document}          \begin{section}{Formation}          \begin{tabular}{lll}      2013-201 & x & Master Finance d'Entreprise et Pratique des March\'{e}s Financiers \\[1mm]          2012-2014 & x & Dipl\^{o}me d'Institut d'\'{e}tudes politiques \\[1mm]          2011-2012 & x & School of Economics \& University of Edinburgh Business School \\[1mm]          2010-2012 & x & Bachelor\'{}s degree in Business Administration \\[1mm]          2008-2010 & x & Classe pr\'{e}paratoire aux grandes \'{e}coles, Kh\^{a}gne, Mention Tr\`{e}s bien \\[1mm]           2008 & x & Baccalaur\'{e}at en sciences \'{e}conomiques et sociales, Mention Bien \\[1mm]           \end{tabular}     \end{section}          \end{document}


title: Use ibidtracker with alphabetic style in biblatex

text: I would like to know if it's possible to use the `ibidtracker` option in combination with `citestyle=alphabetic` in `biblatex`. Something like this:               \usepackage[         citestyle=alphabetic,         bibstyle=authoryear,         sortcites,ibidtracker]{biblatex}     ]      is not working. Maybe, I got it all wrong...


title: Trick Supertabular into Multicols in new command

text: I'm using `supertabular` in `multicols` enviroment using this trick               \let\mcnewpage=\newpage     \makeatletter     \renewcommand\newpage{%         \if@firstcolumn             \hrule width\linewidth height0pt             \columnbreak         \else             \mcnewpage         \fi     }     \makeatother      I'd like to put that code into `\newcommand` - I've tried this:               \newcommand{\TrickSupertabularIntoMulticols}{     \let\mcnewpage=\newpage     \makeatletter     \renewcommand\newpage{%         \if@firstcolumn             \hrule width\linewidth height0pt             \columnbreak         \else             \mcnewpage         \fi     }     \makeatother     }      but when i use my `\newcommand` it doesn't work - table is in only one column. What is the right way to define this command? EDIT: examples this works fine but i generate multiple multicols in the document so I want to put that trick code into single line comand               \documentclass{article}     \usepackage{supertabular,multicol}          \newcount\n     \n=0     \def\tablebody{}     \makeatletter     \loop\ifnum\n<100             \advance\n by1             \protected@edef\tablebody{\tablebody                     \textbf{\number\n.}& shortText                     \tabularnewline             }     \repeat     \makeatother          \begin{document}     \begin{multicols*}{2}     \let\mcnewpage=\newpage     \makeatletter     \renewcommand\newpage{%             \if@firstcolumn                     \hrule width\linewidth height0pt                     \columnbreak             \else                     \mcnewpage             \fi     }     \makeatother          \begin{supertabular}{|l|l|}     \tablebody     \end{supertabular}     \end{multicols*}     \end{document}      and this doesn't work               \documentclass{article}     \usepackage{supertabular,multicol}          \newcount\n     \n=0     \def\tablebody{}     \makeatletter     \loop\ifnum\n<100             \advance\n by1             \protected@edef\tablebody{\tablebody                     \textbf{\number\n.}& shortText                     \tabularnewline             }     \repeat     \makeatother          \newcommand{\TrickSupertabularIntoMulticols}{     \let\mcnewpage=\newpage     \makeatletter     \renewcommand\newpage{%             \if@firstcolumn                     \hrule width\linewidth height0pt                     \columnbreak             \else                     \mcnewpage             \fi     }     \makeatother     }          \begin{document}     \begin{multicols*}{2}     \TrickSupertabularIntoMulticols     \begin{supertabular}{|l|l|}     \tablebody     \end{supertabular}     \end{multicols*}     \end{document}


title: Beamer handout mode: Disable collapsing for some frames

text: Some frames of my `beamer` contain not only standard `\pause` statements, but also graphics which are displayed on only a single step. As a result, when rendering in handout mode, not all content fits onto the page. So I need a way to disable handout-mode frame collapsing for certain frames. I've tried `\pause<handout:1>`, but as expected it did not work.


title: Custom prefix in footnotes with biblatex

text: I have another question about customizing footnote-citations with `biblatex`. For common citations of facts or observations from some article, I want to add a prefix to my footnotes. It's meant to distinguish non-literal literal quotes. Only for the rare cases of actually verbatim quoting someone, it is not required. 95% of my citations use the "See:"-prefix. (The "prefix" I'm referring to is not the usual name-prefix like "von", "de", "van", etc.) So, instead of > Wayne (2012), p. 123. I'd like to achieve > See: Wayne (2012), p. 123. This works already with the prenote-syntax (see the MWE), but could I also customize the `renewbibmacro` to include the prefix there? Otherwise I'd a) have to crawl through the whole document to change every citation manually and b) would have to do it again if I'd ever want to change it. For verbatim quotes I could just introduce a new command `\citelit` with `\let\citelit\cite`, I guess? Minimum working example:               \begin{filecontents}{_references.bib}     @article{wayne12a,         Author={Wayne, B.}, Title={A survey about the social inequalities in Gotham City},         Journal={International Journal of Comic Science}, Year={2012},         Volume={7}, Number={4}, Pages={35--45}}          @article{joker10b,         Author={Joker, T.}, Title={Why so serious?},         Journal={Journal of Vulgarity}, Year={2010},         Volume={38},Number={5}, Pages={103--116}}     \end{filecontents}          \documentclass[a4paper]{article}     \usepackage[utf8]{inputenc}          \usepackage[bibstyle=authoryear, citestyle=authoryear, autocite=footnote,%                 dashed=false, firstinits=true]{biblatex}     \addbibresource{_references.bib}% add bibtex-file     \let\cite\autocite% \cite -> \autocite          \renewbibmacro*{cite:labelyear+extrayear}{% Round parentheses around the year     \iffieldundef{labelyear} % Source: tex.stackexchange.com/a/30822/10434       {}       {\printtext[bibhyperref]{%        \printtext[parens]{%        \printfield{labelyear}%        \printfield{extrayear}}}}}          \begin{document}     The CEO of Wayne Enterprises praised Batman's achievements for improving the living      conditions in Gotham City.~\cite[See:][31]{wayne12a}          In a recent publication, however, The Joker described Batman as ``a little boy in a      playsuit, crying for mummy and daddy.''~\cite[109]{joker10b}     \end{document}


title: Warning for TeX main capacity exceeded when loading files with \pgfplotstableread

text: I am loading quite a few data files via `\pgfplotstableread`, but do not further use them via `pgfplots`. I just kept them in the preamble and switched to plotting them in a standalone document. But now I've run my main document again, I've got:               PGFPlots: reading {xxxxxxxxx/xxxxxxxxx/xxxxxxxxx.csv}     PGFPlots: reading {xxxxxxxxx/xxxxxxxxx/xxxxxxxxx.csv}          Runaway definition?     ->     ! TeX capacity exceeded, sorry [main memory size=5000000].     \pgfplotsapplistXpushback@smallbufoverfl ...@toka                                                        \the \t@pgfplots@tokb }\ex...     l.87 ...sv}{\xxxxxxxxxWordWordWordxxxxxxxx}                                                       ^^M          If you really absolutely need more capacity,     you can ask a wizard to enlarge me.      Kind of looks like I forgot to close some bracket somewhere. However on first check that does not seem to be the case. Is the loading of the data files already too much and should I outsource that?


title: Align a wall of equations

text: I have a wall of equations in the format: y = x^2 = 9 So basically, it's the variable part, the equation part and the answer part. I want these to be in three columns that are all aligned. So my wall of equations looks like this:               Using this formula $C_{in} = \frac{C_{out}g_i}{\hat{f}}$     \[ C_{in-nand3} = \frac{30 * 1.21739}{3.3098} = 11.0344 \rightarrow \frac{11.0344}{2.75} = 4.0125  \]     \[ C_{in-nand2} = \frac{6.153 * 1.21739}{3.3098} = 2.263 \rightarrow \frac{2.263}{2.75} = .8229  \]     \[ C_{in-nand1} = \frac{5.514 * 1.21739}{3.3098} = 2.0279 \rightarrow \frac{2.0279}{2.75} = .7374  \]      There's more but you get the idea. I looked at other posts that suggested I put a               \begin{align}     \end{align}       Around the whole thing, I did that but when I tried to compile in TexStudio it spat out this list of errors: ![enter image description here](http://i.stack.imgur.com/rl6iV.jpg) I have no idea what it is asking about. Does anyone know how I can achieve the alignment that I want?


title: ConTeXt: Font change shifts column content

text: # Background I would like to place balanced itemized lists inside a two-column layout. # Problem Changing the font affects the balanced layout; the fonts are:   * Chivo   * Gentium Basic # Code The following code demonstrates the issue:               \starttypescript [sans] [TestSans]       \definefontsynonym [Sans]           [name:chivoregular]       \definefontsynonym [SansBold]       [name:chivoblack]       \definefontsynonym [SansItalic]     [name:chivoitalic]       \definefontsynonym [SansBoldItalic] [name:chivoblackitalic]     \stoptypescript          \starttypescript [serif] [TestSerif]       \definefontsynonym [Serif]           [name:gentiumbasic]       \definefontsynonym [SerifBold]       [name:gentiumbasicbold]       \definefontsynonym [SerifItalic]     [name:gentiumbasicitalic]       \definefontsynonym [SerifBoldItalic] [name:gentiumbasicbolditalic]     \stoptypescript          \definetypeface [TestFont] [rm] [serif] [TestSerif] [default]     \definetypeface [TestFont] [ss] [sans]  [TestSans]  [default]          \usetypescript[TestFont][ec]     %\setupbodyfont[TestFont]          \define[1]\IngredientName{\expanded{\index{#1+\namedstructurevariable{section}{title}}{#1}}}          \define[1]\IngredientUnit{#1}          \define[1]\IngredientMeasure{       \if\relax\detokenize{#1}\relax         %       \else         #1       \fi     }          \define[3]\ingredient{\startitem\IngredientUnit{#1}\IngredientMeasure{#2}\IngredientName{#3}\stopitem}          \definestartstop[TestIngredientGroup]     \defineitemgroup[TestIngredient]          \setupstartstop[TestIngredientGroup][       before={\startmixedcolumns[balance=yes,grid=,]},       after={\stopmixedcolumns},     ]          \defineitemgroup[TestIngredient]     \setupitemgroup[TestIngredient][each][packed][       width=\zeropoint,       %before={\vskip-.5em},       %after={\vskip.5em},       symbol=,     ]          \setuphead[subsection][       number=no,       %before={\testcolumn[2]},       %after={\empty},       style=\ss,     ]          \starttext          \startTestIngredientGroup     \startsubsection[title={Main Ingredients},]     \startTestIngredient       \ingredient{1}{}{egg}\ingredient{1}{}{avocado}       %\ingredient{1}{pkg}{applewood-smoked bacon}\ingredient{1}{}{onion}\ingredient{2}{tbsp}{flour}\ingredient{2\vfrac{1}{2}}{cup}{fish stock}\ingredient{1}{}{potato}\ingredient{\vfrac{1}{2}}{tsp}{cayenne pepper}\ingredient{\vfrac{1}{2}}{tsp}{nutmeg}\ingredient{1\vfrac{1}{2}\emdash{}2}{cup}{milk}\ingredient{\vfrac{1}{2}}{cup}{cream}\ingredient{1}{pinch}{salt}\ingredient{1}{pinch}{pepper}\ingredient{1}{tsp}{lime juice}     \stopTestIngredient     \stopsubsection     \stopTestIngredientGroup          \stoptext      The result initially looks satisfactory; the problem occurs when trying to adjust the whitespace, the font, or both. # Reproduce Problem Apply the fonts by uncommenting: `%\setupbodyfont[TestFont]`, which produces: ![Font Change](http://i.stack.imgur.com/DQx7N.png) The columnar content has shifted from the left column to the right column. This can be addressed by uncommenting: `%before={\vskip-.5em},`, which produces: ![Vertical Skip](http://i.stack.imgur.com/6khJb.png) This works for two lines, but enabling `%\ingredient{1}{pkg}{applewood-smoked bacon}...` results in missing text: ![Missing Text](http://i.stack.imgur.com/wlQFl.png) Several lines have disappeared completely, regardless of font. The lines can be made visible again, but then the situation reverts to shifting the content from the left column to the right column when there are only a couple of items in the list. I've tried:   * setting `grid=strut`, `grid=`, `grid=verytolerant`, and `grid=stretch`;   * adding `[intro]` to the lists;   * using `\testcolumn[3]` to prevent orphaned subsection titles; and   * coding various combinations of `\vskip` and `\empty` on `before` and `after` attributes for both the itemized list and the subsection title. # Question Using a two-column setup, is there a way to reduce the amount of space? The best result I can achieve without losing any content contains extraneous whitespace: ![Extraneous Whitespace](http://i.stack.imgur.com/yvxhi.png) What I would like to achieve resembles: ![Desired Result](http://i.stack.imgur.com/4VgCN.png)


title: how can i write latex code to produce this rectangle as picture

text: ![how can i write the  Latex code and to produce this rectangle as below? ](http://i.stack.imgur.com/GT80B.png) anyone can help me this question,i really hurry,


title: Switch cases in algorithmic

text: How can I use switch cases in `algorithmicx`? For example a code like this: `switch s do`   `\--case a`   `\----assert(1)`   `\--case b`   `\----assert(0)`   etc. Is is possible to define it as a command?


title: How do you organize an article with multiple aspects?

text: I am writing a reference manual for a component(a particle system) in our game engine. There are many modules in this system. And each of them has a module type. I can write specifications for every module type by type. However, some modules of different module types may cooperate to achieve one task. So I want to write specifications for every module "task by task". I think that two aspects are not compatible to reside in a single rooted "chapter-section-subsection" tree-like structure. And I do not want to repeat module's specification text in two separate chapters. To make my question more clearly I write some expected LaTeX here: (I do not know whether this example involves too much domain knowledge for you. If so I will try to write another one)               \chapter{Modules by type}         \section{Initializer}             \subsection{Position}             % ...             \tasks{Simulation, Rendering}             % Every task tag should be linked to corresponding task section.                  \subsection{Color}             % ...             \tasks{Rendering}              \section{Operator}             \subsection{Integrator}             % ...             \tasks{Simulation, Rendering}          \chapter{Modules by task}         \task{Simulation}         % ...         \listrelatedmodules{Simulation}         % Modules with "Simulation" task tag should be listed here.              \task{Rendering}         % ...         \listrelatedmodules{Rendering}      Above code is just one of my expected ways to do the work. And this question is not confined to making that code work. I would like to hear your suggestions on multiple aspects organization. * * * [UPDATE] Thank you for advices. I try to make this question more specific here. Suppose that I have a collection of (sub)sections(Which are "Position", "Color", "Integrator" in original statements) in one chapter. Every section may fall in several categories(I called it "task" in original statements). And later in another chapter I want to list above sections for every category _automatically_. In original question statements, I use a imaginary command called `\listrelatedmodules{<category>}` for this. Generally speaking, my goal is to let every section register itself to a document-wise list. And later I can traverse this list variable to output references in that list. How to do that in LaTeX? P.S. I am not sure whether this approach is a conventional usage of LaTeX so I asked a more general question above, to allow a different but elegant solution.


title: Problem to compile the pgfmanual with lualatex

text: The next link gives the `pgf_2.10-CVS.tds.zip, pgf_2.10-CVS.pdf and pgf_2.10-CVS.ChangeLog` pgfmanual CVS with the version I found today (25/04/2012). First the file `pgfmanual-en-main.tex` looks strange. I find               \begin{document}          \include{pgfmanual-en-gd-overview}     \include{pgfmanual-en-gd-usage-tikz}     \include{pgfmanual-en-gd-trees}     \include{pgfmanual-en-gd-layered}     \include{pgfmanual-en-gd-force}     \include{pgfmanual-en-gd-circular}     \include{pgfmanual-en-gd-misc}     \include{pgfmanual-en-gd-new-algorithms}     \include{pgfmanual-en-gd-implementation}          \end{document}      inside the document I kept the first line `\begin{document}` and removed others lines. Then I compiled with pdflatex, the result is at the link above. I tried to compile with lualatex, the whole document or only the part about graphs but I got different mistakes. With the whole document, I got a pgfmath error `5mm and 5mm` with `a` or `an` is not a function. With only the graphs, I got                 LaTeX Warning: Reference `section-last-graphdrawing-library-in-manual' on page 4 undefined on input line 28.            ! Missing \endcsname inserted.       <to be read again>                     \unhbox        l.39 \end{codeexample}       Perhaps I don't know how to compile with lualatex but the last time, I have not had any problems. Do you have some ideas to compile this big document with lualatex ?


title: Moderncv with moderntimeline - how do I typeset positions that only lasted for one year?

text: I'm using the package `moderntimeline` which originated here on TeX.sx to typeset my CV. It looks great! However, I have a bunch of positions (mostly for volunteering positions within our student union) which only lasted for one year. If I typeset them in the same way as other stuff (ranging over several years), I get a really thin line (something on the order of 1 px) in the timeline, and the year is displayed twice. Here's an MWE to explain what I mean. Compile with e.g. `pdfLaTeX` or `XeLaTeX`               \documentclass{moderncv}          \usepackage{moderntimeline}     \moderncvtheme{classic}     \tlmaxdates{2007}{2012}          \firstname{Lorem}     \familyname{Ipsum}          \begin{document}     \tlcventry{2010}{0}{I'm still doing this!}{}{}{}{}     \tlcventry{2009}{2010}{Then I did something else.}{}{}{}{}     \tlcventry{2009}{2009}{I did something cool for just one year.}{}{}{}{}     \tlcventry{2007}{2009}{A regular entry}{}{}{}{}     \end{document}      Is there any way to make this more beautiful? I would prefer if, for example, only the start year was shown, and the blue line was half as wide as one that represents two years.


title: Spacing for \listtheorems in ntheorem

text: **Q:** How do I get my theorem number and name to not overlap each other in my list of theorems? This is basically the same question as "Spacing control for listtheorems". But the solutions mentioned there still don't work for me. I've tried the following:   * egreg's `\makeatletter` solution   * minimizing package conflicts by eliminating some and re-ordering declarations   * a global search/replace of `2.3em` with `5.0em` in `C:\Program Files\MiKTeX 2.8\tex\latex\ntheorem\ntheorem.sty` * * * ![listtheorems](http://i.stack.imgur.com/743Mr.jpg) * * *               \documentclass{book}          % Original set-up     \usepackage[amsthm,thmmarks,hyperref]{ntheorem}     \usepackage{amsmath,amsfonts}     \usepackage[bookmarks=true,bookmarksnumbered=true]{hyperref}          %% More minimal set-up (still doesn't work)                 %\usepackage[amsthm,thmmarks]{ntheorem}     %\usepackage{amsmath}          %% egreg's fix (doesn't work in my case)     %\makeatletter     %\def\thm@@thmline#1#2#3#4{%     %  \@dottedtocline{-2}{0em}{5em}{\protect\numberline{#2}#3}{#4}}     %\makeatother          \newtheorem{theorem}{Theorem}[section]     \newtheorem{model}[theorem]{Model}                   \setcounter{theorem}{100}     \numberwithin{equation}{section}          \begin{document}       \theoremlisttype{allname}       \listtheorems{theorem,model}       \begin{theorem}[My Theorem title]         My theorem text       \end{theorem}       \begin{model}[My Model title]         My model text       \end{model}       Lorem ipsum dolor sit amet.      \end{document}


title: Latexian- difference live preview and pdf export in error reporting?

text: I edit lecture slides for work and while the editor in the office runs on Linux (Kile), for home office I use Latexian. I noticed that I can get perfect live previews in Latexian without any (noticeable) errors being reported (except when I go to the console), i.e. the document compiles. However, as soon as I try to export the pdf, it doesn't compile and multiple errors are reported. Not only is this annoying but I am often at loss about what is wrong, given that when I did that faulty slide specifically, nothing was reported. This makes me wonder if the live preview has some sort of built-in 'force' command to show the preview no matter what? This is important for me as I fear that my supervisor might not be able to compile files on her Kile when I send him my work and think that I wasn't thorough enough checking for errors.... Example:               \pagenumbering{arabic}       \documentclass[sans,mathserif,10pt]{beamer}       \mode<presentation>       \usepackage{graphicx}       \usepackage{mdwlist}       \usepackage{color}       %\usepackage{ulsy}       \usepackage{MnSymbol}       \usepackage[T1]{fontenc}       \usepackage{ragged2e}       \usepackage{nicefrac}       \input{preamble_js}       \setbeamersize{text margin left=22pt,text margin right=22pt}            \beamertemplatetransparentcovereddynamic     \title[ABC]{{ABC}}          \begin{document}       \begin{frame}       \titlepage     %\hyperlink{retpred}{\beamergotobutton{Skip}}     \end{frame}          \input{chapter4a.tex}      A typical input in the chapter4a- file would then be e.g.               \section{Is this MA($\infty$) process stationary and ergodic?}          \begin{frame}       \vspace{0.6cm}       Checking stationarity and ergodicity if |\phi|<1\\[0.5cm]       \begin{equation*}       \overset{\infty}{\underset{j=0}{\sum}}|\psi_j| =       \overset{\infty}{\underset{j=0}{\sum}}|\phi^j| = \frac{1}{1-|\phi|}       < \infty \quad \text{if} \quad |\phi|<1       \end{equation*}       $\Rightarrow$ stationary and ergodic! \\\\\\       \vspace{0.5cm} The variance is given by:\vspace{0.1cm}            \[\begin{aligned}       \gamma_0 &=& \mathbb{E} \left[(Y_t - \mu)^2\right] = \mathbb{E} \left[(\varepsilon_t +\phi\varepsilon_{t-1}+\phi^2\varepsilon_{t-2}+\ldots)^2\right] \\       &=&(1+\phi^2+\phi^4+\phi^6+\ldots)\sigma^2\\       &=&\frac{1}{1-\phi^2} \; \sigma^2 \qquad (\text{if} \; |\phi|<1)       \end{aligned}\]       \end{frame}            \end{document}


title: how to set properly ymax and ytick

text: I'm trying a plot the left y-axis from 0.5 to 0.88 with 0.88 at the top border of the box (like the 160 at the 2nd y-axis). But even to get 0.88 I have to set ymax and (the last ytick) to 0.9 and it's still not at the top! Why is this? Why do I have set ymax and ytick 0.02 points further then the number I would like to have? And why isn't the number at the top? I really don't know what's the problem! Thanks in advance!               \documentclass[fontsize=12pt,                 paper=a4,                 twoside=false,                         ]{scrreprt}               \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{siunitx}          \usepackage{pgfplots}     \pgfplotsset{compat=1.9,                                     /pgf/number format/1000 sep={},                  /pgf/number format/use comma,                    }     \usepgfplotslibrary{units}               \usepgfplotslibrary{groupplots}                               \begin{document}     %     \begin{tikzpicture}     %     \pgfplotsset{set layers,                         ticklabel shift={0.05cm}}            %     \begin{axis}[width=0.8\textwidth,                 grid=major,                 ymin = 0.5,                 ymax = 0.9,                 ytick={0.5,0.52,...,0.9},                 y tick label style={/pgf/number format/fixed,/pgf/number format/fixed zerofill=true,/pgf/number format/precision=2},                     axis y line*=left,                 ylabel={voltage},                 y unit=\si{\volt},                 xlabel={time},                 x unit = \si{\minute},                 xtick={0,5,...,75},                 xmin = 0,                 xmax = 75,                 ]     %     \end{axis}     %     \begin{axis}[width=0.8\textwidth,                 %grid=major,                 %/pgf/number format/precision=3,                 legend style={legend columns=-1,anchor=north},                 legend style={at={(0.5,-0.15)}},                 %legend cell align=left,                 ymin = 0,                 ymax = 160,                  %ytick={0,10,...,160},                 axis y line*=right,                 xlabel={time},                 x unit = \si{\minute},                 xtick={0,5,...,75},                 xmin = 0,                 xmax = 75,                 axis x line=none,                 ylabel={current},                 y unit= \si{\ampere},                 ]     %                    %     \end{axis}     %     \end{tikzpicture}     %     \end{document}      After further investigation I was able to figure out the problem. It seems that setting `ymin` and `ymax` and additionally `ytick={...}` causes the problem. `ytick={...}` seems (sometimes) to work differently dependent on the definition. Here's a MWE with the behaviour and an explanation: `ymax` and `ymin` are `0.5` and `1` and I would like to have `0.05` steps at the y-axis. If I only define `ymin=0.5` and `ymax=1` the ticks at the y-axis are 0.5, 0.6, 0.7, ..., 1.0. But that's not what I want. So instead of using `ymin` and `ymax` I define `ytick={0.5, 0.55, ..., 1}`. But then the ticks at the y-axis are only from 0.55 to 0.95. So the first and the last one are being ignored. If I only define `ytick={0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1}` then only the first tick is being ignored. So the ticks at the y-axis are from 0.55 to 1. Therefore, defining `ymin=0.5` and `ymax=1` and additionally `ytick={0.5, 0.55, ..., 1}` prevents the last y-tick 1.0 from being printed! And that's my problem. I want to have 0.5 to 1 with 0.05 steps. But specifying these additionally with `ytick={0.5, 0.55, ..., 1}` it only prints until 0.95. What I'm doing now is defining `ymin=0.5`, `ymax=1` and `ytick={0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1}` to get the right divisions and all the ticks. I don't know if it's really a problem or if I simply don't understand the behaviour of setting up `ymax` and `ymin` and additionally `ytick={...}`?!?! Any ideas to avoid defining all the y-ticks or an explanation how the set up the y-ticks properly are very welcome! MWE:               \documentclass[fontsize=12pt,             paper=a4,             twoside=false,                      ]{scrreprt}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{pgfplots}     \pgfplotsset{compat=1.9,          /pgf/number format/1000 sep={},          /pgf/number format/use comma,          enlargelimits=false,          }          \begin{document}     %     \begin{tikzpicture}     %     \begin{axis}[grid=major,             xlabel ={time /min},             xtick={0,10,...,60},             xmin = 0,             xmax = 60,             ylabel = {voltage /V},             ymin = 0.5,             ymax = 1,             %ytick={0.5,0.55,...,1},   %<-- first and last ytick is being ignored             %ytick={0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1}  %<-- first ytick is being ignored             ]             \addplot[color=red,no marks] coordinates{(0,0.52)(10,0.75)(20,0.85)(30,1)(40,0.85)(50,0.75)(60,0.55)};     \end{axis}     %     \end{tikzpicture}     %     \end{document}


title: Various multicolumn in a header of a table

text: I want to use `\multicolumn` in the header of this table, so instead of having e.g: 2007 twice, these two columns would be merged , and so on. However, when I tried to implement `\multicolumn` it did not work properly, it returns me each column separated: This was the original code I had:               \begin{table*}                                                                                \centering                                                                                \caption{Data from 2007-2013}                                                                                \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}                                                                                \hline Years    &   2007    &   2007    &   2008    &   2008    &   2009    &   2009    &   2010    &   2010    &   2011    &   2011    &   2012    &   2012    &   2013    &   2013    \\ \hline         WS or UP    &   WS  &   UP  &   WS  &   UP  &   WS  &   UP  &   WS  &   UP  &   WS  &   UP  &   WS  &   UP  &   WS  &   UP  \\ \hline         USA &   17\%    &   17\%    &   19\%    &   19\%    &   16\%    &   16\%    &   16\%    &   16\%    &   14\%    &   14\%    &   15\%    &   15\%    &   15\%    &   15\%    \\ \hline         Europe  &   17\%    &   17\%    &   19\%    &   19\%    &   16\%    &   16\%    &   16\%    &   16\%    &   14\%    &   14\%    &   15\%    &   15\%    &   15\%    &   15\%    \\ \hline         \end{tabular}                                                                                \label{fig:data}                                                                                \end{table*}      This is what I tried with `\multicolumn` with no success:               \begin{table*}                                                                                \centering                                                                                \caption{Data from 2007-2013}                                                                                \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}                                                                                \toprule                                                                                {}  &    \multicolumn{2}{c}{2007}           &    \multicolumn{2}{c}{2008}           &    \multicolumn{2}{c}{2009}           &    \multicolumn{2}{c}{2010}           &    \multicolumn{2}{c}{2011}           &    \multicolumn{2}{c}{2012}           &    \multicolumn{2}{c}{2013}                \midrule                                                                                USA &   17\%    &   17\%    &   19\%    &   19\%    &   16\%    &   16\%    &   16\%    &   16\%    &   14\%    &   14\%    &   15\%    &   15\%    &   15\%    &   15\%    \\ \hline     Europe  &   17\%    &   17\%    &   19\%    &   19\%    &   16\%    &   16\%    &   16\%    &   16\%    &   14\%    &   14\%    &   15\%    &   15\%    &   15\%    &   15\%    \\ \hline     \bottomrule                                                                                \end{tabular}                                                                                \label{fig:data}                                                                                \end{table*}


title: Increase image resolution using MetaUML and metapost

text: I'm using MetaUML to create text-driven UML diagrams. When I generate a figure, with:               $ mpost example.mp     $ convert ps:example.1 png:example.png      a very low-resolution image is generated. If I scale the postscript image up using ImageMagick's `convert` utility, it is blurry (obviously sampled up from low-res source data). Additionally, if I change the `defaultscale` parameter in the MetaUML source, all text will be increased in size but it will overlap with other text. Additionally at large values for `defaultscale`, the text will extend beyond the UML boxes. Here's the complete MetaUML source I'm using:               prologues := 2; % needed to load font definitions     defaultscale := 1.0 % I tweaking this value doesn't do what I want     input metauml; % load the MetaUML library       beginfig(1);         Class.A("Object")()();         Class.B("Point") % class name             ("#x:int", "#y:int") % attributes             ("+set(x:int, y:int)", % operations             "+getX():int",             "+getY():int",             "-debug():void");         B.e = A.w + (-20, 0);         drawObjects(A, B);         link(inheritance)(B.e -- A.w);       endfig;     end      How do I make the pipeline (MetaUML -> Metapost -> convert) yield higher resolution images?


title: How to fill an annulus (region bounded by two concentric circles)?

text: How to color with green color the domain bounded by a circle of radius 1.5 and the circle of radius 3.5 ? How to color with yellow color the domain bounded by a circle of radius 3.5 and the circle of radius 5 ?               \RequirePackage{ifluatex}     \documentclass{standalone}     \ifluatex     \usepackage{fontspec}     \setmainfont{TeX Gyre Pagella}     \else     \usepackage{tgpagella}     \usepackage{pst-plot,pst-all,,pst-sigsys}     \definecolor{CyanTikz40}{cmyk}{.4,0,0,0}      \fi      \usepackage{auto-pst-pdf}      \begin{document}      \begin{postscript}      \psset{unit=1cm,arrowscale=1.3,algebraic=true,labelFontSize=\scriptstyle}       \begin{pspicture}(-6,-6)(9,9)      \psgrid[subgriddiv=0,gridlabels=0,gridcolor=gray](-6,-6)(9,9)      \psaxes[labels=none,linewidth=1pt,Dx=1,Dy=1,ticksize=0pt 0pt]{->}(0,0)(-6,-6)(9,9)      \pscircle[](0,0){5}      \pscircle[](0,0){3.5}      \pscircle[fillstyle=solid,fillcolor=blue,opacity=0.5](0,0){1.5}      \psframe[fillstyle=solid,fillcolor=blue,opacity=0.5](6,1)(7,2)      \psframe[fillstyle=solid,fillcolor=green,opacity=0.5](6,3)(7,4)      \psframe[fillstyle=solid,fillcolor=yellow,opacity=0.5](6,5)(7,6)      \uput[dl](0,0){\textcolor{black}{O}}      \uput[d](0.9,0){\textcolor{black}{I}}      \uput[l](0,1){\textcolor{black}{J}}      \uput[r](7,5.5){\textcolor{black}{5 points}}      \uput[r](7,3.5){\textcolor{black}{10 points}}      \uput[r](7,1.5){\textcolor{black}{20 points}}      \psTick{90}(1,0)      \psTick{0}(0,1)      \end{pspicture}      \end{postscript}      \end{document}


title: Polyglossia doesn't work with the ltxdoc document class

text: I have a package that uses the `ltxdoc` document class and the `docstrip` program for code and documentation generation. The package deals with some multilingual stuff and needs XeTeX (to be precise, `polyglossia` itself, but this should be irrelevant), so I process it with `xelatex`. Now I wish to use the `polyglossia` package to typeset a piece of text in another language in the `.dtx` file. However, I get a bizarre error when I add a `\setdefaultlanguage` or a `\setotherlanguage` command to the document:               ! Package doc Error: Character table corrupted.          See the doc package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.26 %   Right brace   \}     Tilde         \~}      I've reduced it to this testcase:               % \iffalse     \documentclass{ltxdoc}          \usepackage{polyglossia}     \setdefaultlanguage{english}          \begin{document}       \DocInput{test.dtx}     \end{document}     % \fi     %     % \CharacterTable     %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z     %   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z     %   Digits        \0\1\2\3\4\5\6\7\8\9     %   Exclamation   \!     Double quote  \"     Hash (number) \#     %   Dollar        \$     Percent       \%     Ampersand     \&     %   Acute accent  \'     Left paren    \(     Right paren   \)     %   Asterisk      \*     Plus          \+     Comma         \,     %   Minus         \-     Point         \.     Solidus       \/     %   Colon         \:     Semicolon     \;     Less than     \<     %   Equals        \=     Greater than  \>     Question mark \?     %   Commercial at \@     Left bracket  \[     Backslash     \\     %   Right bracket \]     Circumflex    \^     Underscore    \_     %   Grave accent  \`     Left brace    \{     Vertical bar  \|     %   Right brace   \}     Tilde         \~}     %     % Hello World!     %     % \StopEventually{}     % \Finale     \endinput      I've observed that once I place `\setdefaultlanguage` (a single line) in another file and `\usepackage` (but not `\input`!) it, then it works. I'm out of ideas. How could one fix the bug? (I have TeX Live 2010 and the latest `polyglossia` version.)


title: cftpartnumwidth - TOC not responding to changes

text: I posted the question here: http://www.latex- community.org/forum/viewtopic.php?f=47&t=11499&sid=ff51ce4bc05d87957773d360d33ffa91 but nobody answered, so I'm posting my question here ;] I am using miktex 2.9. Compiling with pdflatex. I want to increase the numwidth in TOC of part entry in article class to make titles of parts aligned to one line. The minimal example:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english]{babel}          \usepackage{tocloft}     \setlength{\cftpartnumwidth}{4em}     \cftsetindents{part}{0em}{4em}          \begin{document}     \tableofcontents     \part{Part1}     \part{Part2}     \part{Part3}     \part{Part4}     \part{Part5}     \part{Part6}     \end{document}      Neither seems to work:               \setlength{\cftpartnumwidth}{4em}     \cftsetindents{part}{0em}{4em}      I can easily modify numwidth of sections subsections etc. Changes are reflected in TOC. While reading tocloft documentation it is stated: > There is no explicit numwidth for a part; instead a gap of 1em is put > between the number and the title text. However while reading tocloft.sty I see no difference between definitions of `\renewcommand*{\l@part}[2]` and `\renewcommand*{\l@section}[2]`. All modifications to tocloft.sty concerning partnumwidth fail to deliver. Any ideas? I will be grateful for help!


title: Thesis in LaTeX without memoir

text: I'm preparing a thesis report in LaTeX. I don't want to use the `memoir` class as I would like total control. I have two questions:   1. My thesis consists of an introduction and then a series of articles pasted one after the other. Thus each article has its own abstract, introduction, etc. and a bibliography at its end. I understand that perhaps a package like `multibib` can help when we have multiple bibliographies. The idea that I came with is to write each article separately and then use `pdfpages` to combine the final document. Long time ago dvi files concatenation was popular but with graphics I think that `pdfpages` is better. I saw that another package exists, named combine which can help with what I am doing. I'm still exploring my options. Any suggestions?   2. If I decide to use a `book` class instead to make my thesis resemble more into a book-like format which is better, then using the book class format gives me section headings like 0.1 Introduction with the leading 0. This 0 doesn't show in the `article` class format. How to change this default `book` class numbering format so that I'll have e.g. 1. Introduction?


title: Beamer content (text) offset/shifts to top when large image is used

text: I have a small problem. When I insert a large image inside a frame, which in my opinion still fits, the content moves to the top. While I have set that all content must be aligned to the top, but due to the image it moves even further to the top. I really want that the content just stays were it is. This example illustrates the situation. How can I fix this?               \documentclass[t]{beamer}     \usetheme{boxes}     \useoutertheme{infolines}     \usefonttheme[onlylarge]{structurebold}     \setbeamerfont*{frametitle}{size=\normalsize,series=\bfseries}     \setbeamertemplate{navigation symbols}{}     \usepackage{tikz}     \begin{document}     \begin{frame}[t]{General formalization of haplotyping.}       \begin{definition}         \begin{itemize}         \item         \item         \item          \item         \item         \end{itemize}       \end{definition}       \begin{center}         \begin{tikzpicture}           \fill[blue!40!white] (0,0) rectangle (2,2);         \end{tikzpicture}        \end{center}     \end{frame}     \begin{frame}[t]{General formalization of haplotyping.}       \begin{definition}         \begin{itemize}         \item         \item         \item          \item         \item         \end{itemize}       \end{definition}       \begin{center}         \begin{tikzpicture}           \fill[blue!40!white] (0,0) rectangle (4,4);         \end{tikzpicture}        \end{center}     \end{frame}     \end{document}


title: Connecting an arced path in TikZ

text: I'm trying to draw an octant of a sphere. I'm not an expert on drawing perspective, but I managed that with, among others, the arc command. With the sphere drawn I made some layers, again with the arc command, that I'd like to fill to help distuingish them from the others layers. I made a path of one of the layers, filled it but not with the expected result. The path seems closed to me, but not to TikZ. How can I close the arced path and fill it? I presume my manual finetuning of the coordinates might be the cause of the problem? MWE               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{through,shapes}          \begin{document}     \begin{tikzpicture}         % coordinaten         \coordinate (m) at (0,4,0);         % assen         \draw (0,0,0) -- (0,4,0); % z         \draw (0,0,0) -- (4,0,0); % x         \draw (0,0,0) -- (0,0,4.65); % y         % sfeer         \draw (4,0,0) arc (0:116.5:4cm and -2cm);         \draw (4,0,0) arc (0:90:4cm and 4cm);         \draw (0,4,0) arc (90:206.5:2cm and 4cm);         \node[draw,circle through={(m)}] (c) at (0,0,0) {};         % fotosfeer         \draw (3.875,0,0) arc (0:115.8:3.875cm and -1.875cm);         \draw (3.875,0,0) arc (0:90:3.875cm and 3.875cm);         \draw (0,3.875,0) arc (90:205.8:1.875cm and 3.875cm);         % convenctie zone         \draw (2,0,0) arc (0:116.5:2cm and -1cm);         \draw (2,0,0) arc (0:90:2cm and 2cm);         \draw (0,2,0) arc (90:206.5:1cm and 2cm);         % radiatie zone         \draw (1,0,0) arc (0:116.5:1cm and -0.5cm);         \draw (1,0,0) arc (0:90:1cm and 1cm);         \draw (0,1,0) arc (90:206.5:0.5cm and 1cm);         % fill         \draw[fill=blue] (0,3.875,0) -- (0,2,0) (3.875,0,0) arc (0:90:3.875cm and 3.875cm) (2,0,0) arc (0:90:2cm and 2cm) (3.875,0,0) -- (2,0,0);     \end{tikzpicture}     \end{document}      ![Filled, yet not closed path](http://i.imgur.com/SIgGbW6.png) The part I'd like to fill is the biggest section of the xz plane, where the x axis is pointing to the east and the z axis is pointing north. With similar code I'd eventually like to fill the corresponding two parts as well. PS: I use the circle through command instead of a plain circle node to have no problem with scaling the figure.


title: tikz node graph

text: i have a big graph               \begin{center}     \resizebox{\textwidth}{!}{%     \begin{tikzpicture} [       line/.style = {draw, thick, -latex},       dot/.style = {draw, fill=black},     %      scale=0.2       ]              \coordinate (0) at (0cm, 0cm);                   \coordinate (1) at (-20cm, 9cm);              \coordinate (9) at (20cm, 9cm);       \coordinate (2) at (-40cm, 30cm);       \coordinate (8) at (40cm, 30cm);       \coordinate (3) at (-40cm, 50cm);       \coordinate (7) at (40cm, 50cm);             \coordinate (4) at (-30cm, 70cm);             \coordinate (6) at (30cm, 70cm);             \coordinate (5) at (0cm, 85cm);             \coordinate (10) at (0cm, 5cm);              \coordinate (11) at (-15cm, 15cm);              \coordinate (16) at (15cm, 15cm);       \coordinate (12) at (-10cm, 22cm);                   \coordinate (15) at (10cm, 22cm);       \coordinate (13) at (-25cm, 26cm);             \coordinate (14) at (25cm, 26cm);       \coordinate (22) at (-30cm, 57cm);       \coordinate (18) at (30cm, 57cm);             \coordinate (19) at (0cm, 43cm);             \coordinate (20) at (0cm, 55cm);            \coordinate (21) at (-20cm, 45cm);             \coordinate (17) at (20cm, 45cm);              \coordinate (23) at (-12cm, 40cm);       \coordinate (24) at (12cm, 40cm);       \coordinate (25) at (8cm, 51cm);             \coordinate (26) at (-30cm, 34cm);             \coordinate (27) at (30cm, 34cm);            \draw (0) -- (1);       \draw (0) -- (9);       \draw (0) -- (10);       \draw (0) -- (16);       \draw (0) -- (11);            \draw (1) -- (10);       \draw (1) -- (2);       \draw (1) -- (11);                 \draw (2) -- (4);       \draw (2) -- (3);       \draw (2) -- (22);                 \draw (3) -- (4);       \draw (3) -- (22);                 \draw (4) -- (5);       \draw (4) -- (6);      \draw (4) -- (20);       \draw (4) -- (22);                 \draw (5) -- (6);       \draw (5) -- (20);                 \draw (6) -- (20);         \draw (6) -- (7);       \draw (6) -- (18);        \draw (6) -- (8);              \draw (7) -- (18);       \draw (7) -- (8);                  \draw (9) -- (8);                  \draw (9) -- (16);             \draw (9) -- (10);          \draw (16) -- (15);                 \draw (10) -- (11);         \draw (10) -- (16);       \draw (11) -- (12);        \draw (12) -- (13);            \draw (12) -- (27);       \draw (12) -- (23);        \draw (13) -- (27);       \draw (13) -- (23);                 \draw (14) -- (26);       \draw (14) -- (24);        \draw (14) -- (15);       \draw (15) -- (26);       \draw (15) -- (24);             \draw (17) -- (18);       \draw (17) -- (25);       \draw (17) -- (27);            \draw (18) -- (25);       \draw (18) -- (27);             \draw (19) -- (20);       \draw (19) -- (24);       \draw (19) -- (23);       \draw (21) -- (25);       \draw (21) -- (26);                  \draw (22) -- (25);       \draw (22) -- (26);            \draw (21) -- (22);             \draw (27) -- (23);       \draw (24) -- (26);            \draw (26) -- (25);       \draw (27) -- (25);            \draw (27) -- (13);       \draw (27) -- (12);                 \draw (9) -- (8);       \draw (3) -- (2);            \draw (24) -- (26);       \draw (27) -- (23);             \draw (19) -- (20);       \draw (20) -- (4);        \draw (20) -- (6);       \draw (20) -- (5);                  \draw (4) -- (6);                   \draw (25) -- (18);       \draw (25) -- (17);        \draw (25) -- (22);       \draw (25) -- (21);                  \fill [dot] (0) circle (4.0mm);             \fill [dot] (1) circle (4.0mm);             \fill [dot] (2) circle (4.0mm);             \fill [dot] (3) circle (4.0mm);             \fill [dot] (4) circle (4.0mm);             \fill [dot] (5) circle (4.0mm);             \fill [dot] (6) circle (4.0mm);             \fill [dot] (7) circle (4.0mm);             \fill [dot] (8) circle (4.0mm);             \fill [dot] (9) circle (4.0mm);             \fill [dot] (10) circle (4.0mm);             \fill [dot] (11) circle (4.0mm);             \fill [dot] (12) circle (4.0mm);             \fill [dot] (13) circle (4.0mm);             \fill [dot] (14) circle (4.0mm);             \fill [dot] (15) circle (4.0mm);             \fill [dot] (16) circle (4.0mm);             \fill [dot] (17) circle (4.0mm);             \fill [dot] (18) circle (4.0mm);             \fill [dot] (19) circle (4.0mm);             \fill [dot] (20) circle (4.0mm);             \fill [dot] (21) circle (4.0mm);             \fill [dot] (22) circle (4.0mm);             \fill [dot] (23) circle (4.0mm);             \fill [dot] (24) circle (4.0mm);             \fill [dot] (25) circle (4.0mm);             \fill [dot] (26) circle (4.0mm);             \fill [dot] (27) circle (4.0mm);      \node (a) at (0cm, 0cm) {$u_1$};      \node (b) at (0cm, 10cm) {$u_2$};          \end{tikzpicture}     }     \end{center}      And Im trying to use \node to node a coordinate but I have a mistake. I should be wrong somewhere. Can you help me with this? Can you also help me to draw any line in this graph into blue color? Thank you.


title: Adding constant to function (vspace) argument?

text: How can I get Latex to add a constant to a value as part of a `\vspace` argument? Here's my minimal example:               \documentclass{article}     \usepackage{calc}          \begin{document}     ab     %\vspace{20mm+10mm} %documentation of the calc package says it needs at least one dimen register     \newlength{\mylength}\setlength{\mylength}{20mm} \vspace{\mylength+10mm}      \\cd     \end{document}      Which always produces _ab +10mm cd_.


title: Box around a few items in an itemize environment

text: I'm using `beamer` and want to call out a few items in a list by drawing a box around them, and, ideally, having a small comment appear next to the box, like this: ![enter image description here](http://i.stack.imgur.com/aG2Cb.png)


title: Highlighting in Beamer using TikZ nodes

text: > **This question led to a new package:**   >  `aobs-tikz`   1. Is it possible to alter the code in the following MWE to the effect that “ABCD” is visible on both slides but only on the second it has the red node as background?               \documentclass{beamer}     \usepackage{tikz}     \tikzset{         invisible/.style={opacity=0,text opacity=0},         visible on/.style={alt=#1{}{invisible}},         alt/.code args={<#1>#2#3}{%           \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}          },       }     \begin{document}     \frame{\frametitle{Title}     \tikz[remember picture,baseline=(A.base)] \node[fill=red!30,anchor=base,rounded corners,visible on=<2>] (A) {ABCD};     }     \end{document}        2. Using similar code, I would also like to have itemizations such that on all slides all items are visible but they are successively highlighted in the same way as the “ABCD” in the previous MWE. (This differs from the standard `alert` mode in that at every time all items are visible and instead of changing the color of the item one uses a red background box.)


title: What is the difference between \cite and ~\cite?

text: > **Possible Duplicate:**   >  Why I should put a ~ before \ref command? I see the two used fairly interchangeably but have never read what the difference is between them...


title: patgen: what do these values mean?

text: What do `hyph_start`, `hyph_finish`, `pat_start`, `pat_finish`, good weight, bad weight and threshold asked by `patgen` mean?


title: Adjusting the width of a displaymath environment

text: I want to adjust the width of an `displaymath` environment whose contents (a `tikzcd` diagram rather than an actual equation) are too wide to fit in the margins. The obvious thing to do is to use the `adjustwidth` environment, but this doesn't work as well as I would like: the vertical spacing of the result is sometimes quite ugly. (It seems to be some kind of conflict with `mathtools`, see below.) It seems to me that the problem is in the implementation of `adjustwidth` using `list`. Perhaps there is an alternative / more direct way of adjusting the margins of part of a page that works better with `equation`? ![enter image description here](http://i.stack.imgur.com/aruMv.png)               \documentclass[12pt,a4paper]{article}          \usepackage{mathtools}     \usepackage{changepage}     \usepackage{tikz-cd}          \newcommand{\sample}{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate.}          \begin{document}     \sample     \begin{adjustwidth}{-0.5in}{-0.5in}     \[     \begin{tikzcd}     \bullet \dar \rar &     \bullet \dar \rar &     \bullet \dar \rar &     \bullet \dar \rar &     \bullet \dar \rar &     \bullet \dar \rar &     \bullet \dar \rar &     \bullet \dar \rar &     \bullet \dar \rar &     \bullet \dar \\     \bullet \rar &     \bullet \rar &     \bullet \rar &     \bullet \rar &     \bullet \rar &     \bullet \rar &     \bullet \rar &     \bullet \rar &     \bullet \rar &     \bullet     \end{tikzcd}     \]     \end{adjustwidth}     \sample     \end{document}      ![enter image description here](http://i.stack.imgur.com/gNUsU.png)


title: Changing style of alert environment in beamer

text: I would like to specify a background color in the alert environment. I can, for example, use               \setbeamercolor{alerted text}{fg=blue}       to change the colour of the alterted text to blue, but this               \setbeamercolor{alerted text}{bg=blue}       does not work. Is there a way to get around this? I find that the font colours that the alert environment makes are too subtle and I'd like to add a coloured highlight box around my text in addition to changing the fg colour.


title: error in table output

text: I am using stata, a statistical software. It has a program called -tabout-, that generates output (basically tables containing descriptive statistics incl means of variables etc) code for TeX. Currently for the table I need I obtain the following code               \begin{center}     \footnotesize     \newcolumntype{Y}{>{\raggedleft\arraybackslash}X}     \begin{tabularx} {10cm} {@{} l Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y@{}} \\     \toprule      & \multicolumn{3}{c}{orgevent} \\     spontevent&0&1&Total \\     \cmidrule(l{.75em}){2-4} \cmidrule(l{.75em}){5-6}     &Relative&Relative&Relative \\     \midrule     0 (97\%)&0.016\%&0.011\%&0.016\% \\     1 (2\%)&0.044\%&&0.044\% \\     Total (100\%)&0.017\%&0.011\%&0.017\% \\     \bottomrule     \addlinespace[.75ex]     \scriptsize{\emph{Source: }#}     \end{tabularx}     \normalsize     \end{center}       But my LaTeX compiler points to an error in the line                \end{tabularx}      The error reported is > "pdflatex> ! You can't use the 'macro parameter character #' in restricted > mode" Please help understand what's going on and how can I see the table? After regenerating the code from stata, again error bit of a different kind               \begin{center}     \footnotesize     \newcolumntype{Y}{>{\raggedleft\arraybackslash}X}     \begin{tabularx} {10cm} {@{} l Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y@{}} \\     \toprule      & \multicolumn{3}{c}{orgevent} \\     spontevent&0&1&Total \\     \cmidrule(l{.75em}){2-4} \cmidrule(l{.75em}){5-6}     &Relative&Relative&Relative \\     \midrule     0&0.016\%&0.011\%&0.016\% \\     1&0.044\%&&0.044\% \\     Total&0.017\%&0.011\%&0.017\% \\     \begin{center}     \footnotesize     \newcolumntype{Y}{>{\raggedleft\arraybackslash}X}     \begin{tabularx} {10cm} {@{} l Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y@{}} \\     \toprule      & \multicolumn{3}{c}{orgevent} \\     spontevent&0&1&Total \\     \cmidrule(l{.75em}){2-4} \cmidrule(l{.75em}){5-6}     &Relative&Relative&Relative \\     \midrule     0 (97\%)&0.016\%&0.011\%&0.016\% \\     1 (2\%)&0.044\%&&0.044\% \\     Total (100\%)&0.017\%&0.011\%&0.017\% \\     \bottomrule     \addlinespace[.75ex]     %\scriptsize{\emph{Source: }#}     \end{tabularx}     \normalsize     \end{center}      Are there any TeXperts who have some experience with stata as well? As you can see, the code seems to be repeated twice


title: Adobe Garamond Pro (otf) with mathdesign

text: I would like to use the Adobe Garamond Pro (otf) font with `mathdesign`. The readme of the package says: > The following commercial families are also supported: > >   * mdpga family corresponds to Adobe Garamond Pro text fonts >   * mdpus family corresponds to Adobe Utopia Std text fonts >   * mdici family corresponds to ITC Charter text fonts > > > <...> > > You have to obtain the commercial text fonts from your favorite reseller. > Only the opentype version these fonts are supported. You will need the > following files: > >   * For Adobe Garamond Pro > > AGaramondPro-Regular.otf > > AGaramondPro-Italic.otf > > AGaramondPro-Semibold.otf > > AGaramondPro-SemiboldItalic.otf > > > > <...> >   >   >       Put them in your TEXMF tree in the directory >   >     ${TEXMF}/fonts/opentype/<supplier>/<fontname> >   > > (Supplier is garamond or itc. The fontname is basically what you want.) You > don't need to rename the files. The 'expert' options is useless, since this > fonts are provided with small caps and oldstyle figures! I put the fonts in the directory `.../fonts/opentype/garamond/Adobe Garamond Pro/`, but when I run XeLaTeX on the following code, I get this warning and no pdf:               LaTeX Font Info:    Try loading font information for EU1+mdpgd on input line 185.     LaTeX Font Info:    No file EU1mdpgd.fd. on input line 185.          LaTeX Font Warning: Font shape `EU1/mdpgd/m/n' undefined     (Font)              using `EU1/lmr/m/n' instead on input line 185.      MWE:               \documentclass{article}     \usepackage{fontspec}     \setmainfont[Ligatures=TeX]{Adobe Garamond Pro}     \usepackage[adobe-garamond]{mathdesign}% thanks to Ulrike Fisher     \usepackage{polyglossia}     \setmainlanguage{english}     \usepackage{lipsum}          \begin{document}     \lipsum[1]     \[f(x)=\int g(x)\,dx\]     \end{document}


title: Case distinction in a proof using beamer

text: I have the following problem: For a proof of a theorem I need a case distinction inside a proof environment of a beamer presentation. I think that an enumerate might be helpful, the problem is however that I want some enumitems other than (a),(b),(c). I tried to set this using `\setbeamertemplate`:               \documentclass{beamer}     \usetheme{Goettingen}          \setbeamertemplate{enumerate item}{\arabic{enumi}. Fall:}          \begin{document}       \begin{frame}         \begin{enumerate}           \item asd         \end{enumerate}       \end{frame}          \end{document}      Unfortunately, the whole thing looks really crappy, because the enumitem is right justified and there is not enough space to accommodate this _longer_ string. Does anyone have any ideas on how to fix this, or how to make a nice- looking case distinction for a beamer document?


title: What is the proper way of moving my content but not my header/footer?

text: My header and footer are all set. Size and position are good. However, I want to push the actual content to the right and down (creating big margins at the top and left of the document). See this final result I have in mind: ![enter image description here](http://i.stack.imgur.com/HVGXd.png) The geometry package is very useful at changing page margins, but it will also move my header/footer (using the fancyhdr package BTW). What is the proper package/command to use when only moving the content itself?