title: Randomized drawing of individual glyphs

text: I was reading Knuth's "Mathematical Typography" ( _Bulletin of the American Mathematical Society_ 1(2):337-372) and the section "Randomization" called my attention. I quote most of it here. > I'd like to report on a little experiment I did with random numbers. One > might complain that the letters I have designed are too perfect, too much > like a computer, so they lack "character". In order to counteract this, we > can build a certain amount of randomness into the choices of where to put > the pen when drawing each letter, and Figure 21 shows what happens. The > coordinates of the key pen positions where chosen independently with a > normal distribution and with increasing standard deviation, so that the > third example has twice as much standard deviation as the second, the fourth > has three times as much, and so on. Note that the two _m_ 's on each line > (except the first) are different, and so are the _a_ 's and the _t_ 's, > since each letter is drawn randomly. ![Figure 21](http://i.stack.imgur.com/n4xge.png) > After the deviation gets sufficiently large the results become somewhat > ridiculous, and I don't want people to say that I ended this lecture by > making a travesty of mathematics. So let us conclude by looking at Figure > 22, which shows what is obtained in various fonts when the degree of > randomness is somewhat controlled. I think it can be said that the letters > in this final example have a warmth and charm which makes it hard to believe > that they were generated by a computer following strict mathematical rules. > Perhaps the reason the printing of mathematics in the good old days looked > so good was that the fonts of type where imperfect and inconsistent. ![Figure 22](http://i.stack.imgur.com/zeuTu.png) My question is, is there a generalized way of achieving this effect? I haven't found anything relevant in either _The LaTeX Companion_ or _The XeTeX Companion_. I am aware that some fonts (e.g., PunkNova) do this, but what I'm looking for is a method to get this output with any font I choose. Knuth does it by tinkering directly with the Metafont files, and I'm hoping that I can avoid having to go that route.


title: Centering text within custom shape

text: On page 628 of the TikZ manual, it describes how to code the `text` anchor for a custom shape so that the label text is placed with its centre at the origin. I've done this to create a simple shape, which draws a square of side length 10pt. The text label should then be centered at the origin. However, it doesn't seem to work correctly. Here's a screenshot:![enter image description here](http://i.stack.imgur.com/d0IsU.jpg) On the left is a node defined with my new shape, with label `\fbox{$f$}`. On the right is a standard TikZ node with the same label, created with the `draw` option and `inner sep=1pt`. Both nodes are positioned with the same y coordinate - but clearly, the label for my shape hasn't been placed at the same height, and it is clearly not correctly centred in its box. Question: how can I get the text label for a custom shape properly centred at the origin? Here's the code.               \documentclass{article}     \usepackage{tikz}     \makeatletter     \pgfdeclareshape{myshape}     {         \savedanchor\centerpoint         {             \pgf@x=0pt             \pgf@y=0pt         }         \anchor{center}{\centerpoint}         \anchorborder{\centerpoint}         \savedanchor{\upperrightcorner}         {             \pgf@y=.5\ht\pgfnodeparttextbox             \pgf@x=.5\wd\pgfnodeparttextbox         }         \anchor{text}         {             \upperrightcorner             \pgf@x=-\pgf@x             \pgf@y=-\pgf@y         }         \backgroundpath         {             \pgfsetstrokecolor{black}             \pgfpathmoveto{\pgfpoint{-5pt}{-5pt}}             \pgfpathlineto{\pgfpoint{-5pt}{5pt}}             \pgfpathlineto{\pgfpoint{5pt}{5pt}}             \pgfpathlineto{\pgfpoint{5pt}{-5pt}}             \pgfpathclose             \pgfusepath{stroke}         }     }     \makeatother     \begin{document}     \setlength\fboxsep{0pt}     \begin{tikzpicture}     \node [myshape] at (0,0) {\fbox{$f$}};     \node [draw, inner sep=1pt, red] at (12pt,0) {\fbox{$f$}};     \end{tikzpicture}     \end{document}


title: Unable to search word with Romanian characters in output pdf

text: I'm using Tex Live, under Ubuntu 11.11, and Texmaker to create LaTeX source files. Sometimes I edit these files with Krviewer from Krusader, but I pay attention to use the input encoding latin10 (or ISO 8859-16). My layout keyboard is Romanian standard, which correctly produces Romanian diacritics with comma below (as in latin10). In the document preamble I use               \usepackage[romanian]{babel}     \usepackage[latin10]{inputenc}     \usepackage[T1]{fontenc}               The output pdf file correctly renders the characters, with comma below, but thy are not find by the search engine and they are not copied correctly to the keyboard. For example: if I copy the word _știință_ it will paste _s , tiint , ă_ , this being the reason why it wont't be found by the search engine of the pdf reader. Any suggestions, please?


title: About beamer-latex themes

text: I have a question about beamer-latex. I have just downloaded the beamer-latex from this cite: http://faculty.csuci.edu/jorge.garcia/tex/beamer.htm. I did all the requirements. But some of the things do not work:   1. when I write a small code (without frametitles or subsection...), it gives a pdf file but gives theme error, it doesn't understand the theme if it it Warsaw or any others.   2. For long codes , the program doesn't give any pdf view and gives a lot of errors: theme error, frametitle error... Could you please help me, if anyone understands?


title: What is the difference between Fragile and Robust commands?

text: So I've read a few times about this, the “moving arguments” and all that. But what does it really mean? Could someone explain in a few words what is going on at the TeX level, what is the difference between these two kinds of commands? Furthermore, when do we need to use `\protect` and why?


title: Can't implement new command in latex (under beamer)

text: I'm trying to create a new command that will ease on reference placement under beamer. This is an example file:               \documentclass[bigger]{beamer}     \usepackage[absolute,overlay]{textpos}     \tolerance=1000          \newcommand{\myref}[3]{         \begin{textblock*}{100mm}(0.07\textwidth,.93\textheight)           {\footnotesize #1, {\emph #2}, #3}         \end{textblock*}}               \begin{document}          \begin{frame}     \myref{must, write, something}     \end{frame}          \end{document}      When I try to run it through `pdflatex` I get:               tionary/translator-theorem-dictionary-English.dict) (./error.nav)     ! Argument of \end has an extra }.     <inserted text>                      \par      l.14 \end{frame}          Runaway argument?     ! Paragraph ended before \end was complete.     <to be read again>                         \par      l.14 \end{frame}               ! LaTeX Error: \begin{beamer@framepauses} on input line 14 ended by \end{docume     nt}.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.17 \end{document}          (./error.aux)     ! You can't use `\end' in internal vertical mode.     \enddocument ... \endgroup \deadcycles \z@ \@@end           l.17 \end{document}               ! LaTeX Error: \begin{beamer@framepauses} on input line 14 ended by \end{docume     nt}.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.17 \end{document}          )     ! Emergency stop.     <*> \nonstopmode\input error.tex          !  ==> Fatal error occurred, no output PDF file produced!     Transcript written on error.log.     [yotam@myhost Res.Prop.Exam]$       I couldn't find my missing `}` can you? *note that my tex file is named `Error.tex`


title: How to reduce the gap between the header and the figure in Latex

text: Please help me reduce the gap between the figure and the header in my code. I tried using position specifiers like h! or H but those take the figure on to the header slightly. I tried using vspace* but that also gave the same result. So, please help me.               \documentclass{article}     \usepackage{xcolor}     \usepackage{pgfplots}     \usepackage{tikz}     \usepackage{layout}     \usepackage{float}     \usepackage{fancyhdr,adjustbox}     \usepackage{subfig}     \usepackage{titlesec}     \usepackage[margin=0.5in]{geometry}     \usepackage{colortbl}     \usepackage{filecontents}     \usepackage{array}     \usepackage{graphicx}     \usepackage{longtable}     \usepackage[font=small,compatibility=false]{caption}     \usepackage[english]{babel}     \usepackage[T1]{fontenc}          \pagestyle{fancy}     \fancyhf{}     \renewcommand{\headrulewidth}{0pt}     \lhead{\includegraphics[scale=0.4]{headerpic.jpg}}     \chead{}     \rhead{ 10th }     \addtolength{\topmargin}{.1in}     \definecolor{bblue2}{HTML}{00BFFF}     \definecolor{bblue}{HTML}{4F81BD}     \definecolor{rred}{HTML}{C0504D}     \definecolor{ggreen}{HTML}{9BBB59}     \definecolor{ppurple}{HTML}{eb6100}          \begin{document}     \begin{figure}     \centering     \begin{tikzpicture}         \begin{axis}[             axis x line=bottom,             axis y line=left,             width  = 0.85*\textwidth,             height = 8cm,             major x tick style = transparent,             ybar,             bar width=20pt,             ymajorgrids = true,             ylabel = {K Score},             symbolic x coords={              learning,engagement,safety,collaboration              },             xtick = data,             scaled y ticks = false,             enlarge x limits=0.25,             ymin=0,             legend cell align=left,             nodes near coords,             nodes near coords align={vertical},             legend style={                     at={(1,1.05)},                     anchor=south east,                     column sep=1ex             }         ]             \addplot[style={bblue2,fill=bblue2,mark=none}]                 coordinates {                 (learning,3.94) (engagement,4.17) (safety,3.44) (collaboration,4.32)                 };                  \legend{Categories}         \end{axis}     \end{tikzpicture}         \caption{\textit{Overall Metrics} }     \end{figure}     \end{document}      ![enter image description here](http://i.stack.imgur.com/wJzmJ.png)


title: Generate a table with braces and tables

text: I'm trying to get a LaTeX table to look like the below. Any tips on how to implement the brackets? ![](http://i.imgur.com/jjjG2w8.png) I currently just know how to do basic tables, which would be a 11x10 table in this case. Any way to make it simpler so the left and right side of the table have different vertical # of cells?


title: Line spacing with inline formula including fraction

text: I have a fraction in an inline formula as can be seen in the picture. `\dfrac` from the `amsmath` package was used. (This is `article` class with `14pt`s and `linespread 0.9`.) Though the space between the line including the formula and nearby lines are expanded, the space between the denominator of the fraction and the next line is still smaller than the one between other all-text lines. How can I expand the space so that equal space is guaranteed? (I don't want to make the fraction part smaller.) I already tried `abovedisplayskip` and `belowdisplayskip`, but they seem to work only in `\display` environment. I may find a command that works only for specific lines, but I want this spacing applied to the entire document where there is an inline formula with fractions. ![](http://i.stack.imgur.com/CZyHi.jpg)


title: Anchors badly positioned

text: I am trying to overlay some transparent boxes over a picture using TikZ within a Beamer frame. The code I use is the following:               \documentclass{beamer}     \usepackage[spanish]{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usetikzlibrary{arrows,shapes,positioning}          \begin{document}     \begin{frame}     \begin{tikzpicture}[remember picture, overlay]         \onslide<1->{                \draw []                 (-0.95,-2.75) rectangle (1.5,-4.00)                 node (rNode) {};                  \tikzset                 {pt/.style={circle,fill=red,inner sep=0mm,minimum size=4pt}}             \node[pt] at (rNode.center){};             \node[pt] at (rNode.west){};             \node[pt] at (rNode.south){};             \node[pt] at (rNode.east){};             \node[pt] at (rNode.north){};         };     \end{tikzpicture}     \end{frame}     \end{document}      The problem is that the anchors of the TikZ rectangles that I create are incorrect: they seem to be the anchors of a different rectangle that I did not create). I would like to know what I am doing wrong and how to solve this problem. ![enter image description here](http://i.stack.imgur.com/4YDGD.png)


title: Greek `\chi`'s subscript expressions: how to make it smaller or offset lower?

text: I am unsatisfied with the way **subscript is rendered for the Greek letter** `\chi`. This particular letter is rendered with a small downward offset. I occasionally have to prefix the subscript with `\sciptscriptstyle` such that, in effect, an expression may look like               \sup{\chi_{\scriptscriptstyle A_n}(x)}[n]      where               \RenewDocumentCommand{\sup}{m O{}}{         \operatorname{sup}\ifstrempty{#2}{}{\limits_{\mathclap{\substack{\expandafter{\scriptscriptstyle{#2}}}}}}             \expandafter{#1}      }      ( _I admit this snippet is a little messy, especially due to the uncanonical declaration of the optional argument as`O{}` and testing via `\ifstrempty` instead of `o` for the argument type and `IfNoValueTF`--using the xparse package. I am not entirely clear yet about what syntax is more straightforward._) Is there a way to **redefine** `\chi` **keeping the syntax in line with all semantically equivalent concepts** , i.e., letters, but having **only** `\chi`'s subscript expressions **smaller or slightly lower**? To clarify, I am thinking of redefining the subscript operator `_` for `\chi` only. But I naively suppose TeX' grammar would not let me do that. An evident work-around would involve defining a new macro using a different syntax like               \newcommand{\Chi}[1]{\chi_{\scriptscriptstyle{#1}}}      So effectively, what I want is just               \chi_{expr}      where `expr` is **rendered smaller or offset lower** than default.


title: What Font Size Should a Mathematics Paper Be Written in?

text: What font size should a mathematics paper be written in? `\large`? If it's `12pt`, how do you indicate that? Finally, while writing my mathematics paper I'm seeing far too many sentences that end in -. For example: > The Bactkracking Algorithm has a plethora of appli-   >  cations. It is used... Can I get rid of or reduce the number of -'s?


title: Is it safe to "renewcommand" \SS? (Which packages use \SS command?)

text: I've tried to set               \newcommand{\SS}{\mathcal{S}}      in the preamble but I've discovered that this command is already defined. So, I tried native command on my code and I've found that it is a "simple" double S. Now, I can fix my problem using               \renewcommand{\SS}{\mathcal{S}}      but I'm not sure it is safe (I don't know if `\SS` is used by LaTeX only to draw a (simple or special) double S, or for something else too). Does someone know if it is safe (or when it isn't safe) to do a “renewcommand” of `\SS`?


title: Can I hook into the end of the document but *after* the `\clearpage`?

text: The code for `\enddocument` begins:               \def\enddocument{%        \let\AtEndDocument\@firstofone        \@enddocumenthook        \@checkend{document}%        \clearpage        \begingroup      I'd like to put something _after_ that `\clearpage`. What's the simplest way to do that? Alternatively, I could put an extra `\clearpage` into the code that I want to dump there. Is there a problem with issuing more `\clearpage`s than strictly necessary? And would it cause problems having a `\clearpage` before the `\@checkend{document}` (could there be interactions with other stuff using the end document hook)? The specific use case is (with apologies to those who thought I might be asking a _serious_ question) TikZ/PGF. As TeX processes a document with PGF stuff then it stores up some stuff that needs to be put at the start of the document. It does this with a token register `\pgfutil@everybye` which gets invoked with an `\AtEndDocument{\the\pgfutil@everybye}`. This works fine _except_ if stuff is added to this list in the headers and footers of the last page - these don't seem to get added to the list in time to be added to the document (this came to light in looking at defining a fading-style directly in the fill command where the questioner wanted to define a fading in a header. There were various issues with this, and this appears to be a fairly important one.)


title: How to use biber with Ubuntu 12.04?

text: I am using Ubuntu 12.04, TexLive 2012 from backports, TexLive full installation. However, when I try to compile via latexmk, I get an error message that biber is missing. How to get biber working on 12.04 - but please only with packages from the repository, not with manual installation.


title: Piecewise Function Using Pgfplots

text: Using the question here I have tried to plot a piecewise function. My code looks like               \begin{document}     \pgfmathdeclarefunction{func}{1}{%         \pgfmathparse{%     (and(#1<=-2)  * (#1*#1 + #1*6 + 8)   +%          (and(#1>=-2  ,#1<=1) * (2 - #1 - #1*#1)   +%         (and(#1>=1  ,#1<=2) * (6 - #1*8 + #1*#1*2)   +%     (and(#1>=2) * (-10 + #1*6 - #1*#1)   %     }%     }               \begin{tikzpicture}[scale=0.8         \begin{axis}[     axis x line=middle,      axis y line=middle,      ymin=-5, ymax=5, ytick={-1,-2,-3,-4,-5,1,2,3,4,5}, ylabel=$y$,      xmin=-5, xmax=5, xtick={-5,-4,-3,-2,-1,1,2,3,4,5}, xlabel=$x$     ]          \addplot[blue,domain=-5:5]{func(x)};     \end{axis}     \end{tikzpicture}           \end{document}      The function will be x^2+6x+8 for x<=-2, 2-x-x^2 for -2<=x<=1, 2x^2-8x+6 for 1<=x<=2, and -x^2+6x-10 for x>=2. When I try to compile it gives me a `PGF Math Error: internal routine of the floating point`. How do I fix this?


title: Biblatex bibliography title fields for different entries

text: I'd like to typeset my bibliography (which currently contains > 100 entries) and I'm strongly considering using biblatex. I'd like to try some alternatives, being one of them printing the title of an entry in bold. To that end, following the suggestion on the usage of biblatex that another user gave me, I wrote the tex code below that uses \DeclareFieldFormat{title}{\textbf{#1}}. However I only get in bold the titles for books, manuals, miscs, technical reports, but this is ignored for articles, inproceedings and unpublished work. Which is the field from those type of entries that I need to tune in biblatex in order to print their titles in bold?               \begin{filecontents*}{biblio.bib}     @ARTICLE{ar,              author    = {Author-ar},              title     = {ar}}     @inproceedings{inp,              author    = {Author-inp},              title     = {inp}}     @unpublished{unp,              author    = {Author-unp},              title     = {unp}}     @techreport{tr,              author    = {Author-tr},              title     = {tr}}     @misc{mi,              author    = {Author-mi},              title     = {misc}}     @MANUAL{ma,              author    = {Author-ma},              title     = {manual}}     @BOOK{bo,              author    = {Author-bo},              title     = {book}}     \end{filecontents*}          \documentclass{article}     \usepackage[backend=bibtex8]{biblatex}     \bibliography{biblio}     \DeclareFieldFormat{title}{\textbf{#1}}     \begin{document}     Hello ~\cite{ar,inp,unp,tr,mi,ma,bo}.     \printbibliography[title={References}]     \end{document}      Generated output: ![Output for the previous code](http://i.stack.imgur.com/sZiHc.png)


title: Section number and name in italics

text: Note that I "inherited" a preamble that I would like to adapt:               \documentclass[a4paper,12pt]{book}     \usepackage{amsmath, amsthm, amssymb}     \usepackage{fancyhdr}     \pagestyle{fancy}     \renewcommand{\headrulewidth}{0.1pt} % for upper line     \renewcommand{\footrulewidth}{0.1pt} % for lower line     \fancyhead[LE,RO]{\itshape \nouppercase \rightmark}     \fancyhead[LO,RE]{\itshape \nouppercase \leftmark}     \fancyfoot[C]{\thepage}          \usepackage{fancybox}          \usepackage{xcolor}     \usepackage{framed}          \numberwithin{equation}{section} % numbering according to the section     \bibliographystyle{plain} %Choose a bibliograhpic style          \setlength{\headheight}{15pt}          %\parindent0em     \parskip1ex      Withe the above preamble, whenever I make new section, ie.,`\section{My Section}`, both the section number and the text `My Section` are displayed regularly. To make the text in italics, I put it in `\textit{My Section}`. This way, however, does not make the section number in italics. What should I change in order for the section number and name to always be in italics?


title: Can I use the bend command in my coding?

text: \begin{tikzpicture}[scale=1, every node/.style={draw, shape=circle,fill,scale=0.5}]     \path (0,0) node (p1) {}     (-1.5,-1) node (p6) {}     (-1.5,-2.5) node (p5) {}     (1.5,-2.5) node (p3) {}     (1.5,-1) node (p2) {}     (0,-3.5) node (p4) {};     \draw (p1) -- (p2)     (p2) -- (p3)     (p3) -- (p4)     (p5) -- (p6)     (p6) -- (p1)     (p6) -- (p1);     \end{tikzpicture}      As you see I got two of the same edge (p6) -- (p1). I googled it and saw that in some codes different for this I can use a bend command is there some way that could work on this? If yes could you please tell me how?


title: Get current "section" name without label

text: **Update:** I accepted the solution provided by Heiko Oberdiek, because that was doing exactly what I asked. When interested only in the chapter name, egreg's solution works fine. However, to get it working with memoir, one has to change the parameter from `#1` to `#2`. Don't ask me why.               \documentclass[a4paper, 10pt, oneside]{memoir}     \usepackage{etoolbox}     \makeatletter     \apptocmd{\@chapter}{\gdef\currentchapter{#2}}{}{}     \def\currentchapter{?}     \makeatother          \begin{document}     \chapter{A Chapter}     ``\currentchapter''     \section{A Section}     ``\currentchapter''     \end{document}      **Old question:** I want to get the name of the current "section" (chapter, section, subsection, ...) _without_ labeling the section. I tried using `\nameref` with e.g. `\thechapter` which obviously doesn't work, as `\nameref` expects a reference (the name of `\label`) and not a number. Is there a command, that gives me directly the name of the current "section"? Or is there a command which can "generate" a reference out of section numbering, like: `\getname{\thechapter}`? I found out already, that it is impossible to get the numbering of the current "section" - I'd need to check the counter to get the correct "section". My goal is to redefine `\todo` from the package `todonotes` that it always displays the current "section" name:               \let\Oldtodo\todo     \renewcommand{\todo}[1]{\Oldtodo{\currentname: #1}}      If it is not possible to get the name of the current "section", I would be happy with the current chapter or section name too:               \let\Oldtodo\todo     \renewcommand{\todo}[1]{\Oldtodo{\currentchaptername: #1}}      Below is a simple example without `todonotes`.               \documentclass{memoir}     \begin{document}          \section{My section name}     The name of the current section is: " \currentname "     It should be: " My section name "          \subsection{My subsection name}     The name of the current subsection is: " \currentname "     It should be: " My subsection name "          \end{document}      Notice that I'm using documentclass memoir.


