title: aligned environment, align numbers to right

text: I have an "equation", where I simply want to give some constant values. I'm aligning on the equation symbols, but as the numbers have different amounts of digits, I would also like to align the numbers to the right: ![alignment](http://i.stack.imgur.com/6WJUD.png) LaTeX currently looks as follows:               \documentclass[ngerman]{scrbook}     \usepackage{amssymb,amsmath,amsthm}     \begin{document}     \begin{equation*}         \begin{aligned}         \text{first value} &= 12 & \\         \text{second value} &= 1234 & \\         \text{third one} &= 1234567 &         \end{aligned}     \end{equation*}     \end{document}      Is it possible to align to the right with `aligned`? Are there any other packages for achieving this (I would like to stick to the equation if possible, for consistency reasons).


title: Is there a way to explicitly state what the ticks on a TikZ/pgfplots picture should say (ie 10.000 rather than 10)?

text: I'm trying to show that my graph has 5 significant figures on the y-axis. But I can't seem to get TikZ/pgfplots to show the trailing zeros though. I tried to get TikZ/pgfplots to show the extra zeros by using the `ytick` option, but it doesn't seem to work.               \documentclass[letterpaper,12pt]{article}     \usepackage{pgfplots}     \usepackage[margin=1in]{geometry}          \begin{document}     \begin{tikzpicture}         \begin{axis}[         xticklabel={\pgfmathprintnumber\tick\%},         xmin = 0, xmax = 20,         ymin = 10,    ymax = 10.3,         xlabel = Concentration,         axis x line = bottom,          ylabel = Mass (g),         axis y line = left,          xtick = {0,5,10,15,20},         ytick = {10.000,10.100,10.200,10.300}, % My attempt thus far         grid = major,         width = \textwidth - 1in,         tick align = outside         ]             \addplot coordinates{             (5,10.012)             (10,10.180)             (15,10.230)             };         \end{axis}     \end{tikzpicture}     \end{document}      And here's what the document currently looks like: ![Original](http://i.stack.imgur.com/Qxodl.png)


title: Decimal number in axis tick using: "x tick=data"

text: I have found the following problem during the building of an histogram:               \documentclass[a4paper,11pt]{article}          \usepackage{pgfplots}     \pgfplotsset{/pgf/number format/use comma,compat=newest}          \begin{document}          \begin{tikzpicture}     \begin{axis}     [title=Istogramma di distribuzione,     title style={xshift=30mm},     ylabel={Frequenza $[n]$}, ylabel style={font=\footnotesize},     xlabel={Misurazione $[mm]$}, xlabel style={font=\footnotesize},     width=12cm, height=8cm,     axis x line=bottom, axis y line=left,     ymajorgrids, ytick=data, ybar,     xtick=data, x tick label style={rotate=90,anchor=east},     ymin=0, ymax=10, xmin=11.4, xmax=12.9,]     \addplot [fill=white, very thick] coordinates {     (   11.5    ,   1   )     (   11.6    ,   1   )     (   11.7    ,   2   )     (   11.8    ,   2   )     (   11.9    ,   4   )     (   12.0    ,   5   )     (   12.1    ,   7   )     (   12.2    ,   9   )     (   12.3    ,   8   )     (   12.4    ,   4   )     (   12.5    ,   4   )     (   12.6    ,   1   )     (   12.7    ,   1   )     (   12.8    ,   1   )     (0,3) (0,6)     };     \end{axis}     \end{tikzpicture}          \end{document}      In this way I see all my data with the decimal number except 12! What can I do in order to show the numbers after the comma anyway?


title: LaTeX align/distribute objects à la InDesign?

text: I'm trying to replicate, in `LaTeX`, `InDesign`'s align and distribute tools. This is a snapshot of `ID`'s toolbar: ![indesign toolbar](http://i.stack.imgur.com/pXBfC.jpg) Say I want first to align vertically two objects (texts, graphics, boxes,...), and then align them horizontally, so that they become superimposed and completely centred. So, if the first object were `[ ]` and the second `x`, the first step would give me `[ ]x` and the second `[x]`. Of course, I can do this with the `centre` environment and a negative `hspace` command and a bit of math. What I would like to get is a more or less generalized (set of) command(s). I believe this might be easily accomplished in `Tikz`, but I don't know how to. Or perhaps with the `adjustbox` package. Although this question is obviously wide, I wonder if someone has already inquired into this issue and can give me some ideas on it. * * * OK. As requested, this is more or less what I would like to systematise:               \documentclass{article}     \usepackage{graphicx, xcolor, calc}          \newcommand*{\FirstObject}{\colorbox{black!20}{\quad}}     \newcommand*{\SecondObject}{x}          \begin{document}     \thispagestyle{empty}     \parindent=0pt          \section{First Step}     \newlength{\wone}       \setlength{\wone}{\widthof{\FirstObject{}}}     \newlength{\wtwo}       \setlength{\wtwo}{\widthof{\SecondObject{}}}     \newlength{\wthree}       \setlength{\wthree}{\wone + \wtwo}          \FirstObject{}\hspace*{-.5\wthree}\SecondObject{}               \section{Second Step}     \newlength{\hone}       \setlength{\hone}{\heightof{\FirstObject{}}}     \newlength{\htwo}       \setlength{\htwo}{\heightof{\SecondObject{}}}     \newlength{\hthree}       \setlength{\hthree}{\hone + \htwo}          \FirstObject{}\hspace*{-.5\wthree}%     \raisebox{-.25\hthree}{\SecondObject{}}  % Don't know why .5 won't work here...          \end{document}      ![myexample](http://i.stack.imgur.com/1mapX.png)


title: pgfplots - how to specify ticks?

text: I know how to specify ticks manually. But this is too much work if you have multiple plots. I am searching a way to do that automatically. What I want to specify is the number of ticks for an axis. Is there a way to just say how many ticks you want to have? I read about "try min ticks=3" and tried "try max ticks=3" but that would have been too easy... **EDIT: Figure** Here's the figure on what I like to have 5 ticks on the y-axis. ![enter image description here](http://i.stack.imgur.com/dDBjX.png)


title: How to place a textnode at the center of a drawed rectangle

text: A rectangle label does not appear inside the rectangle but on the corner of it.                 \tikzstyle{every node} = [align=center]        \begin{tikzpicture}         \draw (0, 0) rectangle (2, 2) node [center] {label};           %center is unknown but was my best guess       \end{tikzpicture}      How do I move the labelling node to have a common center with the rectangle? The result should look like this                 \tikzstyle{every node} = [align=center]       \begin{tikzpicture}         \draw (0, 0) rectangle (2, 2);         \node at (1,1) {label};       \end{tikzpicture}      but without having to specify the center manually.


title: Incompatibility between memoir and pdfpages ?

text: I am including a single pdf page (the title of my thesis) with the package `pdfpages` :               \begin{document}               \includepdf{title.pdf}     ...      But since I switched from `report` to `memoir` the page is not included, the first page of the resulting pdf if a blank page where "title.pdf" appears. Do you know if there is an incompatibility between these two packages ?


title: How do I remove padding from a framed box?

text: I am unable to use `mdframed` on my server so I am currently creating a `framed` box like this:               \usepackage{framed}     \begin{document}     \begin{framed}     \small{     \noindent \textbf{Key Results}:blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah \\          \noindent \textbf{Implications}:blah blah blah blah blah blah blah blah blah blah blah blah      }     \end{framed}     \end{document}      ![enter image description here](http://i.stack.imgur.com/npVZD.jpg) Can someone please tell me how to reduce the padding in this box so that it appears more like this? ![enter image description here](http://i.stack.imgur.com/JUeaU.jpg)


title: Big quotes drawn with TiKz does not compile

text: ## My problem Sorry to give such a long code but my problem appears in it. I don't see why the first long code given below does not work : more precisely, the problem comes from the big quotes drawn using TiKz. I've just adapted the secund code by changing some names. Any clue to fix my long code ? ## The bugging code               \documentclass[10pt,a4paper,french]{article}     \usepackage[utf8]{inputenc}     \usepackage{fancyvrb}          \setlength{\parindent}{0cm}          \newcommand\bracket[1]{(#1)}          \newcommand\latex{\verb}     \DefineVerbatimEnvironment{Latex}{Verbatim}{numbers=left,numbersep=2mm}          % == PACKAGES USED == %          \usepackage{pgfkeys}          \usepackage[x11names,svgnames]{xcolor}     \usepackage{mdframed}     \usepackage{tikz}          \usepackage{babel}     \usepackage{csquotes}          % == DEF : quote == %          \makeatletter     % Inline mode         \renewcommand\quote{%             \@ifstar{\@quoteStar}{\@quoteNoStar}%         }         \newcommand\@quoteStar[2][]{%             \textquote*[#1]{\textit{#2}}         }         \newcommand\@quoteNoStar[2][]{%             \textquote[#1]{\textit{#2}}         }          % Default settings for quoting blocks         \definecolor{bigQuoteColorNormal}{named}{black}         \definecolor{bigQuoteColorBack}{named}{LightBlue1}              \newlength{\bigQuoteBorderWidth}         \setlength{\bigQuoteBorderWidth}{0pt}         \newlength{\bigQuoteInnerMargin}         \setlength{\bigQuoteInnerMargin}{2pt}         \newlength{\bigQuoteOuterMarginHorizontal}         \setlength{\bigQuoteOuterMarginHorizontal}{15pt}          % Frame for quoting blocks         \mdfdefinestyle{quoteFrameStyle}{             fontcolor         = bigQuoteColorNormal,%             backgroundcolor   = bigQuoteColorBack,%             linewidth         = \bigQuoteBorderWidth,%             leftmargin        = \bigQuoteOuterMarginHorizontal,%             rightmargin       = \bigQuoteOuterMarginHorizontal,%             innerleftmargin   = \bigQuoteInnerMargin,%             innerrightmargin  = \bigQuoteInnerMargin,%             innertopmargin    = \bigQuoteInnerMargin,%             innerbottommargin = \bigQuoteInnerMargin,%         }          % The big quotes         \newcommand*\bigQuotefont{\fontfamily{fxl}} % selects Libertine for quote font              \newcommand*{\bigQuoteOpening}{%             \tikz[%                 remember picture,%                 overlay,%                 xshift=-15pt,%                 yshift=-10pt%             ]             \node (OQ) {\bigQuotefont\fontsize{60}{60}\selectfont``};             \kern0pt         }         \newcommand*{\bigQuoteClosing}{%             \tikz[                 remember picture,                 overlay,                 xshift=15pt,                 yshift=-10pt             ]             \node (CQ) {\bigQuotefont\fontsize{60}{60}\selectfont''};         }          % Block mode         \pgfkeys{             /quote/.is family,             /quote,                 author/.initial = {},                 title/.initial  = {},                 editor/.initial = {}         }         \newenvironment{Quote}[1][]{%     % Management of the keys.             \pgfkeys{/quote, #1}             \pgfkeysgetvalue{/quote/author}{\@author}             \pgfkeysgetvalue{/quote/title}{\@title}             \pgfkeysgetvalue{/quote/editor}{\@editor}     % Let's go !             \medskip             \begin{mdframed}[style=quoteFrameStyle]             \quoteRefFormatBefore{\@author}%                                  {\@title}%                                  {\@editor}%         }{%             \quoteRefFormatAfter{\@author}%                                 {\@title}%                                 {\@editor}%             \end{mdframed}             \medskip         }     % 1  -->  Author     % 2  -->  Title     % 3  -->  Editor         \newcommand\quoteRefFormatBefore[3]{%             \bigQuoteOpening % Problem !!!         }     % 1  -->  Author     % 2  -->  Title     % 3  -->  Editor         \newcommand\quoteRefFormatAfter[3]{{             \footnotesize             \par\smallskip             \hfill #1             \par             \hfill \quote*{#2}             \par             \hfill {\scriptsize#3} \bigQuoteClosing % Problem !!!         }}     \makeatother               \begin{document}          \bigQuoteOpening          \end{document}      ## Working code for big quotes               \documentclass[12pt]{article}         \usepackage[utf8]{inputenc}         \usepackage[T1]{fontenc}     %   \usepackage{libertine} % or any other font package (or none)         \usepackage[svgnames]{xcolor}         \usepackage{tikz}          % Make commands for the quotes         \newcommand*\quotefont{\fontfamily{fxl}} % selects Libertine for quote font              \newcommand*{\openquote}{%             \tikz[                 remember picture,                 overlay,                 xshift=-15pt,                 yshift=-10pt             ]             \node (OQ) {\quotefont\fontsize{60}{60}\selectfont``};             \kern0pt         }         \newcommand*{\closequote}{%             \tikz[                 remember picture,                 overlay,                 xshift=15pt,                 yshift=-10pt             ]             \node (CQ) {\quotefont\fontsize{60}{60}\selectfont''};         }          % wrap everything in its own environment         \newenvironment{shadequote}{%             \begin{quote}\openquote %         }{%             \hfill\closequote\end{quote} %         }              \usepackage{lipsum}         \newcommand*\bigQuotefont{\fontfamily{fxl}} % selects Libertine for quote font              \newcommand*{\bigQuoteClosing}{%             \tikz[                 remember picture,                 overlay,                 xshift=15pt,                 yshift=-10pt             ]             \node (CQ) {\bigQuotefont\fontsize{60}{60}\selectfont''};         }     \begin{document}          \lipsum[1]          \begin{shadequote}     A common mistake that people make when trying to design something completely     foolproof is to underestimate the ingenuity of complete fools.\par\emph{Douglas Adams}     \end{shadequote}          \lipsum[1]          \end{document}


title: Maximizing number of words with constraints on number of characters and lines per inch

text: An organization has the following specs for submitted articles: (a) maximum of 15 characters per 2.5 cm (b) maximum of 6 lines per 2.5 cm (c) minimum font size of 10 (d) Computer Modern font (e) 2.5 cm margins. Assuming an ``average text'', how can I maximize the number of words per page with such constraints? It appears to me that with font size of 10 you get more than 15 characters per inch, so I am not sure if the specs are all that well stated. (To be conservative, or to make calculation easier, I suppose by 2.5 cm we can assume they meant one inch.) A related article is 6 lines per inch.


title: xparse command with just optional argument fails

text: I am trying to define a command with xparse that takes an optional argument but no mandatory argument. The optional argument is a number, which works fine with a single digit but not with more. The command is as follows:               \usepackage{xparse}     \usepackage{xspace}          \NewDocumentCommand \HL { o } {\IfNoValueTF #1 {\emph{HL}\xspace}{\emph{HL} {#1}\xspace}}          \HL     (\HL[1])     (\HL[10])      I want the following result: > _HL_ > > ( _HL_ 1) > > ( _HL_ 10) But I get this: > _HL_ > > ( _HL_ 1) > > ( _HLHL_ 10)


title: pgfgantt chart with weekdays and dates

text: What i have is this:               \documentclass[a4paper]{article}     \usepackage{pgfgantt}     \usepackage{pgfcalendar}     \usepackage[a4paper,landscape,left=1cm,top=1cm,%     bottom=1.5cm,right=1cm]{geometry}     \begin{document}     \begin{ganttchart}[vgrid, hgrid]{42}     \gantttitle{Title}{42} \\     \gantttitlelist[title list options={var=\y, evaluate=\y as \x using "\pgfcalendarweekdayshortname{\y}"}]{5,6,0,1,2,3,4}{6}     \ganttgroup{x}{1}{42} \\     \ganttbar{l}{1}{3} \\     \ganttgroup{y}{1}{42} \\     \ganttbar{l}{1}{3} \\     \ganttgroup{z}{1}{42} \\     \ganttbar{l}{1}{3}      \end{ganttchart}     \end{document}      But i want the dates of these shortnames also be printed, seperated by a comma each day. Just like for example: Sat, 17.11.12 .. . .. . . . . Fri, 23.11.12. I searched a little but so much information seems like overwhelming. Thanks for your help.


title: How I can customize fbox and hrule?

text: I want to customization a sample exercises for a book. I like so much this style: ![example style](http://i.stack.imgur.com/0iZku.jpg) I think that is possible with `fbox` and `hrule`, but I don't know how I can do it. No need to use `fbox` and `hrule` if there is another way to do. EDIT: The bottom rule is here Creating a custom rule UPDATE: I have made my example code with the help Dan and azetina. Thank you both and now I share the code:               \documentclass{article}     \usepackage{multicol}     \usepackage{colortbl}     \usepackage{blindtext}     \usepackage{xcolor}     \usepackage{amsmath}     \usepackage{amssymb}               \addtolength\textwidth{2cm}     \addtolength\oddsidemargin{-1cm}     % 1. define its color     \definecolor{ejemplo}{RGB}{37,153,116}     % 2. define its counter, to be reset with each section     \newcounter{ejemplo}[section]     \renewcommand\theejemplo{\mdseries\normalsize\thesection.\arabic{ejemplo}}     % 3. define the environment. Its argument is the name of the example.     \makeatletter     \newenvironment{ejemplo}[1]{%         \bigbreak         \refstepcounter{ejemplo}         \par%     % (a) heading         \noindent{\color{ejemplo}\large\sffamily         {\setlength{\extrarowheight}{5pt}\begin{tabular}{ll@{}}%         \hline             \cellcolor{ejemplo}\color{white}%             \textmd{\normalsize Ejemplo} \theejemplo&\bfseries #1%         \end{tabular}}}\par     % (b) space after and no indentation after         \begin{multicols}{2}             \vspace{1em}%             \@afterindentfalse             \@afterheading     }   {\end{multicols}     % (c) place the custom rule         \noindent{\color{ejemplo}%         \parbox{\linewidth}{%             \hrulefill\rule{2em}{0.4em}}%         }\par%         }     % The solution     \newcommand\solucion{         \par\vspace{1em}         \noindent         \colorbox{ejemplo}{\textsc{\MakeLowercase{\sffamily\mdseries\color{white}Soluci\'on}}}%         \par\vspace{1em}         \@afterindentfalse         \@afterheading     }     \makeatother      And here the result: ![example](http://i.stack.imgur.com/53nzo.png)


title: Bibliography details (volume, page numbers) not printed

text: In all bibliography styles I found online, volume and page numbers are printed. However, whenever I try this does not happen, I only get authors, title, journal and year for articles, and only title, publisher and year in books. I use bibtex:               \bibliographystyle{plain}     \bibliography{myreferences}      What am I doing wrong? I am probably overlooking something really basic. EDIT: example bib-entry:               @Article{Pope00,     author = {Pope, R.J. and Millington, A.C.},     title = {Unravelling the patterns of alluvial fan development using mineral magnetic analysis: examples from the {S}parta basin, {L}akonia, southern {G}reece},     journal = {Earth surface processes and landforms},     year = {2000},     OPTvolume = {25},     OPTpages = {601-615},     }


title: Electric network one-line diagrams

text: I'm looking for a way of drawing one line diagrams of power distribution grids. So far I've come across CircuiTikZ, but this package seems to be oriented to a different kind of circuit diagram and doesn't include basic components such as buses. Does anyone know of a package that I could use for this? Here is an example of such a diagram: ![Aufnahmefähigkeit von Niederspannungsverteilnetzen für die Einspeisung aus Photovoltaikkleinanlagen - Georg Kerber](http://i.stack.imgur.com/Fxbic.jpg)


title: mathematical symbols

text: I'm using multidimensional formulas in my work and to differ it from the onedimensional ones I denote it by `\mathbf`, but what am I supposed to use in the definition and theorems environment to look samely almost like italic?


title: Overcome 'Dimension too large' when using the forest package with a lot of nodes

text: I am drawing a genealogical tree with the forest package in which I have approximately 50 nodes. I have reached a point where I get the message "Dimension too large" when I try to add another node. I have read this and this, which give me an appreciation of the origins of the error, but not much help into what I can do to resolve it. I am including the tex below; apologies for its length, but I only get an error when I have so many entries. Uncommenting one of the entries will give you the error. The original code was taken from the answer of this question and the Helvet Neue fonts required can be found here.                 \documentclass{standalone}     \usepackage{tabularx}     \usepackage{forest}     \usepackage{marvosym}     \usetikzlibrary{shapes.geometric}          \definecolor{color1}{HTML}{FFFFFF}     \definecolor{color2}{HTML}{FFFFFF}          \newcommand\Person[8]{%       {\textbf{#1}} \\       \begin{tabular}{cl}        b: & #2 \\         d: & #3 \\          & #4 \\         \end{tabular} \\       {\textbf{#5}} \\       \begin{tabular}{cl}        b: & #6 \\         d: & #7 \\          & #8 \\        \end{tabular}     }          \newcommand\SinglePerson[4]{%       {\textbf{#1}} \\       \begin{tabular}{cl}        b: & #2 \\         d: & #3 \\          & #4 \\         \end{tabular}     }              \begin{document}              \begin{forest}         delay={           for tree={             edge path={               \noexpand\path[\forestoption{edge}]                 ([xshift=-(6pt-1pt*level)].child anchor) to[out=180,in=0]                 ([xshift=(6pt-1pt*level)]!u.parent anchor)\forestoption{edge label};             },             if n=1               {fill=color1,shape=tape,tape bend bottom=none}               {if n'=1                 {fill=color2,shape=tape,tape bend top=none}                 {}               }           }         },         for tree={           line width=3pt,           inner sep=4pt,           draw=brown,           minimum size=1cm,           text width=4.5cm,           child anchor=west,           parent anchor=east,           grow=east,           l sep=8cm,           s sep=10pt,           draw,           anchor=west,           edge={line width=(18pt-3pt*level),line cap=rect,color=brown},         }         [\Person{L----}{}{}{}{}{}{}{}         [\Person{K----}{}{}{}{M----}{}{}{}         [\Person{P----}{}{}{}{A----}{}{}{}          [\Person{M----}{}{}{}{}{}{}{}]         [\Person{M----}{}{}{}{}{}{}{}]         [\Person{P----}{}{}{}{}{}{}{}]         [\Person{K----}{}{}{}{}{}{}{}]         [\Person{T----}{}{}{}{}{}{}{}]         [\Person{E----}{}{}{}{}{}{}{}]         ]         [\Person{L----}{}{}{}{E----}{}{}{}          [\Person{M----}{}{}{}{}{}{}{}]         %[\Person{E----}{}{}{}{}{}{}{}]         %[\Person{K----}{}{}{}{}{}{}{}]         %[\Person{S----}{}{}{}{}{}{}{}]         %[\Person{M----}{}{}{}{}{}{}{}]         %[\Person{A----}{}{}{}{}{}{}{}]         ]         [\Person{K----}{}{}{}{}{}{}{}          %[\Person{A----}{}{}{}{}{}{}{}]         %[\Person{T----}{}{}{}{}{}{}{}]         [\Person{G----}{}{}{}{}{}{}{}]         ]         [\Person{N----}{}{}{}{F----}{}{}{}          [\Person{M----}{}{}{}{}{}{}{}]         ]         [\Person{C----}{}{}{K----}{}{}{}{}          [\Person{A----}{}{}{}{}{}{}{}]         [\Person{G----}{}{}{}{}{}{}{}]         ]         [\Person{T----}{}{}{}{E----}{}{}{}          [\Person{M----}{}{}{}{}{}{}{}]         [\Person{E----}{}{}{}{}{}{}{}]         [\Person{K----}{}{}{}{}{}{}{}]         ]         [\Person{E----}{}{}{}{A----}{}{}{} ]         [\Person{S----}{ABT 1896-1900}{}{}{C----}{1890}{}{}          [\Person{M----}{1918}{}{}{}{}{}{} ]         [\Person{P----}{13 Mar 1922}{}{}{}{}{}{} ]         [\Person{G---- \Gentsroom}{7 Nov 1925}{--}{}{A---- \Ladiesroom}{17 Dec 1923}{--}{},fill=color2           [\Person{C----}{20 Oct 1950}{}{}{S---- \Gentsroom}{}{}{}            [\Person{G---- \Gentsroom}{21 Nov 1980}{}{}{M----}{}{}{}            ]            [\Person{G---- \Gentsroom}{2 Dec 1982}{}{}{M----}{}{}{}            ]           ]           [\Person{S---- \Gentsroom}{15 Jan 1953}{--}{}{K----}{}{--}{}            [\Person{T----}{}{--}{}{T---- \Gentsroom}{}{--}{}              [\SinglePerson{K----}{}{--}{}              ]            ]            [\SinglePerson{T---- \Gentsroom}{}{--}{}            ]            [\SinglePerson{R----}{}{--}{}            ]           ][\Person{A----}{}{--}{}{D---- \Gentsroom}{}{--}{}            [\SinglePerson{S---- \Gentsroom}{}{--}{}            ]            [\Person{G---- \Gentsroom}{}{--}{}{A----}{}{--}{}              [\SinglePerson{A----}{}{--}{}              ]              [\SinglePerson{D---- \Gentsroom}{}{--}{}              ]            ]            [\SinglePerson{N----}{}{}{Tseri, Nicosia}            ]           ]           [\Person{M----}{13 Feb 1960}{--}{}{N---- \Gentsroom}{8 Jul 1958}{--}{}             [\Person{N----}{19 Nov 1987}{--}{}{C---- \Gentsroom}{}{--}{}             ]             [\SinglePerson{D---- \Gentsroom}{4 Dec 1989}{--}{}             ]             [\SinglePerson{C----}{22 May 1995}{--}{}             ]           ]         ]         [\Person{M----}{1928}{}{}{}{}{}{} ]         ]         [\Person{G----}{}{}{}{E----}{}{}{}         [\Person{A----}{}{}{}{}{}{}{}]         [\Person{K----}{}{}{}{}{}{}{}]          ]         [\Person{M----}{}{}{}{}{}{}{}         [\Person{A----}{}{}{}{}{}{}{}]         [\Person{E----}{}{}{}{}{}{}{}]          ]         ]         ]         \end{forest}              \end{document}      Any ideas on how to resolve this?


title: Biblatex / Biber full citation for first occurrence only

text: I'm in the process of switching from BibTeX to BibLaTeX/biber. I've searched around but can't seem to find/figure out how to style the citations a particular way and I'd appreciate some help. I'm using the tufte-latex package so citations appear in the margins. I'm looking to have the first occurrence of a citation give the full citation, i.e., Author, Title, publisher, year, and the remaining citations of that item simply give the numeric citation, i.e., author [citation number]. My current biblatex options are:               \usepackage[     natbib=true,     bibstyle=numeric,      block=nbpar,      citestyle=numeric,      backend=biber     ]{biblatex}      Two types of references are found in the text, the standard citation which appears as its own margin note, and a citation appearing within a margin note. To accommodate this I use the BibLaTeX commands `\textcite{}` for citations within a margin note (giving "Author [cit. number]"), and `\autocite{}` for standard citations with autocite being defined as follows.               \renewcommand{\autocite}[1]{\sidenote{\textcite{#1}}}      But again, what I would like is to have this set-up (or similar) but have the initial occurrence of each citation give the full citation (Author, title, pub, year, etc..) and the remainder go back to the numeric version I currently have. Is this possible?


title: A problem with `amsthm` and positive `\parskip`

text: I want my paragraphs to be separated by some whitespace and not indented. However, there is way too big a space between end of a theorem and begin of a proof (an MWE follows). What are my options to fix it? ![enter image description here](http://i.stack.imgur.com/s2RaG.png)               \documentclass{article}          \setlength{\parindent}{0pt}     \setlength{\parskip}{\baselineskip}          \usepackage{amsthm}          \newtheorem{theorem}{Theorem}     \newtheorem{definition}{Definition}          \begin{document}          \begin{definition}       As any dedicated reader can clearly see, the Ideal of practical       reason is a representation of, as far as I know, the things in       themselves; as I have shown elsewhere, the phenomena should only be       used as a canon for our understanding.     \end{definition}          \begin{theorem}       Let us suppose that the noumena have nothing to do with necessity,       since knowledge of the Categories is a posteriori.     \end{theorem}     \begin{proof}       As is shown in the writings of Aristotle, the things in themselves       (and it remains a mystery why this is the case) are a representation       of time. Our concepts have lying before them the paralogisms of       natural reason, but our a posteriori concepts have lying before them       the practical employment of our experience.     \end{proof}          \end{document}


title: Minted gets error when encounters a dollar

text: I'm using minted to try to list & color some pieces of plpgsql (PostgreSQL's plsql), namely some functions and triggers. The problem appears when I write the dollars as               $$      or               $BODY$      which are needed to specify the body of the function. Here is an example:               \begin{minted}{postgresql}               CREATE EXTENSION IF NOT EXISTS dblink;     CREATE OR REPLACE FUNCTION update_vendite()     RETURNS int     AS          $BODY$     DECLARE         quantitaV int;         tot double precision;     BEGIN              SELECT INTO quantitaV qta               FROM vendite_ft WHERE id=2'         RETURN quantitaV;          END;          $BODY$     LANGUAGE 'plpgsql';     \end{minted}      When I try to compile (I'm using TexShop 3.11 for OS X Lion) I get this error from pygments:               *** Error while highlighting:     TypeError: 'NoneType' object is not subscriptable        (file "/Library/Python/2.7/site-packages/Pygments-1.5-py2.7.egg/pygments/formatters/latex.py", line 133, in _get_ttype_name)          (./es_progetto.out.pyg)      it appears as if that syntax is not supported (ignoring the error and continuing compiling gives a listed code printed and stopped at the first `$BODY$` included, removing the `$BODY$`s from the code gives no error at all). Am I missing something using minted? How can I circumvent this? **UPDATE** : I've found this related question here which makes me wonder if you can reproduce the error or it is just me who gets it. **UPDATE2** Here is a mwe that still gets me the error:               \documentclass[11pt]{article}     \usepackage{minted}          \begin{document}     \begin{minted}{postgresql}          CREATE EXTENSION IF NOT EXISTS dblink;     CREATE OR REPLACE FUNCTION update_vendite()     RETURNS int     AS          $BODY$     DECLARE     quantitaV int;     tot double precision;     BEGIN          SELECT INTO quantitaV qta         FROM dblink('hostaddr=127.0.0.1 port=5433 dbname=autoricambi                       user=foodmart password=foodmart',                   'SELECT qta, pz_unit FROM vendite_ft WHERE id=2')         AS t(qta int, pz_unit double precision);              RETURN quantitaV;          END;          $BODY$     LANGUAGE 'plpgsql';     \end{minted}     \end{document}      **UPDATE 3** This is an interesting issue: if I comment the `$BODY$` line with plpgsql comment syle (`'--'`) minted does not give an error but in the output the dollars are substituted with the pound symbol! ![dollars to pounds](http://i.stack.imgur.com/9y2rH.png) can anybody confirm this issue too? can this be related to localization? **UPDATE 4** Based on the hypotesis that the pygment lexer is the problem, I tried to use only `$BODY` and it works, the problem lies on the fact that the last dollar is unrecognized. It appears that pygments uses an external lexer for the strings starting with a dollar...


title: Using variables in constructing new labels

text: First, apologies for my lack of knowledge in this matter. I am trying the following code without really understanding every bit and piece of it. Anyway, can anyone help me find what is wrong with the following code?               \def\pm #1#2{\@bsphack     \newcommand{\currentValue}{\ref{#1}}       \protected@write\@auxout{}%       {\string\newlabel{test\currentValue}{{#2}{\thepage}}}%     \@esphack}      My intentions? To define a `\pm` command that takes two arguments. The first argument needs to be used as a reference itself in order to obtain another variable: `\currentValue`. Then, this variable (`\currentValue`) is appended to some other text ('test') in order to create a new label. Things look good, but for some reason, when the final label is created, an `\hbox {}` is appended to the end of the `test\currentValue` label. Any idea what the problem is? Or how can I achieve my goal, if not in this manner?


title: Print answer key to multiple choice questions

text: I'm using the `exam` document class, and I'd like to print the letter of the correct answer. Something like:               \documentclass{exam}     \begin{document}          \begin{questions}              \question This is a multiple choice question         \begin{choices}            \choice this is a choice            \choice this is another choice            \CorrectChoice this is the correct choice            \choice this is another choice         \end{choices}              The answer is /theCorrectChoice          \end{questions}          \end{document}      I've seen similar issues online but I haven't been able to find a good way to directly reference "the correct choice" the way you can reference /thequestion, for example. Does anyone know how to solve this?


title: Wrong names for theorems/lemma/etc. in LyX

text: I am using LyX 2.0.3, and I usually type my documents (my lecture notes, mainly) in french. Now, I have to write a paper in english, I can't get the label names of the AMS Theorems package to be in english and not in french. They appear in french in the user interface - which, I guess, is the normal behavior - and they are still in french in the PDF. This is weird, because:   * the language of my document is setup as « English »,   * the language pack option in « Documents parameters » → « Language » is « Automatic » (but I have tried all the other options and none is working),   * and LyX automatically uses babel. When I export in LaTeX, the following lines are added :               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.     \theoremstyle{plain}     \newtheorem{thm}{Théorème}       \theoremstyle{definition}       \newtheorem{defn}[thm]{Définition}       \theoremstyle{remark}       \newtheorem*{rem*}{Remarque}       \theoremstyle{plain}       \newtheorem{cor}[thm]{Corollaire}       \theoremstyle{plain}       \newtheorem{prop}[thm]{Proposition}       \theoremstyle{plain}       \newtheorem{fact}[thm]{Fait}      I do not know what adds them. If I manually replace them by their english equivalent, it works fine. So, is there a better solution than to systematically add all the correct definitions in the preambule? Additionally, should I send a bug report to the Lyx developers?


title: PGFPlots - trying to combine legends

text: I have an interesting problem. I am trying to create two graphs using the groupplots environment, side-by-side, that show different sets of data elements with different legend entries and different markers. I'd like to combine their [disjoint] legend entries into a single common legend. For example:               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \pgfplotsset{compat=1.9}     \usepgfplotslibrary{groupplots}          \begin{document}     \begin{center}     \begin{tikzpicture}     \begin{groupplot}[     legend to name=MyLegend,     legend columns=3,     group style={group size=2 by 3,ylabels at=edge left},     ylabel style={text height=0.02\textwidth,inner ysep=0pt},     height=0.475\linewidth,width=0.475\linewidth,/tikz/font=\small]     \nextgroupplot     \addplot [color=black!90,mark=x] coordinates {         (1, 10698) (2, 10853) (4, 17151) (8, 22366)         (12,28016) (16,32345) (20,36076) (24,40908)     };     \addlegendentry{ABC}     \nextgroupplot     \addplot[color=black!75,mark=*] coordinates {         (1, 17500) (2, 14600) (4, 25300) (8, 38800)          (12,49100) (16,58800) (20,67400) (24,75000)      };     \addlegendentry{DEF}     \end{groupplot}     \end{tikzpicture}     \\     \ref{MyLegend}     \end{center}     \end{document}      ![The output is:](http://i.stack.imgur.com/HPWqS.png) I would like the legend to both display ABC and DEF, along with their respective markers.


title: How do I define a math mode formula with a caret ^ in LaTeX?

text: This question has two parts. First, is there a way to define a macro only for math mode? Second, how do I specifically get the following definition to work correctly?               \def\fi{f^{-1}}      One additional point is that I'm trying to create this definition within a local scope rather than global scope, but I'm not sure that's relevant.


title: Align TikZ node inside equation environment

text: I am trying to insert a `TikZ` node into an equation but I have some problems:   1. the = sign is not vertically centred inside the circle   2. the circle is not vertically aligned with the formula. I want to abtain the same alignment of the first equation but I failed also using the `baseline` option   3. the equal sign must be at same distance from `)` as in the first equation > **SOLUTIONS**   1. UNSOLVED   2. Solved in comments using `baseline=-\the\dimexpr\fontdimen22\textfont2\relax`   3. UNSOLVED * * *               \documentclass{article}     \usepackage{amsmath}     \usepackage{tikz}          \newcommand{\mathnodebase}{%         \tikz[inner sep = 0pt,baseline]{\node[circle,draw=black] (1) {$=$};}}     \newcommand{\mathnode}{%         \tikz[inner sep = 0pt]{\node[circle,draw=black] (1) {$=$};}}          \begin{document}     \begin{equation}     \prod_{z^n=-1}(w_1(z)^n+1) =     \end{equation}     \begin{equation}     \prod_{z^n=-1}(w_1(z)^n+1) \mathnodebase     \end{equation}     \begin{equation}     \prod_{z^n=-1}(w_1(z)^n+1) \mathnode     \end{equation}     \end{document}          ![enter image description here](http://i.stack.imgur.com/krjOv.png)


title: How do I call microtype's \SetProtrusion in the preamble?

text: In this answer about full justification for italic text, I used `microtype`'s `\SetProtrusion` to get better-looking margin kerning for italics. It works fine, but I had to call `\SetProtrusion` after `\begin{document}`, which is clearly not nice. I tried it in the preamble: Then it compiles, but the new protrusion table isn't used. I tried it with `\AtBeginDocument`, but this gave a _very_ long error message, starting with               Package microtype Warning: Unknown slot number of character     (microtype)                ` A '     (microtype)                in font encoding `OT1'.     (microtype)                Make sure it's a single character     (microtype)                (or a number) in protrusion list      (microtype)                `cmr-it'.      Thus my question: How do I call `\SetProtrusion` in the preamble? (Answers which use external files are appreciated, but I'd also like to know if it's possible without that.) EDIT: Here's a minimal example (sorry for not providing that immediately).               \documentclass{article}     \usepackage{microtype}     \AtBeginDocument{%     \SetProtrusion        [ name     = cmr-it   ]        { }        { A              = {50,50},          \textquoteleft = {700, } }}     \begin{document}     \it foo     \end{document}


title: Starred version of "xtabular" not working

text: I want to insert a long table in a two-column paper. I tried "tabular" first, but the problem is that it doesn't divide the table among pages. Then people in this post suggested that I use xtab: In LaTeX, how can I make a table that takes up more than a single page? I tried it but, unfortunately, I got this error after adding the star to a working xtabular table:               ./composition-body.tex:392: Missing number, treated as zero.     <to be read again>                         |     l.392     \hline      I didn't understand the error, especially that removing the star removes the error. After some search in the internet, I thought it might expect width, so I added `{5in}` just after `\begin{xtabular*}`. This solved the compiling problem, but LaTeX still tries to insert the table in a column as shown in the following two images: ![enter image description here](http://i.stack.imgur.com/aEU3B.png) ![enter image description here](http://i.stack.imgur.com/grmKX.png) Here is the LaTeX code in case you want to read it:               \tablecaption{The factors the camera solver depends on to evaluate the rules.}     \tablehead{\hline \textbf{Factor} & \textbf{Best Value} & \textbf{$\Delta_t$} & \textbf{$\Delta_{do}$} & \textbf{Explanation} \\}     \begin{xtabular*}{5in}{|c|c|c|c|p{3in}|}         \hline         %%% ----- Rule of Thirds (Corners) -----         \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Rule of Thirds (Corners)} \\         \hline         Horizontal Distance to Corner   & 0     & HD/20         & HD        & The horizontal distance between the centre of mass of the object and the closest corner.                              \\         \hline         Vertical Distance to Corner     & 0     & HD/20         & HD        & The vertical distance between the centre of mass of the object and the closest corner.                                \\         \hline         %%% ----- Rule of Thirds (Lines) -----         \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Rule of Thirds (Lines)} \\         \hline         Line Angle                      & 45    & 15            & 30        & The angle between the prominent line of the object and the diagonal lines                                             \\ % TODO: What object? Make sure it is clear.         \hline         Line Distance                   & 0     & 0.25          & 1         & The distance, in screen coordinates, from the prominent line of the object to the diagonal lines.                     \\ % TODO: Need to define screen coordinates         \hline         Corner Distances                & 0     & 0.1           & 0.7       & The distance, in screen coordinates, from the end of the prominent line of the object to the corners of the screen.   \\         \hline         %%% ----- Diagonal Dominance -----         \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Diagonal Dominance} \\         \hline         Line Angle                      & 45    & 15            & 30        & The angle between the prominent line of the object and the diagonal lines                                             \\ % TODO: What object? Make sure it is clear.         \hline         Line Distance                   & 0     & 0.25          & 1         & The distance, in screen coordinates, from the prominent line of the object to the diagonal lines.                     \\ % TODO: Need to define screen coordinates         \hline         Corner Distances                & 0     & 0.1           & 0.7       & The distance, in screen coordinates, from the end of the prominent line of the object to the corners of the screen.   \\         \hline         %%% ----- Visual Balance -----         \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Visual Balance} \\         \hline         Horizontal Center               & 0     & 0.1           & 0.5       & The horizontal component of the centre of mass of all the objects of the rule.                                        \\ % TODO: What does "objects" mean here? It should be well explained.         \hline         Vertical Center                 & 0     & 0.1           & 0.5       & The vertical component of the centre of mass of all the objects of the rule.                                          \\ % TODO: What does "objects" mean here? It should be well explained.         \hline         %%% ----- Boundary Rule -----         \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Boundardy Rule} \\         \hline         Left Outside                    & 0     & 5\% BW        & 25\% BW   & The width of the part of the object which is beyond the left border of the boundary specified by the rule.            \\         \hline         Right Outside                   & 0     & 5\% BW        & 25\% BW   & The width of the part of the object which is beyond the right border of the boundary specified by the rule.           \\         \hline         Top Outside                     & 0     & 5\% BH        & 25\% BH   & The height of the part of the object which is beyond the upper border of the boundary specified by the rule.          \\         \hline         Bottom Outside                  & 0     & 5\% BH        & 25\% BH   & The height of the part of the object which is beyond the lower border of the boundary specified by the rule.          \\         \hline         %%% ----- Framing Rule -----         \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Framing Rule} \\         \hline         Left Delta                      & 0     & 5\% FW        & 25\% FW   & The distance between the left of the object's frame and the left of the frame specified by the rule.                  \\         \hline         Right Delta                     & 0     & 5\% FW        & 25\% FW   & The distance between the right of the object's frame and the right of the frame specified by the rule.                \\         \hline         Top Delta                       & 0     & 5\% FH        & 25\% FH   & The distance between the top of the object's frame and the top of the frame specified by the rule.                    \\         \hline         Bottom Delta                    & 0     & 5\% FH        & 25\% FH   & The distance between the bottom of the object's frame and the bottom of the frame specified by the rule.              \\         \hline         %%% ----- Visibility Rule -----         \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Visibility Rule (Full Visibility)} \\         \hline         Visibility                      & 100   & 5             & 50        & The percentage of the visible part of the object.                                                                     \\         \hline         %%% ----- Visibility Rule -----         \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Visibility Rule (No Visibility)} \\         \hline         Visibility                      & 0     & 5             & 50        & The percentage of the visible part of the object.                                                                     \\         \hline         %%% ----- Position Rule -----         \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Position Rule} \\         \hline         Horizontal Distance             & 0     & 0.01          & 0.25      & The horizontal distance between the centre of mass of the object and the position specified by the rule.              \\         \hline         Vertical Distance               & 0     & 0.01          & 0.25      & The vertical distance between the centre of mass of the object and the position specified by the rule.                \\         \hline         %%% ----- Size Rule -----         \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Size Rule} \\         \hline         Beyond Minimum Width            & 0     & 5\% AOW       & 25\% FW   & The amount the width of the object is beyond the minimum width.                                                       \\         \hline         Beyond Minimum Height           & 0     & 5\% AOH       & 25\% FH   & The amount the height of the object is beyond the minimum height.                                                     \\         \hline         Beyond Maximum Width            & 0     & 5\% AOW       & 25\% FW   & The amount the width of the object is beyond the maximum width.                                                       \\         \hline         Beyond Maximum Height           & 0     & 5\% AOH       & 25\% FH   & The amount the height of the object is beyond the maximum height.                                                     \\         \hline         \label{table:factors}     \end{xtabular*}


title: Perpendicular lines on sloped lines

text: I'm trying to make a diagram in TikZ which is supposed to illustrate the triangle you construct when constructing a 60 degree angle. I'm having some troubles, mainly concerning the title of the question, that is: identical ticks on the triangle lines. An MWE:               \documentclass{standalone}     \usepackage{tikz}     \begin{document}         \begin{tikzpicture}[inner sep=0]             \node (origo) at (0,0) {} ;             \draw (-0.5,0)--(3,0) ;             \filldraw[fill=green!20!white, draw=green!50!black]             (0,0)--+(5em,0em) arc (0:60:5em) node[name=top,inner sep=0]{} -- cycle; % green arc             \draw (0,0)--+(5em,0em) node[name=base]{} arc (-5:100:5em) ; % large arc             \draw[red] (origo.center)--node[midway,name=a]{}(base.center)--node[midway,name=b]{}(top.center)node[midway,name=c]{}--cycle ;             \draw (5em,0) arc[start angle=115, end angle=125,radius=5em] ; % triangle top point arc         \end{tikzpicture}     \end{document}      which produces ![enter image description here](http://i.stack.imgur.com/IoHyR.png) A couple of questions follows (no surprise, eh?)   1. Usually when illustrating that a triangle has equally long sides, you "tick" each side. How can I do this? I started out by defining nodes halfway along the triangle sides, but got stuck on the `cycle` path, and don't really know how to create perpendicular, small ticks in those nodes. This is my main question, thus the question title.    2. The large arc is an attempt to illustrate how the compass often looks, and I would like it to begin a few degrees lower than zero. However, `arc (-5:100:5em)` doesn't extend the arc below, it just transforms it. As the `arc` operation yields `(start angle):(end angle):(radius)` I thought this was the way to go...   3. I expected the small arc at the lower right to show up at the top of the triangle. How can I move it up there?  I suspect that both question 2 and 3 originates from the same problem: that I don't get a grasp about the `arc` operation.


title: Is there a transformation in TikZ that transforms the positioning of nodes, but not the nodes itself?

text: I'm drawing some category theory diagrams like these:               \documentclass{article}     \usepackage{tikz}          \begin{document}         \newcommand{\dual}{\draw (-2,-1) node[below] {$X$} arc (180:0:2cm) node[below] {$^*X$};}         \begin{tikzpicture}             \dual             \node {Evaluation};         \end{tikzpicture}         \begin{tikzpicture}             \begin{scope}[yscale=-1]                 \dual             \end{scope}             \node {Coevaluation};         \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/4BgfX.png) Since the actual picture is more complicated (decorations) and I'm drawing several such pictures which are all just reflections of each other, I'd like to define the picture once and then have the others with a scope and scaling, as shown in the example. But obviously, the positions of the nodes should now be "above" and not "below". Is there a "nice" way to fix this?


title: Line thickness `thmbox`?

text: I'm using the MWE below to create a color box for my theorems. The box consists of two parts: the horizontal line on top and the rest. I want to be able to adjust the thickness of these two parts separately, whereas right now I can only do that for the whole box at once. Any ideas? Thanks a lot!               \documentclass{report}     \usepackage{thmbox}     \usepackage{xcolor}          \makeatletter     \def\thmbox@color{black}     \define@key{thmbox}{color}{\def\thmbox@color{#1}}     \def\thmbox@head#1{%       \par\noindent\vbox{%     \setbox\thmbox@box@=\hbox{%       \vrule width 0mm height 0mm depth \thmbox@vskip%       #1}%     \copy\thmbox@box@%     \ifthmbox@underline%        \color@begingroup\color{\thmbox@color}\hrule width \wd\thmbox@box@ height \thmbox@thickness\color@endgroup%     \fi}%       \hrule height 0mm\relax}     \def\thmbox@put#1{       \vskip\z@%       \noindent%       \hbox{%     {\dimen0=\thmbox@leftmargin%      \advance\dimen0-\thmbox@hskip%      \advance\dimen0-\thmbox@thickness%      \hskip\dimen0}%     \color@begingroup\color{\thmbox@color}\vrule width \thmbox@thickness\color@endgroup%     \hskip\thmbox@hskip%     \box#1%     \ifx\thmbox@style L%       \hskip\thmbox@hskip%       \color@begingroup\color{\thmbox@color}\vrule width \thmbox@thickness\color@endgroup%     \fi}%       \par\nobreak}     \def\thmbox@tail{%       \hrule height 0mm%       \ifx\thmbox@style M%         \thmbox@dim=1cm%       \else\ifx\thmbox@style L%         \thmbox@dim=\hsize%         \advance\thmbox@dim-\thmbox@leftmargin%         \advance\thmbox@dim-\thmbox@rightmargin%         \advance\thmbox@dim2\thmbox@hskip%         \advance\thmbox@dim2\thmbox@thickness%       \fi\fi%       \noindent%       {\dimen0=\thmbox@leftmargin%        \advance\dimen0-\thmbox@hskip%        \advance\dimen0-\thmbox@thickness%        \hskip\dimen0}%       \color@begingroup\color{\thmbox@color}\vrule width \thmbox@dim height \thmbox@thickness\color@endgroup%       \par}     \makeatother     \newtheorem[style=M, thickness=1pt,color=red]{theoremExa}{Example}[chapter]          \begin{document}      \begin{theoremExa}[Example Bla]        ......      \end{theoremExa}     \end{document}


title: Using Sweave to include lattice graphics - issues with colour

text: I am using Sweave and the R package nlme: when including lattice graphics, (encapsulated in the `print()` command), the `.eps` files that are generated are all in black and white. The original graphic, (which appears in R) and the saved `.pdf` file are in colour, but not the `.eps`. When including graphics which do not use the lattice package, the `.eps` files are fine. I have tried including the lattice graphics in one step, e.g.:               \begin{figure}[!h]       \begin{center}       \setkeys{Gin}{width=0.5\textwidth}       <<echo=FALSE,fig=TRUE,width=4,height=4>>=     print(      plot(intervals(sulf1comp.lis),layout=c(3,1,1)#,main="Parameter Estimates     &   95% CI"               #,sub="Sulfadoxine: Bi-Exponential nlsList Model"               ))       @      %      \caption{Parameter Estimates and 95\% Confidence Intervals for Individual Model Fits       \label{label sulf_fig2}}        %\label{fig:}       \end{center}       \end{figure}        in two steps, explicitly:               <<figa,echo=FALSE,fig=TRUE,include=FALSE>>=        print(plot(sulf1comp.nls,pid~resid(.,type="p"),abline=0,cex.axis=0.7,        #,main="Plot of Residuals by Subject (Sulfadoxine: NLS Model)"               ))          @      %         \begin{figure}[!h]       \begin{center}       \includegraphics*[height=0.5\textwidth]{analysisinprogress_sw-figa.pdf}        \caption{Residuals by Subject ID: Sulfadoxine Bi-Exponential NLS Model \label{label       sulf_fig1}}        \end{center}       \end{figure}     %        Without using the fig=T command, e.g.:                <<figa,echo=FALSE>>=          postscript("filename.eps")         print(plot(sulf1comp.nls,pid~resid(.,type="p"),abline=0,cex.axis=0.7,          #,main="Plot of Residuals by Subject (Sulfadoxine: NLS Model)"                 ))            dev.off()           @          %          And various other possibilities. I'm at my wit's end trying to figure out what I'm doing wrong. Any advice would be appreciated.


title: Flashcards class installed incompletely on MiKTeX

text: I don't have much experience with low-level LaTeX. MiKTeX (my version is `basic-miktex-2.9.3972`) always installed needed packages "on-the-fly". Trying to compile a document using `1.0.1` version of `flashcards` package (available at ctan), I encountered the following error               ! Undefined control sequence.     \reserved@b ...@onefilewithoptions #1[{\cardpaper                                                        }][{}]\noexpand \@pkgexten...      That led me to inspect the `flashcards.cls` file in `tex/latex/Flashcards`, and notice `\cardpaper` option in not defined in that document. After that, I manually downloaded `flashcards.dtx` file from ctan and compiled it twice, to produce configuration files `avery5371.cfg` and `avery5388.cfg`, as well as the documentation file. When the configuration files are present with my source file, the document compiles without problems My question: Is this "normal" behaviour (expecting that I should compile required parts of the package manually)?


title: Biber, TeX Live 2013, and OS X 10.9

text: This question is related to the question Tufte-Style Asides. I downloaded `caesar_example.tex` from Github sources and complied it from TeXShop. The output file `caesar_example.pdf` does not contain the bibliography. After examining the console I identified the following as a possible problem.               LaTeX Warning: Empty bibliography on input line 126.          [7] (./caesar_example.aux)          LaTeX Warning: There were undefined references.          Package biblatex Warning: Please (re)run Biber on the file:          (biblatex)                caesar_example          (biblatex)                and rerun LaTeX afterwards.      I was wondering if the `biber` package is not installed in my TeX Live 2013. So, I included the line `\usepackage{biber}` and re-compiled the modified `caesar_example.tex` file. Then there was no compilation and I got the following message on the console.               ! LaTeX Error: File `biber.sty' not found.          Type X to quit or <RETURN> to proceed,          or enter new name. (Default extension: sty)          Enter file name:      Then I used "TeX Live Utility" to see if this is true. I found out that the following `biber` packages are installed. `universal-da universal darwin files of biber` `x86_64-darwin x86_64-darwin files of biber` What do I have to do to get `caesar_example.tex` properly compiled? (If this question is too localized then is there a place that I can ask this question?)


title: Exercise 6.5 Knuth's TeXbook

text: Running this exercise according to the suggestions on its answer in Appendix B, I got the following result : ![enter image description here](http://i.stack.imgur.com/YFi2Q.png) The following lines can be seen in the log: `Loose \hbox <badness 4>` ... Corresponding to the line _Once upon a time_ `Underfull \hbox <badness 230>` ... Corresponding to the line _in a distant galaxy_ `Loose \hbox <badness 15>`... Corresponding to the line _called Ööç, there lived_ `Loose \hbox <badness 0>` ... Corresponding to the line _a computer named R. J._ Q1) What is the difference between a `Loose` box and an `Underfull` box ? Q2) The 4th message above has `badness = 0`. So, why the warning ?


title: Sort of "\let" for Tikz shape?

text: Is there a way to redefine the name of a Tikz object in case of name conflict, like the `\let` command for a TeX macro? As practical case, I have define a set of path decoration that can simply be used as:               \draw[pneumatic signal] (A) -- (B);      I have named one of these decoration _signal_ for an undefined signal type. But this badly chosen name is conflicting with the signal shape of the shapes.symbols library. So, do I need to rename my decoration or is there a mean to change a name as needed?


title: Misplaced \omit and \multicolumn in \IfEqCase

text: I have the following code with a command that creates rows for a tabular:               \documentclass[letterpaper,10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{xstring}          \newcommand*{\condrow}[2]{     \IfEqCase{#1}{      {l}{#2 & & \\}      {r}{ & & #2 \\}      {c}{ & #2 & \\}      {m}{\multicolumn{3}{c}{#2} \\}     }[\PackageError{condrow}{Undefined option: #1}{}]     }          \begin{document}     \begin{tabular}{|c|c|c|}      \condrow{l}{left}      \condrow{r}{right}      \condrow{c}{center}      \multicolumn{3}{c}{manual multi} \\ % WORKS      \condrow{m}{condrow multi} % FAILS     \end{tabular}     \end{document}      While using the `\multicolumn` directly in the tabular works, using `\multicolumn` through the command `\condrow` fails. My guess is that `\IfEqCase` in `\condrow` prepends something to the beginning of the `\multicolumn` command, triggering the following error:               ! Misplaced \omit.     \multispan ->\omit                         \@multispan      l.20  \condrow{m}{condrow multi}                                      % FAILS      Prepending `\\\` before `\multicolumn` in the command makes the error disappear, but inserts an empty row. The problem Misplaced \omit. \multispan with \newcommand is similar. However, the answers do not solve my case. I have tried using the `ifthen` package for branching without success. Any ideas how to fix this?


title: In LyX, is it possible to customize the special characters (specifically symbols)?

text: This could be a problem to many newcomers to LyX (and LaTeX in general), who are migrating from word processors; the story is that first I try to insert a special character, an **arrow** for example, so I choose `Insert -> Special Character -> Symbols...` from the menu, and choose the `Arrows` category. That works fine for some fonts such as the **Latin Modern Roman** but not for others such as **Palatino**. The next thing I would try is to use symbols from the **Dingbats** category. And again, it doesn't always work with errors such as `l.31 \textrightarrow{}\FiveStarConvex {} I wasn't able to read the size data for this font, so I will ignore the font specification.` The third thing I would do is to change the encoding to unicode by putting `\usepackage[utf8]{inputenc}` in the preamble (can also be done through the `Document -> Settings` dialog). This has the effect of adding many other dingbats to the **dingbats** symbol category. But again, this seems to be useless (at least from a beginner's point of view). My problem in summary is that I'm not able to insert special symbols from the `Insert -> Special Character -> Symbols...` dialog the way I can in _Open Office Writer_ for example. Is it possible to make symbol insertion more usable, probably through some configuration? Or may be using **XeTeX** helps in this situation? I tried **XeTeX** actually but it ignored the symbols I inserted, obviously because they are not supported in the font I was using. So any clue, or tutorial on this? I found that some fonts include representation for Dingbats, such as **FreeSerif**. Other fonts such as Times New Roman don't. I also found that the **Character Map tool** of Gnome doesn't show that some characters are not provided by some fonts. So may be I just need to use **XeTeX** , and find an alternative to the Gnome Character Map tool to know which fonts provide which symbols.


title: Lyx - setting bibtex options

text: I want to turn off printing of DOIs in my BibTex bibliography in Lyx. When I try to add the option **doi=false** under _Document settings -> Bibliography -> Bibliography generation -> Options_ the bibliography is not generated anymore (i.e. question mark for citation and empty bibliography). How can I set this option via Lyx ?


title: How to customize page numbering as "Chapter number + page number" in book class?

text: I am writing my final thesis, and I want to change the default page numbering like (also in TOC):               1. Introduction             1-1        1.1 Background ......... 1-1        1.1 Object ......... ... 1-2        1.1 Outline ............ 1-4          2. State of the art         2-1        2.1 Introduction ....... 2-1        2.1 Blabla ......... ... 2-4        2.1 Blabla ............. 2-18            ...          Reference                   R-1     Appendix A                  A-1     Appendix B                  A-3      where `R` and `A` stand for `Reference` and `Appendix` respectively. Using `fancyhdr`:               \fancyhead[LE]{ \thechapter - \thepage }     \fancyhead[RO]{ \thechapter - \thepage }      Where number 5 is the first page of chapter 2 and it should be `2-1`, the second page number should be like `2-2` instead of `2-6`. Besides, the Roman page number in `frontmatter` becomes like `0-XV` etc. ![enter image description here](http://i.stack.imgur.com/6arIV.png) I have been looking through some relevant posts, but all of them can not solve this issue. What I want is to make the whole document page numbering as `Chapter No. + page No.` staring with `chapter No. + 1`, and use the default Roman number for `frontmatter` pages `without chapter No.` So how to figure this out?


title: Inline listing for LaTeX code: language definition fails

text: I would like to define a command which produces inline LaTeX listings via the package `listings`. However, the language definition for LaTeX contains `[]` which seems to be the cause of the error:               \documentclass{scrartcl}          \usepackage[american]{babel}     \usepackage{listings}          \newcommand*{\Lcode}{\lstinline[language=[LaTeX]TeX]}% does not work     %\newcommand*{\Lcode}{\lstinline}% works          \begin{document}        If you like LaTeX, you write \Lcode|\LaTeX| which gives \LaTeX     \end{document}


title: Opposite of \parindent

text: I want to do the opposite of normal paragraph indentation, meaning:   1. Have no indent on the first line of each paragraph, but   2. Indent each subsequent line in the paragraph. Currently I'm using the command `\setlength{\parindent}{0pt}` to accomplish (1), but what is the command for (2)?


title: Controlling arrow distance from the destination node in TikZ

text: I'm trying to draw a simple diagram in TikZ. I used a code example from the documentation (code below). As you can see on the graphic: ![enter image description here](http://i.stack.imgur.com/N7dtB.png) there is a problem with arrows that are not touching the destination nodes. The propblem is especially visible on loop arrows. Even if I draw the simplest diagram, the arrows are always spaced from nodes. In my .tex document I use many packages so this distance may probably result in some other setting from other package. Is there a way (parameter) I can control the arrow distance from the destination node? How can I change the below code to have the tip of the arrow touch the destination node? The "shorten" param seems to control the distance from the origin node.               \begin{tikzpicture}[->,>=stealth',shorten <=1pt,auto,node distance=2.8cm,semithick]     \tikzstyle{every state}=[fill=red,draw=none,text=white]     \node[initial,state] (A) {$q_a$};     \node[state] (B) [above right of=A] {$q_b$};     \node[state] (D) [below right of=A] {$q_d$};     \node[state] (C) [below right of=B] {$q_c$};     \node[state] (E) [below of=D] {$q_e$};     \path (A) edge node {0,1,L} (B)     edge node {1,1,R} (C)     (B) edge [loop above] node {1,1,L} (B)     edge node {0,1,L} (C)     (C) edge node {0,1,L} (D)     edge [bend left] node {1,0,R} (E)     (D) edge [loop below] node {1,1,R} (D)     edge node {0,1,R} (A)     (E) edge [bend left] node {1,0,R} (A);     \node [right=1cm,text width=8cm,font=\footnotesize] at (C)     {         The current candidate for the busy beaver for five states. It is          presumed that this Turing machine writes a maximum number of         $1$'s before halting among all Turing machines with five states         and the tape alphabet $\{0, 1\}$. Proving this conjecture is an         open research problem.     };     \end{tikzpicture}      Preamble:               \pdfoutput=1     \pdfcompresslevel=9     \pdfinfo     {         /Author (xxx)         /Title (xxx)         /Subject (xxx)         /Keywords (xxx)     }          \documentclass[a4paper,onecolumn,oneside,11pt,wide,floatssmall]{mwrep}          \usepackage{mathtools}     \usepackage{tikz}     \usepackage{pgf}     \usetikzlibrary{arrows,automata}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{bookman}          \usepackage[absolute]{textpos}          \usepackage{geometry}     \usepackage{t1enc}          \usepackage[pdftex, bookmarks=true]{hyperref}          \def\url#1{{ \tt #1}}          \usepackage{listings}          \usepackage[utf8]{inputenc}               \textwidth\paperwidth     \advance\textwidth -55mm     \oddsidemargin-0.9in     \advance\oddsidemargin 33mm     \evensidemargin-0.9in     \advance\evensidemargin 33mm     \topmargin -1in     \advance\topmargin 25mm     \setlength\textheight{48\baselineskip}     \addtolength\textheight{\topskip}     \marginparwidth15mm          \clubpenalty=10000      \widowpenalty=10000      \brokenpenalty=10000      \sloppy          \tolerance4500     \pretolerance250     \hfuzz=1.5pt     \hbadness1450               \renewcommand{\chaptermark}[1]{\markboth{\scshape\small\bfseries \     #1}{\small\bfseries \ #1}}     \renewcommand{\sectionmark}[1]{\markboth{\scshape\small\bfseries\thesection.\     #1}{\small\bfseries\thesection.\ #1}}          \pagestyle{uheadings}          %\usepackage[pdftex]{color,graphicx}     \usepackage{color,graphicx}          \usepackage[utf8]{inputenc}          \usepackage[sort, compress]{cite}          \usepackage{multirow}     \usepackage{rotating}     \usepackage{longtable}     \usepackage{hyperref}     \usepackage{enumerate}     \usepackage{array}     \usepackage{tabularx}          \usepackage{glossaries}                    \makeglossaries          \theoremstyle{definition}     \newtheorem{defn}{Definicja}[section]     \newtheorem{conj}{Teza}[section]     \newtheorem{conjmain}{Teza}     \newtheorem{exmp}{PrzykĹ‚ad}[section]          \theoremstyle{plain}     \newtheorem{thm}{Twierdzenie}[section]     \newtheorem{lem}[thm]{Lemat}     \newtheorem{prop}[thm]{Hipoteza}     \newtheorem*{cor}{Wniosek}          \theoremstyle{remark}     \newtheorem*{rem}{Uwaga}     \newtheorem*{note}{Uwaga}     \newtheorem{case}{Przypadek}          \definecolor{ListingBackground}{rgb}{0.95,0.95,0.95}          \begin{document}          \input {glo/glossary}          \lstdefinestyle{incode}     {     basicstyle={\footnotesize},     keywordstyle={\bf\footnotesize\color{blue}},     commentstyle={\em\footnotesize\color{magenta}},     numbers=left,      stepnumber=5,      firstnumber=1,     numberfirstline=true,     numberblanklines=true,     numberstyle={\sf\tiny},      numbersep=10pt,      tabsize=2,     xleftmargin=17pt,     framexleftmargin=3pt,     framexbottommargin=2pt,     framextopmargin=2pt,     framexrightmargin=0pt,     showstringspaces=true,     backgroundcolor={\color{ListingBackground}},     extendedchars=true,          captionpos=b,          frame=tb,     framerule=0pt,      }          \lstdefinestyle{outcode}     {     basicstyle={\footnotesize},     keywordstyle={\bf\footnotesize\color{blue}},     commentstyle={\em\footnotesize\color{magenta}},     numbers=left,      stepnumber=5,      firstnumber=1,     numberfirstline=true,     numberblanklines=true,     numberstyle={\sf\tiny},      numbersep=10pt,      tabsize=2,     xleftmargin=17pt,     framexleftmargin=3pt,     framexbottommargin=2pt,     framextopmargin=2pt,     framexrightmargin=0pt,     showstringspaces=true,     backgroundcolor={\color{ListingBackground}},     extendedchars=true,          captionpos=b,          frame=tb,     framerule=0.1pt,      }          \renewcommand*\lstlistingname{Wydruk}     \renewcommand*\lstlistlistingname{Spis wydrukĂłw}          \pagenumbering{roman}     \renewcommand{\baselinestretch}{1.0}     \raggedbottom     \input {tex/Tytulowa}          \tableofcontents          \listoffigures     \listoftables          \printglossaries


title: spurious whitespace in \index with fixme package

text: Consider the following example:               \documentclass{article}     \usepackage{fixme}     \makeindex     \begin{document}         Ignorance is strength\index{strength}.     \end{document}      Then there will be a white space between “strength” and the full stop. What is the best way to circumvent this problem?


title: Data in table row not aligned

text: I have a pretty complicated table that gathers some decisions inside of it. I recently added a new column to the table, which did not disrupt it, but some of the rows filled with the data for the new column behave in a strange way: ![enter image description here](http://i.stack.imgur.com/rgR0Y.png) Take a look at the last column. You can see it doesn't have a "+" for the "Linear" entry. The problem arise when I add a "+" there: ![enter image description here](http://i.stack.imgur.com/ePa6O.png) As you can see, the "+" for the last column is not aligned correctly with the rest of the "+"s. The important thing to notice is that I **did not** change the code of the table, I simply added a new column as I always do when I need to add a new column entry. As you can imagine the code of this table is simply huge, thus I don't think it is feasible to paste it here. If you need me to paste a small portion of it I can modify this post and add it. Thanks! EDIT:               \documentclass[10pt, conference, compsocconf]{IEEEtran}          % Package to generate and customize Algorithm as per ACM style     \usepackage[ruled]{algorithm2e}     \usepackage{tabularx}     \usepackage{longtable}     \usepackage{color}     \usepackage{rotating}     \usepackage[table]{xcolor}          \definecolor{lightgray}{rgb}{.9,.9,.9}     \definecolor{darkgray}{rgb}{.4,.4,.4}     \definecolor{purple}{rgb}{0.65, 0.12, 0.82}               \renewcommand{\algorithmcfname}{ALGORITHM}     \SetAlFnt{\small}     \SetAlCapFnt{\small}     \SetAlCapNameFnt{\small}     \SetAlCapHSkip{0pt}     \IncMargin{-\parindent}     \hyphenation{op-tical net-works semi-conduc-tor}          \clubpenalty=10000      \widowpenalty = 10000          % Document starts     \begin{document}          \title{title something}     \maketitle     \newcolumntype{x}[1]{>{\centering\hspace{0pt}}b{#1}}     \newcolumntype{?}[1]{!{\vrule width #1}}     \begin{table*}     \centering     \small              \definecolor{light-gray}{gray}{0.90}         \rowcolors{1}{white}{light-gray}         \begin{tabularx}{0.504\textwidth}{c|l%b{23mm}                 %|c                 %|l                 |x{2.2mm}                 %|c                 %|l                 %|x{2.2mm}                 |c?{0.3mm}                 %|c                 %|l                 x{2.2mm}                 %|c                 %|l                 |x{2.2mm}                 %|c                 %|l                 |x{2.2mm}                 %|c                 %|l                 |x{2.2mm}                 %|c                 %|l                 %|x{2.2mm}                 |c?{0.3mm}                 %|c                 %|l                 x{2.2mm}                 %|c                 %|l                 |x{2.2mm}                 %|c                 %|l                 |x{2.2mm}                 %|c                 %|l                 |x{2.2mm}                 %|c                 %|l                 |x{2.2mm}                 %|c                 %|l                 |x{2.2mm}                 %|c                 %|l                 |x{2.2mm}             |         }         &         \textbf{something}, something              & \begin{sideways}             b                 (2003)             \end{sideways}              & \begin{sideways}             c                 (2003)             \end{sideways}              & \begin{sideways}             d                 (2005)             \end{sideways}              & \begin{sideways}             e                 (2006)             \end{sideways}             & \begin{sideways}             f                 (2007)             \end{sideways}              & \begin{sideways}             g                 (2008)             \end{sideways}             & \begin{sideways}             h                 (2010)             \end{sideways}             & \begin{sideways}             i                 (2011)            \end{sideways}         \tabularnewline              \hline          \hline      &     %\multirow{9}{1cm}{Design Time Issues} &             \textbf{something}                                 &                      &                      &                      &                     &                          &                     &                     &                                          \tabularnewline &                 \hspace{0.5mm} something                                                        &                         +               &                         +               &                         +               &                         +               &                         +               &                         +               &                         +               &                         +                      \tabularnewline &                 \hspace{0.5mm} something                                              & %g                         +               & %h                         +               & %i                         +               & %j                         +               & %k                         +               & %l                         +               & %m                         +               & %n                         +                %o                 \tabularnewline &                 \hspace{0.5mm} something                                              & %g                         +               & %h                         +               & %i                         +               & %j                         +               & %k                                         & %l                         +               & %m                         +               & %n                         +                %o                 \tabularnewline &                 \hspace{0.5mm} something                                              & %g                                         & %h                                         & %i                         +               & %j                                         & %k                                         & %l                                         & %m                                         & %n                                          %o             \tabularnewline         \hline               \hline         \end{tabularx}         \vspace{0.4cm}         \caption{something}         \vspace{-0.5cm}     \end{table*}     \end{document}


title: How to use a colon in lstlisting keywords?

text: for the use of CSS code I've defined the following style:               \lstdefinelanguage{CSS}{         sensitive=true,         alsodigit={-},         keywords={transform, transition-property, transition-duration, transition-timing-functio},                       morecomment=[l]{//},         morecomment=[s]{/*}{*/},         morestring=[b]',         morestring=[b]"     }      In CSS3 `transform` can be a keyword and a property. Therefore, both variations are shown in blue in my document. **Screenshot:** ![s](http://i.stack.imgur.com/KR5ND.png) Keywords always end with a colon. Can this rule be used to prevent the properties being marked as keyword? **MWE:**               \documentclass{article}          \usepackage{listings}     \usepackage{color}          \definecolor{lightgray}{rgb}{0.95, 0.95, 0.95}     \definecolor{darkgray}{rgb}{0.4, 0.4, 0.4}     \definecolor{purple}{rgb}{0.65, 0.12, 0.82}          \lstdefinelanguage{CSS}{         keywords={color,background-image,margin,padding,font,weight,display,position,top,left,right,bottom,list,style,border,size,white,space,min,width, transform, transition, transition-property, transition-duration, transition-timing-function},         alsodigit={-},         sensitive=true,         morecomment=[l]{//},         morecomment=[s]{/*}{*/},         morestring=[b]',         morestring=[b]"     }          \lstset{%         % General design         backgroundcolor=\color{lightgray},         basicstyle={\small\ttfamily},            frame=l,         % Code design         identifierstyle=\color{black},         keywordstyle=\color{blue}\bfseries,         ndkeywordstyle=\color{greenCode}\bfseries,         stringstyle=\color{ocherCode}\ttfamily,         commentstyle=\color{darkgray}\ttfamily,         % Code         language={CSS},         tabsize=2,         showtabs=false,         showspaces=false,         showstringspaces=false,         extendedchars=true,         breaklines=true,         % line-numbers         xleftmargin={0.75cm},         numbers=left,         stepnumber=1,         firstnumber=1,         numberfirstline=true,     }          \begin{document}       \begin{lstlisting}             #box {                 transition-property: transform;                 transition-duration: 2s;                 transition-timing-function: linear;           }       \end{lstlisting}     \end{document}


title: Trying to use FreeSerif as a maths font -- what am I doing wrong?

text: Always in search of the ideal font combination unicorn, I thought I'd try the GNU Free UCS Outline Fonts (FreeSerif, FreeSans, and FreeMono). I seem to have fallen at the first hurdle:               \documentclass[final]{article}     \usepackage{fontspec}     \setmainfont{FreeSerif}     \usepackage{unicode-math}     \setmathfont{FreeSerif}     \begin{document}     \[x+y=\sqrt{z}\]     \end{document}      Both XeLaTeX and LuaLaTeX (`.otf` format fonts with TexLive, Windows 7) give me this: ![formatted output](http://i.stack.imgur.com/b2ow0.png) What am I missing?


title: Flexible vspace

text: I created a macro to insert diary-like right-aligned paragraphs.               \newcommand{\diarydate}[1]{\begin{flushright}\textit{#1}\end{flushright}}      Example:               \diarydate{New York, August 1992}      ![enter image description here](http://i.stack.imgur.com/GRRF0.png) This looks great at the top of the page, but not if there's a paragraph preceding it. Therefore, I want to add vertical spacing before the diarydate text if it is located between two paragraphs, but not when it's at the top of a page or right after a heading. Is there an easy command or macro that covers all those use cases?


title: Drawing an ellipse with TikZ

text: How can I draw only part of an ellipse using TikZ? I was only the top left quarter of it. I tried to use a white square box to hide the rest, but that is a tedious and ineffective method.


title: parallel or other parallel text - paragraph alignment feeding from input files

text: I am scratching my head trying to sort out an issue with parallel text (in a bilingual document). So first off I have seen many examples on stackexchange regarding this problem but not quite the solution I am looking for. In my document, I am supplying separate tex files for each chapter. So I have a set of files for one language, and then another set of files for the translation. I would like to keep it this way for various reasons, rather than write one big file with a ton of \ParallelPars every twenty lines or so to keep the paragraphs together. The different languages have significant differences in chapter length, about every page or so there is a difference of three lines so it adds up when it gets to the end (I could have an extra one or two pages of one language per chapter). Is there any way to synchronize the chapters and paragraphs of the document fed via input files? How else might this be done? Another kind of parallel paragraph package maybe? One thing I am considering is playing with the textwidth so the language that is longer has a wider column (bringing the paragraph lengths closer together) but I don't think this will look very nice. Also you will see I am useing pdfcolparallel, which helps with the use of colors in the document, which will become a PDF. Example code:               \documentclass[10pt]{article}          \usepackage{yfonts,color,lettrine,pdfcolparallel}     \usepackage[top=.5in, bottom=1in, left=1in, right=1in]{geometry}          \begin{document}          \begin{Parallel}{.47\textwidth}{.47\textwidth}     \ParallelLText{\input{cv/doc1.tex}}     \ParallelRText{\input{dr/doc1.tex}}     \ParallelPar     \newpage     \ParallelLText{\input{cv/doc2.tex}}     \ParallelRText{\input{dr/doc2.tex}}     \ParallelPar     \newpage     \ParallelLText{\input{cv/doc3.tex}}     \ParallelRText{\input{dr/doc3.tex}}     \ParallelPar     \newpage     \ParallelLText{\input{cv/doc4.tex}}     \ParallelRText{\input{dr/doc4.tex}}     \ParallelPar     \newpage     \ParallelLText{\input{cv/doc5.tex}}     \ParallelRText{\input{dr/doc5.tex}}     \ParallelPar     \newpage     \end{Parallel}     \end{document}


title: What exactly is a command in Latex?

text: In other programming languages I have come across a command is a verb; it is something for the computer to do. The things that commands act upon are called variables and these come in various types. We can have a string variable or a numeric variable or a date variable and so on, and the code usually instructs the commands to do something to the variables: @ Row(24) Col(65) Print(date), for example. In Latex, anything that starts with a backslash is called a command, so `\author{text}` is called a command despite the fact it does nothing. It is really just the declaration of a variable. Not only that, it is a variable I am unable to use, directly. If I type `\author` Latex tells me I have made an error, and if I type `\author{}` Latex assumes the author has no name. So the "command" `\author{text}` is, in real computer programming terms neither a command nor a variable. The "command" `\title{text}` is the same. If I actually want to display the title within my document I can either write it directly, by hand, or I can define a new command, `\newcommand{mytitle}{title text}` and then in the body of my document type `\mytitle`. So as far as I can determine, the command `\title{text}` does exactly nothing for my document. It is not a command in the, "do something useful" sense, it is not a variable in the, "store some data" sense. So what exactly is the proper definition of "command" in Latex?


title: bytefield doesn't work with subfigures

text: I'm trying to use `bytefield` and `subfig` (and also tested with `subfigure` with the same results) but I got the error: > ! Extra alignment tab has been changed > > to \cr. \endtemplate at the end of the `subfloat` environment. The code below reproduces the problem               \documentclass{article}     \usepackage{bytefield}     \usepackage{subfig}          \begin{document}     \pagestyle{empty}     % this works     \begin{figure}     \begin{bytefield}{16}     \wordbox{1}{A 16-bit field} \\     \bitbox{8}{8 bits} & \bitbox{8}{8 more bits} \\     \wordbox{2}{A 32-bit field. Note that text wraps within the box.}     \end{bytefield}     \caption{Some caption}     \end{figure}          % this doesn't     \begin{figure}     \subfloat[]{     \begin{bytefield}{16}     \wordbox{1}{A 16-bit field} \\     \bitbox{8}{8 bits} & \bitbox{8}{8 more bits} \\     \wordbox{2}{A 32-bit field. Note that text wraps within the box.}     \end{bytefield}     }% the error is trown here     \subfloat[]{     \begin{bytefield}{16}     \wordbox{1}{A 16-bit field} \\     \bitbox{8}{8 bits} & \bitbox{8}{8 more bits} \\     \wordbox{2}{A 32-bit field. Note that text wraps within the box.}     \end{bytefield}     }% and here     \caption{Some caption}     \end{figure}          \end{document}      ![error pic](http://i.stack.imgur.com/4HToU.png)


title: Create summary section from marked text at the end of chapter/section?

text: I am trying to automatically create a summary section/subsection at the end of a chapter/section, by marking text within the main text as part of the summary. Is there a package that does that? I am trying to do this manually. The text in the summary section/subsection is copied from marked text within the main text. I used the `collect` package to do that (inspired from Gonzalo's answer). I'm having a few issues so far:   * Text within the `collect*` environment is placed within its own paragraph in the main text.   * The `beforecol` and `aftercol` parameters of the `collect` package are separated from the text entry with a `\par` token, even when I do not provide it explicitly. I do not want that. I want them to be part of the same paragraph, unless explicitly stated.   * If I do not provide `\par` at the end of `aftercol`, the `aftercol` content and `begincol` content of the subsequent collection are merged into one.   * I am not sure how to use `\includecollection` in an `enumerate` environment such that each `\begin{collect*} ... \end{collect*}` becomes an `\item` in `enumerate`. Right now, the whole collection is treated as one big `\item`.   * Automation. I guess what I am really looking for is the ability to use something like `\summary[Before text.][After text.]{Text within main text}` which will typeset _and collect_ the text within main text normally, collect the before after parts, and produce a summary section/subsection at the end of every chapter/section, where every `\summary` is an `\item` in an `enumerate` environment. This is the least of my concerns though. `:-)` Below is what I have so far. The second summary subsection is what I would like to get. # MWE:               \documentclass{article}     \usepackage{collect}     \usepackage{multicol}          %% Gonzalo's answer: http://tex.stackexchange.com/a/166978/32206          \makeatletter     \newenvironment{summary}[2]       {\@nameuse{collect*}{thesummary}{}{}{{#1}}{{#2}}}       {\@nameuse{endcollect*}}     \makeatother          \definecollection{thesummary} % Collect summary content here.          \begin{document}          \section{El Section}     % This part should be in the summary, with some text before.     \begin{summary}{Some text before.}{}     Far quitting dwelling graceful the likewise received building. An fact so to that show am shed sold cold.     \end{summary}     Unaffected remarkably get yet introduced excellence terminated led. Result either design saw she esteem and. On ashamed no inhabit ferrars it ye besides resolve. Own judgment directly few trifling.     % This part should be in the summary, with some text after.     \begin{summary}{}{Some text after.}     Elderly as pursuit at regular do parlors. Rank what has into fond she.     \end{summary}     %% End of paragraph 1.          % This part should be in the summary, with some text before and after.     \begin{summary}{Some text before.}{Some text after.}     Lose away off why half led have near bed. At engage simple father of period others except.     \end{summary}     My giving do summer of though narrow marked at. Spring formal no county ye waited.     %% End of paragraph 2.          % Generate summary subsection. Split into two columns and enumerate.     \subsection*{Summary}     \begin{multicols}{2}       \begin{enumerate}         \item \includecollection{thesummary}       \end{enumerate}     \end{multicols}          % Ideal outcome.     \subsection*{Summary}     \begin{multicols}{2}       \begin{enumerate}         \item Some text before. Far quitting dwelling graceful the likewise received building. An fact so to that show am shed sold cold.         \item Elderly as pursuit at regular do parlors. Rank what has into fond she. Some text after.         \item Some text before. Lose away off why half led have near bed. At engage simple father of period others except. Some text after.       \end{enumerate}     \end{multicols}          \end{document}      # Output: ![Output](http://i.stack.imgur.com/VpY05.png)


title: setup neccessary latex items on windows

text: Assume that I have a fresh windows 7 and I want to setup Latex on my machine. I would need some basic software, Latex editor, bunch of packages, settings so on and so forth. Can you please provide a list of sorted items which has no duplicated stuff. I want to know what should I install and what is the order. I have tried other references and I know that one possible combination is:               teXnicCenter (Latex environment and Editor)     gsview      pstotext      pdfreader (viewer)     MikTex     ...      but my list is not complete and I am not sure about which one to install first.


title: LaTeX-Referenz package in MiKTeX

text: Since last year, I noticed that in MiKTeX there is a package called `LaTeX- Referenz` but when I try to install it, it issues an error (note the 0 Bytes file size). Is this local to my computer only or does anyone have the same issue? See images below: ![enter image description here](http://i.stack.imgur.com/7CQEc.png) ![enter image description here](http://i.stack.imgur.com/SYhnR.png)


title: Define different ranges for different data sets when plotting from a file or table

text: I would like to make a plot of several data sets that are stored in a text file (tab-separated). Is there a way of defining the x-range for which some (not all) of the data sets should be plotted? I want some data sets to plot fully, and others only in specified ranges. Consider the following example: The table: x B C D 1 3 4 5 2 4 6 3 3 4 7 4 4 5 7 2 should be plotted so that all four values of columns B and C are plotted against the x values, but only the values for which x is in the range [2,3] should be plotted for column D. In other words, I want to use \addplot three times in the same axis environment, and define the x-range separately for each data set. The condition cannot be the index. I need to use this for large data files, for which I do not know the indices of the data points I need. Hence, the input to define the points to plot must be an x interval.


title: Adding keywords to entries in bib file with a view to using JabRef as a file explorer / manager

text: I have created a bib database of maths textbooks, articles, notes etc. and I want to use JabRef to assign keywords to each entry to take advantage of the file management functionality which would result. I would be interested to hear from anyone who has done this already, either with JabRef or a similar package. How did you strike a balance between too few and too many keywords? Two extreme approaches I have in mind are:   1. More or less sticking to top level AMS MSC or a similar classification scheme.   2. Harvesting contents pages and indexes for keywords.


title: Import Simulink figures in LaTeX

text: I am writing my Thesis report using LaTeX. I have to explain about a few models that I created in Simulink in my report. I do not know how to import these Simulink models into LaTeX. Can someone help me out with this?


title: bibliography file error using apa

text: I have searched for hours trying to find a solution. I have compiled pdf to `latex` then `bibtex` then `latex` using texworks and this is the result               ! Argument of \astroncite has an extra }.     <inserted text>                      \par      l.82 ...rsts is reported by others.  \cite{McNabb}                                                        conclude that for a data ...     ?      I have `\include*` files but have commented them out to no effect. I am using `\bibliographystyle{apa}` and `\usepackage{natbib}`. Here is some of the .bib file               @article{blind,      author = {Newstead, Stephen E. \& Dennis, Ian},      year = {1990},       title = {BLIND MARKING AND SEX BIAS IN STUDENT ASSESSMENT},      journal = {Assessment \& Evaluation in Higher Education},      volume = {15},     number = {2},      pages = {132-139},      doi = {10.1080/0260293900150204},     URL = {link},      eprint = {link}     }          @article{BRW,     author = {Barrow, Michael and Reilly, Barry and Woodfield, Ruth},     title = {The determinants of undergraduate degree performance: how important is gender?},     journal = {British Educational Research Journal},     volume = {35},     number = {4},     pages = {575-597},     year = {2009},     doi = {10.1080/01411920802642322},     URL = {link},     eprint = {link}     }          @article {McNabb,     author = {McNabb, Robert and Pal, Sarmistha and Sloane, Peter},     title = {Gender Differences in Educational Attainment: The Case of University Students in England and Wales},     journal = {Economica},     volume = {69},     number = {275},     pages = {481-503},     year = {2002},      publisher = {Blackwell Publishers Ltd.},     issn = {1468-0335},     url = {link},     doi = {10.1111/1468-0335.00295},     eprint = {link}     }


title: Usage of LaTeX?

text: I've seen LaTeX being used in academic theses, letters, music scores, CVs, reaction schemes, Feynman diagrams and even exam papers. Did I miss anything intriguing?


title: Lowercase letters and numbers in blackboard bold (XeTeX)

text: I'd like to use "bbm10" and "bbmbx10" on blackboard.ps downloadable from http://www.ctan.org/pkg/blackboard. How do I?


title: Remove whitespace above section title with image formatted with leftmargin

text: I am trying to remove the whitespace above a title that is formatted with `leftmargin` and that also has an image as part of it. The problem is very similar to this question, but the solution there does not work for me and it is not using `leftmargin`. There are a variety of other similar questions, but none that I can find with solutions to this particular situation. When I remove the `leftmargin` formatting the space disappears. My code is as follows. I would welcome any feedback as to whether there is a better way of achieving the same result (with a wide left margin).               \documentclass[a4paper]{article}          \usepackage[document]{ragged2e}     \usepackage{graphicx,titlesec,lipsum}     \usepackage[vmargin=0.8cm,hmargin={8.3cm,0.8cm},showframe]{geometry}          % Unrelated: how do you include parameters to commands in \titleformat     \newcommand{\includerotate}[1]{\includegraphics[angle=180,origin=c]{#1}}          \titleformat{\section}[leftmargin]     {\huge}     {}     {0em}                              {}     [\hspace{-7.5cm}\includerotate{3_lines.pdf}\\]          \titlespacing{\section}     {0cm}{0pt}{7.5cm}          \begin{document}     \section{service overview}     \lipsum[1-2]     \end{document}      Which produces the following document. The whitespace that I am trying to remove is between the top margin and the coloured line. Here is a link to 3_lines.pdf if you want to compile the code. ![example document](http://i.stack.imgur.com/bojaH.png)