title: Can I have automatic \needspace for listings package?

text: I am using the listings package. The problem I have is that if the code gets in the middle of two packages, it is cut, which I don't want. To kind of solve that, I am using the package `needspace` and I defined my command:                 \newcommand{\needlines}[1]{\Needspace{#1\baselineskip}}      So then I can do something like:                 \needlines{2}       \begin{lstlisting}       this is one line of code       this is another one       \end{lstlisting}       \end{needlines}      The problem is that I need to do this for every piece of code and to calculate the needed number of lines. Does anyone know if there is a way to do it automatically? Just in case I paste all my code, thanks!!                   % Source Code         \usepackage{color}         \usepackage{textcomp}         \usepackage{listings}         %\usepackage{ulem}         %\usepackage[T1]{fontenc}         %\usepackage{times}         % \usepackage{needspace}                   \definecolor{source}{gray}{0.85}% my comment style         \newcommand{\myCommentStyle}[1]{{\footnotesize\ttfamily\color{gray!100!white} #1}}              % my string style         \newcommand{\myStringStyle}[1]{{\footnotesize\ttfamily\color{violet!100!black} #1}}              % my symbol style         \newcommand{\mySymbolStyle}[1]{{\footnotesize\ttfamily\color{violet!100!black} #1}}              % my keyword style         \newcommand{\myKeywordStyle}[1]{{\footnotesize\ttfamily\color{green!70!black} #1}}              % my global style         \newcommand{\myGlobalStyle}[1]{{\footnotesize\ttfamily\color{blue!100!black} #1}}              % my number style         \newcommand{\myNumberStyle}[1]{{\footnotesize\ttfamily\color{brown!100!black} #1}}              \lstset{         language={},         % characters         tabsize=3,         escapechar={!},         keepspaces=true,         breaklines=true,         alsoletter={\#},         breakautoindent=true,         columns=fullflexible,         showstringspaces=false,         % background         frame=single,         aboveskip=1em, % automatic space before         framerule=0pt,         basicstyle=\footnotesize\sffamily\color{black},         keywordstyle=\myKeywordStyle,% keyword style         commentstyle=\myCommentStyle,% comment style         frame=single,%         backgroundcolor=\color{source},         % numbering         stepnumber=1,         numbersep=10pt,         numberstyle=\tiny,         numberfirstline=true,         % caption         captionpos=b,         % formatting (html)         moredelim=[is][\bfseries]{}{},         moredelim=[is][\textit]{}{},         moredelim=[is][\uline]{}{},         moredelim=[is][\color{red}\uwave]{<wave>}{</wave>},         moredelim=[is][\color{red}\sout]{}{},         moredelim=[is][\color{blue}\uline]{}{},         % smalltalk stuff         morecomment=[s][\myCommentStyle]{"}{"},         %    morecomment=[s][\myvs]{|}{|},         morestring=[b][\myStringStyle]',         moredelim=[is][]{<sel>}{</sel>},         moredelim=[is][]{<rcv>}{</rcv>},         moredelim=[is][\itshape]{<symb>}{</symb>},         moredelim=[is][\scshape]{<class>}{</class>},         morekeywords={true,false,nil,self,super,thisContext},         identifierstyle=\idstyle,         }              \makeatletter         \newcommand*\idstyle[1]{%         \expandafter\id@style\the\lst@token{#1}\relax%         }         \def\id@style#1#2\relax{%         \ifnum\pdfstrcmp{#1}{\#}=0%         % this is a symbol         \mySymbolStyle{\the\lst@token}%         \else%         \edef\tempa{\uccode`#1}%         \edef\tempb{`#1}%         \ifnum\tempa=\tempb%         % this is a global         \myGlobalStyle{\the\lst@token}%         \else%         \the\lst@token%         \fi%         \fi%         }         \makeatother              \lstset{literate=%         *{0}{{{\myNumberStyle{0}}}}1         {1}{{{\myNumberStyle{1}}}}1         {2}{{{\myNumberStyle{2}}}}1         {3}{{{\myNumberStyle{3}}}}1         {4}{{{\myNumberStyle{4}}}}1         {5}{{{\myNumberStyle{5}}}}1         {6}{{{\myNumberStyle{6}}}}1         {7}{{{\myNumberStyle{7}}}}1         {8}{{{\myNumberStyle{8}}}}1         {9}{{{\myNumberStyle{9}}}}1         }              %\newcommand{\ct}{\lstinline[backgroundcolor=\color{white}]}         \newcommand{\needlines}[1]{\Needspace{#1\baselineskip}}         \newcommand{\lct}{\texttt}              \lstnewenvironment{code}{%         \lstset{%         % frame=lines,         frame=single,         framerule=0pt,         mathescape=false         }         }{}                   \lstnewenvironment{codeWithLineNumbers}{%         \lstset{%         % frame=lines,         frame=single,         framerule=0pt,         mathescape=false,         numbers=left,         }         }{}                   \newenvironment{codeNonSmalltalk}         {\begin{alltt}\sffamily}         {\end{alltt}\normalsize}


title: How do I get new document classes? Ubuntu

text: I just want to get more document classes. I just started running Ubuntu 12.04. I barely know how to navigate the terminal. I'm trying to edit my resume on TeXWorks, but I don't have the `resume` document class. Most of the materials I've found online have been very unhelpful, and presume a large understanding of the OS. In fact, all the Ubuntu materials seem to presume a large understanding of the OS. If you happen to know a good Ubuntu manual, that would help too. Sorry for the rookie question.


title: Shorter way to color indices of a matrix?

text: I've made a bordermatrix with brackets [] instead of (), now there are these indices on the top and left side. In my case on the top they are u_1,v_1,u_2,v_2 and so on. On the left side they are F_1x,F_1y,F_2x,F_2y. Now I would like to have all the "u_i" indices in blue and all the "v_i" indices in green. The same for the left side, all the "F_ix" blue and all the "F_iy" green. My solution looks like this and works, but if the matrix has more rows and lines this will be too much code.               \bordermatrix{~ & \color{blue!80!black}  \bf \overline {u}_1                           & \color{green!80!black} \bf \overline {v}_1                           & \color{blue!80!black}  \bf \overline {u}_5                           & \color{green!80!black} \bf \overline {v}_5 \cr         \color{blue!80!black} \bf \overline {F}_{1x} & 336000 & 0 & -336000 & 0 \cr         \color{green!80!black} \bf \overline {F}_{1y} & 0 & 0 & 0 & 0 \cr         \color{blue!80!black} \bf \overline {F}_{5x} & -336000 & 0 & 336000 & 0 \cr         \color{green!80!black} \bf \overline {F}_{5y} & 0 & 0 & 0 & 0 \cr                   }       Is there a shorter more elegant way to achieve the same result?


title: Print/Output only Equations/Math Formulas of a Given LaTeX or LyX Document

text: I have a LyX document filled with text and equations like in a scientific paper. To focus only on the math sometimes it can be really useful to only print/output the formulas and not the text around it. Is there any way to do this automatically in LyX? So far I manually copy all the equations but that is not convenient in the long run. All equations are numbered and centered in the math mode.


title: Set bullet instead of dot using \dot

text: I would like to place a bullet in the same way that `$\dot{x}$` places a dot above x. Does anyone have a clue?


title: How to force lstlisting caption names and numbers to always appear, even when captions are empty?

text: I noticed `lstlisting` environment seems to supress the caption name and number when no caption is specified. See the code below:               \documentclass{article}     \usepackage{listings}     \lstset{language=C}     \begin{document}     The listing below will have no caption.     \begin{lstlisting}     int main(int argc, char *argv[])     {         return 0;     }     \end{lstlisting}     Now this code will show the caption.      \begin{lstlisting}[caption=This is the caption]     int main(int argc, char *argv[])     {         return 0;     }     \end{lstlisting}     \end{document}      The only solution I found was to set the caption to be an empty space and to get rid of the separator, but this solution does not look very nice:               \documentclass{article}     \usepackage{listings}     \lstset{language=C}     \usepackage{caption}     \captionsetup{labelsep=none}     \begin{document}     This is not an elegant solution, but works:     \begin{lstlisting}[caption=\ ]     int main(int argc, char *argv[])     {         return 0;     }     \end{lstlisting}     \end{document}      Any ideas?


title: footnotes - on the bottom except on last page of chapter

text: My school requires that dissertations follow a set of sometimes odd formatting requirements. We have a latex class file which does a reasonable job at bringing documents into compliance with their requirements. There is, however, one requirement that I have't got a clue how to make happen: Footnote are supposed to be at the bottom of each page which can be accomplished by using footmisc. However, on the last page of a chapter the footnotes are supposed to be directly after the actual chapter text ends not at the bottom of the page. Now I can solve individual cases by adding vspace, or simply not putting footnotes at the end of my chapters. However, I'm wondering if there is a way to modify the class file to make this happen automatically.


title: Hyphens and minuses are MIA.

text: I am experiencing a strange bug involving the omission of hyphens in the .dvi file.               % This is a sample LaTeX input file.  (Version of 12 August 2004.) % % A '%' character causes TeX to ignore all remaining text on the line, % and is used for comments like this one.          \documentclass{article}      % Specifies the document class                                       % The preamble begins here. \usepackage{hyperref}          \title{ Chapter 0, A Quick Description of the Workings of a Computer }     % Declares the document's title.     \author{John M. Morrison}      % Declares the author's name.     %\date{\today}      % Deleting this command produces today's date.          \setlength{\parskip}{6pt}     \newenvironment{code}{\begin{quote}\obeylines\tt\setlength{\parskip}{0pt}}{\end{quote}}     \newenvironment{ul}{\begin{itemize}\setlength{\parskip}{0pt} }{\end{itemize}}     \newenvironment{ol}{\begin{enumerate}\setlength{\parskip}{0pt}}{\end{enumerate}}     \setcounter{section}{-1}     \begin{document}             % End of preamble and beginning of text.          \maketitle                   % Produces the title.     \tableofcontents     \input c0core.tex               \end{document}               % End of document.      This code in the document c0core.tex               \section{Integers and Computers}     Every operating system has a word size; machines today are 32 or 64 bit     machines. What does this mean? The most basic unit of memory in a computer is     an integer, or whole number. There are two types of integer, signed integers     and unsigned integers. Unsigned integers are always non-negative. Unsigned     integers are used to supply memory addresses for your computer’s RAM. Signed     integers (having a + or - sign) are often used in arithmetic. When the computer     puts them to the screen or a file, you see a sign for the integer. When the     computer manipulates them behind the scenes, it actually stores them as     unsigned integers using a very clever scheme. We will discuss this scheme     shortly, but we will begin by looking at unsigned integers.          If you have a 32 bit machine, integers have 32 bits; likewise, if you have a 64     bit machine, integers have 64 bits. A 32 bit unsigned integer can store numbers     from 0 to $2^{32}$ − 1. This number represents the 4 gig limit for usable RAM     on 32 bit machines. A 64 bit unsigned integer can store numbers from 0 to     $2^{64} − 1$; this can support memory up to 18 exabytes. Since today’s machines     are coming with 4 or more gigs of RAM, going to the 64 bit system is necessary.     A 32 bit unsigned integer can be represented with 8 hex digits; a 64 bit     integer requires 16 hex digits. Unsigned integers are just plain–vanilla binary     numbers.      The - signs and hyphens fail to appear in this segment of code. Is there a bug or conflict in the packages? Thanks for your help!


title: tilde over a symbol Phi

text: Please suggest me a way to put tilde over a symbol phi. I can easily put it over a letter but coming to the case of symbols, it is giving problems. Thanks in advance.


title: maxnames and minnames using rsc bibtex

text: I'm using BibTeX with the `rsc` citation package for citations and I'm trying to limit my bibliography so that it shows et al. if there are more than 5 names in the reference, which I can do as below:               \documentclass[11pt,a4paper]{report}     \usepackage[maxauthors=5]{rsc}     \begin{document}     Here is a citation\cite{test}     \bibliography{Biblio}      \bibliographystyle{rsc}      However, if there are more than 5 names in the citation then now it only shows the first followed by et al. whereas I'd like them to show the first 5 names followed by et al. I think you're meant to be able to do this using `minnames` but I can't make this work. Can anyone advise? Thanks in advance!


title: Contradiction in a TeXbook example?

text: This might be a little OT, but I'm curious about this: in the TeXbook the excercises 4.1 and 4.2 mention the italic correction needed in some cases. One such case is:               {\it f\/}      Since TeX is only interested in the bounding boxes for fonts it naturally cannot know which fonts have italic correction in their shapes. But as TeX is all about clean separation of content from the presentation, why am I required to do such manual _typographical_ adjustments when using fonts such as Computer Modern? Shouldn't TeX do the adjustment automatically when it meets a certain combination of (its own) fonts and characters? To me this feels like Knuth is violating his own principle of messing with manual formatting as little as possible. If I have misunderstood the need for typing `\/` all the time, please enlighten me. In any case, is it possible to automatize italic correction when `\bf`, `\it` etc. clash?


title: How to rotate the label such that its base line is parallel to the bisector?

text: How to rotate the label counter clockwise such that its base line is parallel to the bisector? ![enter image description here](http://i.stack.imgur.com/bepLX.png)               \documentclass[border=0pt,pstricks]{standalone}     \usepackage{pst-eucl}     \psset{PointName=none,PointSymbol=none}     \begin{document}          \begin{pspicture}[showgrid=false](6,6)         \pstGeonode[CurveType=polyline](1,1){A}(5,5){B}(4,1){C}         \pstBissectBAC[linestyle=dotted,linecolor=red]{A}{B}{C}{C'}         \pstMarkAngle[MarkAngleRadius=1.5,LabelSep=0.75]{A}{B}{C}{\tiny$180^\circ-\theta$}     \end{pspicture}          \end{document}


title: get math width in math unit (mu)

text: Is there any command to get the width of math in math mode and give the result in math unit of the used font?   I am using `\settowidth{\myl}{$M$}\the\myl` but the result is in pt and in would like to get the value in mu directly.


title: increase \hyphenation{word1 word-2...} capacity

text: We use LaTeX to typeset a large collection of books with many proper names. We use the `\hyphenation{word1 word-2...}` command to specify words that should not be hyphenated and to suggest hyphenation points for other words. Our problem is we have way too many words. How can we increase the capacity of `\hyphenation{...}` in, say, `TeXLive` or `MiKTeX`? (We are now stuck in a powerful but unsupported `VTeX 8.42`, but may switch to a standard distribution.)


title: Use content of keyword field of a bibtex entry to build an index when using biblatex

text: I built a reading list with biblatex with a - very - long list of court decisions. The list is built using `\nocite{*}` once, and then `\printbibliography` (actually, several `\printbibliography`s using keyword-based filtering). In its basic form, stripped of the formatting, the tex file thus looks like this:               \documentclass[%     a4paper,%     12pt,%     twoside%     ]%     {book}          \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage[%     citestyle=biblatex-mcgill,%            bibstyle=biblatex-mcgill,%     bibencoding=utf8,%     backend=biber,     abstract=true,     sorting=juranote,%     datezeros=false,%     eventdate=short,%     annotation=true,%     rating=true,     hyperref=false,%     ]{biblatex}%          \begin{document}          \nocite{*}          \printbibliography[type=jurisdiction]          \end{document}      Biblatex-McGill is my yet to be published Biblatex style, but I think for the sake of this question it is enough to know that it defines "case" as a synonym for the "jurisdiction" entry type. Each of the 380 entries is extensively tagged with keywords (according to a carefully defined taxonomy of the law). Overall, there must be around 500 different keywords in the bibliography. In each entry, the keyword field is a comma-seperated list. My question is: Is it possible to somehow automatically pass the contents of the keyword field at the moment the entry is written to an index and then print an index of all the keywords referring back to all the pages where a decision tagged with the respective keyword/index entry is printed in the bibliography. Below is a random sample of the kind of entries:               @case{BGH-2012-07-12-IX-ZB-267-11,     Crossref = {BGH},     Date = {2012-07-12},     Date-Added = {2012-11-14 13:27:04 +0200},     Date-Modified = {2012-11-14 12:23:37 +0000},     Eventdate = {2012-07-12},     Keywords = {Einwendungen gegen den Titel (internationales Vollstreckungsrecht), Vollstreckungs- und Anerkennungsrecht (internationales), BGH, IZVR, JB-gesehen, Zivilrecht},     Note = {Beschl.},     Number = {IX ZB 267/11},     Rating = {5}}          @case{BVerfG-2009-10-15-2-BvR-2438-08,         Additionalreporter = {NJW 2010, 287, wistra 2010, 60},         Crossref = {BVerfG},         Date = {2009-10-15},         Date-Added = {2012-11-11 14:32:00 +0200},         Date-Modified = {2012-11-13 19:26:58 +0000},         Keywords = {JB-gesehen, außerhalb von Wohnungen nichtöffentlich gesprochenes Wort, Kaiser, Examen, Strafprozessrecht, BVerfG, Strafrecht, Ermittlungsmaßnahmen},         Note = {Beschl.},         Number = {2 BvR 2438/08},         Preferredreporter = {BVerfGK 16, 299},         Rating = {5}}          @case{VGHMannheim-2008-04-30-5-S-2858-06,         Crossref = {VGHMannheim},         Date = {2008-04-30},         Date-Added = {2012-11-02 12:00:00 +0000},         Date-Modified = {2012-11-13 19:24:44 +0000},         Eventdate = {2008-04-30},         Keywords = {Straßen- und Wegerecht, Verwaltungsrecht, Verjährung (unvordenkliche), Verwaltungsrecht AT, VGH Mannheim, Examen, JB-gesehen},         Note = {Urt.},         Number = {5 S 2858/06},         Preferredreporter = {BWGZ 2008, 950},         Rating = {5}}          @case{OLGStuttgart-2011-11-22-10-W-47-11,         Crossref = {OLGStuttgart},         Date = {2011-11-22},         Date-Added = {2012-11-12 13:10:40 +0200},         Date-Modified = {2012-11-13 16:12:12 +0000},         Eventdate = {2011-11-22},         Keywords = {einstweilige Verfügung (ZPO), Sachenrecht, OLG Stuttgart, petitorische Einwendungen (gegen den Besitzschutzanspruch), Examen, Besitz (als absolutes Recht), Zivilverfahrensrecht, Störerhaftung, einstweiliger Rechtsschutz (ZPO), Zivilrecht, Besitzstörung, Kaiser, absolute Rechte, JB-gesehen, Besitz},         Note = {Beschl.},         Number = {10 W 47/11},         Rating = {3}}          @case{BGH-2008-11-28-LwZR-9-08,         Crossref = {BGH},         Date = {2008-11-28},         Date-Added = {2012-11-13 17:14:27 +0200},         Date-Modified = {2012-11-13 16:10:58 +0000},         Eventdate = {2008-11-28},         Keywords = {Sachenrecht, Zivilrecht, Examen, BGH, Besitz, Herausgabeanspruch des früheren Besitzers},         Note = {Urt.},         Number = {LwZR 9/08},         Rating = {3}}          @case{BGH-2012-10-25-VII-ZB-31-12,         Crossref = {BGH},         Date = {2012-10-25},         Date-Added = {2012-11-13 16:50:35 +0200},         Date-Modified = {2012-11-13 15:47:33 +0000},         Eventdate = {2012-10-25},         Keywords = {Zwangsvollstreckungsrecht, Vollstreckungsverfahren, Fahrnispfändung, Geldforderung (Vollstreckung wegen), Examen, Zivilverfahrensrecht, Forderungspfändung, Zivilrecht, BGH, Unpfändbarkeit, JB-gesehen},         Note = {Beschl.},         Number = {VII ZB 31/12},         Rating = {4}}


title: MikTeX can’t find xstring

text: I’m not using MikTeX myself but someone I developed a class for. And it seems like there’s a problem with `xstring`. The following MWE compiles fine with my TeX Live 2012 but MikTeX (on Win 7) can’t find the package, although it seem to be installed correctly installed. Furthermore MikTeX should install missing packages on the fly, shouldn’t it (the feature is activated)?               \documentclass{article}          \usepackage{xstring}          \begin{document}     Test     \end{document}      ![package manager](http://i.stack.imgur.com/7nhw4.png) ![installed files](http://i.stack.imgur.com/99To9.png)


title: Undefined control sequence on legitimate LyX macro

text: I'm trying to define a LyX macro, Insert -> Math -> Macro on the menus. It's a very simple macro. Source code under View -> View Source:               \global\long\def\Z{\mathbb{Z}}      The file compiles nicely if I don't use the macro. However, once I put a `\Z` inside a Math formula and try to compile, it gives me an _Undefined control sequence_ with the following error message:               ! Undefined control sequence.     \Z ->\mathbb                   {Z}     l.32 d$\Z              $     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.      Now, the most peculiar thing is that I have used this exact same macro on other files, where it works perfectly. In case it might be of any help, I'm using the _article_ document class on LyX 2.0.0. Could it be that the document encoding or document class make a difference? Or maybe the document language setting? A complete log of the LaTeX errors is available at this link. Thanks!


title: How to put code in beamer two column

text: I was trying to put code and a figure side by side in a `beamer` presentation. I tried two methods - one said in `beamer` documentation and other in standard LaTeX. But couldn't get the output. The two column thing works well if I don't have any code in it. I tried both `listings` and `verbatim`, with `fragile` option but in vein. The code I gave was               \begin{frame}     \begin{columns}     \column[t]{5cm}     Two     \column[t]{5cm}     test     \end{columns}      This works well. But when I gave code with `fragile` option it gave error. Code without `fragile` option also gave error.               \begin[fragile]{frame}     \begin{columns}     \column[t]{5cm}     \begin{verbatim}     Two     \end{verbatim}     \column[t]{5cm}     test     \end{columns}      The error I got is (From Log file)                [8     ] [9     ]     ! Missing $ inserted.     <inserted text>     $     l.100     I've inserted a begin-math/end-math symbol since I think     you left one out. Proceed, with fingers crossed.     ! Display math should end with $$.     <to be read again>     \par     l.100     The `$' that I just saw supposedly matches a previous `$$'.     So I shall assume that you typed `$$' both times.     ! You can't use `\unskip' in vertical mode.     \beamer@smuggle ...@zeropt \else \ifvmode \unskip     \fi \ifhmode \unskip \fi \...     l.102 \column     [t]{5cm}     Sorry...I usually can't take things from the current page.     Try `I\vskip-\lastskip' instead.     ! Extra }, or forgotten \endgroup.     \endframe ->\egroup     \begingroup \def \@currenvir {frame}     l.110 \end{frame}     I've deleted a group-closing symbol because it seems to be     spurious, as in `$x}$'. But perhaps the } is legitimate and     you forgot something else, as in `\hbox{$x}'. In such cases     the way to recover is to insert both the forgotten and the     deleted material, e.g., by typing `I$}'.     [10     ]     \tf@nav=\write6     \openout6 = `latex.nav'.     \tf@toc=\write7     \openout7 = `latex.toc'.     \tf@snm=\write8     \openout8 = `latex.snm'.     ! LaTeX Error: \begin{equation*} on input line 88 ended by \end{document}.     See the LaTeX manual or LaTeX Companion for explanation.     Type H <return> for immediate help.     ...      I also got error without code, with fragile option included. I also tried the following but in vein               \begin[fragile]{frame}     \frametitle{Structure of a \LaTeX\ document}     \begin{columns}     \begin{column}{0.5\textwidth}     \begin{semiverbatim}     test     \end{semivrbatim}     \end{column}     \begin{column}{0.5\textwidth}     \includegraphics[scale=.2]{hello}     \end{column}     \end{frame}     \end{columns}


title: ConTeXt: Page numbering in words for spanish

text: So I tried to hack the macro given in the ConTeXt wiki to write pagenumbering in words in spanish, my native language. Things were great until I had to reach the 100th page. ConTeXt claims when compiling, but I don't know how to fix the macro so it can write hundred-numbers. 'Cien' is 100 for spanish. 'Ciento uno' for 101, 'ciento dos' for 102 and so (You can see a more detailed example here). So basically I need to prepend the word 'cien' for each word number from 1 to 99 to write the one-hundreds, 'doscientos' for the two-hundreds... Here is my dirty hacked version of the macro (you may save it as 'numstr.tex' for compiling), and a minimal example as follows:               \input numstr     \defineconversion[numstring][\numstr]     \setupuserpagenumber[numberconversion=numstring]     \starttext     \dorecurse{100}{\recurselevel\page}     \stoptext      I'm such a noob with TeX and I cannot figure out how to do this. Could you TeX/ConTeXt masters give me a clue? Thank you so much!


title: MinionPro, including math, in ConTeXt

text: A rather simple question, which probably will have a complex answer. I'm trying to migrate to ConTeXt, since I want to have a layout not easily achieved with LaTeX (grid...). In LaTeX, MinionPro is working fine, including the math, after some voodoo and lots of hair pulling. I haven't touched it since. Now, how to get this stuff to work in ConTeXt as well? I started with the body font, that's the easy part. I have no clue where to look for the math font, or how to port/translate the TeX stuff I have to something ConTeXt will understand. Where do I begin? Edit: To clarify, what I currently have is               \starttypescript [serif] [minionpro]         \definefontsynonym [Serif] [name:minionproregular] [features=default]     \stoptypescript          \starttypescript [minionpro]         \definetypeface [minionpro] [rm] [serif] [minionpro] [default]         \definetypeface [minionpro] [mm] [math] [minionpro] [default]     \stoptypescript          \usetypescript [minionpro]     \setupbodyfont [minionpro,10pt]          \starttext     Hi, this is text. A formula: $x + y = z$.     \stoptext      This is obviously not enough information to make it go, it helpfully cries out with the error               error on line 14 in file tmp.tex: Math error: parameter \Umathquad\displaystyle is not set ...


title: How can I alter the ieeetr bib style to add brackets to the year?

text: I'm trying to change the bibliography from this:               [40] B. Jeziorski and H. Monkhorst, “Coupled-cluster method for        multideterminantal reference states,” Physical Review A, vol. 24,      no. 4, p. 1668, 1981.      to this               [40] B. Jeziorski and H. Monkhorst, “Coupled-cluster method for      multideterminantal reference states,” Physical Review A, vol. 24,      no. 4, p. 1668, (1981).      with brackets around the year. Currently I'm using the plain vanilla `\bibliographystyle{ieeetr}`.


title: How to get the page numbers within the margins specified in the settings in Lyx?

text: I have specified the right, left, top and bottom margins in the Lyx settings under Page margins, but the page numbers appear outside those margins. How can I force the page numbers to be within the margins? Many thanks in advance!


title: Custom LaTeX logo

text: I'm trying to get this "logo" ![My Logo, using hspace and raisebox](http://i.stack.imgur.com/015KW.png) At the moment I use the following command               \mbox{%       M\hspace{-0.25ex}%       \raisebox{0.18ex}{\tiny A}\hspace{-0.65ex}%       T\hspace{-0.65ex}%       \raisebox{0.18ex}{\tiny E}\hspace{-0.4ex}%       X%     }      But does not fit when I change the font size as '\TeX' or '\LaTeX'. I tried to modify this code, but I can not find the necessary changes               \makeatletter     \DeclareRobustCommand{\MaTeX}{%       M\kern-.09em %       {%         \setbox0\hbox{T}%         \vbox to\ht0{%           \hbox{%             \csname S@\f@size\endcsname             \fontsize\sf@size\z@             \math@fontsfalse\selectfont             A%           }%           \vss         }%       }       \kern-.40em       \hbox{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125ex X}}     \makeatother      and this (modification) ![Fake version](http://i.stack.imgur.com/fj7hn.png)


title: Allow floatfoot to left-align beneath figure, but extend past right

text: I can set my `\caption` and my `\floatfoot` as separate widths, using the following example, based on the answer to my previous question: Different width for caption and floatfoot with floatrow               \documentclass{article}     \usepackage{floatrow}     \usepackage[demo]{graphicx}     \usepackage{siunitx}     \usepackage{caption}          \begin{document}          \begin{figure}     \RawCaption%         {\caption{Selected Interatomic Distances of Protons in $\beta$-Pinene Normal Lactone}%          \label{fig:noeDistances}}\vskip\captionskip     \floatbox[{\captop}]{figure}[\FBwidth]         {}         {\includegraphics{nOeDistances}         \floatfoot{\textsuperscript{1}All distances reported are in \si{\angstrom}.%         \\ \textsuperscript{2}Selected carbon numbering is given in cyan.}}     \end{figure}          \end{document}      However, I've found that in this case the second footnote wraps because the figure width is quite small. The result I had intended to achieve, would be that the `\floatfoot` would be left aligned to the figure, but be able to extend past the right of the figure. I did try setting the width of the `\floatbox` to something greater than `\FBwidth` using the `calc` package, and then use `\FBwidth*\real{1.5}`, but this predictably puts half the extra space on each side of the float. Resulting in the `\floatfoot` no longer being left-aligned. I've also considered manually calculating the width of the image, then setting the margins myself, something like:               \def\mygraphic{\includegraphics{nOeDistances}}     \newlength\graphicwidth     \setlength\graphicwidth{\widthof{\mygraphic}}     \newlength\leftMarg     \newlength\rightMarg     \setlength\leftMarg{\textwidth-\graphicwidth/2}     \setlength\rightMarg{0pt}      But I'm just not familiar enough to complete the idea.


title: Cannot properly define an rgb color

text: I am trying to define an rgb color. More specifically I want to create this color ![enter image description here](http://i.stack.imgur.com/hvFtA.png) which in `rgb` mode it's `(98,190,177)`. I tried to define this color using the following code               \documentclass{standalone}          \usepackage{tikz}          \begin{document}      \definecolor{tank}{rgb}{0.098,0.190,0.177}      %\definecolor{tank}{rgb}{98,190,177}      \begin{tikzpicture}       \coordinate (tank) at (0,0);       \draw[red, fill=tank] (-2,0.5)--(-0.5,1)--(0.5,1)--(2,0.5)--(2,-0.5)--(0.5,-1)--(-0.5,-1)--(-2,-0.5)--cycle;      \end{tikzpicture}     \end{document}      but the output is totally different from what I am trying to achieve ![enter image description here](http://i.stack.imgur.com/kT0Mu.png) I also tried to use `\definecolor{tank}{rgb}{98,190,177}` but I get no color at all. How to properly define an rgb color?


title: How to put a symbol over another in the same line - simultaneous superscript/subscrtipt

text: Is there a way to put one symbol over the other just as in this shot of a dictionary page? http://phonetic-blog.blogspot.com/2009/09/weak.html


title: Is there a way to prevent URLs from appearing in biblatex citations?

text: I'd like to customize verbose biblatex citations to exclude URLs (and DOIs) while keeping them in the bibliography. Is there a simple way to accomplish this? While I'm at it, I'd like to get rid of the "In: " that the verbose styles use (in both the bibliography and citations), and put the URLs and DOIs on separate lines in the bibliography.


title: Latex \tracing commands list?

text: Often I need to recall the different `\tracing` commands; and a couple of times I stumbled on some webpages that worked fine for me; sadly, I didn't keep them, and my searches don't take me there anymore. So I thought I'd ask about links to where one can read a list of `\tracing` commands? For instance, TRALICS : a LaTeX to XML translator (T) mentions:               \tracingall     \tracingassigns     \tracingcommands     \tracinggroups     \tracingifs     \tracinglostchars     \tracingmacros     \tracingnesting     \tracingonline     \tracingoutput     \tracingpages     \tracingparagraphs     \tracingrestores     \tracingstats     \tracingscantokens      .. but, I'm pretty sure there was something like `\tracingboxes` ( _and not so sure if there was something like`\tracingglues`_); yet I cannot find any resources mentioning those.


title: Implementing switch cases

text: I'd like to have command built around a `switch-case` environment in LaTeX, much like the example below:               \documentclass{article}          \usepackage{xstring}          \newcommand{\dothis}[1]{%     \IfStrEqCase{#1}{{a}{so you typed a}         {b}{now this is b}         {c}{you want me to do c?}}         [nada]     }          \begin{document}          \dothis{a}          \dothis{b}          \dothis{c}          \dothis{e}          \end{document}      My problem with it is that it requires the `xstring` package. Is there any other way to do this? Preferably without loading additional packages and avoiding disgraceful thickets of `\if-\else-\fi` statements?


title: How do I manually break a line in a custom title?

text: I'm using my university's LaTeX class package to write my thesis, but I'm running into an issue with line breaks in the title. I'm required to break my title manually in a certain spot, but the following: `\title{An AUV Simulator for Incorporating \\ Physical Feedback}` gives the following error after running `pdflatex`:               ! Use of \@icentercr doesn't match its definition.     <argument> \def          l.59 \titlepage      Instead of `\\`, I've also tried `\newline` and `\par`, but nothing seems to work (no errors, but no spacing either). I've also done what was suggested here, but it gives the same error. I'm not really sure how the class package does titles, and am generally have no experience with advanced formatting. Is there a way to accomplish a line break here? (Note: `\newline` works, but the first line will be off-center relative to the rest of the page.)


title: Multiple TikZ keys with foreach

text: Playing around with pgffor, I'm trying to slightly modify an example from the TikZ/pgf manual:               \path \foreach \x/\content/\style in {%       0/a/draw,       1/b/{draw,red},       2/c/{circle,blue},       3/d/draw%     } {       node[\style] at (\x,0) {\content}     } ;      Unfortunately, this does not work for nodes with multiple `\style` options set. TikZ complains with > >     ! Package pgfkeys Error: I do not know the key '/tikz/draw,red' and I am > going >     to ignore it. Perhaps you misspelled it. >   Now, this works perfectly, when I use a comma separated list for some other variable (e.g. `\content`). So now, my question is: how can I split `\style` while executing the loop? Obviosly, pgf tries to find one key named `draw,red`, when it should be looking for two keys instead, namely `draw` and `red`. Is there some clever LaTeX macro that correctly expands the loop variable or tells pgf to expect multiple keys?


title: Specification of Warsaw Color Theme

text: Does anyone know the specification (RGB) of the `Warsaw` blue color? I want to make a custom block and want it to match the blue `Warsaw` color.


title: How to reference plot in legend?

text: I want to reference a plot in the legend. The problem is, that the little legend image from the blue plot is shown distorted in the legend. Here a minimal example:               \documentclass{minimal}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}       \begin{axis}         \addplot[color=red] coordinates {(1, 1) (2, 200)};         \addlegendentry{plot 1 (\ref{pgfplots:plot2} xy added)}              \addplot[color=blue, mark=x, forget plot] coordinates {(2, 200) (2.5, 100) (3, 50)};         \label{pgfplots:plot2}              \addplot[color=red, forget plot] coordinates {(3, 50) (4, 100)};       \end{axis}     \end{tikzpicture}\\     Here the legend image \ref{pgfplots:plot2} is displayed correctly.     \end{document}      How is it possible to fix this? Thanks for your time.


title: How to automatically arrange an unknown number of images?

text: I have several compilable LaTeX input files and their corresponding PDF files. Each PDF file contains any number of pages. I want to import each LaTeX input file with `\lstinputlisting` followed by its PDF pages as images. I have to consider   * the number of pages for each PDF file on the fly,   * the available spaces for the images to avoid getting trimmed/cropped output. The following is my MWE. Determining the number of PDF pages per file on the fly has been solved. The remaining task is to automatically arrange the imported PDF pages.               \documentclass[12pt]{book}     \usepackage[a4paper,margin=25mm,showframe=false]{geometry}     \usepackage{graphicx}     \usepackage{multido}     \usepackage{etoolbox,ifpdf,ifxetex}          \ifxetex         \newcount\pdflastximagepages         \def\pdfximage#1{\pdflastximagepages=\XeTeXpdfpagecount"#1"\relax}     \fi               \newcommand\Directory{}          \newcommand{\InsertOutput}[1]{%                 \IfFileExists{\Directory/#1.pdf}{%                         \pdfximage{\Directory/#1.pdf}%                         \multido{\i=1+1}{\the\pdflastximagepages}                             {\includegraphics[page=\i]{\Directory/#1}}                 }{The corresponding PDF file does not exist.}%     }                    \begin{document}          \renewcommand\Directory{Contents}     \InsertOutput{Article}          \end{document}      Pages in a single PDF file have the same dimension. I might need scaling factor to arrange the images. Each PDF file might need different scaling factor but the same factor will be used for the pages in a single PDF file. I prefer no more than 2 images in one row. I skipped the usage of `\lstinputlisting` code for the sake of simplicity. Using `pdfpages` package is not my option because I need the images floats and fill the available space. ## The real scenario I want to write a tutorial on LaTeX showing the code followed its output. As `LTXexample` from `showexpl` does not work well for a compilable LaTeX input file, I have to use `\lstinputlisting` and `\includegraphics`. The problem is to arrange the images following the imported code. I want to produce a tutorial like below. FOR EXAMPLE, the page `n` contains a source code and `2m` images, the page `n+1` may contain the remaining images and some sentences as the corresponding comments, with `m` and `n` are integers. ![enter image description here](http://i.stack.imgur.com/fSmOP.png)


title: authors biography for springer journal

text: How can we write authors biography in springer journal? Tried looking around on the net can't find any solution. can someone please help.


title: Glossaries and nomencl not updating after changes

text: I am running `pdflatex`, `makeglossaries`, `pdflatex`, `pdflatex` to generate my PDF using TexMaker with MikTeX on Windows. The first compilation goes smoothly, all files are generated and the glossaries and nomenclature is displayed correctly. However, if I change an existing acronym and run the same procedure again - the changes are not updated. I have to delete all files except the .pdf and .tex file and run everything again. Why are my updates not being included and/or overwritten?


title: BibLaTeX citing style

text: I'm currently trying to setup a document with the bibliography made with biblatex. I have used the template/example from this website khirevich. Everything seems to be going fine, but in his template you either cite a reference with 1, [2] and so on, or with a superscript number, and then the reference as a footnote. I would like to have an inline reference, like: (Number, Author, year) or something like that. But not just the number, and not as a footnote. My example code is currently this right now:               %%%%%%%%%%%%%%%     %   \cite (citation number of normal size in square brackets, no cite info in footnote);     %   \superfullcite (superscript citation number, full cite info in footnote);     %   \sjcitep (superscript citation number, short cite info in footnote).     %%%%%%%%%%%%%%%          \documentclass[a4paper,12pt]{article}          \usepackage[danish]{babel}     \usepackage[utf8]{inputenc}     \usepackage[margin=1.4in]{geometry}     \usepackage{amsmath, amsthm, amssymb, amsbsy}     \usepackage{lmodern}     \usepackage[T1]{fontenc}          \usepackage[hyperref=true,                 url=false,                 isbn=false,                 backref=true,                 style=custom-numeric-comp,                 maxcitenames=3,                 maxbibnames=100,                 backend=bibtex, % while checking on one of my (newest) systems, this option was needed to generate bibliography                 block=none]{biblatex}          \usepackage{hyperref}          % back reference text preceding the page number ("see p.")     \DefineBibliographyStrings{english}{%         backrefpage  = {se s.}, % for single page number         backrefpages = {se ss.} % for multiple page numbers     }          % the followings activate 'custom-english-ordinal-sscript.lbx'     % in order to print ordinal 'edition' suffixes as superscripts,     % and adjusts (reduces) spacing between suffix and following "ed."     \DeclareLanguageMapping{english}{custom-english-ordinal-sscript}     \DeclareFieldFormat{edition}%                        {\ifinteger{#1}%                         {\mkbibordedition{#1}\addthinspace{}ed.}%                         {#1\isdot}}          % removes period at the very end of bibliographic record     \renewcommand{\finentrypunct}{}          % removes period after DOI and suppresses capitalization     % of the word following DOI ("See p. xx" -> "see p. xx")     \renewcommand{\newunitpunct}{\addspace\midsentence}          \DeclareFieldFormat{journaltitle}{\mkbibemph{#1},} % italic journal title with comma     \DeclareFieldFormat[inbook,thesis]{title}{\mkbibemph{#1}\addperiod} % italic title with period     \DeclareFieldFormat[article]{title}{#1} % title of journal article is printed as normal text     \DeclareFieldFormat[article]{volume}{\textbf{#1}\addcolon\space} % makes volume of journal bold and adds colon          %%%%%%%%%     % the command \sjcitep defined below prints footnote citation above punctuation     \newlength{\spc} % declare a variable to save spacing value     \newcommand{\sjcitep}[2][]{% new command with two arguments: optional (#1) and mandatory (#2)             \settowidth{\spc}{#1}% set value of \spc variable to the width of #1 argument             \addtolength{\spc}{-1.8\spc}% subtract from \spc about two (1.8) of its values making its magnitude negative             #1% print the optional argument             \hspace*{\spc}% print an additional negative spacing stored in \spc after #1             \supershortnotecite{#2}}% print (cite) the mandatory argument     %%%%%%%%%          \bibliography{example_ref_list}  % includes file "example_ref_list.bib" with data on the cited references          \title{Title}     \author{Name}               \begin{document}     \maketitle          \section*{Aronova}     Text text               % prints author names as small caps     \renewcommand{\mkbibnamefirst}[1]{\textsc{#1}}     \renewcommand{\mkbibnamelast}[1]{\textsc{#1}}     \renewcommand{\mkbibnameprefix}[1]{\textsc{#1}}     \renewcommand{\mkbibnameaffix}[1]{\textsc{#1}}          \printbibliography          \end{document}       Sorry for all the comments, but I'm still trying to figure out using this :) So does anyone know what I have to to in order to get inline cites, and not just numbers or footnote references. Thanks in advance.


title: .tex alignment works only for the main

text: The text alignment (using the tab in emacs) works only for the main tex document but not for the included tex files. Is there any option for that? it is not really a problem but the appearance helps for the writing


title: Adjust vertical space between headline and float element(picture)

text: How to adjust vertical space between headline and float(picture)? I found this solution Adjust vertical space between headline and text box but I didn't get how enable it in my code. This my code:               \documentclass[14pt]{beamer}     \usepackage[T2A]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[english,russian]{babel}     \usepackage{amssymb,amsfonts,amsmath,mathtext}     \usepackage{cite,enumerate,float,indentfirst}     \usepackage{graphicx} % Подключаем пакет работы с графикой          \graphicspath{{images/}}     \setlength\lineskip{1pt}     \usetheme{Pittsburgh}     \usecolortheme{whale}               \setbeamercolor{footline}{fg=blue}     \setbeamertemplate{footline}{       \leavevmode%       \hbox{%       \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{}%         С. А. Халимон, ХАИ       \end{beamercolorbox}%       \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{}%         Харьков, 2013       \end{beamercolorbox}%       \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{}%       Стр. \insertframenumber{} из \inserttotalframenumber \hspace*{2ex}       \end{beamercolorbox}}%       \vskip0pt%     }          \newcommand{\itemi}{\item[\checkmark]}          \title{\small Харьковский Авиационный Институт}     \author{\small{\emph{Курсовая работа} \\%     Сервис для отображения людей с списка друзей в социальных сетях\\%     \vspace{30pt}%     \emph{Выступающий:}~С. А. Халимон\\%     \emph{Руководитель:}~ст.~преподаватель~Е. В. Бабешко}\\%     }     \vspace{20pt}%     \date{\small{Харьков, 2013}}          \begin{document}     \maketitle          \begin{frame}     \frametitle{Диаграмма классов}     \begin{figure} [h]        \center       \includegraphics [width=10cm, height=7.5cm] {ClassDiagram}     \end{figure}     \end{frame}          \end{document}       ![enter image description here](http://i.stack.imgur.com/kVkTS.png)


title: Using braket package with Lyx with WYSIWYG

text: The `braket` package defines Dirac's braket notation. To use it in Lyx, I add the line:               \usepackage{braket}      to the LaTeX preamble. Then Lyx will be able to compile commands like `\bra` and `\ket`. Problem is that the Lyx editor itself won't recognize this commands. If instead of using the `braket` package I had defined math-macros for the commands `\bra`, `\ket`, etc., I could tell Lyx how these things should look in the editor. That is, I can tell it to put an `\rangle` before the argument (that Lyx knows how to draw) and a `|` after. Is there a way to use the `\bra`, `\ket`, etc., commands from the `braket` package, and still be able to tell Lyx how these should look in the editor? EDIT: Right after posting, I discovered this question, which mentions the Instant Preview feature of Lyx. Although this kind of fixes my issue, it's not exactly what I want. I want to be able to specify what the command should look like in the editor, in terms of other commands that Lyx already recognizes (in the editor), like I would do with a math-macro.


title: Remove space below section in memoir

text: I'm growing tired of the extra space below `\section` and `\subsection` in the memoir class - it's way too big. How can I remove it - like one use `\vspace{-20pt}$`. This must be done for all `\section` and `\subsection`. What I have right now:               \documentclass[12]{memoir}          %\usepackage[danish]{babel}            \linespread{1.5}     \usepackage[bf, small, raggedright, compact]{titlesec}     \usepackage{lipsum}          \begin{document}     \chapter{Chapter title}          \section{Section heading} \lipsum[1]          \subsubsection{Subsection} \lipsum[1]          \end{document}


title: Complex Count in \foreach for number line

text: I am looking to create simple number lines. I have asked a similar question: Resetting numerical labels in \foreach commands on a numberline. But now I am in a different situation. I know how to start the counting at a different number, but how can I count from a specific number by fives. For example: I want the number line to begin at 140, but count by 5's every x coordinate.               \documentclass[letterpaper,12pt]{book}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}[line width=1pt,line cap=round,x=.5cm,y=.5cm]                         \clip (0,-0.8) rectangle (10,1);                         %   Inequality Line                         \draw   [<->,thick]     (0,0) -- (10,0);                         %   Tick Marks                         \foreach \x in {1,2,...,9}                         \draw (\x,-2pt) -- (\x,2pt) node [anchor=north,below=3pt]                          {$\scriptstyle \x$};                         %   Displayed Solution     \end{tikzpicture}                    \end{document}


title: Missing mark at legend for tikz bar chart

text: I have the following code:               \begin{tikzpicture}     \pgfplotstableread{ % Read the data into a table macro     Label   First   Second  Third     test      30     30     40     }\datatable          \begin{axis}[         xbar stacked,   % Stacked horizontal bars         xmin=0,         % Start x axis at 0         xmax = 100.01,          xticklabels={0, 0\%, 20\%,40\%,60\%,80\%,100\%},%         ytick=data,     % Use as many tick labels as y coordinates         yticklabels from table={\datatable}{Label}  % Get the labels from the Label column of the \datatable     ]     \addplot [fill=yellow] table [x=First, y expr=\coordindex] {\datatable};    % Plot the "First" column against the data index     \addplot [fill=green!70!blue]table [x=Second, y expr=\coordindex] {\datatable};     \addplot [fill=red!80!yellow] table [x=Third, y expr=\coordindex] {\datatable};     \legend{test1, test2, test3}     \end{axis}     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/Dvr55.png) **Can someone please explain why the "colour-boxes" do not show for each legend, and help me add them?** It seems to be working if I make the bar chart vertical, but I would like to keep it horizontal. Thank you very much for any help!


title: How to emulate some options of \node from TikZ

text: ![enter image description here](http://i.stack.imgur.com/y18IA.png) **Code**               \documentclass{article}     \usepackage{tikz}      \begin{document}     \begin{tikzpicture}        \foreach \a in {0,45,...,315}%        {\node[line width = 0pt,               rotate     = \a,               anchor     = west,               inner sep  = 0pt,               opacity    = .5]{\rule{.5cm}{.1cm}};}%           \end{tikzpicture}         \end{document}      I would to get the same result with `\rotatebox` and `\put` but **other interesting methods are allowed without TikZ**. Some explanations of the first code :   1. `anchor = west` is the most important if we want to place the rules at the same point    2. `inner sep = 0pt` to remove white space around the rule (> 0pt -> pretty pictures)   3. `line width = 0p` subtlety! without this a small white point appears at the center   4. `opacity = .5` only to watch how the rules are placed. **First try**               \documentclass{article}     \usepackage{tikz} % I keep TikZ because `foreach` is useful        \begin{document}           \begin{picture}(0,0)            \foreach \a in {0,45,...,315}%           {\put(0,0){\rotatebox[origin=l]{\a}{\mbox{\rule{.5cm}{.1cm}}}}}%          \end{picture}     \end{document}       ![enter image description here](http://i.stack.imgur.com/eCW83.png) It's normal because the boxes are misplaced, we can see why if we remove `put`: ![enter image description here](http://i.stack.imgur.com/NWr38.png) I'm a serious guy so I found this question and some good and useful answers so ... **Second try**               \documentclass{article}     \usepackage{tikz}      \makeatletter     \newcommand{\somespecialrotate}[3][]{%         \begingroup         \sbox\@tempboxa{\rotatebox[#1]{#2}{#3}}%         \@tempdima=-\wd\@tempboxa          \advance\@tempdima by 0.09cm  % this is one of the problem         \mbox{\hskip\@tempdima\usebox\@tempboxa}%         \endgroup}%     \makeatother         \begin{document}           \begin{picture}(0,0)            \foreach \a in {-90,-45,...,90}%           {\put(0,0){\rotatebox[origin=l]{\a}{\mbox{\rule{.5cm}{.1cm}}}}}%              \put(0,0){\somespecialrotate[origin=l]{180}{\mbox{\rule{.5cm}{.1cm}}}}%             \put(0,0){\somespecialrotate[origin=l]{135}{\mbox{\rule{.5cm}{.1cm}}}}%            \put(0,0){\somespecialrotate[origin=l]{225}{\mbox{\rule{.5cm}{.1cm}}}}%           \end{picture}     \end{document}       ![enter image description here](http://i.stack.imgur.com/cize9.png) This looks fine but `\advance\@tempdima by 0.09cm` is not serious and if I compare with the first code ![enter image description here](http://i.stack.imgur.com/LctX5.png)               \documentclass{article}     \usepackage{tikz}      \makeatletter     \newcommand{\somespecialrotate}[3][]{%         \begingroup         \sbox\@tempboxa{\rotatebox[#1]{#2}{#3}}%         \@tempdima=-\wd\@tempboxa          \advance\@tempdima by 0.09cm  % this is one of the problem         \mbox{\hskip\@tempdima\usebox\@tempboxa}%         \endgroup}%     \makeatother         \begin{document}       \begin{picture}(0,0)            \foreach \a in {-90,-45,...,90}%           {\put(0,0){\rotatebox[origin=l]{\a}{\mbox{\rule{.5cm}{.1cm}}}}}%              \put(0,0){\somespecialrotate[origin=l]{180}{\mbox{\rule{.5cm}{.1cm}}}}%             \put(0,0){\somespecialrotate[origin=l]{135}{\mbox{\rule{.5cm}{.1cm}}}}%            \put(0,0){\somespecialrotate[origin=l]{225}{\mbox{\rule{.5cm}{.1cm}}}}%           \end{picture}%     \color{red}%     \begin{tikzpicture} [overlay]     \foreach \a in {0,45,...,315}%        {\node[rotate=\a,anchor=west,inner sep=0pt,opacity=.5]{\rule{.5cm}{.1cm}};}%           \end{tikzpicture}      \end{document}       **My question** How to get the same picture with `put`and `rotatebox`?


title: Should I distinguish text that names a concept and text that is to be emphasized, on font?

text: In scientific writing, we often need to mention a term and emphasize a point. So far, I always try to distinguish these two typical cases on font, by using different series or styles, say, use slanted text (`\textsl{}`) for the former while use italicized text (`\emph{}` or `\textit{}`) for the latter. In particular, I try to avoid using boldface for the former to ease my reader. For example, for the following line > TeX is a typesetting system for professional writing. I would slant "typesetting system" and italicize (or `\emph`) "professional". But in some font sets, slant and italic font are the same, e.g., the Concerete Math font set. That means my attempt to distinguish these two cases does not work. I wonder if you think this distinction is worth. And if it is, how do you handle it? Thanks.


title: memoir class \part style

text: I am preparing a book in memoir class. I use `\chapterstyle{madsen}`, which uses a sans serif font (I don't know which one). I also have parts and I would like to have the parts to be typeset in the madsen style as well (if I can get the font to be the same, I would be satisfied). Second, if I can get the section titles to be in the same font, it would be great. Any suggestions would be very much appreciated.


title: The [H] "put it here" placement option doesn't work with floatrow

text: I'm using the `minted`, `floatrow`, `caption`, and `listing` packages to create code blocks like these: ![my code block](http://i.stack.imgur.com/P224G.png) To do this, I'm using a hack based on this answer. Here is what I have:               ...     \usepackage{listings}     \usepackage{floatrow}     \usepackage{minted}     ...          % the number style (from fancyvrb package):     \renewcommand{\theFancyVerbLine}{\textcolor{Gray}{\scriptsize\arabic{FancyVerbLine}}}          % caption style     \usepackage{caption}     \DeclareCaptionStyle{code_style}{margin=-1mm}     \DeclareCaptionFont{code_font}{\color{white}\footnotesize\bfseries}     \DeclareCaptionFormat{code_format}{\colorbox{MidnightBlue}{\parbox{\textwidth}{#1#2#3}}}     \captionsetup[listing]{%     style=code_style,format=code_format,labelfont=code_font,textfont=code_font}     % this is from floatrow package:     \floatsetup[listing]{capposition=top,rowpostcode=rule}          \makeatletter     \newenvironment{mycode}[3]      {\VerbatimEnvironment       \minted@resetoptions       \setkeys{minted@opt}{linenos,fontfamily=courier,fontsize=\scriptsize, xleftmargin=21pt}       \renewcommand{\minted@proglang}[1]{#1}       \begin{listing}[H]         \caption{#2}\label{#3}           \begin{VerbatimOut}{\jobname.pyg}}      {\end{VerbatimOut}       \minted@pygmentize{\minted@proglang{}}       \DeleteFile{\jobname.pyg}       \end{listing}}     \makeatother      And I call `mycode` like this:               \begin{mycode}{ruby}{Código do método Project\#tasks\_by\_position (versão 3)}{code:tdd_code3}     # app/models/project.rb     def tasks_by_position position       tasks.select { |item| item.position.to_s == position.to_s }     end     \end{mycode}      The problem is that when using the `floatrow` package, the `[H]` "put it here" placement option doesn't work, and my code is placed at the end of the text. If I remove the `floatrow` package, the code works fine, but I can't put the caption at the top and the line at the bottom. * * * **edited** (30/01/2012) As egreg asked, I made an minimal example and realize that the problem is that I'm using the `\documentclass{abnt}` from abntex package. If I use the `\documentclass{book}`, for example, it works. Unfortunately, this package have only Brazilian Portuguese documentation and it's not updated since 2006.


title: Finding the physical page number of a particular logical page

text: I need to fetch some part from a pdf file (e.g. with pdftk). The page numbers as given in the table of contents are logical numbers (for example Roman numbers I to XX in the front-matter, main-matter starting with Arabic 1, although being the 21st physical page). Can I get physical numbers of pages for a particular part of a generated document (section, subsection, paragraph...)?


title: Spacing around \left and \right: When is it needed?

text: There have been a few questions (such as this and more recently this) regarding the "extra" spacing around `\left` and `\right`. And there are various options for fixing it, including the `mleftright` package. Is there any time we would actually **want** the default behavior? Is there any situation in which redefining `\left` and `\right` to get rid of the space would produce an inferior result?


title: How can I assign a node name while wrapping minted environment?

text: I was thinking how can I frame particular pieces of `minted` environment for `beamer` slides. I had a choice either to use overlays and split code across several blocks ( Beamer vs. Minted: overlays ) or just to draw some frame on top. I feel like the second should be a bit better though it would require some absolute coordinates for selection to roughly match code. I've read Wrapping minted in a Tikz box with a command and it works just fine, however I'd like to be able to refer to each node by some unique name. For instance the following allows me to refer to a single minted block later as _a_.               \renewenvironment{minted@colorbg}[1]{%       \noindent       \begin{lrbox}{\minted@bgbox}       \begin{minipage}{.8\linewidth}}      {\end{minipage}       \end{lrbox}%       \tikz\node[text width=\linewidth,] (a) %mintedbox,              {\usebox{\minted@bgbox}};      }          %\newmint[jscode]{javascript}{}          \tikzstyle{every picture}+=[remember picture]      So I can have later something like               \begin{tikzpicture}[overlay]             \draw (a.north west) rectangle ++(2cm,-1cm);     \end{tikzpicture}      I'd like it to be less hard-coded. Is it possible to pass a name into that `\renewenvironment` definition via somehow redefined `minted` or something? If there are better alternatives to point into particular fragments of `minted` environment on `beamer` slides, I'd be interested.


title: datatool with longtable

text: I have a CSV file that has many rows. I want to typeset these rows into a table using `longtable` and `datatool` package.   1. However just before before the "lastfoot" (which says _concluded_ ) I am getting an empty row which I do not want. How to remove that extra row?    2. The columns are not equally spaced under the dates. Somebody please help me to make them equally spaced. I am giving the sample code. The name of my CSV file is `namelist.csv` and it looks like this.                   number,degree,Name         1,Dr,Abdul Ali         2,Mrs,Francesca Joestar         3,Mr,Chan Ker Mei         4,Dr,Hikaru Yagami         5,Dr,Harish Kumar      My LaTeX code is below.               \documentclass[12pt]{article}     \usepackage{setspace}     \usepackage{bookman}     \usepackage{longtable}     \usepackage{pdflscape}     \usepackage[a4paper,left=1in,right=0.8in,top=0.5in,bottom=0.5in]{geometry}     \usepackage{tgschola}     \usepackage{microtype}     \usepackage{datatool}     \DTLloaddb{names}{namelist.csv}     %==================================================================     \begin{document}     %     \begin{landscape}     %     \doublespacing     %     \begin{longtable}{|l|l|c|c|r|r|r|c|c|c|c|c|c|c|c|c|c|c|}\hline     %     No.&\multicolumn{1}{c|}{Name}& \multicolumn{2}{c|}{13.12.2010}&       \multicolumn{2}{c|}{14.12.2010}&\multicolumn{2}{c|}{15.12.2010}&     \multicolumn{2}{c|}{16.12.2010}     &\multicolumn{2}{c|}{17.12.2010}&\multicolumn{2}{c|}{18.12.2010}     &\multicolumn{2}{c|}{19.12.2010} &\multicolumn{2}{c|}{20.12.2010}\\ \hline\hline     \endfirsthead     %     \multicolumn{18}{c}%     {{\bfseries  Continued from previous page}} \\     \hline     %     No.&\multicolumn{1}{c|}{Name}& \multicolumn{2}{c|}{13.12.2010}&     \multicolumn{2}{c|}{14.12.2010}&\multicolumn{2}{c|}{15.12.2010}&      \multicolumn{2}{c|}{16.12.2010}     &\multicolumn{2}{c|}{17.12.2010}&\multicolumn{2}{c|}{18.12.2010}     &\multicolumn{2}{c|}{19.12.2010} &\multicolumn{2}{c|}{20.12.2010}\\ \hline\hline     \endhead     %     \hline \multicolumn{18}{|r|}{{Continued on next page}} \\ \hline     \endfoot     %     \hline     \multicolumn{18}{|r|}{{Concluded}} \\ \hline     \endlastfoot     %     \DTLforeach{names}{     \no=number, \dg=degree, \name=Name}{     \no& \dg. \name &  & &  & &  & &  &     &  &  &  &  &  &  &  & \\ \hline     }     \end{longtable}%     %     \end{landscape}     %     \end{document}      ![output of code](http://i.stack.imgur.com/PT7h2.png)


title: Bibliography shows citation locations in LyX

text: I'm rather new to LaTeX and as a result I'm starting out with LyX. The problem is that in my bibliography I cannot get rid of the citation locations. You can see here it sometimes (though not always) starts with (document) and then lists the section/subsection that the citation is located in. ![](http://i.imgur.com/aBfVX.png) e.g. > Part, D. (1984). Reasons and Persons. Oxford: Oxford University Press. > (document), 1.1, 1.2, 2, 2.1.1, 2.1.2, 5, 2.1.3, 3.1.1, 3.2, 4.1, 12, 5.2, > 5.3 I'm sure this is a really easy fix but I can't find anything to disable this. This happens with all styles, though I'm currently using `apa-good`.


title: SO-style Markups for References in the Bottom of the Page in Bibtex-ed Document?

text: I often have a long bibliography and then later I find that I should have a notice like this buying-list in a project (not that important so not wanting them to the bibtex). I find it overkill to explain a trivia like a buying- list-notice next to more important things in Bibtex, I need just SO-style references. How can I add the references nicely to the bottom of the page instead of the back with author/howpublished/title-bibtex-clutter? I am not against Bibtex but I am looking for more casual referencing besides Bibtex.               \begin{itemize}     \item 4pcs [1] (24USD)  % Here [1] and [2] are references to      \item 2pcs [2] (25USD)  % the below thing with the urls.     \item ...     \end{itemize}          <<echo=FALSE>>   % I am not sure about the parameters here but they                       % but they could be things like fonts etc.                      %                      % I want here a Sweave-like -tool                      % for easy mark-up references that will                      % automatically appear at the bottom of the page.                      % Then just latexmk to handle compiling?     [1]: http://www.something.com/buyThis/XYZmoment     [2]: http://www.hello.com/notImportantButForTheFuture/GoodToKnowWhereToBuy     %


title: Nomenclature definition in hidden places?

text: This question is related to a previous question of mine Increasing nesting level for parameters and global xparse macros? I use a modified version of `\defsym` as given by egreg in this answer to the second question above. However I have the problem that the nomenclature definition fails on occasions, so some symbols are missing. For a MWE check egreg's answer together with the code snippets below. I do neither understand when exactly it fails nor can I think of a solution how to fix it. It seems to happen when the first use of the symbol is invisible in some way, e.g. `\phantom{\Ak}` or               \begin{align}     \Uk[j]     \end{align}      The `align` environment seems to probe the line for the length, therefore the first use is invisible. This can be seen using a `\typeout` in the symbol definition which will then appear twice in the log. Inserting one of those snippets above after `\begin{document}` in egreg's MWE causes the symbols to disappear from the nomenclature.   1. I'd like to understand why `\nomenclature` does not work e.g. in the following pointless example `$\phantom{\nomenclature{$\alpha$}{Foo}}$`. I don't understand why writing something to a file fails in this example.   2. Is there some systematic when it fails?   3. How to fix it? Is it possible to check if `\nomenclature` did successfully write the symbol to the nlo file?


title: Create a switch from a given macro

text: I would like to create the equivalent of what `\bfseries` is for `\textbf`, relative to the command `\shadowtext`, which is defined as:               \newcommand\shadowtext[1]%     {%        \begingroup%        \settowidth{\st@temp@width}{#1}%        \settoheight{\st@temp@height}{#1}%        \setlength{\st@pic@width}{\st@temp@width}%        \setlength{\st@pic@height}{\st@temp@height}%        \addtolength{\st@pic@width}{\st@shadowoffsetx}%        \addtolength{\st@pic@height}{\st@shadowoffsety}%        %        \edef\num@tw{\strip@pt\st@temp@width}%        \edef\num@th{\strip@pt\st@temp@height}%        \edef\num@pw{\strip@pt\st@pic@width}%        \edef\num@ph{\strip@pt\st@pic@height}%        \edef\num@offsetx{\strip@pt\st@shadowoffsetx}%        \edef\num@offsety{\strip@pt\st@shadowoffsety}%        \raisebox{-\st@shadowoffsety}{        \begin{picture}(\num@pw,\num@ph)(0,0)             \put(\num@offsetx,0){\makebox(\num@tw,\num@th)[tl]{\color{\st@shadowcolor}\def\color##1{}\ignorespaces #1}}             \put(0,\num@offsety){\makebox(\num@tw,\num@th)[tl]{\ignorespaces #1}}         \end{picture}}%         \endgroup%         \ignorespaces%     }      My first naive try was to make the argument optional, but that of course didn't work out :). So, how do i turn `\shadowtext` into a switch like `\bfseries`?


title: Glossary print a specific definition

text: How does one print a specific glossary entry, i.e. the definition, such that:               \newglossaryentry{hardware}     {         name        = {Hardware},         description = {...}     }      and, for example:               \glossaryDescription{hardware}      outputs               ...      I can't seem to find a method to do this, the glossary specification only talks about referencing particular entries so that they become visible wherever you `\printglossary`, but I want to be able to use the definitions throughout my document as well. Any advice/guidance is much appreciated!


title: How to make kile to accept absolute pathnames at inverse search?

text: I have the combination Kile and SumatraPDF under Windows 7. The inverse search is running so far. The main problem is, that if I activate it, Kile opens the file in a new tab under the absolute path name instead of selecting the already open tab from the project. That's annoying as I get twice as much tabs and they are not linked to the project. Is there a possibility to   * call Kile with a relative path or   * make Kile open first the project file? My command within Sumatra is th following:               C:\ProgramData\KDE\bin\kile.exe %f --line %l


title: How to have TeXnicCenter reopen PDF window at same monitor location?

text: I use TeXnixCenter as LaTeX editor. To view the resulting PDF, I press `CTRL`-`F5` (build+view), which closes the Acrobat windows with the previous PDF version (if it was open) and then opens the new version of the PDF in an Acrobat window. The problem is, after build+view, the Acrobat PDF window is _always_ positioned in the top-left window of my screen. Putting the window in a more convenient location for me (e.g., on my second monitor) is not remembered; I have to drag it there each time again. How can I have TeXnicCenter/Acrobat have Acrobat remember the last window position? _(Note: just for clarity, I am not interested in having the PDF open at a specific/same page, which is the topic of the question:How to get TeXnicCenter to remember the last page viewed in output PDF (as done automatically by TeXworks).)_ **Edit** : For readers looking for a solution to this problem, my _workaround_ was to install SumatraPDF (and fix TeXnicCenter to interact correctly with it). It works very nice (despite the SumatraPDF website looking so un-cool.)


title: Unexpected results from pgfmath functions with numbers with leading 0

text: The pgfmath functions give me unexpected results when used on numbers with leading zeros. Are the output in the example below expected for `0011` and `0021`?               \documentclass{article}     \usepackage{tikz}          \newcommand\truncateline[2]{%          #1 & #2 & \pgfmathtruncatemacro{\foo}{#1}\foo \\%     }     \newcommand\roundline[2]{%          #1 & #2 & \pgfmathround{#1}\pgfmathresult \\%     }     \newcommand\intline[2]{%          #1 & #2 & \pgfmathint{#1}\pgfmathresult \\%     }          \begin{document}          \section{pgfmathtruncatemacro}     \begin{tabular}{lll}     Input & Expected & Output \\     \truncateline{0}{0}     \truncateline{1}{1}     \truncateline{01}{1}     \truncateline{001}{1}     \truncateline{0011}{11}     \truncateline{0021}{21}     \end{tabular}          \section{pgfmathround}     \begin{tabular}{lll}     Input & Expected & Output \\     \roundline{0}{0}     \roundline{1}{1}     \roundline{01}{1}     \roundline{001}{1}     \roundline{0011}{11}     \roundline{0021}{21}     \end{tabular}          \section{pgfmathint}     \begin{tabular}{lll}     Input & Expected & Output \\     \intline{0}{0}     \intline{1}{1}     \intline{01}{1}     \intline{001}{1}     \intline{0011}{11}     \intline{0021}{21}     \end{tabular}          \end{document}


title: vim-latex with strange (unwanted) highlighting

text: I'm using vim with the `latex-suite` package installed on Ubuntu 11.10 to edit LaTeX files. The `latex-suite` highlights the LaTeX source as I edit it, but it seems to get very confused after something like `$\sigma_{\{x,y\}}$`. The LaTeX code is correct; it compiles and displays fine, but highlighting after this symbol is very strange. I tried to post a picture of what I get, but apparently new users can't post pictures. Here is some example code which causes problems for me:               \documentclass{article}     \begin{document}     This text appears normally.  $\sigma_{\{x,y\}}$          But this text is highlighted very strangely.     \end{document}      Is there a way to fix this? As it is, I'd say the highlighting scheme in vim- latex is a little aggressive; I could do with something quite a bit simpler (e.g. one color for text, one for math, and one for environment declarations like `\begin{environementName}` and `\end{environmentName}`). ![enter image description here](http://i.stack.imgur.com/9Fgud.png)


title: Inconsistent appearance of white \hline on black background

text: Are there known issues with the appearance of white text on black background? When I use several `\hline` in a table I get different appearances for the lines. It could appear as normal or weak or entirely missing. Only when I magnify to about 400% do I see the lines consistently. Assuming this is a hardware issue I tried on a different monitor and same thing showed up. I tried the `booktabs` package to get custom thickness for the lines but that package puts a band of space around its `\hrule` causing disconnected appearance if you have a vertical rule. (`booktabs` discourages vertical rules in a table.) (Final Edit: I eventually agreed with `booktabs`, gave up on vertical rule, and got consistent looking white rules on black ground for a table.) Sample code would be as in white text on black background in entire table:               \documentclass[11pt,letterpaper]{article}     \usepackage[table]{xcolor}     \usepackage{array}     \begin{document}     \begin{table}[H]       \caption{Caption}       \label{Table1}       \begin{center}         \arrayrulecolor{white}         \newcolumntype{B}{>{\columncolor{black}\color{white}}c}         \begin{tabular}{  B  l   | B  p{6in}   }           \hline\hline           Text 1 & Text 2 \\           \hline\hline           Text 3 & Text 4 \\           \hline         \end{tabular}       \end{center}     \end{table}     \end{document}


title: How/where to test my template document?

text: I've created a sort of a template for a Ph.D. thesis at my faculty (a document class, a main thesis.tex file and some dummy content). The faculty's Linux server doesn't have a full TeX distro (e.g. no etoolbox) so I can't test it there. My template compiles nicely with MiKTeX 2.9 and culmus (necessary for the Hebrew). I've read the answers here about online LaTeX compilation. I've tried a couple of these out, some with no positive results, some with partially positive results. ScribTeX was the closest I got, and it still gave out a lot of warnings and errors. I'm pretty sure I'm not using any strange MiKTeX quirks or anything - although I am using some known workarounds for issues relating to Hebrew (search the tag and you'll see some). Anyway, where could I test my template other than installing Linux+TeXLive on a computer of my own? For anyone interested: The template zip file. Notes:   * It's useful if I can tell people "you can test/compile at place XXX" rather than just "I've tested it."   * If there's a place with shell access which allows this, that would be great, although I guess this is unlikely to be available.


title: Roman numbering, cleardoublepage and table of content not working

text: I'm currently doing the thesis report and I cant seem to get the numbering to work as well as the along with some other stuff. What I want is Abstract(eng) Abstract(swe) and Acknowledgments to all be on the right side, with roman numbering. I can accomplish this with               \newpage     \thispagestyle{empty}     \mbox{}     \newpage      but I wanna use `\cleardoublepage`, which is not working, between the chapters as well. Another thing I want is the numbering in the `toc` to be roman as well, but it isn't. I also want the abstract to show in the `toc` with the roman page number ref but they all show up with arabic number page 1.               \documentclass[a4paper]{report}          \usepackage[english,swedish]{babel}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{subfig}     \usepackage[table]{xcolor}     \usepackage{lscape}     \usepackage[hidelinks]{hyperref}     \usepackage[cp1252]{inputenc}     \usepackage{cite}     \usepackage{appendix}     \parindent 0pt          \begin{document}          \pagenumbering{roman}          \chapter*{Abstract}     \input{abseng}     \pagenumbering{plain}     \cleardoublepage                    % not working          \chapter*{Sammanfattning}     \input{abssve}     \pagenumbering{plain}     \cleardoublepage          \chapter*{Acknowledgment}     \input{ack}     \pagenumbering{plain}     \cleardoublepage          \tableofcontents     \addtocontents{toc}{~\hfill\textbf{Page}\par}       % Add page above numbers          \addcontentsline{toc}{chapter}{Abstract}            % Add to toc ?     \addcontentsline{toc}{chapter}{Sammanfattning}     \addcontentsline{toc}{chapter}{Acknowledgments}     \addcontentsline{toc}{chapter}{Contents}          \pagenumbering{arabic}     \cleardoublepage                                     %<-- not working     \include{Introduction}          %\include{other chapters}          \bibliographystyle{unsrt}       % (uses file "plain.bst")     \bibliography{myrefs}          \listoffigures[toc]          \begin{appendix}     \include{appendix}          \end{document}


title: Wrap text inside tabular environment without changing a lot of code

text: I used the following code:               \begin{tabular}{|c|c|l|}     \hline      Pin Number & Pin Name & Analog Function\\     \hline     \hline      1& 4xOUTZ& Yaw-rate or Z-rate output voltage 4 times amplified ($\pm$ 100 °/sec) \\     \hline      2& OUTZ& Yaw-rate or Z-rate output voltage ($\pm$ 400 °/sec) \\     \hline      3& ST& Self-test (logic 0: normal mode; logic 1: self-test) for Yaw Gyroscope \\     \hline      4& PD& Power-down(logic 0: normal mode; logic 1: Power-down mode) for Yaw Gyroscope \\      \hline      5& HP& High pass filter reset(logic 0: normal mode; logic 1: external high pass filter is      reset) for Yaw Gyroscope \\     \hline      6& NC& Not connected \\     \hline      7& GND& Supply Ground \\     \hline      8& NC& Not connected \\     \hline      9& NC& Not connected \\     \hline      10& Vref& Vref output from the Yaw Gyroscope IC. (Leave unconnected) \\     \hline      11& OUTY& Roll-Rate or Y-rate output voltage ($\pm$ 400 °/sec) \\     \hline      12& 4xOUTY& Roll-rate or Y-rate output voltage 4 times amplified ($\pm$ 100 °/sec)\\     \hline      13& 4xOUTX& Pitch-rate or X-rate output voltage 4 times amplified ($\pm$ 100 °/sec) \\     \hline      14& OUTX& Pitch-rate or X-rate output voltage ($\pm$ 400 °/sec) \\     \hline      15& ST& Self-test (logic 0: normal mode; logic 1: self-test) for Pitch and Roll Gyroscope \\     \hline      16& PD& Power-down(logic 0: normal mode; logic 1: Power-down mode) Pitch and Roll Gyroscope \\     \hline      17& HP& High pass filter reset(logic 0: normal mode; logic 1: external high pass filter is reset) Pitch and Roll Gyroscope \\     \hline      18& Vdd& 3.3V supply voltage \\     \hline      19& Vref& Vref output from the Pitch and Roll Gyroscope IC. (Leave unconnected) \\     \hline      20& NC& Not connected \\     \hline      21& NC& Not connected \\     \hline      22& Vref& Vref output from the IC. (Leave unconnected) \\     \hline      23& NC& Not connected \\     \hline      24& NC& Not connected \\     \hline     \end{tabular}      to prepare a table like this: ![image](http://i.imgur.com/PEOiG.jpg) However you can see what my problem is. Is there a way to wrap the text in the table without changing a lot of the code I have already written?


title: Multiple bibliographies without BibTeX

text: I'm compiling a journal in which each paper is a `\section*`, using `\include` to put the whole thing together. Reference-wise each paper has the following format:               ``Lorem''.\footnote{Bostock \cite{bostock2} p.~87.}     ``Ipsum''.\footnote{Ibid.~p.~133.}          \begin{thebibliography}{99}          \bibitem{bostock2} Bostock, D. (2009) \emph{Philosophy of Mathematics}. Oxford: Wiley-Blackwell.          \end{thebibliography}      This works reasonably, but I've realised it's buggy if two papers use the same label (which, since papers are typeset separately, is very possible). So if Paper 1 only cites `bostock2` but Paper 2 cites `bostock1` and `bostock2` in that order, the footnotes that ought to read [1] in Paper 1 will read [2]. I appreciate that this is a very messy way to be doing things anyway, but is there a minimally-disruptive way (viz. one that doesn't involve making non- specialists spend even more time rearranging someone else's bibliography than they do already) to fix this? * * * MWE:               \documentclass{article}     \begin{document}          \section*{Paper 1}          Ipsum \cite{ipsum}, % I want this to produce the text '[1]', since it is number 1 in this paper's bibliography.     Dolor \cite{dolor}          \begin{thebibliography}{9}     \bibitem{ipsum} Ipsum     \bibitem{dolor} Dolor     \end{thebibliography}          \section*{Paper 2}          Lorem \cite{lorem}, Ipsum \cite{ipsum}          \begin{thebibliography}{9}     \bibitem{lorem} Lorem     \bibitem{ipsum} Ipsum     \end{thebibliography}          \end{document}


title: While writing in Greek, I need to keep citations and bibliography in English

text: i have just been introduced to LaTeX as a means to write my dissertation. I am faced with the problem of writing my document in Greek while keeping all bibliographic entries and citations in English. This is a minimal working example with the exact set of packages I am using:               \documentclass[12pt, a4paper]{report}     \usepackage[english,greek]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{gfsartemisia}     \usepackage{natbib}     \usepackage{setspace}     \onehalfspacing     \usepackage{graphicx}     \widowpenalty=300     \clubpenalty=300          \begin{document}          Το φύλο αυτό των φυκών, αποτελεί επικράτεια των Βακτηρίων\citep{GarciaPichel2009107}          \bibliographystyle{abbrvnat}     \bibliography{bib}          \end{document}          %this is the entry in the bib.bib file     @incollection\{GarciaPichel2009107,     title = "Cyanobacteria ",     editor = "Schaechter, Moselio ",     booktitle = "Encyclopedia of Microbiology (Third Edition) ",     publisher = "Academic Press",     edition = "Third Edition",     address = "Oxford",     year = "2009",     pages = "107 - 124",     isbn = "978-0-12-373944-5",     doi = "http://dx.doi.org/10.1016/B978-012373944-5.00250-9",     url = "http://www.sciencedirect.com/science/article/pii/B9780123739445002509",     author = "F. Garcia-Pichel",     keywords = "benthos",     keywords = "blue-green algae",     keywords = "cell differentiation",     keywords = "chlorophyll",     keywords = "extreme environments",     keywords = "nitrogen fixation",     keywords = "photoautotrophy",     keywords = "photosynthesis",     keywords = "phycobiliproteins",     keywords = "plankton",     keywords = "primary production",     keywords = "symbiosis",     language = "English",     keywords = "toxins "     \}      This is the output i get, when i wish it to be in English (instead, all characters are "translated" to their Greek variants): ![enter image description here](http://i.stack.imgur.com/V8ydm.jpg)


title: Vertically center a table on a landscape page

text: I have a landscape page with one table on it. My current code horizontally centers the table, but how can I also vertically center it?               \documentclass[10pt,a4paper]{report}     \usepackage[latin1]{inputenc}     \usepackage[landscape]{geometry}     \usepackage[german]{babel}     \usepackage{lmodern}     \usepackage{adjustbox}          \begin{document}          \begin{adjustbox}{center}      \resizebox{27cm}{!}{            \begin{tabular}{|*7c|}       \hline        \multicolumn{1}{|c|}{Column 1} &       \multicolumn{2}{|c|}{Column 2} &       \multicolumn{2}{|c|}{Column 3} &       \multicolumn{2}{|c|}{Column 4} \\       \hline       1. Row & a & b & c & d & e & f \\        \hline        % more lines here       \end{tabular}       }          \end{adjustbox}          \end{document}      I omitted a the remaining rows here for the sake of clarity, but they don't occupy more than 50% of the page, so there is still plenty of space at the bottom. Putting the `tabular` in a `table` with `\centering` (as often suggested in that case) fails with `Not in outer par mode.` I assume that it's due to the adjustbox and resizebox.


title: Conditional centering if single line

text: I would like to define a new environment that centers its contents if it can be typeset on a single line, but justifies the contents if it requires multiple lines.               \documentclass{article}     \usepackage{lipsum}     \newenvironment{mycenter}{\noindent}{}     \begin{document}          \begin{mycenter}%     This should be centered since it is a single line     \end{mycenter}          \begin{mycenter}%     This should be justified since it is multiple lines. \lipsum[1]     \end{mycenter}          \end{document}      I have a convoluted idea using the `Environ` package to capture the contents, then sticking them in a box and trying to check the height of the box. Is there an easier way?


title: Biblatex and MARC Records

text: Is there a `biblatex` style that is based on `MARC` records? The notion here is that one maps `MARC` records into bibtex entries with `MARC` field names:               @BOOK{smith:303,     MARC240uniformtitle = {My Title},     MARC250editionstatement = {2nd ed.},     MARC300physicaldescription = {xvi, 194, [2], viii, [1], 10-238, [1], 10-148 p., 22 cm. 8vo.},     ...     }      and then uses a `biblatex` style to create handlists and such. Thanks for any insight.


title: Beamer for letter size paper

text: My daughter is in high school and is working on a science project. She has really enjoyed writing the paper in LaTeX. Now, she has to make a tri-fold presentation of the major points. In the past, that has meant powerpoint printed onto letter-size paper then pasting those pages (one slide per page) onto the board. How can we resize beamer to have at least the same aspect ratio as letter-size paper? Ideally, we would have the same dimensions, also, but that is not so important as we can scale at print time. I have used beamerpresentation in the past, but that generates just one page, I think. Any suggestions are appreciated. The default is to simply use beamer as-is and scale to as close to letter size as possible when printing.


title: Changing glossary pagestyle using memoir

text: I use the `memoir` class to typeset my documents. This class also allows the easy addition of a glossary to those documents. However, the default pagestyle for the glossary is `plain`. I want to change the pagestyle to the style that I have defined myself and that I have set as the pagestyle for the document using `\pagestyle{myheadings}`. How can I achieve this feat? An MWE is included below.               \documentclass[twoside,article]{memoir}     \usepackage{authoraftertitle}          \title{foo bar}          \makeindex     \makeglossary          \makepsmarks{myheadings}{%     \createplainmark{glossary}{both}{\glossaryname}     }          \makeevenhead{myheadings}{\textsf\thepage}{}{\textsc{\textsf\MyTitle}}      \makeoddhead{myheadings}{\textsc{\textsf\MyTitle}}{}{\textsf\thepage}          \pagestyle{myheadings}          \begin{document}          \glossary{foo}{bar}          \printglossary          \end{document}


title: Tikz clip shapes with another (built in) shape

text: I have some geometry that I need to clip. I would like to use the built in node shapes like diamonds, stars, etc... http://www.texample.net/tikz/examples/node-shapes/ Basically I use standard tikz draw commands to generate the picture I want but then I want to clip them according to some built in shape(or even custom shape).               \documentclass{article}          \usepackage{tikz}     \begin{document}     \scrollmode               \begin{tikzpicture}            \begin{scope}         \clip (0,0) diamond (1cm);         \fill[black] (0cm,1cm) rectangle (-1cm, -1cm);       \end{scope}          \end{tikzpicture}     \end{document}      I need someway to specify the size of the clip shape also.


title: Problem with vspace around table environment

text: I recently decided I wanted a caption for the top table, so I placed it in a `table` environment. When I did this, the `\vspace*{-2.5cm}` before the second table seemed to be ignored for some reason. Does anyone know why? How I can overcome this problem?               \begin{center}     \begin{table}     \caption{My Table}     \begin{tabular}     ...     \end{tabular}     \end{table}     \end{center}          \newpage     \vspace*{-2.5cm}     \begin{center}     \begin{tabular}     ...     \end{tabular}     \end{center}      If I remove the `table` environment then the `\vspace*{-2.5cm}` works again.


title: How to write inclusion symbols diagonally?

text: I have two sequences of inclusions, say `$A \subset B \subset C$` and `$A \subset D \subset C$`, and I want to combine these into one sequence. I don't know how to explain this very well, but the combined sequence should look like "a diamond" of inclusions. How can I do this in LaTeX? EDIT: What I have in mind is something like this: ![diamond](http://i.stack.imgur.com/qbBjk.jpg)


title: Trying to align dots along part of a circle

text: I'm working on a circle with legs problem and I'm trying to replace n "unseens" legs with dots. But I can't find a good way to align them. I tried aliging them along an arc, but I can't find a good way to set the center. I found a way somewhere where it supposedly works with parametrizing. But I would basically need to set a center reffering to a point I earlier set relative to another one. If I try it with calc like this               plot ($ (c1) + ( {0.7*cos(\x)}, {0.7*sin(\x)} )$ )      I get an error. "! Package tikz Error: + or - expected.See the tikz package documentation for explanation.Type H for immediate help.... }}] plot ($ (c1)" Here is an image, I'm trying to get the same kind of circles I have on the left on the right: ![mystuff](http://i.stack.imgur.com/U0MCT.png) This is my full code:               \documentclass[utf8]{article} %Sets Basic Layout, article has no chapters     \usepackage[utf8]{inputenc} % Allows special characters e.g. €, Æ ...     \usepackage[T1]{fontenc} %For Umlaute, Accents     \usepackage[toc]{appendix} %For Appendices, adds options     \usepackage[english]{babel} % English as default language (for German use ngerman )     \usepackage{newclude} %Some Include Enhancements     \usepackage[parfill]{parskip} % Empty Line between paragraphs instead of spaces.     \usepackage{lmodern} % Sets Font to be lmodern     \usepackage[nomessages]{fp}% http://ctan.org/pkg/fp Float Variables          \usepackage{tikz} %For Drawing with pdflatex     \usetikzlibrary{decorations.markings} % For Arrow heads in the middle     \usetikzlibrary{decorations.text} % For text along path      \usetikzlibrary{positioning} % For relative positioning     \usetikzlibrary{backgrounds} % For background layer     \usetikzlibrary{fit} % To make background fit     \usetikzlibrary{calc} % To calculate e.g. the distance between nodes     \usetikzlibrary{shapes} % more shapes             \tikzset{dot/.style={draw,circle,inner sep=.7pt,fill,node distance=1cm}} %Defining a dot in tikz     \tikzset{dot1/.style={draw,circle,inner sep=.7pt,fill}} % For dots with arbitrary node distance     \tikzset{triangle/.style={draw,regular polygon, regular polygon sides=3}} %Triangle     \tikzset{->-/.style={decoration={       markings,       mark=at position .5 with {\arrow{>}}},postaction={decorate}}} %Put Arrow head in the middle for ->-     \tikzset{-<-/.style={decoration={ % Same as above but with inverse direction Arrow       markings,       mark=at position .5 with {\arrow{<}}},postaction={decorate}}}          \newdimen\XCoord     \newdimen\YCoord          \newcommand*{\ExtCoord}[1]{\path (#1); \pgfgetlastxy{\XCoord}{\YCoord};}%     \newcommand*{\ExtCoordX}[1]{\path (#1); \pgfgetlastxy{\XCoord}{\YCoord} \XCoord}%     \newcommand*{\ExtCoordY}[1]{\path (#1); \pgfgetlastxy{\XCoord}{\YCoord} \YCoord}%          \begin{document}     \begin{tikzpicture}     \newdimen\cix      \newdimen\ciy     %     \node[draw,circle, minimum size=1cm] (c1) {1L};     %\ExtCoord{c1} ;     %\cix = \XCoord ;     %\ciy = \YCoord ;      \path [domain=180:360,     postaction={decorate,decoration={text along path, text=. . . . . . ,     text align={fit to path stretching spaces}     }}] plot ({0.7*cos(\x)}, { 0.7*sin(\x)});     %\coordinate (d) at ($ (\cix,\ciy) + (1,3) $)     %edge [thick] node [] {} (c1.40) ;     %     \node [right =.5cm of c1.east] (eq) {$=$} ;     %     \node[right=.5cm of eq.east,draw,circle, minimum size=1cm] (c2) {0L};     \node [above right=.5cm of c2.north east] (l1c2) {$\hat{1}$}      edge [thick] node [] {} (c2.40) ;     \node [above left=.5cm of c2.north west] (lnc2) {$\hat{n}$}      edge [thick] node [] {} (c2.140) ;     \node [above left=.5cm of c2.north] (ll1c2) {$l_1$}      edge [thick] node [] {} (c2.110) ;     \node [above right=.5cm of c2.north] (ll2c2) {$l_2$}      edge [thick] node [] {} (c2.70) ;     \path [domain=180:360,     postaction={decorate,decoration={text along path, text=. . . . . . ,     text align={fit to path stretching spaces}     }}] plot ({0.7*cos(\x)}, {0.7*sin(\x)}); % the dots     \end{tikzpicture}               \end{document}


title: How to use tocloft to create a list which appears in the middle of the document

text: I have a document in IEEE (conf) format and I want to add a new environment using `tocloft`. The relevant code looks like this (slightly abbreviated):               \documentclass[conference]{IEEEtran}     \usepackage[titles]{tocloft}     \newcommand{\listexampletitle}{List of Examples}     % FIXME: Should be styled as a "normal" subsection     \newlistof{examples}{exp}{\listexampletitle}     % FIXME: Remove page numbers     \newcommand{\examplelist}[1]{%       \refstepcounter{examples}       \addcontentsline{exp}{examples}       {\protect\numberline{\theexamples}#1}     }     \newcommand{\example}[1]{\examplelist{#1}\textbf{Example}: #1}     \begin{document}     \section{A section}     \example{A first example}     \listofexamples     \end{document}      And the result looks something like this: ![Output of the code above](http://i.stack.imgur.com/hd7ee.png) Despite using the `titles` option with `\usepackage[titles]{tocloft}` the heading for the list of examples looks like a `\section*` rather than a `\section`. This makes sense as a default, usually a table would be generated as part of the front matter of a book. However, I would like that heading to be a normal `\section` since it will appear in the middle of the document. Is this possible? Secondly, how can the page numbers against each item in the `\listofexamples` be removed, so only the examples themselves are listed?


title: Function determining the length of text, usable where something with internal units (e.g. "em") is expected

text: Is there a way to define a function `\horizontallengthof` returning the length of a piece of text in internal units? I would like to be able to use it anywhere where something of that sort is required, for example like `p{\horizontallengthof{this particular piece of text}}` (in a table specification) or `\hspace{\horizontallengthof{this particular piece of text}}`. * * * I am hesitant to post a particular use case, since I am interested in a generic solution instead of workarounds for particular situations. But here is one (with `calc`'s `\widthof` standing in for `\horizontallengthof`):               \documentclass{article}     \usepackage{fixltx2e}     \usepackage{calc}          \begin{document}          \begin{tabular}{p{0em}@{\hspace{1.0em}\quad}l@{\qquad}l}       \(\bullet\) & \(x = y\) & \(z = w\) \\       \(\bullet\) & \(a = b\) & \(c = d\) \\     \end{tabular}          \begin{tabular}{p{\widthof{\(\bullet\)}}@{\hspace{1.0em}\quad}l@{\qquad}l}       \(\bullet\) & \(x = y\) & \(z = w\) \\       \(\bullet\) & \(a = b\) & \(c = d\) \\     \end{tabular}          \begin{tabular}{p{\widthof{\(\bullet\)}}@{\hspace{1.0em-\widthof{\(\bullet\)}}\quad}l@{\qquad}l}       \(\bullet\) & \(x = y\) & \(z = w\) \\       \(\bullet\) & \(a = b\) & \(c = d\) \\     \end{tabular}          \end{document}      With the suggestion to add `fixltx2e`, this compiles properly, but I'd like the second table to have the same appearance (spacing-wise) as the first one, while giving me no `Overfull \hbox` warnings. Table 3 is a failed attempt at achieving this. One reason why I didn't initially post this is that I didn't want any potential workarounds to this distract from a general (and imho needed) solution.