title: How to display cover page alone in the "two page view" mode

text: For some pdf ebooks, Adobe Reader displays the cover page alone even though the display mode is "two page view". Other than the cover page, the rest of the pdf content is displayed as two pages at once, which is expected in the "two page view" mode. My question is: Is it possible to enforce this behavior if I use pdflatex, and if so, how could I achieve that? The document class I'm using is `memoir`.


title: How to add a preface chapter to a book that appears before all chapters and is not numbered as a chapter?

text: I just wrote the preface to my book and I made it a `\chapter`, but now the preface is `Chapter 1` of the book, which is not what I desire. I am using the `memoir` document class. Does anyone know how to make this preface chapter not really be a chapter?


title: how to include chess symbols in text

text: I would like to know how to include chess symbols in normal text in LaTeX. I have looked online but the packages `chess.sty` or skak are too old or they display chessboards.


title: Possible to use MnSymbol with LuaTex?

text: I want to use the Minion Pro font together with math symbols from MnSymbol (http://www.ctan.org/tex-archive/fonts/mnsymbol). Is this possible? It has already been discussed here -> http://www.latex- community.org/forum/viewtopic.php?f=48&t=16231. No solution has been found but this was over 2 years ago. If I understand it correct unicode-math can directly use OTF fonts. I am wondering why this doesn't work for MnSymbol. At http://www.ctan.org/tex- archive/fonts/mnsymbol/otf you find OTF files but I don't know how to deal with them. Is it possible to convert them? Ideas? Here an example. I don't have Minion Pro installed as a system font so you probably have to adjust the paths. The example works but I want the "functionality" of something like "\setmathfont{MnSymbol.otf}".               % !TEX TS-program = lualatex     \documentclass{article}     \usepackage{fontspec}     \usepackage{unicode-math}     \setmainfont[         BoldFont       = MinionPro-Bold,         BoldItalicFont = MinionPro-BoldIt,         Extension      = .otf,         ItalicFont     = MinionPro-It,         Ligatures      = TeX,         Path           = ../Font/MinionPro/     ]{MinionPro-Regular}     \setmathfont{latinmodern-math.otf} % <-- here I want to use MnSymbol     \setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}, Path = ../Font/MinionPro/]{MinionPro-Regular}     \setmathfont[range=\mathbfup/{num,latin,Latin,greek,Greek}, Path = ../Font/MinionPro/]{MinionPro-Bold}     \setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}, Path = ../Font/MinionPro/]{MinionPro-It}     \setmathfont[range=\mathbfit/{num,latin,Latin,greek,Greek}, Path = ../Font/MinionPro/]{MinionPro-BoldIt}     \begin{document}     $\forall x$     \end{document}


title: Making a variable-sized surd?

text: Is there a get around to make `$\surd$` variable-sized via standard AMS package? For example, I would like `$\surd \frac{a}{b}$` to look like `$\sqrt{\frac{a}{b}}$` with the elongated left line but no overline on `$\frac{a}{b}$`.


title: Adding TikZ code to TOC

text: Friends, I've been successfully using the `tocloft` package to manage custom indices. But now I have some doubts on a tricky part, whether is possible or not. Consider the following code:               \documentclass{article}          \usepackage[titles]{tocloft}     \usepackage{tikz}          \newcommand*\info[1]{%       \begin{tikzpicture}         \node[draw,inner sep=1pt, minimum height=0.2cm, minimum width=0.5cm] {\tt\tiny #1};       \end{tikzpicture}}          \newcommand{\listfoo}{List of foo}     \newlistof[section]{foo}{idf}{\listfoo}          \begin{document}          \info{123} \info{ABC} Hello world.          \refstepcounter{foo}     \addcontentsline{idf}{foo}{Hello world.}          \refstepcounter{foo}     \addcontentsline{idf}{foo}{Hello bar.}          \listoffoo          \end{document}      The output is as expected: ![List of foo](http://i.stack.imgur.com/HC5Lq.png) In this particular case, I was wondering if it's possible to add a TikZ image to the list entries. I tried to add `\addcontentsline{idf}{foo}{\info{123} \info{ABC} Hello world.}` but it didn't work. I hope to achieve something like this: ![List of foo part 2](http://i.stack.imgur.com/M5IdG.png) I also tried the inline `\tikz`, but no success. Probably I'm missing something obvious, or maybe it's trickier than I thought. Any ideas?


title: aligning equations with a tag

text: \documentclass{article}     \usepackage[a4paper, total={6in, 8in}]{geometry}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{fourier}     \usepackage{mathtools}     \usepackage{amsmath}     \usepackage[english]{babel}     \usepackage{graphicx}     \usepackage{marginnote}      \begin{document}     $$ KP = e^{-\lambda} \Big( \frac {\nu'}{r} +\frac {1}{r}\Big) -\frac {1}{r^2}$$         \begin {gather}         \Rightarrow \frac {dP}{dr} = - \frac { P+\rho (P) c^2}{r(r-2u)} \Big[ \frac {K}{2} P r^3 +u \Big] \tag {**}         \end {gather}     \end {document}      How do I align them ?


title: Scale sideways subfigure to fit to page

text: I have a document with subfigures that are printed sideways with rotating. I need to scale that figure (with subfigures) to fit to page.               %% LyX 1.6.7 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{graphicx}          \makeatletter          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.     %% A simple dot to overcome graphicx limitations     \newcommand{\lyxdot}{.}               \makeatother          \usepackage{babel}          \begin{document}          \begin{sidewaysfigure}          \captcont{Gene Ontology analysis of cancer marked control overexpressed     genes}          \subfigure{           \label{fig:cncrUniqMrkdCntrlOvrExp}           \includegraphics[width=1\\linewidth,height=12cm]{\lyxdot \lyxdot /\lyxdot \lyxdot /fig/go_gprof/go_cncrUniqMrkdCntrlOvrExp}          }          \captcont{Gene Ontology analysis of cancer marked cancer overexpressed     genes}          \subfigure{           \label{fig:go_cncrUniqMrkdCncrOvrExp}           \includegraphics[width=1\\linewidth,height=12cm]{\lyxdot \lyxdot /\lyxdot \lyxdot /fig/go_gprof/go_cncrUniqMrkdCncrOvrExp}          }           \end{sidewaysfigure}          \end{document}      What variables should I use for width and height?


title: typesetting material to the left of a big curly brace

text: \documentclass{article}          \newcommand*{\LeftWidth}{3.0cm}%     \newcommand*{\RightWidth}{\dimexpr\linewidth-\LeftWidth-2em\relax}%     \newcommand{\AlignedBrace}[2]{%         \medskip\par\noindent%         \makebox[\LeftWidth][r]{\textbf{#1}~}%         $\left\{~\parbox{\RightWidth}{\strut\textit{#2}\strut}\right.$%     }%          \begin{document}     \AlignedBrace{Gradation}{%         Industria Virtutem parit: \\         Virtus Laudem excibat: \\         Laus adfert honorem: \\         Honoris socia est, et comes AEmulatio     }     \AlignedBrace{Commutation}{%         Quae de illo dicuntur; \textasciicircum{}dici non\textasciicircum{} \\         dici non possunt: \\         quae dici possunt: \\         non dicuntur:     }     \AlignedBrace{Distribution}{%         consilio ciuitatem inuare: \\         Senatus officium est: \\         Magistratus officium est: \\         opera \& diligentia, consequi senatus Voluntatem     }     \AlignedBrace{Division}{%         Si probus es: \\         non meruisti: \\         sin improbus: \\         non commoVeris:     }     \AlignedBrace{Similitude}{%         Vt hirundines estiuuo tempore, presto sunt \\         frigore pulsae recedunt: \\         Ita falsi amici amici: sereno Vitae tempore, presto sunt \\         Simulatque hyemem fortunae dederint Auolant omnes     }     \AlignedBrace{Exposition}{%         Qui est tam tenui cogitatione praeditus: \\         cuius animus, tantis angustiis invidiae continentur: \\         Qui non hunc hominem, studiosissime Laudet, \\         et sapientissimum iudicet:         Qui pro salute patriae, pro incolumitate ciuitatis \\         pro Repub: fortunis, quamuis magnum atque \\         atrox periculum, studiose subeat?     }     \end{document}      This works very well but I've got a further problem: sometimes, what I type on the left, before the big curly braces, is too long and sticks out of the left margin, what should I do? This is a follow up to aligning braces in a text (not maths).


title: Why won't I see the table of contents?

text: I tried to write table of contents to my book but encountered a problem, as it prints "Sisältö" but there is no table of contents. What is the mistake I made?               \documentclass[11pt,a5paper,twosided,margin=3in]{amsart}     \usepackage[utf8]{inputenc}     \usepackage[finnish]{babel}     \usepackage{amsmath}     \usepackage[top=0.5in, bottom=0.8in, left=1in, right=1in]{geometry}     \usepackage{fancyhdr}      \fancyfoot{}     \fancyhead[RO,LE]{\thepage}     \fancyhead[LO]{\leftmark}     \fancyhead[RE]{\rightmark}     \cfoot{}      \setlength{\oddsidemargin}{5mm}     \setlength{\evensidemargin}{-5mm}     \linespread{1.5}     \vbadness=20000     \usepackage{titlesec}     \titlespacing{\section}{0pt}{36pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}     \titlespacing{\subsection}{0pt}{36pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}     \pagestyle{fancy}      \begin{document}     \tableofcontents     \title{title}     \newpage     \section*{Beginning}     Some text.     \subsection*{Start}     \hspace{1em}     Some text.     \end{document}


title: Using contcapt in the sidewaysfigure environment

text: In a two sidewaysfigure environments across two pages contcapt in the second page has an incremented caption number. Oddly, the subfigure letter on the second page is correct ex. (it will start with b) rather than a)). Since the second page is still part of the first figure I don't want to increment the caption counter. Does anyone else get such an error?   Does anyone know why such an error would be cause?   Does anyone know how to fix this error?   Can the solution work in Lyx?               %% LyX 1.6.7 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{graphicx}          \makeatletter          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.     %% A simple dot to overcome graphicx limitations     \newcommand{\lyxdot}{.}               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \usepackage{float}     %figures     \usepackage{captcont}     \usepackage{subfigure}     %\usepackage{subfig}     \usepackage{rotating}          \makeatother          \usepackage{babel}          \begin{document}     \begin{sidewaysfigure}          \caption{Gene Ontology analysis of marked overexpressed genes in     cancer and matched-control cell lines}          \subfigure[Gene Ontology analysis of control cancer marked overexpressed     genes]{          \label{fig:go_cntrlUniqMrkdCncrOvrExp}          \includegraphics[width=1\textheight]{\lyxdot \lyxdot /\lyxdot \lyxdot /fig/go_gprof/go_cntrlUniqMrkdCncrOvrExp}          }          \end{sidewaysfigure}          \begin{sidewaysfigure}          \captcont*{Gene Ontology analysis of marked overexpressed genes     in cancer and matched-control cell lines}          \subfigure[Gene Ontology analysis of cancer marked control overexpressed     genes]{          \label{fig:cncrUniqMrkdCntrlOvrExp}          \includegraphics[width=1\textheight]{\lyxdot \lyxdot /\lyxdot \lyxdot /fig/go_gprof/go_cncrUniqMrkdCntrlOvrExp}          }          \subfigure[Gene Ontology analysis of cancer marked cancer overexpressed     genes]{          \label{fig:go_cncrUniqMrkdCncrOvrExp}          \includegraphics[width=1\textheight]{\lyxdot \lyxdot /\lyxdot \lyxdot /fig/go_gprof/go_cncrUniqMrkdCncrOvrExp}          }          \subfigure[Gene Ontology analysis of control marked control overexpressed     genes]{          \label{fig:go_cntrlUniqMrkdCntrlOvrExp}          \includegraphics[width=1\textheight]{\lyxdot \lyxdot /\lyxdot \lyxdot /fig/go_gprof/go_cntrlUniqMrkdCntrlOvrExp}          }          \end{sidewaysfigure}     \end{document}


title: How to make contextual framed letters get proportional size automatically?

text: I am creating a question sheet using a method (I don't know the exact name, maybe bubble sheet format) as follows: ![alt text](http://i.stack.imgur.com/RAZbd.png) My question is how to improve the appearance such that the framed letters get proportional size based on the context. If the frame letter must work as an exponent, it must be smaller. If it works as a lower index in integral or sum, it also must be smaller. Here is my code snippet after "normalization" :-)               \documentclass[dvipsnames,dvips,cmyk]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{xcolor}     \usepackage{amsmath}     \usepackage{bera}               \fboxsep=2pt     \fboxrule=0.8pt          \newcommand{\boxy}[1]{\ensuremath{\,\fbox{\;\,{\color{red}\bf#1}\,\;}\,}}          \newcommand{\ltr}[1]{{\color{red}\bf#1}}          \begin{document}     \noindent%     Each letter \ltr{A}, \ltr{B}, \ltr{C}, etc in the equations represents a numeral (from 0 to 9) or the minus sign ($-$).               \[     \int_{\boxy{A}}^{\boxy{B}}f(x)\,\textrm{d}x=\frac{1-\boxy{P}}{\boxy{Q}+\boxy{R}}     \]          \[     -2 x^{\boxy{XYZ}}-\boxy{W}\sqrt{\boxy{V}+1}     \]          \[     \sum_{i=\boxy{A}}^{\boxy{BC}}=\tan\left(\boxy{D}-\boxy{E}\right)     \]     \end{document}


title: how should LaTeX know, where to break the 'equation' ... somewhere in the exponential function?

text: I have failed to command latex to automatically enter new line as shown in the picture below.![enter image description here](http://i.stack.imgur.com/VEMj5.jpg) Here is my command:               \documentclass{article}     \usepackage{braket}     \usepackage{mathtools}     \everymath{\displaystyle}     \begin{document}     \title{Quantum Mechanics Homework 3 \& 4}     \author{Seng Sopheak}     \date{2014}     \maketitle     [...]     $= \frac{1}{(2\pi\hbar)^{1/2}}\frac{1}{\left(2\pi\Delta x^2\right)^{1/4}}\int_{-\infty}^{+\infty}e^{-\frac{(x-\langle x \rangle)^2}{4\Delta x^2}-\frac{\frac{4i}{\hbar}(p-\langle p \rangle)(x-\langle x \rangle)\Delta x^2}{4\Delta x^2}-\frac{\frac{4i^2}{\hbar^2}(p-\langle p \rangle)^2\Delta x^4}{4\Delta x^2}-\frac{i}{\hbar}x(p-\langle p \rangle)+\frac{\frac{4i}{\hbar}(p-\langle p \rangle)(x-\langle x \rangle)\Delta x^2}{4\Delta x^2}+\frac{\frac{4i^2}{\hbar^2}(p-\langle p \rangle)^2\Delta x^4}{4\Delta x^2}}\mathrm{d}x$\\     [...]     \end{document}      I could use line breaker `\\\`, but I wonder if there is a way for latex to automatically entering new line. Could you help me? Sorry for my English.


title: Math Times Pro 2 and Txfontsb

text: Im trying to load both mtpro2 (full version) and txfontsb packages in the same document but i get this error "Command \Bbbk already defined. \newcommand{\Bbbk}{\mathbb{k}}" If I place the txfontsb pachage after mtpro2 I get weird symbols instead of "+" or "="               \documentclass[a4paper,11pt]{article}      \usepackage{psfrag}      \usepackage[english,greek]{babel}      \usepackage[iso-8859-7]{inputenc}      \usepackage[T1]{fontenc}      \usepackage{mtpro2}      \usepackage{txfontsb}      \usepackage[left=2.00cm, right=2.00cm, top=3.00cm, bottom=3.00cm]{geometry}      \usepackage{tikz}      \usepackage{tkz-euclide,tkz-fct}      \usepackage{wrapfig}      \usepackage{calc}           \begin{document}      $ a+\beta=1 $      \end{document}      How can I make them work together?


title: Beamer: highlighting aligned math with overlay

text: > **This question led to a new package:**   >  `hf-tikz` Minimal working example:               \documentclass{beamer}     \usepackage{amsmath}     \begin{document}      \begin{frame}      \begin{align}           a_i + b_j = 10 & \forall i\in I, j\in J \\           c_j + d_j + a_i >= 30 & \forall i\in I, j\in J      \end{align}      \end{frame}      \end{document}      Suppose I want to highlight both `a_i` 's in the equations and then the second equation as a whole. I could use `\alert<2>` on each `a_i`, but this would not work with the second equation, the part after the `&` would need to be enclosed in a separated `\alert<3>` directive. However I have several equations to highlight at once, so I'd prefer a method that works across "groups", i.e across `&`. Secondly, if it was possible, I'd prefer, rather to use alert, to enclose the equations in boxes, like with `\boxed`, and have labels on such boxes, for descriptive purposes. What packages I need to look into, if any? EDIT: is there something else beside TikZ (and possibly simpler)? I can't get it to work with my outdated TeXLive 2007, and I can't update the latter either.


title: Automatically fixing catcode output

text: Using the following macro to redefine catcodes for lua blocks to make programming lua inside tex files more natural has a fault:               \def\lua{%       \bgroup       \catcode`\\=12       \catcode`\{=12       \catcode`\}=12       \catcode`\^^M=12       \catcode`\#=12       \catcode`\~=12       \catcode`\%=12       \catcode`\_=12       \catcode`\@=12       \doluacode     }          \bgroup     \catcode`\|=0     \catcode`\^^M=12 %     \catcode`\\=12 %     |long|gdef|doluacode#1^^M#2\endlua{|directlua{#2}|egroup}%     |egroup      Because it redefines the codes it also redefines the codes from tex.print output. The following code will fail               \lua         tex.print("\\mymacro")     \endlua      because `\` is interpreted with a catcode of 12. Is there any way to get tex.print to revert back to using the original tex catcodes so printing tex stuff will work **WITHOUT** having to redefine each character by hand(which obviously doesn't work when you are generating tex code programmatically in lua). That is, I would like to simply run the above code with LITTLE modification and have it work correctly and not have to do stuff like tex.print(0, "\") tex.print("mymacro") which ,AGAIN, does not work for programmatically generated tex. The only way to do this that I have of is to create a new print function that scans the string and converts the cat codes but hopefully there is a better way?


title: Spanning multiple beamer columns

text: How does one have something (say a figure) span multiple columns when using the beamer `columns` environment? Nathaniel Johnston's beamer poster template does this by nesting two `columns` environments, but this fails for me--somehow the column widths get messed up and things run off the page.


title: Change leftmark in fancyhdr

text: Can anyone tell me how, in the minimal example pasted below, I can achieve that the dot after Appendix in the header disappears? I understand that it is there because I simply made the number of the `appendix` invisible.               \documentclass[10pt, a4paper]{report}          \usepackage[T1]{fontenc}     \usepackage[titletoc]{appendix}     \usepackage{fancyhdr}     \usepackage{blindtext}          \pagestyle{fancy}           \begin{document}          \tableofcontents          \begin{appendices}        {\def\thechapter{}\chapter{This and that}}        \blindtext        \newpage        \blindtext     \end{appendices}          \end{document}      EDIT by ldpw: Maybe it would be even better if the dot was not removed but if it was put directly behind Appendix (that is, without the blank space between appendix and the dot): APPENDIX . THIS AND THAT --> APPENDIX. THIS AND THAT


title: Having a table use textwidth and still have centered text?

text: I'm wondering if it's possible to have a table in LaTeX that spans the entire textwidth, and that the columns automatically center themselves... I have tried using the "X" option in `tablerx`, but it doesn't center the columns... Additionally, you'll see that I place two `\hline`s below my first row. Is it possible to put a little space below **the line**? Code below.               \begin{table}[h]     \caption{Unit comparison between reduced Lennard-Jones units and GROMACS dimensional units.  \vspace{0.2cm}}     \begin{tabularx}{\textwidth}{X X X X}          \hline \hline %\vspace{0.1cm}         \bf{Unit}          &              \bf{Lennard-Jones}              &             \bf{Dimensional}          &       \bf{GROMACS units} \\ \hline          Time             &                    1 $t^*$                       &                   1 ps                  &                     ps              \\          Velocity        &                    1 $v^*$                      &                1000 m/s            &                   ps/nm          \\         Temperature &                  1 $T^*$                      &                120.272 K          &                        K     \\ \hline \hline     \end{tabularx}     \label{table:properties}     \end{table}


title: package(s) for creating knot diagrams

text: I was wondering if anyone could suggest software/packages to create nice knot diagrams (hopefully with a link to images they have made in the past). I have used xy-pic recently but am mainly interested in hearing about other options.


title: Macros multicolumn and row in LaTeX

text: I have a table like this but in LaTeX when I use `\multicolumn` or `\multirow` the output view is not perfect and it seems that there is some overlapping between cells and when we use these commands there is not any separator between cells. Can you help me to make this table better.               \begin{table}[h]     \centering         \begin{tabular}{ | p{1.2cm} | p{1.6cm} | p{1.6cm} | p{1.6cm} | p{1.6cm} |}         \hline         \multirow{2}{*}{Scenario} & \multicolumn{2}{|c|}{Urban} & \multicolumn{2}{|c|}{Highway} \\          & Without RSU & With RSU & Without RSU & With RSU \\ \hline         PDR & e-HBCWC & HBCWC & e-HBCWC & \\ \hline         End-to-End Delay & e-HBCWC & DCF & HBCWC & \\ \hline         Overall & e-HBCWC & e-HBCWC & e-HBCWC & \\ \hline         \end{tabular}     \end{table}


title: Makeindex in TeXnicCenter

text: I need to create an index in my document, so I put the following lines in my preambel               \usepackage{makeidx}     \usepackage{showidx}     \makeindex      So, when compiling with TeXnicCenter, I noticed the following line in the log               Can't create output index file E:\...\doc.ind      No further information on why - just this line. Of course, in the compiled document, there is no index (duh!) - So, why does this error ocurr and how can I get TeXnicCenter to produce the index file? If I run makeindex myself over cmd, it runs smoothly and creates the index without a problem.


title: Best practice for index construction -- recommendations and references

text: I'm about to embark on something I've never done (at any rate, seriously) before: preparing an index for a ~200-page document. I have started, but I get the feeling "something's wrong". I know that I must do the index _as I write the document_ -- this is just to help me set my own ground rules as I do that. Here are some typical doubts:   * Should I attempt to identify the principal reference (with a bold or coloured page number)? (I have my own `\ixmain` command for this.)   * How much effort should I invest in generating page ranges? (I have my own `\ixstart` and `\ixend` for this.)    * To what extent should I rely on the "see" construct, especially for abbreviations and (common or local) acronyms?:               \index{session identifier|see{session id}}     \index{session identifier|see{\textsc{sid}}}     \index{process identifier|see{\textsc{pid}}}        * How redundant should I make my index? For example, which of these index entries should I _not_ use?:               \index{session identifier}     \index{identifier!session}     \index{session!identifier}     \index{session id}     \index{sid@\textsc{sid}}      The question is this: what are the guiding principles that, when followed, make an index user-friendly? Detailed explanations or reference pointers will both be welcome


title: How can I get Sperrsatz?

text: Sperrsatz is a special kind of emphasis often used in combination with blackletter fonts. A word in Sperrsatz has 0.125 em spaces between its characters, but some ligatures are preserved. For example: »B ä ck e r ſt r a ß e« How can I get Sperrsatz with (La)TeX?


title: Package not found

text: I'm having some problems using the package `minitoc`. Every time I try to compile my LaTeX file, I'm getting the error: `minitoc.sty not found`. I did a search in my computer and I found that I have that package. How do I tell LaTeX to use the right path to that package? I have the MacTeX 2010 distribution and I'm running Snow Leopard.


title: How come \label doesn't work after \footnote?

text: In the comments on Martin Scharrer's answer to Why does an environment's label have to appear after the caption? there is a discussion of whether one ought to put `\label` inside of or after `\caption`. From reading the comments, one gets the sense that, in most cases, it is inconsequential whether one puts `\label` either inside the argument to a command or after the command and that putting it after is possibly preferred, as, according to Axel's quote of Leslie Lamport, "A label can appear in the argument of a sectioning or `\caption` command, but in no other moving arguments". That is to say, this quote might suggest, then, that putting `\label` after a command is a best practice, as it will always work, even in the case of "moving arguments". ( **Note** : I realize this is not literally true (else I wouldn't be asking this question), but it seems to me that one might reasonably assume that this is so, based on that quote.) Yet, when `\label`ing `\footnote`s, `\ref` only works properly when the `\label` is _inside_ the `\footnote`, _not_ after. Why is this the case?               \documentclass{article}          \begin{document}          Text.\footnote{\label{fn:test-1}This is a footnote.}          More text.\footnote{This is another footnote.}\label{fn:test-2}          Let's reference fn.~\ref{fn:test-1}, and let's also reference fn.~\ref{fn:test-2}          \end{document}      ![enter image description here](http://i.stack.imgur.com/SrnLf.png) An answer that touches on both the reason for why this is so as well as why it was designed to be so would be preferred to an answer that just touches on why this is so.


title: How to choose font size given the paper size

text: How do you choose what font size to use given the paper size in use? For example, I found somewhere that for a European standard the following is recommended:               \documentclass[a4paper,11pt]{article}     \usepackage[scale=0.7,vmarginratio={1:2},heightrounded]{geometry}      What is the typographic rule here? For example I want to print something (book, dissertation) on an `A5` paper size. What should be the corresponding font size? How should I adjust the boundaries? To be even more specific, in case it makes a difference, how this issue should be tackled when using the `memoir` document class? ## Edit: Thanks to @cfr's answer, I'll state a more explicit case. I use the `memoir` class and it will be printed on A4 page. The class is loaded as:               \documentclass[11pt,a4paper,extrafontsizes,twoside]{memoir}     \fixpdflayout      Furthermore, I load the package `\usepackage{fourier}` to use the Utopia face. Finally, using the code snippet from 15 of the `memoir` class, I get the following output: > The length of this alphabet is 39.03668pt. Should I do anything further?


title: How to change (Mac)Vim's syntax highlighting rules for (La)TeX files?

text: I'm a long-time AUCTeX/Emacs user that switched to Vim/LaTeX-Box recently. I got everything working the way I want and grew pretty fond of Vim, but there's still one unusual thing that bothers me: Vim's syntax highlighting rules for LaTeX seem to be different and more "noisy" than those of AUCTeX/Emacs. See the attached screenshots. ![MacVim+LaTeX-Box+Solarized](http://i.stack.imgur.com/9y998.png) ![Emacs+AUCTeX+Solarized](http://i.stack.imgur.com/ex2Qp.png) Both show the same place of the same file using Solarized color scheme, but in Vim there's a lot more colors, which I find distracting. Particularly the fact that `$` symbols that open inline math environments are colored differently than the contents of that environmnent makes editing proofs slightly annoying. Is it possible to modify Vim highlighting rules in a relatively easy way?


title: Draw with TikZ a Pythagorean triangle with the squares of its sides and labels

text: I've made this checking the old questions and the TikZ manual and I want to draw the squares of the sides of my Pythagorean triangle. So far I have               \documentclass{article}          \usepackage{tikz}          \begin{document}          \begin{tikzpicture}[scale=1.25]%,cap=round,>=latex]          \coordinate [label=left:$C$] (A) at (-1.5cm,-1.cm);     \coordinate [label=right:$A$] (C) at (1.5cm,-1.0cm);     \coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);     \draw (A) -- node[above] {$a$} (B) -- node[right] {$c$} (C) -- node[below] {$b$} (A);          \draw (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);          \end{tikzpicture}          \end{document}      which produces ![output](http://i.stack.imgur.com/mVExf.png)


title: How to change the svmono class of Springer to use 12pt as font size

text: I want to change the svmono class of Springer in order to use 12pt as font size. I've been looking for in this foro (and others), but the answers didn't work.


title: bibtex: bar over a capital letter

text: Is there a way to simultaneously capitalize and put a bar over a letter in BibTeX? I know that to capitalize a letter, it needs to be wrapped in `{}`, and `\=` can be used to put a bar over it. But this does not seem to work together. Any ideas? Thanks much.


title: Retain side-effects but discard command output

text: The following code works, although I have a feeling my `\settowidth` method of discarding the output is not how it should be done:               \documentclass{article}     \newlength{\trashlength}     \long\def\ignoreoutput#1{%      \settowidth{\trashlength}{#1}%     }     \long\def\command#1{      This \gdef\stuff{Stored: #1} shouldn't be here.     }     %% Should not raise Missing \begin{document} error here:     %\ignoreoutput{\command}     \begin{document}      % Should produce "nothing":      no\ignoreoutput{\command{Side %\par %%%%% this breaks everything.        effect!}}thing.           % Should output the text previously stored:      \ifx\stuff\undefined No side effect.      \else \stuff \fi     \end{document} When uncommenting the `\par` though, it breaks: with _Paragraph ended before \@settodim was complete._ So how do I ignore commands that allow long input?


title: TikZ: Creating stack with variable width

text: I am new to TikZ and want to draw a simple stack Diagram. The Diagram should look like:               [a] [b] [c] [d]  |-|                      |j|     [f            ]  | |                      | |     [g            ]  | |                      | |     [h            ]  |_|      I hope my ASCII-Art can be seen. Right now i try to use something like:               \begin{tikzpicture}[x=20pt, y=20pt, node distance=1pt,outer sep = 0pt]          \tikzstyle{box}=[rectangle,draw,anchor=north west,text centered]     \tikzstyle{smallbox}=[box,minimum height=20pt,minimum width=40pt,text width=4em]     \tikzstyle{normalbox}=[box,minimum height=20pt,minimum width=80pt,text width=16em]     \tikzstyle{bigbox}=[box,minimum height=40pt,minimum width=80pt,text width=16em]          \node[smallbox,fill=green!20] (a) at (1,1) {a};     \node[smallbox,fill=green!20] (b) [right = of a] {b};     \node[smallbox,fill=green!20] (c) [right = of b] {c};     \node[smallbox,fill=green!20] (d) [right = of c] {d};          \node[normalbox,fill=green!20] (f) [below = of a] {f};     \node[bigbox,fill=green!20] (g) [below = of f] {g};     \node[normalbox,fill=green!20] (h) [below = of g] {h};          \end{tikzpicture}      But the stacks are not aligned correctly and I am also having problems with the vertical stack (`j`) to the right. Thank you for your help.


title: Drawing atomic orbitals upon a chemfig structure

text: Is there a way to draw an atomic orbital in a `chemfig` structure? I think you can better understand if you see want I want to get:![resonance between different diradical structure: it's worth to note that one radicalic center is sigma, the other pi](http://i.stack.imgur.com/pRNLs.jpg) Here is what I've already done. Any improvement would be appreciated.               \documentclass[a4paper,12pt,twoside,openright,titlepage]{book}     \usepackage{chemfig,chemmacros,chemnum,modiagram}         \usepackage[version=3]{mhchem}             \makeatletter             \def\CF@node@content{%                 \expandafter\expandafter\expandafter                     \printatom\expandafter\expandafter\expandafter                     {\csname atom@\number\CF@cnt@atomnumber\endcsname}%                     \ensuremath{\CF@node@strut}%                 }             \makeatother             \chemsetup[chemformula]{format=\sffamily}             %\renewcommand*\printatom[1]{\ensuremath{\mathsf{#1}}}             \renewcommand*{\printatom}[1]{{\sffamily\cf{#1}}}             \setdoublesep{0.32500 em}  % 'Bond Spacing'             \setatomsep{1.78500 em}    % 'Fixed Length'             \setbondoffset{0.18265 em} % 'Margin Width'             \newcommand{\bondwidth}{0.06642 em} % 'Line Width'             \setbondstyle{line width = \bondwidth}          \begin{document}     \schemestart     \setbondoffset{0pt}      \chemsetup[orbital]{        overlay ,        opacity = 0.5 ,        p/scale = 1.25 ,        s/color = gray!50 ,        s/scale = 1.25      }      \chemfig{*6(-=(-(-[,.2,,,draw=none]\Lewis{0.,}\orbital{s}))-=(-[,.4,,,draw=none]\Lewis{0.,}{\orbital[half,angle=90]{p}})-=-)}     \arrow     \setbondoffset{0pt}      \chemsetup[orbital]{        overlay ,        opacity = 0.5 ,        p/scale = 1.25 ,        s/color = gray!50 ,        s/scale = 1.25      }     \chemfig{[:-60]*6(-=-(=)-(-[,.0,,,draw=none]\Lewis{0.,}\orbital{s})-(-[,.4,,,draw=none]\Lewis{0.,}{\orbital[half,angle=90]{p}})=)}     \arrow     \setbondoffset{0pt}      \chemsetup[orbital]{        overlay ,        opacity = 0.5 ,        p/scale = 1.25 ,        s/color = gray!50 ,        s/scale = 1.25      }     \chemfig{*6(-=(-\orbital{s})-=-=)}     \schemestop          \end{document}


title: How do I discard a portion of an equation number when cross-referencing?

text: I am writing a LaTeX document in which I number equations within sections. Thus, in my preamble I have               \makeatletter         \@addtoreset {equation}{section}         \renewcommand{\theequation}{\thesection.\@arabic\c@equation}     \makeatother      and this works the way I would like it to. When I cross-reference an equation with "see Eq.\ (\ref{mylabel})" I get, for example, "see Eq. (3.4.15)" for the 15th equation in Sec. 3.4. However, I would like to be able to cross-reference the equation from within the section where it resides and omit the section number. In this case, I would like to obtain "see Eq. (15)" I am using the hyperref package, so the information in the .aux file looks like               \newlabel{mylabel}{{3.4.15}{43}{GENERALIZED SPEEDS\relax }{equation.3.4.15}{}}      I gather that the \ref command looks in the .aux file for {mylabel}, finds {3.4.15}, and uses the string within the braces. I am wondering if it is possible to define a new command, call it \myref, and have it discard "3.4." So the result of "see Eq.\ (\myref{mylabel})" would be "see Eq. (15)" The \hyperref command has the syntax               \hyperref[mylabel]{text}      so if I could figure out a way to use mylabel to go into the .aux file, bring back the string 3.4.15, and discard "\thesection.", I could use what remains as the argument {text} for \hyperref. * * * @Ricardo: Thank you so very much for this solution. It works very well without hyperref, but unfortunately I run into a problem with hyperref. When I use               \renewcommand{\theequation}{\@arabic\c@equation}      to create abbreviated equation numbers in the home section, this leads to non- unique entries in the aux file, and I get the error               ! pdfTeX warning (ext4): destination with the same identifier (name{equation.1}     ) has been already used, duplicate ignored      The problem is that each section has an equation (1). I tried to fix the problem according to the advice on ``Subordinate counters'' in the hyperref README, but have been unsuccessful. Here is a combination of your code and @Lockstep's example that should reproduce the problem:               \documentclass{book}          % The book class numbers equations within chapters.     % We want to number these within sections.              \makeatletter         \@addtoreset {equation}{section}         \renewcommand{\theequation}{\@arabic\c@equation}     \makeatother          \usepackage[colorlinks=true, linkcolor={blue}]{hyperref}     \usepackage{smartref}          \addtoreflist{section}          \newcommand*{\srefaux}[1]{%       \issectionchanged{#1}% checks if section number has changed       \ifsectionchanged% if section is different       \sectionref{#1}.% put the section reference       \fi% else do nothing       \ref*{#1}%  <-<-<--- we changed this to ref*     }          \newcommand*\sref[1]{\hyperref[#1]{\hbox{\srefaux{#1}}}}          \begin{document}          \chapter{first}     \section{bla}          If we include a first equation     \begin{equation}\label{eq:xyz}     x^2 + y^2 = z^2     \end{equation}     in this section then hyperref will not be happy with another first equation in the      next section.          As shown in Eq.\ (\sref{eq:def}) \dots          \section{blubb}          As shown in Eq.\ (\sref{eq:abc}) \dots          \begin{equation}\label{eq:abc}     a^2 + b^2 = c^2     \end{equation}          \begin{equation}\label{eq:def}     d^2 + e^2 = f^2     \end{equation}          \section{foo}          As shown in Eq.\ (\sref{eq:abc}) \dots          \end{document}


title: How do I replace Warsaw black to someting else, like color theme beaver does?

text: The Warsaw theme uses black for the left half of top and bottom bars, and blue for the right half. Theme color beaver replaces these two colors with two shades of gray. How can I do the same within my .tex file?


title: Use g-brief address field layout to produce labels

text: I have a number of letters created with the document class `g-brief` and would like to generate labels (does not have to be automatic; cut-and-paste would be ok for now) from the address used in each letter. I have had some minor success in using the `labels` package, but the labels do not look as good as the `g-brief` label, mostly I miss the sender above the recipient. Any ideas how to "merge" these two packages? I. e. have the same "look" of the address field, just printed on labels? Also, has anyone had any success in using the `\skiplabels`option of the `labels`package? If I use the option all labels are placed all over the page... That's why I use the double tilde in my code. `labels` code I use so far:               \documentclass[a4paper,12pt]{scrartcl}     \usepackage{labels}     \usepackage[utf8]{inputenc}     \usepackage{ngerman}     %\LabelInfotrue     %\LabelGridtrue     \TopBorder=5mm     \BottomBorder=5mm     \LeftBorder=20mm     \RightBorder=2mm     \LabelRows=6     \LabelCols=2     %\numberoflabels=24     \begin{document}          \begin{labels}     ~     ~          {\tiny Christian Schmidt - My Address 123 - 31415 My City}     Testfirma GmbH \& Co. KG     \emph{Herrn Peter Mustermann}     Musterstrasse 12a     \hspace{1mm}     \textbf{12345 Musterhausen}     \end{labels}     \end{document}      Edit: The solution for Staples type 2x6 / 105mm x 48mm labels:               \documentclass[a4paper,12pt]{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage{ngerman}          \usepackage[]{ticket}     \usepackage[margin=2mm]{geometry}          \setlength{\unitlength}{1mm}     \ticketNumbers{2}{6}     \ticketSize{104}{44}     \ticketDistance{0}{4}          \newif\iftrennlinien          \renewcommand*{\ticketdefault}{\small           \put(0,39){\makebox(85,4)           {\scriptsize \textrm{\retouradresse}}}           \iftrennlinien \put(0, 38.9){\line(1,0){85}} \fi     }     \newcommand*{\myticket}[2][]{\ticket{\small           \put(0,39){\makebox(85,4)           {\scriptsize \textrm{\retouradresse}}}           \put(8,32.85){\parbox[t]{3in}{\textbf{#1} \par \vspace{2mm} #2}}     }}          \newcommand*{\retouradresse}{My Name $\cdot$ My Street 123 $\cdot$ 31415 My City}          \begin{document}     \trennlinientrue     \myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \myticket[E I N S C H R E I B E N]{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \myticket[R E C H N U N G]{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}     \end{document}


title: How to import additional code into class file

text: I was inspired by the article "Fancy chapter headings with TikZ" (Stefan Kottwitz many thx) and I have created the whole fancy sectioning. But what I need to do now is to import this whole code for sections and chapter into my REPORT CLASS because I dont want this code to be in my project. For example when I will start my new project and will add the `\documentclass[svgnames]{report}` and will begin document with `\section{bla bla}` so the edited sectioning in report class will be automatically applied for the `\section{bla bla}` command. I am asking for some help because I have never ever played with the latex files and classes.


title: Chinese character \cjk within \section{} does not work using pdflatex, + \includegraphics

text: Why does the following not work               \section{ \begin{CJK}{UTF8}{gbsn}     白居易     \end{CJK}}      It works when I use it in the main text, but does not work within `\section{xxx}`. Same applies to the following case `\section{ \includegraphics[]{image.png}}` Any advise on how to force the chinese characters in the section using the CJK package and pdflatex ? (I don't want to use xelatex or luatex since they mess up my other settings).


title: Recommented Workflow: XML workflow in LaTeX

text: We have would like to develop `XML Workflow in LaTeX Platform`. Please suggest `ConTeXT` or `XMLTeX` or `anything`. Please provide the _tutorials_ would be greatly appreciated.


title: Having multiple contradictory options, how to handle them?

text: Lets say you are writing a package, which has the usual pair of `draft` and `final`-mode. But how should I handle, if this package gets the global option `final` and the local `draft`? Consider the following ex.sty:               \NeedsTeXFormat{LaTeX2e}[1999/12/01]     \ProvidesPackage{ex}[2014/07/26 v1.00 This is just an example]     \DeclareOption{draft}{\newcommand\@draftmode{true}}     \DeclareOption{final}{\let\@draftmode=\@undefined}     \ProcessOptions\relax     \ifdefined\@draftmode       \newcommand\example{%         an example text, only visible in draft mode}     \else       \let\example=\relax     \fi      Using that in the following main.tex:               \documentclass[final]{article}     \usepackage[draft]{ex}     \begin{document}     some example text and eventually some more text: \example.     \end{document}      Results in the output “some example text and eventually some more text: .”. If I swap the `\DeclareOption` (`final` first, then `draft`), then at least I have the output of `\example`. But then it wouldn't work if I swap the options in the main.tex… So what is the LaTeX way to handle this?   * Check if both options are set and then fire an error? (and how to check for both options?)   * Check if both options are set and then fire a warning?   * Prefer global option over local option? (how to check if a given option is global or local?)   * Prefer local option over global option?   * Just do it as I have and live with its problems? (how to decide which order might be more sens?)   * Use a package that I haven't found yet but really helps with such stuff?


title: subtitles in tcolorbox like in mdframed

text: Until now, I have used mdframed to produced nice framed boxes. I recently discovered tcolorbox, and found that it has several advantages over mdframed. In my actual and future work I would prefer tcolorbox. Nevertheless, one nice thing in mdframed is the `\mdfsubtitle`. You can divide a framed box into several "sections" with nice formatted titles, as seen in the picture (copied from the mdframed documentation): ![example of an framed box with one subtitle; copied from the documentation](http://i.stack.imgur.com/N1SmL.png) **My Question:** is there a (more or less) simple way of having such subtitles with tcolorbox?


title: Bending arrows in Tikz

text: In `Tikz`, I would like to bend an arrow like the one between `$H_2O$` and `$O_2$` in this figure: ![enter image description here](http://i.stack.imgur.com/1D1So.gif) I'm able to have a bended line between `$H_2O$` and `$O_2$`, but it's not touching the photophosphorylation node… How can I do that?


title: Footnotes in table captions but not in list of tables

text: I have the following problem: My tables are formatted via `caption[title]{long description...}`. Now I need to add the sources to some of them as a footnote added to the caption, like in the following example: ![enter image description here](http://i.stack.imgur.com/luW3Y.png) I tried this: Using \footnote in a figure's \caption, but the problem is that the footnotes also show up in the list of tables at the beginning of the document. Note that 'The red fox - attributes' is the `[title]` and the rest of the text is the `{long description}`, used as here: Add table titles from captions in scrreprt class Also I am not using footnotes for every single caption, so the solution would have to be flexible in that it provides the option to add one (but not mandatory). Is the above format possible? Looking for a solution which works safely without undesired results. MWE:               \documentclass[a4paper, 12pt, headsepline, smallheadings]{scrreprt}     \usepackage[labelfont={small,bf}, textfont=small, labelsep=colon,singlelinecheck=false,format=plain, parindent=1em]{caption}     \newlength\myindention     \setlength\myindention{1em}      \usepackage{chngcntr}     \counterwithout{table}{chapter}          \let\oldcaption\caption     \renewcommand*\caption[2][]{%     \oldcaption[#1]{#1\\\hspace*{\myindention}#2}%     }          \begin{document}          \listoftables          \chapter{Introduction}     \begin{table}[h]     \caption[title table 1]{description table 1}     \fbox{content}     \end{table}          \end{document}       Thanks.


title: Tikz binomial distribution

text: I'm trying to plot the pmf of the binomial distribution for particular values of N and p. For example, when N=10 and p=0.5:               \documentclass{article}     \usepackage{amsmath}     \usepackage{pgfplots}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}     \draw (0,0) -- (10,0);     \foreach \x in {1,2,...,10} \draw (\x,10!/(\x!*(10-\x!))*(0.5)^\x*(0.5)^(10-\x)) circle (2pt);     \end{tikzpicture}     \end{document}      What I essentially what is a discrete plot of 10 points, where k is along the x-axis and the probability is plotted on the y-axis. That coordinate seems so complicated that I'm guessing there is a simpler way to approach this?


title: List of Algorithms Using algorithm2e

text: According to the documentation, I can add an entry in the ToC for the list of algorithms created using the `algorithm2e` package by including `dotocloa` as a package option. When I do this I receive an error:               ! Undefined control sequence.     l.1005 \newcommand{\algocf@name                                    }{algorithm2e}%      How can I fix it so List of Algorithms appears in the ToC? Here is a minimum non-working example:               \documentclass[10pt]{book}          \usepackage[dotocloa]{algorithm2e}          \begin{document}          \tableofcontents          \chapter{Test}          \begin{algorithm}      \caption{AlgorithmName}\label{alg:AlgorithmName}     \end{algorithm}          \end{document}


title: Why do the less than symbol (<) and the greater than symbol (>) appear wrong as upside down exclamation (¡) or question mark (¿)?

text: When typing `<` or `>` in LaTeX and compiling with `pdflatex`, the less than and greater than symbols appear at upside down exclamation points. I'm not in math mode.


title: Using < > symbols inside algorithmic

text: > **Possible Duplicate:**   >  Why do the less than symbol (<) and the greater than symbol (>) appear > wrong as upside down exclamation or question mark? I have the following code               \begin{algorithm}     \begin{algorithmic}[h]          \IF{$valuea$ < $valueb$}         \STATE $valuer$ = 255     \ENDIF          \end{algorithmic}     \end{algorithm}      but it is printed on pdf like this               if value_a¡valueb then     valuer = 255     end if      with the "¡" symbol instead of the "<" is there a way to force using "<" symbol?


title: Problem printing some symbols accurately from a pgf plot table

text: > **Possible Duplicate:**   >  Why do the less than symbol (<) and the greater than symbol (>) appear > wrong as upside down exclamation or question mark? I'm trying to print symbols from my pgf plot table, which usually works fine. However, some signs, for example `<`and `>` aren't printed correctly. (In these particular cases, `<` is printed as an `¡` and `>` is printed as an `¿`. I figure it can't be an encoding issue, since I'm typing the symbols are contained within my .tex file, so I guess it might have something to do with `<` and `>` being symbols normally used for syntax. However, putting an escape character before the symbol doesn't solve the problem. Minimal non-working example:               \documentclass{standalone}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{tikz}          \pgfplotstableread[col sep=comma, header=false]{     <     }\mydata          \begin{document}     \begin{tikzpicture}     \pgfplotstablegetelem{0}{0}\of\mydata     \node[draw=black] at (0,0) {\pgfplotsretval};     \end{tikzpicture}          \end{document}


title: How to use non-alphabetical symbols respectively characters like '<' and '>' in Tikz qtree node labels?

text: I am trying to use label nodes for a tikz qtree that include the lower-than `<` and greater-than `>` characters like shown in the first node of the example below. The problem is that instead of showing `<` and `>` some other strange symbols are presented - see first node label of the picture below. While the second node does solve the problem somehow by just forcing `<` and `>` to be in math-mode I seek for a solution which also forces the text to accept the `\textbf` command it is enclosed in.               \documentclass[border=3mm]{standalone}     \usepackage{tikz}     \usepackage{tikz-qtree}     \begin{document}     \begin{tikzpicture}         \Tree              [.\node(html){\textbf{<html>}};              [.\node(html){\textbf{$<$html$>$}}; ]             ]     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/GvUk4.png)   1. Is there a solution?   2. What is the reason for this - in my eyes - strange behavior?


title: How to handle > character?

text: > **Possible Duplicate:**   >  Why do the less than symbol (<) and the greater than symbol (>) appear > wrong as upside down exclamation or question mark? I have some `>` and `<` character in input file. How can I handle such characters?               \documentstyle{article}        \begin{document}                                    This is first example.           I am very old (> 65 years).     \end{document}


title: labbook figure numbering

text: I am using the `labbook` document class which is based on scrbook. `labbook` doesn't number the chapters, but the figure numbering still behaves the way it was in `scrbook`: it's not running, but each chapter starts with "Figure 1". I tried               \usepackage{chngcntr}     \counterwithout{figure}{addchap}      but I get the error that `addchap` is not a counter (which absolutely makes sense). How can I get running figure numbering throughout the document? MWE:               \documentclass[oneside]{labbook}     \usepackage[]{graphicx}      \begin{document}          \labday{Monday}          \begin{figure}     \centering     \includegraphics{Figure1.jpg}     \caption{Figure1}     \label{fig:Figure1}     \end{figure}          \labday{Tuesday}          \begin{figure}     \centering     \includegraphics{Figure2.jpg}     \caption{Figure2}     \label{fig:Figure2}     \end{figure}          \end{document}


title: Adjust the exponent to switch between notations using siunitx

text: I have a big question about the `siunitx` package and I hope somebody out there can help me. At first I want to use the automatic number conversion of the package. So I defined:               \sisetup{scientific-notation = engineering}      But now every number is converted into the engineering format. For example: `0.01` => `10x10^3` But I want that this number is not converted automatically. Is there an option to adjust, which tells the package at which max. Exponent number this conversion to `scientific-notation` should take place? I have really a lot numbers in a paper and it would be really hard to put the scientific-notation on or off for each number manually.


title: Load integral sign from eulervm

text: I want to write a book for university and I want to have the "german" integral symbol in it. I tried using `mathabx` and `wasysym` but I don't like them. But I like the integral symbol in `eulervm`.   How do I load this symbol? I have already tried:               \documentclass{article}     \let\int\undefined     \DeclareSymbolFont{largesymbols}{OMX}{eulervm}{m}{n}     \DeclareMathSymbol{\int}{\mathop}{largesymbols}{"52}     \begin{document}     \[ \int \]     \end{document}      But that just loads the normal "american" integral symbol. What am I doing wrong?


title: How to determine which register a count uses

text: Suppose there is               \newcount\c@mycountera     \newcount\c@mycounterb     \newcount\c@mycounterc      Each `\newcount` uses `\alloc@` and that has `\wlog{\string#5=\string#2\the\allocationnumber}`. Thus to determine which register `mycountera` uses I can look into the `.log` file for the (e.g.) `\c@mycountera=\count123`. But how can I determine the number of the used register inside of LaTeX automatically? (Something like `\registernumber{\c@mycountera}` expanding to `123`.) After `\newcount\c@mycountera` it is `\the\allocationnumber`, but when there is an unknown number of counts created between `\newcount\c@mycountera` and the time when I need the information this does not help. (I cannot use `\xdef\myallocationnumber{\the\allocationnumber}` immediatly after `\newcount\c@mycountera`, because it is defined inside of a package.) (I suspect that the answer is usable with e.g. \dimen, \box,... too.)


title: Wrong page number for List of Figures within Table of Contents

text: I have a problem when I typeset my document. The document class is `book`. I added the List of Figures to Table of Contents manually using following command:               \newpage     \phantomsection\label{listoffig}     \addcontentsline{toc}{chapter}{List of Figures}     \listoffigures      The Table of Contents itself contains of 3 pages and started at page xii. The List of Figures appears at page xv. However, the Table of Contents showed that the List of Figures is at page xiii (which is wrong). I have also tried this command:               \cleardoublepage     \phantomsection     \addcontentsline{toc}{chapter}{List of Figures}     \listoffigures      but the problem still occurs. Every page number within the Table of Contents is correct, except for the List of Figures. Strangely, when I open the .toc files, the page number for the List of Figures is correct (it showed xv). **Update:** I still unable to fix the problem, now the Table of Contents page number is incorrect within the Table of Contents itself, here is the example of what I have done so far.               \documentclass[12pt,a4paper,final,titlepage,onecolumn,openright,oneside]{book}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amstext}     \usepackage{color}     \usepackage{enumerate}     \usepackage{eurosym}     \usepackage{fancyhdr}     \usepackage{geometry}     \usepackage{graphicx}     \usepackage{indentfirst}     \usepackage{makeidx}     \usepackage{nomencl}     \usepackage[onehalfspacing]{setspace}     \usepackage{theorem}     \usepackage{ulem}     \usepackage[debug]{hyperref}          \setcounter{MaxMatrixCols}{10}          \newtheorem{theorem}{Theorem}[section]     \newtheorem{acknowledgement}[theorem]{Acknowledgement}     \newtheorem{algorithm}[theorem]{Algorithm}     \newtheorem{axiom}[theorem]{Axiom}     \newtheorem{case}[theorem]{Case}     \newtheorem{claim}[theorem]{Claim}     \newtheorem{conclusion}[theorem]{Conclusion}     \newtheorem{condition}[theorem]{Condition}     \newtheorem{conjecture}[theorem]{Conjecture}     \newtheorem{corollary}[theorem]{Corollary}     \newtheorem{criterion}[theorem]{Criterion}     \newtheorem{definition}[theorem]{Definition}     \newtheorem{example}[theorem]{Example}     \newtheorem{exercise}[theorem]{Exercise}     \newtheorem{lemma}[theorem]{Lemma}     \newtheorem{notation}[theorem]{Notation}     \newtheorem{problem}[theorem]{Problem}     \newtheorem{proposition}[theorem]{Proposition}     \newtheorem{remark}[theorem]{Remark}     \newtheorem{solution}[theorem]{Solution}     \newtheorem{summary}[theorem]{Summary}     \newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}     \topmargin=0.4 cm\headsep=0.5 cm \textwidth=15cm     \textheight=22.5cm\oddsidemargin=1.5cm     \geometry{left=3.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}     \def\contentsname{Contents}     \renewcommand{\bibname}{Reference}     \pagestyle{fancy}     \lhead{}     \chead{}     \rhead{\ \thepage}     \lfoot{}     \cfoot{}     \rfoot{}     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}                    \begin{document}          \frontmatter     \thispagestyle{empty}     \begin{center}          \begin{figure}\begin{center}          \end{center}\end{figure}          \renewcommand     {\baselinestretch}{1}          \textsc{\Large{GREAT UNIVERSITY}}\\          \bigskip\bigskip\bigskip\bigskip          \textsc{\large{TRANSLATION OF SEVERAL LOGICS \\     TO ANOTHER LOGICS}}          \bigskip          \vspace{0.7 in}     \textsc{THESES}\\          \bigskip     \normalsize     \textsc{Submitted as A Partial Fulfillment\\     to Obtain Master Degree\\     In Mathematics}          \bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip     \textsc{Harry McKenzie}\\     \textrm{99999}\\          \vfill     \vfill     \vfill     \vfill          \textsc{SCHOOL OF MATH AND CS}\\     \textsc{GRADUATE PROGRAM IN MATH} \\     \textsc{ANTARTICA}\\     \textsc{1998}\\     \bigskip     \end{center}     \chapter{Approval Page}          \chapter{Preface}          \chapter{Abstract}     \cleardoublepage     \phantomsection     \tableofcontents     \addcontentsline{toc}{chapter}{Report Contents} \markboth{Report Contents}{\textbf{Reports Contents}}     \cleardoublepage     \phantomsection     \addtocontents{lof}{\protect\addcontentsline{toc}{chapter}{Figures}}     \listoffigures          \mainmatter          \chapter{Introduction}          \section{Background}          \subsection{The Importance of This Topic}          \subsection{An Example in The Real World}          \subsection{Related Work}          \section{Problem Identification}          \section{Goal of This Project}          \section{Outline of This Project}          \section{Some Mathematical Preliminaries}          \subsection{Set Theory}          \subsection{Order Theory}          \chapter{A Variant of The Logic A and B}          \section{Informal Syntax and Semantics}          \section{Formal Syntax of Logic A and B}          \subsection{Formal Syntax of Logic A}          \subsection{Formal Syntax of Logic B}          \section{Formal Semantics of Logic A and B}          \subsection{Formal Semantics of Logic A}          \subsection{Formal Semantics of Logic B}          \section{Two Specific Variants}          \chapter{Logic 1 and Logic 2}          \section{Logic 1}          \subsection{Syntax of Logic 1}          \subsection{Semantics of Logic 1}          \subsection{A Variant of Logic 1}          \subsection{The Satisfiability Problem of Logic 1}          \section{Logic 2}          \subsection{Syntax of Logic 2}          \subsection{Semantics of Logic 2}          \subsection{The Satisfiability Problem of Logic 2}          \chapter{Translations}          \section{The First Translations}          \subsection{First Model Construction}          \subsection{First Translation Construction}          \subsection{The First Algorithm}          \subsection{Size Propagation}          \section{The Second Translations}          \subsection{Second Model Construction}          \subsection{Second Translation Construction}          \subsection{The Second Algorithm}          \subsection{Size Propagation}          \section{Some Concluding Remarks}          \chapter{The Decidability of The Logic}          \section{Computable Mapping and Mapping Reduction}          \section{The Reduction}          \section{Some Concluding Remarks}          \chapter{Conclusions and Future Works}          \section{Conclusion}          \section{Future Works}          \appendix          \chapter{The Appendix}          \backmatter          \cleardoublepage     \phantomsection     \addcontentsline{toc}{chapter}{Reference}          \begin{thebibliography}{Gr\"{a}11}     \bibitem[All83]{All83}           \bibitem[All84]{All84}           \bibitem[BGMS07]{BGMS07}           \bibitem[BGMS09]{BGMS09}           \bibitem[BHH07]{BHH07}           \bibitem[BM05]{BM05}           \bibitem[BMSS08]{BMSS08}           \bibitem[BMSS11]{BMSS11}           \bibitem[Bro97]{Bro97}           \bibitem[CH98]{CH98}           \bibitem[CH04]{CH04}           \bibitem[GMS03]{GMS03}           \bibitem[GMS04]{GMS04}           \bibitem[Gr\"{a}11]{Gra11}           \bibitem[HH07]{HH07}           \bibitem[HR04]{HR04}           \bibitem[KJJ03]{KJJ03}           \bibitem[LPS95]{LPS95}           \bibitem[Mar03]{Mar03}           \bibitem[Mei07]{Mei07}           \bibitem[Nel11]{Nel11}           \bibitem[OD08]{OD08}           \bibitem[Rab00]{Rab00}           \bibitem[RB06]{RB06}           \bibitem[Ros07]{Ros07}           \bibitem[SC85]{SC85}           \bibitem[Sip06]{Sip06}           \bibitem[SS94]{SS94}           \bibitem[Vit05]{Vit05}           \bibitem[VKvB89]{VKvB89}      \end{thebibliography}          \end{document}


title: Is there a way to get \framezoom to do what I expected it would?

text: Before trying it, I thought `\framezoom` would make slides that looked something like this workaround:               \documentclass{beamer}         \usepackage{tikz}         \usepackage{graphicx}         \setbeamertemplate{navigation symbols}{}         \title{Zoomed Image}     \begin{document}          \begin{frame}         \titlepage     \end{frame}          \begin{frame}<1-2>[label=original]         \frametitle<1,3>{Image}         \frametitle<2>{Region of Interest}         \begin{center}             \begin{tikzpicture}                 \node<1->[anchor=south west,inner sep=0] at (0,0) {\includegraphics[height=0.75\paperheight]{standardWheel} };                 \draw<2>[red,ultra thick,rotate=53] (5.4,-0.4) ellipse (32pt and 18pt);             \end{tikzpicture}         \end{center}     \end{frame}          \begin{frame}{Caliper}         \begin{center}             \includegraphics[trim=800 900 1500 600,clip,height=0.75\paperheight]{standardWheel}         \end{center}     \end{frame}          \againframe<3->{original}          \begin{frame}{Next Slide}         This is the next slide.     \end{frame}      Please note that when you navigate through the resulting slides, you see the full image, (then the image with the Tikz drawing), then the zoomed image, then the full image, then the next slide. I tried a bunch of different things with `\framezoom` but I couldn't get any of them to navigate like that. The closest I was able to get was:               \documentclass{beamer}         \usepackage{graphicx}         \setbeamertemplate{navigation symbols}{}         \title{Zoomed Image}     \begin{document}          \begin{frame}         \titlepage     \end{frame}          \begin{frame}<1-2>[label=original]{An Attempt}         \frametitle<1,3>{Image}         \frametitle<2>{Region of Interest}         \framezoom<1><2>[border](2.5cm,2cm)(2cm,2cm)         \begin{centering}             \includegraphics[height=0.75\paperheight]{standardWheel}         \end{centering}     \end{frame}          \againframe<3->{original}          \begin{frame}{Next Slide}         next slide     \end{frame}          \end{document}      Even if I navigate through the slides by clicking instead of using the keyboard, I always end up showing the enlarged image twice. Once by clicking the button that `\framezoom` creates, (then clicking the enlarged image to return to the original image), then again when I click the slide with the original image to navigate to my next slide (I have to navigate through the enlarged image to continue my presentation). Is this how `\framezoom` was intended to work? If I add additional zoom locations to the image, I'll have to navigate through all the enlarged images to continue my presentation. I don't get it. EDIT: Alternatively, does anyone know how to override the page down/arrow/click anywhere (as opposed to making a button hyperlink) command for one slide? Then I could set the target to the slide after the zoomed images. The image is a JPG but this is just a test - when I put it into my presentation I intend to use an EPS. I'm compiling with `pdflatex` and using `acroread` to view since my version of `evince` (2.28.1) can't follow the zoomed image link back to the original image.


title: Citation not found?

text: I have just started with Latex, but have read several guides. I get the following error : > Citation `Chaparro2011DataDriven' on page 2 undefined > > Empty `thebibliography' environment > > There were undefined citations. My code is (simplified):               \cite{Chaparro2011DataDriven}      and in the main file:               %----------------------------------------------------------------------------------------     %   BIBLIOGRAPHY     %----------------------------------------------------------------------------------------          \label{Bibliography}          \lhead{\emph{Bibliography}} % Change the page header to say "Bibliography"          \bibliographystyle{unsrtnat} % Use the "unsrtnat" BibTeX style for formatting the Bibliography          \bibliography{bibliography} % The references (bibliography) information are stored in the file named "Bibliography.bib"      The problem is when I write `\cite` and the auto suggestion comes up and I choose one, it chooses wrong keywords. For example if the reference in the BIB file is "Reference3", when I choose that article it inputs a name like `\cite{reference3_articleblabla}`


title: Group itemize text by placing } in LyX

text: Is it possible in Lyx to group itemize text with this symbol } ? In order to understand what i want to do , i attach a screenshot : ![List](http://i.stack.imgur.com/uBp06.png)


title: pdflatex and TexStudio includegraphic problem

text: I'm having ( _no Boundingbox_ ) problem **even using pdflatex engine**. It's strange because it's working fine with MikTex but not Texstudio. Sadly I want to stick to TexStudio now. I've included the code bellow as well as the snapshot of my Texstudio configuration.               \documentclass{report}     \usepackage{graphicx}     \begin{document}     \includegraphics{test.pdf}     \end{document}          Cannot determine size of graphic in test.pdf (no BoundingBox). \includegraphics{test.pdf}      The snapshot of the configuration: ![builder information](http://i.stack.imgur.com/I8uZj.gif) And the log file:               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit) (preloaded format=latex 2014.2.21)  5 MAR 2014 12:42     entering extended mode     **test.tex     (U:\Thesis\Report\test\test.tex     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar     abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,      croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga     lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland     ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,      lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n     german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman     ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm     an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl     ishmax, welsh, loaded.     ("C:\Program Files\MiKTex\tex\latex\base\report.cls"     Document Class: report 2007/10/19 v1.4h Standard LaTeX document class     ("C:\Program Files\MiKTex\tex\latex\base\size10.clo"     File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     )     \c@part=\count79     \c@chapter=\count80     \c@section=\count81     \c@subsection=\count82     \c@subsubsection=\count83     \c@paragraph=\count84     \c@subparagraph=\count85     \c@figure=\count86     \c@table=\count87     \abovecaptionskip=\skip41     \belowcaptionskip=\skip42     \bibindent=\dimen102     )     ("C:\Program Files\MiKTex\tex\latex\graphics\graphicx.sty"     Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)          ("C:\Program Files\MiKTex\tex\latex\graphics\keyval.sty"     Package: keyval 1999/03/16 v1.13 key=value parser (DPC)     \KV@toks@=\toks14     )     ("C:\Program Files\MiKTex\tex\latex\graphics\graphics.sty"     Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)          ("C:\Program Files\MiKTex\tex\latex\graphics\trig.sty"     Package: trig 1999/03/16 v1.09 sin cos tan (DPC)     )     ("C:\Program Files\MiKTex\tex\latex\00miktex\graphics.cfg"     File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive     )     Package graphics Info: Driver file: dvips.def on input line 91.          ("C:\Program Files\MiKTex\tex\latex\graphics\dvips.def"     File: dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)     ))     \Gin@req@height=\dimen103     \Gin@req@width=\dimen104     )     (U:\Thesis\Report\test\test.aux)     LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.               ! LaTeX Error: Cannot determine size of graphic in test.pdf (no BoundingBox).          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.4 \includegraphics{test.pdf}          Try typing  <return>  to proceed.     If that doesn't work, type  X <return>  to quit.          File: test.pdf Graphic file (type eps)     <test.pdf> [1          ] (U:\Thesis\Report\test\test.aux) )      Here is how much of TeX's memory you used:      530 strings out of 493922      6268 string characters out of 3148909      53647 words of memory out of 3000000      3891 multiletter control sequences out of 15000+200000      3640 words of font info for 14 fonts, out of 3000000 for 9000      841 hyphenation exceptions out of 8191      25i,4n,19p,683b,142s stack positions out of 5000i,500n,10000p,200000b,50000s          Output written on test.dvi (1 page, 308 bytes).


title: Newcommand returning a boolean value

text: I'm using `etoolbox`. How can I create a new command that returns a boolean value? For example if I create the following command:               \newcommand\ifkeyempty[1]{         \def\novalue{\pgfkeysnovalue}%         \def\empty{}%         \pgfkeysgetvalue{#1}{\value}%         \ifboolexpr{test {\ifdefequal{\value}{\empty}} or test {\ifdefequal{\value}{\novalue}}}{true}{false}%     }      I would like to be able to use it in a boolean expression like this:                   \ifboolexpr{test {\ifkeyempty{/keyname}} or ... }{expression is true}{expression is false}      Is this possible?