title: Obtain \badness or glue adjustment for each line

text: This might be interesting for perfectionists and/or fastidious typesetters who would like to improve the document even further (beyond the beyond the magnificence of a book with zero bad boxes). We all know that the hyphenation algorithm, as conceived by Mr. Franklin Mark Liang and implemented in the **patgen** programme, is based on the processing of a whole bunch of pre-hyphenated words, calculating the likelihood of a permitted break, building a compact table for the sake of space and memory efficiency etc. It may correctly identify up to 90% possible breaks depending on the language. However, given that the computers of the present day are no longer constrained by the limitations of ’82, the hyphenation in *TeX output can be further improved in two ways:   1. We can create a comprehensive hyphenation database for each language and get the 100% accuracy.   2. We can deal with the problem if it appears: analyse the logged report, find any occurrences of overfulls and, if their roots stretch back to undiscovered allowed hyphenation point, manually add the word to the “white list” of `\hyphenation{...}`. While in English language this doesn’t seem to be the problem owing to the abundance of short words, in Russian and German it is a frequent case: sometimes I get 5 overfull boxes only due to the missed hyphenation point, and after some hard-coding similar to `\hyphenation{ми-н-да-лём ра-с-по-ря-ди-те- лю мо-ж-но}`, all the bad boxes are gone. As a typesetter of Russian texts, I can assure you that they look perfect after TeX with `[russian]{babel}` that beautifully handles all the diverse punctuation, but the practice of tying (`~`) one-letter words (and ideally some two-letter auxiliaries) to the following word is begloomed by some unfound hyphenation points, and overfulls ensue. Since many-many books are compact in size, the text area is often limited to 100×175 mm, or even smaller. Believe me, this is a real challenge for a typesetter of cyrillic texts. > Problem in one sentence: a missed hyphenation point causes some inferior > line breaking or one close to æsthetically unacceptable, and after manual > hyphenation is introduced, a new breakpoint is used, improving the breaking; > however, manual “leak plugging” is unfunny. Any additional non-breakable space (`~`) is a restriction, and we all know that mathematically, it cannot decrease the general “badness” of a paragraph. Any additional condition is a compromise that causes the conditional minimum obtained through the minimisation of the cubic function to grow in comparison to what it would have been if the restriction had not been imposed (same for regression analysis: the restricted sum of squared residuals is greater than the unrestricted one). The problem is aggravated by the fact that _TeX does not report if the badness of a line does not exceed 1000 but comes very close to it_. It would be much nicer if I could track down and hunt, say, a line with badness 990 that is only that bad because a breakpoint of a word was not found by the hyphenation algorithm! It would be much nicer to see all the spots where the breakpoints were missed and add more degrees of freedom, thus improving the look (if a word has to be broken anyway, better give it a maximum number of breaks allowed by the rules of the language!). This has driven me to the point of two possible ways of dealing with the problem:   1. Make and compile a DIY modification of pdfLaTeX that would report every occurence of `\badness` exceeding **X** (say 700) in every line in which a word had to be hyphenated, which is undoubtedly a dirty hack;   2. Write an extension that would display the badness after each line (kind of “über-`draft`” mode that not only prints a black rectangle where the overflow has occurred, but rather report instances of the interword space being close to its maximum or minimum allowed value. I thought that it _might_ be possible in LuaTeX that the absolute amount of glue added to the standard interword space (3.33333pt plus 1.66666pt minus 1.11111pt, if I am correct) were printed in the margins. If it is possible in LuaTeX, then it can be pushed further to being user-friendly: the percentage of possible amount shrunk or expanded printed... and coloured (it’s LuaTeX, after all!). **UPDATE:** But obviously it uses different fonts and metrics, and such a solution would not help any of LaTeX typesetters, who, as I roughly estimate, make up a large majority of TeX users, and the proportion is not likely to waver. If `microtype` package is enabled, the same question arises: can we obtain the `stretch/shrink` parameter values for each line of output? If the default limit is 20, then a value of 20 or −19 in a line in which a word break occurs may indicate that it could not find a hyphenation point and therefore had to resort to extreme expansion/compression. Although the transition to full-size hyphenation dictionaries may be the most beautiful option in the long run (assuming that the complexity of the hyphenation search algorithm does not exceed... say, O( _n_ ·log( _n_ )), where _n_ is the measure of the dictionary size), **all I want for now** is the ascertainment of the possibility of printing/storing the badness of each line and/or the exact amount of glue added/removed. > Desired result in one sentence: review occurrences of `\badness`es close to > critical or amount of glue added close to maximum allowed (the concept is > shown in the figures). ![Reporting amount of glue added](http://i.stack.imgur.com/JYx2w.png) ![Reporting badness higher than a threshold](http://i.stack.imgur.com/uVTP9.png) (This is an approximate model of what could become the new quality criterion for LaTeX output.) What can you advise? Sorry for the verbiage, I wanted to make it as detailed as possible. ## UPDATE I have reproduced a bothering example in which a manual `\hyphenation` of a word drastically improved the paragraph layout. Minimal working example:               \documentclass[10pt]{memoir}     \usepackage[T2A]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[russian]{babel} % Enable Russian hyphenation     \usepackage{microtype} % See how even microtype fails     \righthyphenmin=2 % Russian language rules     \def\psk{\hskip1.5em\relax} % Parboxes and all that hard-coded stuff just pursue     % the illustrative aim to reproduce the example precisely          \begin{document}     \parbox[t]{226.15pt}{\psk И~он показывал какую-то странную позу, несколько     запрокинувшись назад, как бы полупадая от «истомлённости».}     % The badness is very close to 1000, and you see how bad it is          \parbox[t]{226.2pt}{\psk И~он показывал какую-то странную позу, несколько     запрокинувшись назад, как бы полупадая от «истомлённости».}     % Now the badness is over 1000          \parbox[t]{226.15pt}{\psk И~он показывал какую-то странную позу, не\-с\-ко\-ль\-ко     запрокинувшись назад, как бы полупадая от «истомлённости».}     % Since there must a hyphen anyway, this breaking is much more beautiful now!     % (And such hyphenation is perfectly legitimate.)     \end{document}      ![Badness close to 1000 due to missed hyphenation point](http://i.stack.imgur.com/t1h5D.png)               Underfull \hbox (badness 1009) in paragraph at lines 15--15     [] \T2A/cmr/m/n/10 (+20) И он по-ка-зы-вал какую-то стран-ную по-зу,      This is what I was talking about: there must be one hyphen in a paragraph, and both layouts 1 and 3 are not reported as bad, but the manually adjusted 3 is more beautiful. Of course one can run the document multiple times with `\textwidth` ranging, for instance, from 220 to 250 pt with step 5, and manually amend all those ugly lines by providing all possible breakpoints, but... You know... LaTeX documents are not meant to be improved by some hard- coding, r-right? **Nota bene:** if `\parbox`es are used, then unfound hyphenation causes `underfull`s. If the same width is passed as a parameter to the `geometry` package and the text is typeset as normal paragraphs, unfound hyphenation causes `overfull`s. Both are odious, though. **P.S.** I am aware of the http://tug.org/TUGboat/tb31-3/tb99isambert.pdf article by Mr. Paul Isambert that introduces a Lua(La)TeX way to look at the page grey evenness. Besides, the `chickenize` package provides the `\colorstretch` function that blindly evaluates _everything_. However, I do not deem highly of Lua(La)TeX’s robustness and stability (with respect to input) since there are so many things to manually detect and recode with some hand-kludged typography tools (thin spaces, thin nbsp’s, initial spaces—holy cow, there is no way to dispose of good old `babel`) in Unicode in place of nice and decent LaTeX macros! Just to illustrate that there is a not-so-robust solution which may or may not be reimplemented if LaTeX, please see the following example (`polyglossia`'s hyphenation goes smash, too):               \documentclass[10pt,oneside]{memoir}     \usepackage{fontspec}     \usepackage{polyglossia}     \usepackage{microtype} % See how even microtype fails     \righthyphenmin=2 % Russian language rules     \setmainfont{Liberation Serif}     \setdefaultlanguage{russian}     \setlength{\parindent}{1.5em}     \usepackage[textwidth=200.2pt]{geometry}     \usepackage{chickenize}          \begin{document}     \colorstretch     И~он показывал какую-то странную позу, несколько     запрокинувшись назад, как бы полупадая от «истомлённости».          И~он показывал какую-то странную позу, не\-с\-ко\-ль\-ко     запрокинувшись назад, как бы полупадая от «истомлённости».     \end{document}      ![LuaLaTeX’s chickenize output](http://i.stack.imgur.com/oHWul.png) (Compiled on Linux Mint Debian without any additional fonts installed.) Well, this does not reproduce the exact spacing and goodness of the handcrafted paragraph, but gives a slight idea of what I desire to see in LaTeX—a mean of detection of possible inferior breaking that was caused by a missed hyphenation point.


title: Hex renderer in LaTeX

text: Is there a package to render binary files as hex in LaTeX. We've searched for it, but couldn't find any. The package should provide some kind of command:               \lsthex{file.ext}      With `file.ext` a "binary" file (in this case the header of a `.png` file, but the content is here of course irrelevant). Resulting in something like:               | 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 |     | 00 00 00 10 00 00 00 10 08 06 00 00 00 1F F3 FF |


title: Question on top margin in chapter page

text: In my LaTeX template, there is a page contained the chapter part that is too far from top of the page like the following: ![enter image description here](http://i.stack.imgur.com/yzAHk.png) My LaTeX file uses `amsbook`: `\documentclass[11pt,a4paper]{amsbook}`. This happened only in the chapter page, the others are normal. My question is: how can I fix it?


title: How to make a multicolored table of contents?

text: I'm trying to change the colors of the table of contents in a Beamer presentation, like Changing color and bullets in Beamer's table of contents except that I would like to make the "bullet" for each section a different color. Perhaps this requires reimplementing the `\tableofcontents` macro, which I'm willing to do, but does anyone know an easier way? (Is there a package?) I'm interested in the Warsaw theme at the moment, but input on any theme will be appreciated.


title: Adding tabs or creating my own command

text: I have a problem adding tabs and I can't use a `tabular` environments (like `tabular` or `tabbing`) because I can't mix it with enumerate environments. Is there a way to add a simgle tab like in any text editor? I use MathType to make equations writing much easier and there you can insert tabs, so when you export the code you see MathType uses `&` for that, but when you compile that code, LaTeX complains with:               Misplaced alignment tab character &.      So somehow LaTeX knows that I'm trying to add a tab and it's driving me crazy. I thought to create my own "tab" macro or command: the idea is to tell LaTeX to go back to the left (or right) margin with `\hspace` and the move to the "tab" with another `\hspace`, something like:               Hi everybody. \hspace{-len_to_left_margin} \hspace{tab_value} My name is Agustin.      Is that posible?


title: Page size problem

text: I am writting my thesis book in LaTeX and I have a problem with the page size. This is my preamble:               \documentclass[11pt,a5paper,headinclude=true,footinclude=true]{scrbook}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[spanish,activeacute]{babel}          \usepackage[linedheaders,parts,pdfspacing]{../classicthesis}      The page borders space is too large when I print my document. Are the a5paper sizes optimal for theses? Is better a4paper?


title: \{ & \} vs \lbrace & \rbrace

text: So, what is the difference in using `\\{` and `\\}` to using `\lbrace` and `\rbrace`? Which one is preferred, and when one has to take care?


title: How to use \multirow

text: I can compile this table separately but when I want to compile the whole file, it gives me an error, which is fixed by removing `\multirow`.               \usepackage{multirow}          \begin{table}[htbp]     \begin{center}     \begin{tabular}{|c|c|c|c|p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}|}     \hline     A & B & C & D & \multicolumn{7}{|c|}{F}  \\ \hline     \multirow{ 2}{}{1} & 0 & 6 & 230 & 35 & 40 & 55 & 25 & 40 & 35 & \\     & 1 & 5 & 195 & 25 & 50 & 35 & 40 & 45 &  &  \\ \hline     \end{tabular}     \end{center}     \label{table2}     \end{table}


title: How to add a counter to beginning of each sentence like the Bible?

text: 1 In the beginning God created the     heaven and the earth.  2 And the     earth was without form, and void;     and darkness was upon the face of     the deep. And the Spirit of God     moved upon the face of the waters.           3 And God said, "Let there be     light," and there was light.  4 God     saw that the light was good, and     he separated the light from the     darkness.  5 God called the light     "day," and the darkness he called     "night." And there was evening,     and there was morning-the first day.      as above.


title: Beamer alert in Math mode

text: I'm trying to alert my audience to numbers in a table that uses the `dcolumn` alignment environment. `\alert` works when it's used in a normal table cell, as below.               \documentclass[compress]{beamer}     \usepackage{dcolumn}     \usepackage{booktabs}     \usepackage[english]{babel}          \begin{document}     \begin{frame}{Table}     \begin{table}\begin{tabular}{l D{.}{.}{3}D{.}{.}{3}}     \toprule      & \multicolumn{2}{c}{Both}   \\      \cmidrule{2-3}     {\itshape Variables } & \beta & t\text{-stat} \\      \midrule     \multicolumn{3}{l}{{\bfseries 2 Vehicles}}\\      \hspace*{1em} $\log($Current Alternative Share$)$ &  -0.417^{***} & -22.1  \\     \hspace*{1em} $\log($Past Alternative Share$)$ &   &  \\     \midrule     $\rho^2_C$  & \multicolumn{2}{c}{\alert<2>{0.0903}} \\     \bottomrule     \end{tabular}     \end{table}     \end{frame}     \end{document}      ![First](http://i.stack.imgur.com/1Y0Dz.png) ![alerted](http://i.stack.imgur.com/iy7eL.png) It does not work, however, when used in the `dcolumn` cells. The frame below fails with a `missing \endgroup inserted` error.               \begin{frame}{Table}     \begin{table}\begin{tabular}{l D{.}{.}{3}D{.}{.}{3}}     \toprule      & \multicolumn{2}{c}{Both}   \\      \cmidrule{2-3}     {\itshape Variables }&       \beta & t\text{-stat} \\      \midrule     \multicolumn{3}{l}{{\bfseries 2 Vehicles}}\\      %% ALERT CELL %%     \hspace*{1em} $\log($Current Alternative Share$)$ & \alert<3>{-0.417^{***}} & -22.1  \\     %%%%%%%%%%%%%%%%     \hspace*{1em} $\log($Past Alternative Share$)$ &  &  \\     \midrule     $\rho^2_C$  & \multicolumn{2}{c}{\alert<2>{0.0903}} \\     \bottomrule     \end{tabular}\end{table}     \end{frame}      I can alert the text with `\text{\alert<n>{x}}` but then I lose the alignment and math formatting. `\text{\alert<n>{$x$}}` doesn't work. ![Not working alert](http://i.stack.imgur.com/RW5js.png) Any tips?


title: Incompatibility between etoolbox and hyperref

text: I tried to compile Werner's second answer from Automatically number inequalities with the `hyperref` package. However, the first run will give me the error below:               Runaway argument?     {\@firstoffive }\fi ), you will notice it is different from (\ref {re\ETC.     ! Paragraph ended before \Hy@setref@link was complete.     <to be read again>                         \par       While the second run does not give me any errors, but the inequality referencing doesn't work, i.e. I get ?? instead of i and ii. If I don't include the `hyperref` package, then the code compiles fine. For completeness, here is the MWE               \documentclass{article}     \usepackage{amsmath}% http://ctan.org/pkg/amsmath     \usepackage{hyperref}     \usepackage{etoolbox}% http://ctan.org/pkg/etoolbox          \newcounter{numrel}% Counter for numering relations     \renewcommand{\thenumrel}{\roman{numrel}}% Counter numrel uses lowercase roman numerals     \let\textlabel\label% Use text \label rather than math \label     \newcommand{\numrel}[2]{% Relation numbering       \begingroup%       \refstepcounter{numrel}% Increment numrel counter and create correct reference hook       \textlabel{#2}\endgroup% Label numrel counter       \ensuremath{\stackrel{(\thenumrel)}{#1}}% Print counter + relation     }     \AfterEndEnvironment{align*}{\setcounter{numrel}{0}}% Resets numrel at the end of align*          \begin{document}     \section{First section}     \begin{align*}       P(x) &= ax^2+bx+c \\            &\stackrel{(i)}{\leq} cx^3+dx^2+ex+f \\            &\stackrel{(ii)}{<} gx^4+hx^3+ix^2+jx+k       \end{align*}     \section{Second section}     \begin{align*}       P(x) &= ax^2+bx+c \\            &\numrel{\leq}{rel1} cx^3+dx^2+ex+f \\            &\numrel{<}{rel2} gx^4+hx^3+ix^2+jx+k       \end{align*}     If you look at (\ref{rel1}), you will notice it is different from (\ref{rel2}).     \begin{align*}       P(x) &= ax^2+bx+c \\            &\numrel{\leq}{rel3} cx^3+dx^2+ex+f \\            &\numrel{<}{rel4} gx^4+hx^3+ix^2+jx+k       \end{align*}     If you look at (\ref{rel3}), you will notice it is different from (\ref{rel4}).          \end{document}


title: Wrong code Beamer

text: Can you help me please! what's wrong with my code ? I am a beginner! work not finished!               \documentclass[10pt]{beamer}     \usepackage[frenchb]{babel}     \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}     \usepackage{textcomp}     \usepackage{amsmath,amssymb}     \usepackage{xcolor}     \setbeamersize{text margin left= 0.5cm ,text margin right=0.5cm}     \setbeamersize{text margin top= 0.5cm ,text margin bottom=0.5cm}     \definecolor{trustcolor}{rgb}{0.22,.26,.64}     \usepackage{pifont}     \usepackage{tikz}     \usetheme{Warsaw}               \AtBeginSection[]     {     \begin{frame}     \frametitle{Sommaire}     \tableofcontents[currentsection,      pausesubsections]     \end{frame}     }     \title{Les Statistiques}     \author{}     \institute{Lyc\'{e}e Agricole Douai}     \date{}     \begin{document}     \begin{frame}%premier frame               \titlepage     \end{frame}%1          \begin{frame}[allowframebreaks]% 2     \frametitle{Introduction }               Dans tout ce chapitre,nous prendrons comme exemple les 4 s\'{e}ries suivantes :     \begin{exampleblock}%le premier block     {\underline{S\'{e}rie A}:Un chimiste a relev\'{e} la temp\'{e}rature d'un liquide lors d'une exp\'{e}rience.\\     Il a obtenu les r\'{e}sultas suivants:\\[0.5cm]}           \begin{center     \begin{tabular}{*{10}{c}}  61& 62& 63& 64& 68& 71& 73& 77& 80\\     \end{tabular}     \end{center}     \end{exampleblock}                         \begin{exampleblock}     {\underline {S\'{e}rie B}:Un professeur de math\'{e}matiques d'une classe de 1\up{\`{e}re} S obtient les notes suivantes:}          \begin{center}               \begin{tabular}{|c|c|c|c|c|c|c|c|}     \hline      Note $x_{i}$ & 7 & 8 & 9 & 10 & 12 & 13 & 14 \\      \hline      Effectifs $n_{i}$ & 1 & 4 & 5 & 10 & 9 & 8 & 2 \\      \hline      \end{tabular}     \end{center}     \end{exampleblock}%fin du block     \end{frame}     \begin{frame}%3                         \begin{alertblock}     {\underline{S\'{e}rie C}:Le tableau ci-contre donne le nombres de personnes par m\'{e}nage en France :}                        \begin{center}                          \begin{tabular}{|*{6}{c|}}     \hline      Personnes par m\'{e}nage & 1 & 2 & 3 & 4 & 5 et plus \\      \hline      Fr\'{e}quence & 0,292 & 0,318 & 0,168 & 0,142 & 0,08 \\      \hline             \end{tabular}                                \end{center}                                \end{alertblock}                    \begin{alertblock}{\underline{S\'{e}rie D}: Une machine d\'{e}coupe des plaques en aciers.On a mesur\'{e} la longueur des plaques d\'{e}coup\'{e}es et l'on a obtenu le tableau suivant:\\[0.5cm]}               {\renewcommand{\arraystretch}{2.5}}               \begin{tabular}{|p{1.2cm}|c|c|c|c|c|c|}      \hline       \small{ Longueur de la plaque (en cm)}& [97;98[ &  [98;99[ & [99;100[&  [100;101[ & [101;102[ &  [102;103[ \\       \hline       Nombres de plaques & 2&  34 & 66 &  102&  80&  6 \\       \hline       \end{tabular}       \end{alertblock}     \end{frame}          \begin{frame}%4     \frametitle{Moyenne}     Soit une s\'{e}rie statistique d'effectif total N,prenant les valeurs $x_1,x_2,...,x_p$ d'effectifs correspondants $n_1,n_2,...,n_p$. \begin{alertblock}%début      { \textbf{D\'{e}finition}:}La moyenne de cette s\'{e}rie est not\'{e}e $\overline{x}$  et est d\'{e}finie par:      \[\overline{x}=\frac{ \sum_{i=1}^{n} n_i x_i}{N}=\frac{n_1x_1+n_2x_2+...+n_ix_i}{N}\]     \end{alertblock}%la fin     \end{frame}%fin du 5 eme frame     \begin{frame} %5     \begin{exampleblock}      {Remarque:}          { Dans le cas d'une s\'{e}rie continue, les $x_i$ correspondent au centre des classes.}           \end{exampleblock}          {\textcolor{trustcolor}{ Application \no 1}: Calculer la Moyenne des s\'{e}ries A,B et D}           \begin{exampleblock}     { Propri\'{e}t\'{e}:}                \[M=f_1 x_1+f_2 x_2+...+f_p x_p=\sum_{i=1}^{n} f_i x_i\] \quad o\`{u} les\quad $f_i$ \quad sont des fr\'{e}quences           \end{exampleblock}           En effet,\\[2cm]                          \textcolor{trustcolor}{Application \no 2}: Calculer la moyenne de la  s\'{e}rie C.      \end{frame}     \begin{frame}%6     \frametitle{M\'{e}diane}     \begin{alertblock}     {D\'{e}finition: }      On appelle m\'{e}diane d'une s\'{e}rie not\'{e}e Me, le nombre r\'{e}el qui partage la population en deux sous-s\'{e}ries de m\^{e}me effectif, c'est-\`{a}-dire le nombre tel que:      \begin{itemize}      \item[\textbullet]  $50 \%$ au moins de la s\'{e}rie ont une valeur inf\'{e}rieure ou \'{e}gale \`{a} Me.      \item[\textbullet]  $50\% $  au moins de la s\'{e}rie ont une valeur sup\'{e}rieure  ou \'{e}gale \`{a} Me.      \end{itemize}      \end{alertblock}           M\'{e}thode pour calculer la m\'{e}diane:       \begin{alertblock}     {Cas d'un caract\`{e}re quantitatif discret :}     Soit N le nombre total de donn\'{e}es qu'on ordonne \underline{dans l'ordre croissant:     \begin{itemize}     \item[\textbullet] Lorsque l'effectif total N est \textbf{impair}, la m\'{e}diane Me est le \textbf{terme central},\`{a} savoir le terme de rang $ \frac{N+1}{2}$     \item[\textbullet] Lorsque l'effectif total N est \textbf{pair}, l'usage veut que l'on choisisse pour la m\'{e}diane Me la \textbf{moyenne des deux termes centraux},\`{a} savoir les termes de rang $ \frac{N}{2}$ \quad et\quad  $\frac{N}{2}+1 $     \end{itemize}     \end{alertblock}     \end{frame}          \begin{frame}%7               \textcolor{trustcolor}{Application \no 3:} D\'{e}terminer la m\'{e}diane des  s\'{e}ries A,B et C.\\     \begin{exampleblock}     {Cas d'un caract\`{e}re quantitatif continu}:     La m\'{e}diane correspond \`{a} l'\textbf{abscisse} du point du \textbf{polygone des effectifs} (ou fr\'{e}quences) \textbf{cumul\'{e}(e)s croissant(e)s} d'ordonn\'{e} $\frac{N}{2}$ (ou 0,5 pour les fr\'{e}quences).     \end{exampleblock}          \begin{exampleblock}     {  Remarque:   }    La m\'{e}diane n'est donc pas n\'{e}cessairement une des valeurs de s\'{e}rie.        \end{exampleblock}     \textcolor{trustcolor}{Application \no 4:}D\'{e}terminer la m\'{e}diane de la  s\'{e}rie D.     \end{frame}          \begin{frame}%8     \frametitle{caract\'{e}ristiques de position non centrale: les quartiles}     \begin{alertblock}     {\textbf{D\'{e}finition}:}     On consid\`{e}re une s\'{e}rie statistique dont les valeurs du caract\`{e}re sont ordonn\'{e}es dans l'ordre croissant:     $x_1\leq x_2\leq \leq...\leq x_n $     {\begin{itemize}     \item[\centerdot]\textbf{Le premier Quartile} not\'{e} \textbf{$Q_1$} d'une s\'{e}rie statistique est la plus petite des valeurs de la s\'{e}rie telle qu'au moins $25\%$ des donn\'{e}es lui soient inf\'{e}rieures ou \'{e}gales.     \item[\centerdot]\textbf{Le troisi\`{e}ime Quartile } not\'{e} \textbf{$Q_3$} d'une s\'{e}rie statistique est la plus petite des valeurs de la s\'{e}rie telle qu'au moins $75\%$ des donn\'{e}es lui soient inf\'{e}rieures ou \'{e}gales.     \end{itemize}     \end{alertblock}     \end{frame}          \begin{frame}%9     \textbf{M\'{e}thode pour d\'{e}terminer les quartiles:}     \begin{exampleblock}{cas d'une s\'{e}rie discr\`{e}te:}          \begin{itemize}     \item[\centerdot]Lorsque l'effectif est un \textbf{multiple de 4}, les quartiles $Q_1$ et $Q_3$ sont respectivement les termes de rang \quad  $ \frac{N}{4} \quad et\quad \frac{3N}{4}$     \item[\centerdot]Lorsque l'effectif n'est \textbf{pas un multiple de 4},les quartiles $Q_1$ et $Q_3$ sontrespectivement les termes de rang $i$, le plus petit entier sup\'{e}rieur ou \'{e}gal \`{a} $\frac{N}{4}$ et de rang $j$, le plus petit entier sup\'{e}rieur ou \'{e}gal \`{a} $\frac{3N}{4}$ .     \end{itemize}     \end{exampleblock}          \textcolor{trustcolor}{Application \no 5:} D\'{e}terminer les quartiles des  s\'{e}ries A,B et C.          \begin{exampleblock}     {Cas d'une s\'{e}rie continue :(Les valeurs sont regroup\'{e}es par classe)}     \begin{itemize}               \item[\centerdot] $ Q_1$ correspond \`{a} l'\textbf{abscisse} du point du \textbf{polygone des effectifs}(ou fr\'{e}quences) \textbf{cumul\'{e}(e)s croissant(e)s} d'ordonn\'{e}e $\frac{N}{4}$ (ou 0,25 pour les fr\'{e}quences).     \item[\centerdot] $Q_3$ correspond \`{a} l'\textbf{abscisse} du point du \textbf{polygone des effectifs}(ou fr\'{e}quences) \textbf{cumul\'{e}(e)s croissant(e)s} d'ordonn\'{e}e $\frac{3N}{4}$ (ou 0,75 pour les fr\'{e}quences).     \end{itemize}     \end{exampleblock}          \end{frame}          \begin{frame}%10          \begin{exampleblock}     {Cas d'une s\'{e}rie continue :(Les valeurs sont regroup\'{e}es par classe)}     \begin{itemize}     \item[\centerdot] $ Q_1$ correspond \`{a} l'\textbf{abscisse} du point du \textbf{polygone des effectifs}(ou fr\'{e}quences) \textbf{cumul\'{e}(e)s croissant(e)s} d'ordonn\'{e}e $\frac{N}{4}$ (ou 0,25 pour les fr\'{e}quences).     \item[\centerdot] $Q_3$ correspond \`{a} l'\textbf{abscisse} du point du \textbf{polygone des effectifs}(ou fr\'{e}quences) \textbf{cumul\'{e}(e)s croissant(e)s} d'ordonn\'{e}e $\frac{3N}{4}$ (ou 0,75 pour les fr\'{e}quences).     \end{itemize}     \end{exampleblock}     \end{frame}          \begin{frame}%11          \begin{exampleblock}     {Cas d'une s\'{e}rie continue :(Les valeurs sont regroup\'{e}es par classe)}     \begin{itemize}     \item[\centerdot] $ Q_1$ correspond \`{a} l'\textbf{abscisse} du point du \textbf{polygone des effectifs}(ou fr\'{e}quences) \textbf{cumul\'{e}(e)s croissant(e)s} d'ordonn\'{e}e $\frac{N}{4}$ (ou 0,25 pour les fr\'{e}quences).     \item[\centerdot] $Q_3$ correspond \`{a} l'\textbf{abscisse} du point du \textbf{polygone des effectifs}(ou fr\'{e}quences) \textbf{cumul\'{e}(e)s croissant(e)s} d'ordonn\'{e}e $\frac{3N}{4}$ (ou 0,75 pour les fr\'{e}quences).     \end{itemize}     \end{exampleblock}     \end{frame}          \begin{frame}%12     \textcolor{trustcolor}{Application \no  6:} D\'{e}terminer les quartiles de la   s\'{e}rie D.\\          \begin{block}{Remarques:}     \begin{itemize}     \item[\centerdot] De nombreuses calculatrices consid\`{e}rent les quartiles comme les m\'{e}dianes des deux s\'{e}ries onbtenues apr\`{e}s avoir partag\'{e} la s\'{e}rie initiale par sa m\'{e}diane, ce qui explique les diff\'{e}rences constat\'{e}es.Dans la pratique,ces diff\'{e}rences ont peu d'importance vu la taille des s\'{e}ries.     \item[\centerdot] De la m\^{e}me fa\c{c}on, on peut d\'{e}finir les d\'{e}ciles d'une s\'{e}rie statistique pour un d\'{e}coupage plus fin.     \end{itemize}     \end{block}     \end{frame}          \begin{frame}     \frametitle{Les d\'{e}ciles}:     \begin{alertblock}     {D\'{e}finition:}\textbf{Le premier d\'{e}cile} est la plus petite valeur de la s\'{e}rie telle qu'au moins 10\% des donn\'{e}es lui soient inf\'{e}rieurres ou \'{e}gales.\\     \textbf{Le neuvi\`{e}me d\'{e}cile} est la plus petite valeur de la s\'{e}rie telle qu'au moins 90\% des donn\'{e}es lui soient inf\'{e}rieurres ou \'{e}gales.     \end{alertblock}     \end{frame}     \begin{frame}     \frametitle{carateristiques de disposition d'une serie statistique}     \begin{exampleblock}     {Etendue:}          D\'{e}finition:\textbf{L'\'{e}tendue} d'une s\'{e}rie not\'{e}e mesure l'\'{e}cart entre la plus grande et la plus petite valeur.     \end{exampleblock}               \textcolor{trustcolor}{Application \no  7:}  D\'{e}terminer l'\'{e}tendue de la s\'{e}rie A.               \end{frame}     \begin{frame}     \frametitle{\'{e}cart interquartile}          \begin{exampleblock}%debut     {D\'{e}finitions:}\textbf{L'intervalle interquartile} est l'intervalle $[Q_1;Q_2]$. \\     \textbf{l'\'{e}cart interquartile} est $Q_3 -Q_1$.     \end{exampleblock}%fin          \begin{block}     {Remarques:}     \begin{enumerate}     \item[\centerdot]l'\'{e}cart interquartile mesure la dispersion des valeurs autours de la m\'{e}diane; plus {l'\'{e}cart est petit, plus les valeurs de la s\'{e}rie appartennant \`{a} l'intervalle interquartile sont concentr\'{e}es autour de la m\'{e}diane.     \item[\centerdot]Contrairement \`{a} l'\'{e}tendue, l'\'{e}cart interquartile \'{e}limine les valeurs extr\^{e}mes qui peuvent \^{e}tre douteuse, cependant il ne tient conte que de $50\%$ de l'effectif.     \end{enumerate}     \end{block}     \end{frame}          \begin{frame}     On peut correctement r\'{e}sumer une s\'{e}rie statistique par le couple : (m\'{e}diane; intervalle interquartile)          \begin{alertblock}     {Diagramme en bo\^{i}te: (bo\^{i}tes  \`{a} moustaches ou \`{a} pattes)\\}     la bo\^{i}te (de largeur arbitraire) repr\'{e}sente $50\%$ (au moins) de l'effectif total.\\     De cette bo\^{i}te s'\'{e}tirent deux moustaches( repr\'{e}sent\'{e}es par des traits) jusqu'au minimum et au maximum.\\          \begin{center}          \begin{tikzpicture}     \draw (-2,0)rectangle(1.5,1);     \draw (-2,0)rectangle(-0.5,1);     \draw (-4,0.5)--(-2,0.5);     \draw (1.5,0.5)--(4,0.5);     \draw (-4,0.4)--(-4,0.6);     \draw (4,0.4)--(4,0.6);     \draw (-4.5,-1.6)--(4.5,-1.6);     \draw(-4,-2) node[below]{Min};                  \draw(-2,-2)node[below]{$Q_1$} ;                             \draw(-0.5,-2) node[below]{Me};                           \draw(1.5,-2) node[below] {$Q_3$};                                 \draw(4,-2) node[below] {Max};      \draw (-4,-1.5)--(-4,-1.7);     \draw (-2,-1.5)--(-2,-1.7);     \draw (-0.5,-1.5)--(-0.5,-1.7);     \draw (1.5,-1.5)--(1.5,-1.7);     \draw (4,-1.5)--(4,-1.7);                  \end{tikzpicture}                                                       \end{center}     \end{alertblock}     \begin{exampleblock}     \end{frame}     \begin{frame}     {Ces diagrammes permettent avec uniquement 5 valeurs:}     \begin{itemize}     \item[\ding{226}] D'appr\'{e}hender la fa\c{c}on dont sont r\'{e}parties les effectifs d'une s\'{e}rie statistique          \item[\ding{226}] De comprendre les r\'{e}partitions des effectifs pour des s\'{e}ries relatives  \`{a} un m\^{e}me caract\`{e}re.     \end{itemize}     \end{exampleblock}     \textcolor{trustcolor}{Application \no  9:} Repr\'{e}senter le diagramme en bo\^{i}te de la s\'{e}rie B.     \end{frame}               \end{document}


title: Point to a Verbatim Line using TikZ

text: I'm trying to use TikZ in beamer to point to a line of code. Here's what I have so far:               \documentclass{beamer}     \usepackage{tikz}     \usepackage{fancyvrb}          \begin{document}          \begin{frame}[fragile,t]      \frametitle{test}     \begin{Verbatim}     example code      lines     \end{Verbatim}     \tikz \node [circle,fill=black] {};     \begin{Verbatim}     here      \end{Verbatim}     \end{frame}          \end{document}      The node, however, appears on a new line. I want to put it on the right of the line saying, "lines" so that I can then use TikZ overlays to point an arrow to it and put some explanatory lines on the right. I have seen examples of this but they either use math or plain text. How can I do this with Verbatim?


title: Using inputenc package for cp1252 encoding

text: I want to be able to use the ansinew characters in a latex document. According to the pdf file for the inputenc package, I can do that by putting `\usepackage[cp1252]{inputenc}` in my preamble. I do that, but when I put things like `\guilsinglleft` in my document, I get the error `! LaTeX Error: Command \guilsinglleft unavailable in encoding OT1.` when compiling. I'm not going into great detail here, because I assume I am making some very basic mistake, being new to latex.


title: Different options for nodes for positive and negative bars in pgfplots

text: I am having a problem with pgfplots when I want to change options for my nodes. For example if I just want to increase the distance between the bars and the nodes I can use the `yshift` option and it works fine if I just have bars which go in one direction, but if I have bars which go in both directions (positive and negative) it obviously doesn't work if I just use `yshift=5pt`. Another example of the problem would be if I want to use different anchors for the nodes depending if the bars are positiv or negativ. So I was wondering if there is a general way to change the behavior of the nodes depending on the kind of bars they belong to.               \documentclass[a4paper,10pt]{scrartcl}      \usepackage{filecontents}     \usepackage{pgfplots}          \begin{document}          \begin{filecontents*}{daten.dat}     X Y Y_error     0 -.3 .2     3 -.5 .3     6  .5 .1     8  1  .3     \end{filecontents*}          \pgfplotsset{     every node near coord/.append style = {yshift=5pt},     }     \begin{tikzpicture}         \begin{axis}[         extra y ticks       = 0,         extra y tick labels = ,         extra y tick style  = {grid = major},         nodes near coords,         nodes near coords align={vertical},        ybar,        height=0.5\textwidth,        width=0.5\textwidth,        symbolic x coords={0,3,6,8},        ymin=-1,        ymax=3,        xtick=data,                          ytick={-1, -0.5,...,2.5},        ]     \addplot+[error bars/.cd,y dir=both,y explicit] table[x=X, y=Y, y error=Y_error]{daten.dat};     \end{axis}         \end{tikzpicture}     \end{document}


title: Equation connected by lines

text: I have written a code that defines a new environment in which aligned equation are connected by lines as in the image: ![enter image description here](http://i.stack.imgur.com/gVBdz.png) I think it is useful when, inside the align environment, there is the need of splitting on step in more than one line like in this second example: ![enter image description here](http://i.stack.imgur.com/eOurI.png) It uses `tikz` and `amsmath` packages. Lines can connect also different math sign than `=` and the line width is customizable. My questions are:   1. I initially wrote this code for learning but then I search for packages that already include this feature and I didn't find anything. Do you know if there exist such a package?   2. Do you think it is a useful feature? How can I improve it?   3. If the answer to second point is "yes", do you think it's better to write a package with this feature or to suggest its insertion into the `amsmath` package? **EDIT** The `\vdotswithin` feature provided by the `mathtools` is different because it adds the `vdots` in a separated line:               \usepackage{mathtools}     \begin{align*}     \prod_{z^n=-1}(w_1(z)^n+1) &= \prod_{z^n=-1}(w_1(z)^n+1) + \prod_{z^n=-1}(w_1(z)^n+1) \\     &\vdotswithin{=}\\     &= \prod_{z^n=-1}(w_1(z)^n+1)     \end{align*}      ![enter image description here](http://i.stack.imgur.com/8vntS.png)


title: linebreak in description title

text: In my document I have a `description` environment. One of the titles in the description is too long to fit in one line and I want to break it. I know this is a bad styling but I can't think of any way to shorten it. I tried `\\\` and `\newline` and they didn't work. What else can I do? I tried to use the mdwlist package. I added the following in the begining of my document:               \renewenvironment{description}{       \begin{basedescript}{%         \renewcommand{\makelabel}[1]{\bfseries##1}%       }     }{%       \desclabelstyle{\multilinelabel}            \end{basedescript}%          }      but all I got is the same result. I also tried this without any effect:               \renewenvironment{description}{       \desclabelstyle{\multilinelabel}       \begin{basedescript}{%         \renewcommand{\makelabel}[1]{\bfseries##1}%       }     }{%       \end{basedescript}%     }      I can't use the `\multilinelabel` since the words in the label are too long, thus, I want to use `\pushlabel`. However, this doesn't work even in the example you given (probably, it doesn't know how to break lines). Is there any way to force break lines?


title: What document class should I use for a variable size image generator

text: Currently, whenever I want to make a math image, I head over to my Wikipedia Sandbox and use the WP math tag(which uses TeX). I then copy the image from the preview. I have TeXmaker (from USBTeX), and I'd like to use it more often. The issue is, I can't find a way to create a page that is cropped to the size of the content. So The most I can do is use `\documentclass[]{slides}` and crop it with Paint--clearly inefficient. What would be nice would be something which autosizes each page based on its contents. Does something like this exist??


title: I'm using multibib to have references at the end of each chapter but the numbering is wrong

text: I am using `multibib` to have references at the end of each chapter but when I have the same reference in multiple chapters, the numbering in the text corresponds to the last chapter that the reference appears in. The numbering in the reference sections are all fine and `hyperref` works correctly. As an example, currently I get something like this: > Chapter 1 > > I cite ann [4], bob [2] and cat [3]. > > References for Chapter 1 > > 1 ann 2 bob 3 cat > > Chapter 2 > > I cite dug [4], ed [5] and ann [6]. > > References for Chapter 2 > > 4 dug 5 ed 6 ann So I should get ann turning up as ref 1 in chapter ref 3 in chapter 2.


title: Creating a new float (memoir)

text: I recently started using `memoir`. Previously I had a number of floats defined using `float` package-- `attachment`, `code`, and `illustration` in addition to default `figure` and `table`. Now that I'm trying to define new floats in `memoir` way, I'm struggling a bit. I followed `memoir` documentation and defined `illustration` as below:               \newcommand{\illustrationname}{Illustration}     \newfloat[chapter]{illustration}{lol}{\illustrationname}      And I'm using it like this:               \begin{illustration}      \includegraphics[width=0.45\textwidth]{2027-original}      \illustrationname{caption goes here}      \label{ill:2027}     \end{illustration}      However, when I run pdflatex, I get the following error:               <use ./images/2027-original.png> [5 <./images/2027-original.png>] [6]     ! Use of \pictur@ doesn't match its definition.     <argument> \includegraphics       So how can I make this illustration float to use `\includegraphics`?


title: >> is changed to » using beramono

text: I have the following piece of text in Latex: `\texttt{List<List<Integer>>}` and it was rendering properly. Then, I decided to use beramono as my typewriter font, and I have a problem: >> is now rendered as a » character. How should I fix it? In a listing environment, >> is shown correctly.


title: Method of avoiding variant Greek letters

text: Using a virtual greek keyboard and the following packages it's possible to directly implement Greek unicode characters (e.g. θ)               \usepackage[mathletters]{ucs}     \usepackage[utf8]{inputenc}      However the displayed characters in the PDF are always the Greek variants e.g. `\vartheta` as opposed to `\theta`. Is there any way to avoid this other than `\let\vartheta\theta` for each character?


title: Adjust line numbers in error messages

text: # Question Is there any way I can alter the line-numbers reported by TeX and friends in error messages? This is almost an identical question to Add offset to line number (in error message) when using input files, but the solution there (that LaTeX already treats `\input` properly) is not helpful for my problem. I am programmatically generating (using a custom python version of Sweave) `.tex` files from a different `.Plw` source file that inserts generated figures, source code etc. As a result, when LaTeX complains, it refers to lines numbers in the generated `.tex` file rather then the `.Plw` file that I am editing. Is there anyway I can insert something into the generated `.tex` file to instruct TeX that the line `x` in `.tex` is actually line `y` in the `.Plw` file? The specific problem is simply a matter of offsets: each time a figure, or source code listing is inserted into the file, the current offset changes – it can go up or down – but all the other lines are copied verbatim with the same wrapping etc. as in the original `.Plw` file.


title: Minted: am I using illegal characters?

text: I have the following simple LaTeX document...               \documentclass[letterpaper, 10pt]{article}     \usepackage[margin=1in]{geometry}     \usepackage{minted}     \usepackage{hyperref}     \hypersetup     {       colorlinks=false,       pdfborder={0,0,0},     }          \begin{document}          \begin{minted}[mathescape,                    linenos,                    numbersep=5pt,                    gobble=2,                    frame=lines,                    framesep=2mm]{bash}       #!/bin/bash       curl -o wdbc.data http://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/wdbc.data       perl -ne '@f = split/,/; print(join(",", @f[2..31]))' < wdbc.data > wdbc-values.data       perl -ne '@f = split/,/; printf("%s\n", $f[1])' < wdbc.data > wdbc-diagnoses.data       /Applications/MATLAB_R2011b.app/bin/matlab -nodisplay < run-kmeans.m       echo -e "\n\n\n======Results======"       paste -d: wdbc-clusters.data wdbc-diagnoses.data | sort | uniq -c     \end{minted}               \end{document}      I've essentially copied the example from the minted home page and inserted a shell script. When I try to typeset this example, I get the following error.               standage@gremlin4:~hw04$ pdflatex -shell-escape test.tex     This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)      \write18 enabled.     entering extended mode     (./test.tex     LaTeX2e <2009/09/24>     Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh     yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slov     ak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-1     9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, san     skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nyn     orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian     , estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, po     rtuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded.     (/usr/share/texmf-texlive/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texmf-texlive/tex/latex/base/size10.clo))     (/usr/share/texmf-texlive/tex/latex/geometry/geometry.sty     (/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)     (/usr/share/texmf-texlive/tex/generic/oberdiek/ifpdf.sty)     (/usr/share/texmf-texlive/tex/generic/oberdiek/ifvtex.sty)     (/usr/share/texmf-texlive/tex/xelatex/xetexconfig/geometry.cfg)) (./minted.sty     (/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty     Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix      <2008/02/07> (tvz)) (/usr/share/texmf/tex/latex/xcolor/xcolor.sty     (/etc/texmf/tex/latex/config/color.cfg)     (/usr/share/texmf-texlive/tex/latex/pdftex-def/pdftex.def))     (/usr/share/texmf-texlive/tex/latex/float/float.sty)     (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty)     (/usr/share/texmf-texlive/tex/latex/tools/calc.sty)     (/usr/share/texmf-texlive/tex/latex/ifplatform/ifplatform.sty     (/usr/share/texmf-texlive/tex/generic/oberdiek/pdftexcmds.sty     (/usr/share/texmf-texlive/tex/generic/oberdiek/infwarerr.sty)     (/usr/share/texmf-texlive/tex/generic/oberdiek/ifluatex.sty)     (/usr/share/texmf-texlive/tex/generic/oberdiek/ltxcmds.sty))     (/usr/share/texmf-texlive/tex/generic/oberdiek/catchfile.sty) (./test.w18)))/usr/bin/pygmentize          (/usr/share/texmf-texlive/tex/latex/hyperref/hyperref.sty     (/usr/share/texmf-texlive/tex/generic/ifxetex/ifxetex.sty)     (/usr/share/texmf-texlive/tex/latex/oberdiek/hycolor.sty     (/usr/share/texmf-texlive/tex/latex/oberdiek/xcolor-patch.sty))     (/usr/share/texmf-texlive/tex/latex/hyperref/pd1enc.def)     (/usr/share/texmf-texlive/tex/generic/oberdiek/etexcmds.sty)     (/usr/share/texmf-texlive/tex/latex/latexconfig/hyperref.cfg)     (/usr/share/texmf-texlive/tex/latex/oberdiek/kvoptions.sty     (/usr/share/texmf-texlive/tex/generic/oberdiek/kvsetkeys.sty))     Implicit mode ON; LaTeX internals redefined     (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty)     (/usr/share/texmf-texlive/tex/generic/oberdiek/bitset.sty     (/usr/share/texmf-texlive/tex/generic/oberdiek/intcalc.sty)     (/usr/share/texmf-texlive/tex/generic/oberdiek/bigintcalc.sty))     (/usr/share/texmf-texlive/tex/generic/oberdiek/atbegshi.sty))     *hyperref using default driver hpdftex*     (/usr/share/texmf-texlive/tex/latex/hyperref/hpdftex.def) (./test.aux)     *geometry auto-detecting driver*     *geometry detected driver: pdftex*     (/usr/share/texmf/tex/context/base/supp-pdf.mkii     [Loading MPS to PDF converter (version 2006.09.02).]     ) (./test.pyg) (/usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty     (/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) (./test.out)     (./test.out) (./test.out.pyg     ! TeX capacity exceeded, sorry [main memory size=3000000].     '->\leavevmode \kern \z@                               \char `\'     l.5 ...o}{-}\PY{n}{diagnoses}\PY{p}{.}\PY{n}{data}          !  ==> Fatal error occurred, no output PDF file produced!     Transcript written on test.log.      If I replace the bash script with other code (Perl, R, etc), I have no problems. Does my bash script use characters that are not supported in minted? Is this documented anywhere? **Note** :               >>> pygments = __import__('pygments', {}, {}, ['lexers', 'styles', 'formatters'])     >>> print 'Pygments', pygments.__version__     Pygments 1.3.1


title: How to break a line after the n-th word?

text: Suppose i have a raw text defined as:               \newcommand{\rawtext}{this is some raw text with many words in it}      How to break this line after a given word or position? Of course, i only have access to `\rawtext` in the call site. One possible solution is to prepend the n-th whitespace with `\\\`, i simply don't know how.


title: Syntax for smoothing a coordinate plot with the foreach command

text: Currently implementing the solution of Curve synthesis - Adding two curves to get another one. I would like to smooth out the resulting curve. The present code:               % red line     \path[red,name path=one] plot [smooth] coordinates {(0,0) (7.5,0) (8,6) (8.5,0) (10,0)};          % function     \path[blue,name path=three]     plot[domain=0:10,samples=100,smooth] (\x,{0.5*rand+2});          % red line + function     \foreach \c in {0,...,100} {     \pgfmathsetmacro{\x}{\c/10}     \path[name path=line] (\x,-10) -- (\x,20);     \path[name intersections={of=one and line,name=newone}];     \path[name intersections={of=three and line,name=newthree}];     \path let \p1=(newone-1), \p2=(newthree-1) in      (\x1,\y1+\y2) coordinate (sum-\c);     }     \draw[blue] (sum-0) \foreach \x in {1,...,100}{ -- (sum-\x)};      What `\foreach` syntax should i use instead of:               \draw[blue] (sum-0) \foreach \x in {1,...,100}{ -- (sum-\x)};      to get the list of coordinates `[...]` in between braces so that i can do:               \draw[blue] plot [smooth] coordinates{ [...] };


title: Change citation conjunction from "and" to "i"

text: How can I change the citation conjunction from english "and" to catalan "i"? Otherwise               Author = {Kirk, D. and MacPhail, A.},      would get cited as `(Kirk and MacPhail, 2002)` when it should be `(Kirk i MacPhail, 2002)`. When there are more than 2 authors I get `et al.` which is fine. I've seen Natbib change author separation to '&' and Change multiple author reference from '&' to 'and' with natbib bibliography which do not work with `apalike` style. Also, I'd rather not use biblatex if possible.


title: Bounding box calculation in groupplots suddenly fails?

text: Suddenly some graphs changed in my documents. I have not the slightest idea what changed but as of today the bounding box calculation for some plots created in `pgfplots` is going haywire. My MWE looks as follows:               \documentclass[tikz]{standalone}     \usepackage{tikz,pgfplots}     \pgfplotsset{compat=1.7}           \usetikzlibrary{pgfplots.groupplots}          \begin{document}           \begin{tikzpicture}     \begin{groupplot}[         group style={group name=my plots, group size=1 by 1}]         \nextgroupplot[xmin=0.05,]              \addplot {0};     \end{groupplot}       \end{tikzpicture}      \end{document}      And the non-expected output with lots of whitespace at the left: ![enter image description here](http://i.stack.imgur.com/TNjJ7.png) This only happens in groupplots in combination with `xmin=`, not in normal plots but the document itself did not change.


title: Left-margin alignment of biblatex's bibliography list

text: > **Possible Duplicate:**   >  Move biblatex label into margin Is there a simple solution to force the numerals of `biblatex`'s bibliography list (via `\printbibliography`) into the left column such that text of the entry will align with the rest of the text in the document? I'd like to produce                  References     1. Last, F. M.; Last, F. M., Title; Publisher: City, Year, pages.     2. Last, F. M.; Last, F. M., Title; Publisher: City, Year, pages.      instead of the usual               References     1. Last, F. M.; Last, F. M., Title; Publisher: City, Year, pages.     1. Last, F. M.; Last, F. M., Title; Publisher: City, Year, pages.      It seems that using the solution from my earlier question "How can I align section titles and list environments in the left margin?" does not work, so I'm assuming that generating the bibliography list goes beyond declaring a simple enumerate list.


title: Generating a table of glyphs with XeTeX

text: I am trying to get XeTeX to generate a table of all the possible glyphs of a given font, but can not figure out how to make XeTeX know how many glyphs the font has, so I have to specify an exact number. This is what I have got so far:               \documentclass[border=0.5cm,10pt,landscape]{standalone}     \usepackage{geometry}     \usepackage{xunicode, xltxtra}     \usepackage{fontspec}     \usepackage{multicol}     \setmainfont[Mapping=tex-text, Ligatures={Historical}, Alternate=0]{Linux Libertine O}     \setlength{\columnsep}{0.3cm}     \setlength{\columnseprule}{1pt}     \begin{document}          \begin{multicols}{10}     \newcount\charcount     \charcount=0     \loop     \number\charcount \hspace{1ex} \XeTeXglyph\charcount     \par     \ifnum\charcount<2500     \advance\charcount1     \repeat     \end{multicols}          \end{document}      ![Example.](http://i.stack.imgur.com/jwQZh.jpg) **Fig. 1:** Example of the output. How can it automatically know the exact number of accessible glyphs? **Bonus:** Is anyone willing to waste his time by making it put everything inside a table with 10 columns? :-) It also reports an error probably caused by `multicol` which a I could not fix yet.


title: Add rotated comment on margin

text: this is my MWE:               \documentclass[a5paper]{book}     \usepackage[ngerman]{babel}     \usepackage{ucs}     \usepackage[utf8x,utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[garamond]{mathdesign}     \usepackage{geometry}     \geometry{a5paper, top=15mm, left=15mm, right=15mm, bottom=20mm, headsep=10mm, footskip=12mm}     \usepackage{adjustbox}      \usepackage{tabularx,ragged2e,booktabs}      \usepackage[vlines]{tabularht}          \makeatletter     \newcommand{\thickhline}{         \noalign {\ifnum 0=`}\fi \hrule height 1pt         \futurelet \reserved@a \@xhline     }     \makeatother          \newcolumntype{Y}{>{\centering\arraybackslash}X} % zentriert und gleichmäßig verteilt          \begin{document}          \setlength{\tabcolsep}{2pt}     \begin{adjustbox}{angle=90}     {\fontsize{8}{9}\selectfont         \begin{tabularhtx}{\linewidth}{\textheight}{|Y|X|X|X|X|X|X|X|X|X|X|X|X|}         \hline             \interrowfill            Wochen  & Kaffee & Rizinusöl & Mahlzeit & Leinöl & Acidol & Saft & Kalium & Lugol & Schilddr. & Niacin & Pankreatin & Leberextr. \\         \interrowfill         \thickhline         \interrowfill           2 -- 3   & 4 Std. &  2 Tage  & normal  & 2 TL  &  3 x 2  & 1 - 5 - 4 - 3 & 10 x 2 &  6 x 1 & 3 x 1/2 & 6 x 1  & 4 x 3  & täglich \\         \interrowfill         \hline         \interrowfill           3     &  &       &   &    &       &       &       &       &       &       &     &  \\         \interrowfill         \hline         \interrowfill           5     &  &       &    &   &       &       &       &       &       &       &     &  \\         \interrowfill         \hline         \interrowfill           4     &  &       &   &    &       &       &       &       &       &       &     &  \\         \interrowfill         \hline         \interrowfill           5     &  &       &    &   &       &       &       &       &       &       &     &  \\         \interrowfill         \hline         \interrowfill           4     &  &       &    &   &       &       &       &       &       &       &     &  \\         \interrowfill         \hline         \interrowfill           6     &  &       &    &   &       &       &       &       &       &       &     &  \\         \interrowfill         \hline         \interrowfill           6     &  &       &    &   &       &       &       &       &       &       &     &  \\         \interrowfill         \hline         \interrowfill           6    &  &       &     &  &       &       &       &       &       &       &     &  \\         \interrowfill         \hline         \interrowfill           9     &  &       &   &    &       &       &       &       &       &       &     &  \\         \interrowfill         \hline         \interrowfill           9    &  &       &    &   &       &       &       &       &       &       &     &  \\         \interrowfill         \hline         \interrowfill           7     &  &       &  &     &       &       &       &       &       &       &     &  \\         \interrowfill         \hline         \end{tabularhtx}}     \end{adjustbox}          \end{document}      The tablecells have no space to add additional comments, so I'd like to add the comments to the margin like in this picture: ![enter image description here](http://i.stack.imgur.com/TFH3G.png) I tried to add a `tikzpicture` but when I add it before the `adjustbox` it's placed on the side before, after `adjustbox` on the next page. Has anybody an idea?


title: Sorting of references in Bibliography (books/articles) with correct labels

text: I've got a problem with my bibliography. I have to split it up into different parts (books / articles). The problem is, I`ve got articles AND books of the same author, published in the same year. Using biblatex and "authoryear", they are sorted alphabetically by title.                \documentclass{article}     \usepackage[style=authoryear]{biblatex}     \usepackage{filecontents}          \begin{filecontents}{references.bib}          @article{Anonymous:2012b,     Author = {Anonymous, Arthur},     Journal = {Somewhere},     Pages = {46-54},     Title = {Arthur's article},     Volume = {25 (2012)},     Year = {2012}}          @article{Anonymous:2012c,          Author = {Anonymous, Arthur},     Journal = {Somewhere else},     Pages = {6-12},     Title = {Last words},     Volume = {43 (2012)},     Year = {2012}}          @book{Anonymous:2012a,     Address = {Someplace},     Author = {Anonymous, Arthur},     Publisher = {Nobody},     Title = {Book by Arthur},     Year = {2012}}          \end{filecontents}          \bibliography{references.bib}               \begin{document}     \nocite{*}          \printbibliography[title={Books}, type=book]          \printbibliography[title={Articles},type=article]          \end{document}      I am not allowed to post a picture of the results, but the main result is: "Book by Arthur" gets the label "2012b". The problem is: I need to have an automatical sorting that labels the book 2012a - as it is the first reference given in the bibliography - and the first article 2012b. I cannot find a solution. Maybe someone's got an idea? Thank you very much! * * * O.k., I'm trying to specify what I have to achieve and I will provide a simple example without code (as I am not at home right now; I´ll try to add an example based on code later). My PhD thesis contains a bibliography of ALL publications of two authors in a specific period of time. Therefore, the problem is not just a local one, but more ore less all over the place. The bibliography will probably contain at least 500 , much more likely nearly 1000 publications over the space of 30 years, of all kinds of types. Aside from splitting these bibliographies in different sections (that would be easy if the main problem is solved), the general sorting I need is as follows: Name, Year, and (!) within every single year: "books" first, then "incollection", then "articles" This would read as follows: Anonymous 2001a: article (title: "a") Anonymous 2001b: article (title: "x") Anonymous 2002a: book (title: "e") Anonymous 2002b: book (title: "m") Anonymous 2002c: book (title: "z") Anonymous 2002d: article (title: "b") Anonymous 2003a: book (title: "g") Anonymous 2003b: article (title: "d") Anonymous 2003c: article (title: "h") Anonymous 2004a: book (title: "n") Anonymous 2004b: incollection (title: "j") Anonymous 2005a: incollection (title: "y") Anonymous 2005b: article (title: "k") Anonymous 2012a: book (title: "n") Anonymous 2012b: article (title: "l") Anonymous 2012c: article (title: "s")


title: Multi-line Equations

text: I am trying to split my equation. I am using the code below. However, each time I am getting the following error > ! Extra }, or forgotten \right. } $\hfill \endtemplate l.215 \end{split} ?               \documentclass{article}     \usepackage{amsmath}              \begin{document}     \begin{equation}\begin{split}     MSE_{II}(\overline{y}_{CST})&= MSE_{I}(\overline{y}_{CST})+\overline{Y}^{2}\left[\left(c_{2}^{2}+2c_{1}c_{3}\right)V_{4,\, 0}+2c_{1}c_{2}V_{3,\, 0}+2\left(2c_{1}c_{2}+c_{3}\right)V_{3,\, 1} +\\      &+2 \left(c_{1}^{2}+c_{2} \right)V_{2,\, 1}+\left( c_{1}^{2}+2c_{2} \right)V_{2,\, 2}+{2c_{1}V_{1,\, 2}}\right]     \end{split}\end{equation}     \end{document}      But, when I remove, `\left[` and `\right]` codes, it works fine. I do not understand. Please, help me.


title: Using expex across pages

text: I am using the `expex` package to align two types of text, doing it as if it were a gloss, and it works fine. There is one problem, though: Many of the texts I'm working on are longer than a page, and instead of continuing on the next one, which would be desirable, they violate the lower margin, into oblivion. I could just split the text across more than one gloss, but that really is a pain because it forces me to take the appearance and not the logical structure of the document into account. Also, any changes to other aspects of my document's layout force me to reorganize what text goes into what gloss every time. To sum it all up: I would like to be able to span one gloss across pages using `expex`. Is there a way of doing this?


title: TeX capacity memory exceeded error

text: \caption[$Set\:3$: Intermediate set]{$Set\:3$: Intermediate set; Classical orifice plate ($s3c$); Plate numbers ($s3f(0-3)$); Classical plate,($s3p$).}      Is this a wrong caption? Because it is prompting an error as follows pointing at the line number of this caption:               Tex capacity exceeded, sorry [main memory size 1500000].


title: beamer class on MikTex2.9

text: I'm having a hard time getting MikTex ready to produce `\documentclass{beamer}` Documents. The MikTex-package-manager says that "beamer" is already installed. I de- installed and installed it again, still the example document isn't compiling. All i can understand by reading the command line is that some hyperref-library stops working. See here an excerpt of the output:                   (C:\Users\altug\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcorepa     tterns.code.tex)))     (C:\Users\altug\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\utilities\xxcolor.sty)      ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\hyperref\hyperref.sty"     ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\hobsub-hyperref.sty"     ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\hobsub-generic.sty"))     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty")     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\hyperref\pd1enc.def")     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\hyperref.cfg")     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ltxmisc\url.sty")          Package hyperref Message: Stopped early.          )          Package hyperref Message: Driver (default): hdvips.          ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\hyperref\hdvips.def"     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\hyperref\pdfmark.def"     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\oberdiek\rerunfilecheck.sty")))      Searched the stackexchange, found a thread, stating "you just need to install "hyperref"-lib over "mpm" ". Problem is can't install "hyperref" over mpm, because i neither can click on install nor on un-install, both remain grey. What to try next? I desperatly need this beamer-class installed due to some work at university. Thanks for help, if you need additional information let me know!


title: Best free Baskerville font with small caps

text: I have been using the Baskervald font for a document but have realised that small caps do not work with it. Instead lowercase letters are used. Is there a better free option if you want these features or is there a way to somehow use LaTeX to reduce the normal caps to small caps (although that might not look correct)? I've looked around the net for other free clones but most are limited in similar ways.


title: Three figures positioned horizontally and vertically

text: I'm trying to get the following layout for three figures in LaTeX ![enter image description here](http://i.stack.imgur.com/GGEQk.png) However, thus far I'm not really getting anywhere. What I've found is a way to put them next to each other, but they are too large to fit next to each other. I used               \begin{figure}         \centering         \begin{subfigure}{0.33\textwidth}             \centering             \includegraphics[height=1.7in]{something.eps}             \caption{}         \end{subfigure}%         ~             \begin{subfigure}{0.33\textwidth}             \centering             \includegraphics[height=1.7in]{something.eps}             \caption{}         \end{subfigure}%         ~          \begin{subfigure}{0.5\textwidth}             \centering             \includegraphics[height=1.7in]{something.eps}             \caption{}         \end{subfigure}         \caption{Some caption}         \label{label}     \end{figure}      But this simply positions them horizontally. Could anyone help me figure out how to put the figures in the above layout?


title: LaTeX - How to write a mathematics symbol in caption

text: I'm trying to put a mathematics symbols in the caption of my figure with this:               \begin{figure}[!ht]         \centering         \includegraphics[scale=0.2]{vect_CM.png}         \caption{Vecteur $\overrightarrow{CM}$ à un moment donné}         \label{vect_CM}     \end{figure}      And LaTeX show an error:               Illegal parameter number in definition of \reserved@a.     <to be read again>                         \crcr      l.76 ...$\overrightarrow{CM}$ à un moment donné}      Do I have to use any package to do this?


title: Drawing tree in text (like inline math)

text: Is there a way to draw (with tikz/tikz-qtree) a tree directly in the text, like the inline math command? For a small tree with 2 or 3 nodes? Thanks!


title: Latex: Multiple \cite's with an 'and' before the last reference

text: I'm using Natbib and BibTeX writing my thesis. If I say:               \citet{key1,key2,key3} did something big.      I get:               Key1 Author (2014); Key2 Author (2011); Key3 Author (1900) did something big.      Is there a formatting command that might give me an "and" before the last reference? That it might look like this:               Key1 Author (2014); Key2 Author (2011) and Key3 Author (1900) did something big.      I know that I can go:               \citet{key1,key2} and \citet{key3} did something big      but that kinda seems hacky. I was wondering if anyone knows some LaTeX magic that will make this work? Thanks in advance!


title: Adjust width of tcolorbox to contains long Equation

text: My work based on that subject Create Beamer-Theorem like boxes i want all long equations be inside a box and the width to be adjust based on the content also the my box can't be split on different pages even i added breakable option As pointed out by Gonzalo Medina in a comment. by the way i use \usetheme{Luebeck} here is my go               \documentclass[leqno,mathserif,hyperref={pdfpagelabels=false}]{beamer}     \usepackage{lmodern}     \usepackage{graphics,bm}     %\usetheme{AnnArbor}     \usetheme{Luebeck}     \usepackage{tcolorbox}     \tcbuselibrary{breakable,skins}     \setbeamercolor{structure}{blue}     \usepackage[tightpage]{preview}               \setbeamercovered{transparent}     \usepackage[T1]{fontenc}     \usepackage[english]{babel}     \usepackage{xcolor}     \usepackage{enumerate}     \newcommand{\diff}{\mathop{}\mathopen{}\mathrm{d}}          \usepackage{lipsum}     \usepackage{enumitem}               \colorlet{xlightblue}{blue!5}          \newtcolorbox{Educ}[1]{      title=#1,       beamer,        colback=xlightblue,       colframe=blue!30,       fonttitle=\bfseries,       left=1mm,       right=1mm,       top=1mm,       bottom=1mm,       middle=1mm,       breakable,     }          \begin{document}     \section[Plan]{Plan}     \section[Introduction]{Introduction}     \section[Example1]{Example1}     \section[Example2]{Example2}     \begin{frame}     \frametitle{Solution d'une EDS}     \begin{Educ}{Définition}     Une solution de l'EDS $E(b,\sigma)$  est un couple $(X,W)$ de processus adaptés sur un espace de probabilité filtré $(\Omega,\mathcal{F},\mathcal{F}_{t},\mathbb{P})$ qui satisfait les conditions usuelles, vérifiant :     \begin{itemize}     \item $W$ est un $\mathcal{F}_{t}$-mouvement brownien m-dimensionnel;     \item pour tout $t\geq 0$, on a les conditions de régularité      \[     \mathbb{P}\big\{ \int_{0}^{t} \sum_{i=1}^{n} |b_{i}(s,X_{s})| \diff s <\infty \big\}=\mathbb{P}\big\{ \int_{0}^{t}\sum_{i=1}^{n}\sum_{j=1}^{m}|\sigma_{ij} (s,X_{s})|^{2}\diff s <\infty \big\}=1;     \]     \item pour tout $t\geq 0, i=1,\ldots,n$, on a presque sûrement       \[     X_{t}^{i}=X_{0}^{i}+\int_{0}^{t}b_{i}(s,X_{s})\diff s +\sum_{j=1}^{m}\int_{0}^{t}\sigma_{ij}(s,X_{s})\diff W_{s}^{j}.     \]     \end{itemize}     \lipsum[5]     \end{Educ}     \end{frame}           \end{document}      ![enter image description here](http://i.stack.imgur.com/MmITC.jpg) I can use **align*** so that the box can contians the equation but that take lot space that's why i want the equation be in one row and inside a box               \begin{align*}     &\mathbb{P}\big\{ \int_{0}^{t} \sum_{i=1}^{n} \abs{b_{i}(s,X_{s})} \diff s <\infty \big\}\\     &=\mathbb{P}\big\{ \int_{0}^{t}\sum_{i=1}^{n}\sum_{j=1}^{m}\abs{\sigma_{ij} (s,X_{s})}^{2}\diff s <\infty \big\}\\     &=1;     \end{align*}      ![enter image description here](http://i.stack.imgur.com/quCe9.jpg)


title: package clash between ctable and auto-pst-pdf?

text: I'm new to LaTeX and decided to write my PhD thesis with it (pdflatex.exe, TexStudio2.6.6, Win7x64). I nailed the conflict to two packages namely `ctable` and `auto-pst-pdf`. Unfortunately I need both packages and I hope it is a small problem. Here we go. If I use an `X` specifier in a table with a `width` option, then `latex.exe` in taskmanager is very busy and no output is processed within 30 minutes until I kill the task. If no `X` specifier is used in a `ctable` command, no odd behavior occurrs. Maybe this is a system specific problem of my installation. I've prepared a MWE with a table typeset with the `tabularx` environment and one typeset with the `ctable` command; `tabularx` works fine with the `X` specifier and `auto-pst-pdf` activated. What is going on? Thanks so much for your attention and assistance.               \documentclass[plain,english,a4paper,12pt,headsepline]{scrbook}          \usepackage{ifplatform}     \usepackage{pst-xkey}     %\usepackage[runs=2]{auto-pst-pdf}     \usepackage{ctable}           \begin{document}          \begin{table}     \caption{MWE with tabularx}     \begin{tabularx}{\textwidth}{XXll}     \FL                              \textbf{A}  &   \textbf{B}  &   \textbf{C}      &   \textbf{D}       \ML                              a   &   b   &   c   &   1   \NN     a   &   b   &   c   &   1        \LL      \end{tabularx}     \end{table}          \ctable[     caption = MWE with ctable,     notespar,     width = \textwidth     ]     {XXll}     {     \tnote[a]{aaa}     \tnote[b]{bbb}     \tnote[c]{ccc}     .}     {     \FL                              \textbf{A}  &   \textbf{B}  &   \textbf{C}      &   \textbf{D}       \ML                              a   &   b   &   c   &   1   \NN     a   &   b   &   c   &   1        \LL                          }     \end{document}


title: New to LaTeX, getting bunch of errors and not sure how to fix them

text: I started learning LaTeX just today. I'm trying to write some of my notes in TeX form, but when I try to build this I'm getting a bunch of errors. Can you take a look at it and see what's wrong? Thanks.               \documentclass{article}     \begin{document}     \title{Foundations of CS, Lecture 1}     \author{Ryan}     \date{January 23, 2014}     \maketitle          \textbf{Proposition} - a declarative statement that is either True or False.     \begin{itemize}          \item Atomic proposition - basic proposition         \item Compound proposition - complex proposition that is built upon smaller ones         \begin{itemize}             \item Negation - \lnot p             \item Conjunction - p \land q             \item Dis-junction - p \lor q             \item Implication - p \rightarrow q             \item Bi-conditional - p \longleftrightarrow q         \end{itemize}     \end{itemize}          For a statement p -> q, there are several related statements:     \begin{itemize}         \item Converse: q \rightarrow p         \item Contrapositive: \lnot q \rightarrow \lnot p         \item Inverse: \lnot p \rightarrow \lnot q     \end{itemize}           \textbf{Logical Equivalency} - Two propositions are logically equivalent      if they have the same truth table.     \begin{itemize}         \item \textbf{Example: }Is p \rightarrow q equivalent to \lnot q \rightarrow \lnot p?         Truth table goes here     \end{itemize}           \textbf{Precedence of Logical Operators}     Table goes here          \begin{itemize}         \item Tautology - proposition that is always True         \item Contradiction - proposition that is always False         \item Contingency - proposition that is neither True or False         \begin{itemize}             \item For example, p         \end{itemize}     \end{itemize}                           \end{document}


title: ifthenelse conditional & macro

text: Why I get the error below if I use the               \ifthenelse{\boolean{@parts}}%     {%     }{}      conditional (defined into `classicthesis.sty`) you try to comment it, you don't have any error?               \documentclass[11pt]{scrreprt}          \usepackage[parts]{classicthesis}          \usepackage{expl3}          \ExplSyntaxOn          \newcommand{\useifmybooltrue}{          \RequirePackage{siunitx}     \RequirePackage{booktabs}     \RequirePackage{xparse}     \RequirePackage{environ}     \RequirePackage{geometry}          \bool_new:N \g_has_run_bool     \tl_new:N \l_aw_text_tl     \int_new:N \l_aw_tot_int     \int_new:N \g_aw_tot_alph_int     \int_new:N \g_wid_space_int     \int_new:N \g_space_int     \fp_new:N \g_rat_space_int     \fp_new:N \g_aw_avg_width_fp     \dim_new:N \myalphabetwidth     \dim_new:N \mytextwidth     \makeatletter     \input{\jobname.aux}     \tl_const:Nx \c_aw_the_alphabet_tl {abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.;?()!' \token_to_str:N :}          % this can be changed to an evironment or renamed or whatever     \NewDocumentCommand {\avgwidthstart} {}       {         \aw_avg_width:w       }          \NewDocumentCommand {\avgwidthend}{}{}          % Here is the environment version, using just "text" as a name is probably a bad idea.     \NewEnviron{textcount}     {       \expandafter\avgwidthstart\BODY\avgwidthend     }          \cs_new:Npn \aw_avg_width:w #1 \avgwidthend       {         % if first run, then generate variables to be used         \bool_if:NF \g_has_run_bool           {             \tl_map_inline:Nn \c_aw_the_alphabet_tl             {               \int_new:c {g_##1_int}               \fp_new:c {g_rat_##1_fp}               \fp_new:c {g_wid_##1_fp}             }           }         \tl_set:Nn \l_aw_text_tl {#1}              % this can be used rather than the preceding line to take capital          % letters into account, but is Slooooooow         %\tl_set:Nx \l_aw_text_tl {\tl_expandable_lowercase:n {#1}}              \int_set:Nn \l_aw_tot_int {\tl_count:N \l_aw_text_tl}         \tl_map_function:NN \c_aw_the_alphabet_tl \aw_get_counts:n         \deal_with_spaces:n {#1}         \tl_map_function:NN \c_aw_the_alphabet_tl \aw_calc_ratios:n         \tl_map_function:NN \c_aw_the_alphabet_tl \aw_calc_avg_width:n         \fp_gset_eq:NN \g_aw_avg_width_fp \l_tmpa_fp         \fp_zero:N \l_tmpa_fp              % the dimension \myalphabetwidth gives the width of the alphabet based on your character freq,         % can be accessed by \the\myalphabetwidth         \dim_gset:Nn \myalphabetwidth {\fp_to_dim:n {\fp_eval:n {61*\g_aw_avg_width_fp}}}              % the dimension \mytextwidth gives the recommended \textwidth based on 66 chars per line.         % can be accessed by \the\mytextwidth         \dim_gset:Nn \mytextwidth {\fp_to_dim:n {\fp_eval:n {66*\g_aw_avg_width_fp}}}         \protected@write\@mainaux{}{\mytextwidth=\the\mytextwidth}         \bool_gset_true:N \g_has_run_bool              % and lastly print the content         #1       }          \makeatother          \cs_new:Npn \aw_get_counts:n #1       {         % make a temporary token list from the document body          \tl_set_eq:NN \l_tmpb_tl \l_aw_text_tl         % remove all occurrences of the character         \tl_remove_all:Nn \l_tmpb_tl {#1}         % add to appropriate int the number of occurrences of that character in current block         \int_set:Nn \l_tmpa_int {\int_eval:n{\l_aw_tot_int -\tl_count:N \l_tmpb_tl}}         % add to appropriate int the number of occurrences of that character in current block         \int_gadd:cn {g_#1_int} {\l_tmpa_int}         % add this to the total         \int_gadd:Nn \g_aw_tot_alph_int {\l_tmpa_int}       }          \cs_new:Npn \deal_with_spaces:n #1       {         \tl_set:Nn \l_tmpa_tl {#1}         % rescan body with spaces as characters         \tl_set_rescan:Nnn \l_tmpb_tl {\char_set_catcode_letter:N \ }{#1}         % find number of new characters introduced.  add to number of spaces and alph chars         \int_set:Nn \l_tmpa_int {\tl_count:N \l_tmpb_tl -\tl_count:N \l_tmpa_tl}         \int_gadd:Nn \g_space_int {\l_tmpa_int}         \int_gadd:Nn \g_aw_tot_alph_int {\l_tmpa_int}         % since this comes after the rest of chars are dealt with, tot_alph is final total         \fp_set:Nn \g_rat_space_fp {\g_space_int/\g_aw_tot_alph_int}         % get width of space and use it.  obviously space is stretchable, so i'll assume         % that the expansions and contractions cancel one another over large text.  is this         % a terrible assumption???         \hbox_set:Nn \l_tmpa_box {\ }         \fp_gset:Nn \g_wid_space_fp {\dim_to_fp:n {\box_wd:N \l_tmpa_box}}         \fp_add:Nn \l_tmpa_fp {\g_wid_space_fp*\g_rat_space_fp}       }          \cs_new:Npn \aw_calc_ratios:n #1       {         % divide number of occurrences of char by total alphabetic chars         \fp_gset:cn {g_rat_#1_fp}{{\int_use:c {g_#1_int}}/\g_aw_tot_alph_int}       }          \cs_new:Npn \aw_calc_avg_width:n #1       {         % only need to find char widths once         \bool_if:NF \g_has_run_bool           {             % find width of char box             \hbox_set:Nn \l_tmpa_box {#1}             \fp_gset:cn {g_wid_#1_fp}{\dim_to_fp:n {\box_wd:N \l_tmpa_box}}           }         % multiply it by char frequency and add to avg width         \fp_add:Nn \l_tmpa_fp {{\fp_use:c {g_wid_#1_fp}}*{\fp_use:c {g_rat_#1_fp}}}       }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % This part is just for fun. Delete it and the showtable command from the document if     % it isn't wanted     \tl_new:N \l_aw_tab_rows_tl     \seq_new:N \g_aw_the_alphabet_seq          \NewDocumentCommand {\showtable}{}         {           \clearpage           \thispagestyle{empty}           \newgeometry{top=2cm,bottom=2cm,left=2cm,right=2cm,heightrounded}           \aw_make_table:           \restoregeometry         }          \cs_generate_variant:Nn \seq_set_split:Nnn {NnV}     \cs_new:Npn \aw_make_table:         {           \thispagestyle{empty}           \seq_set_split:NnV \g_aw_the_alphabet_seq {} \c_aw_the_alphabet_tl           \seq_map_function:NN \g_aw_the_alphabet_seq \aw_generate_row:n         \begin{table}             \centering             \small             \sisetup{round-mode = places,round-precision = 5,output-decimal-marker={,},table-format = 3.5}           \begin{tabular}{lll}             \toprule             {Average\,\texttt{\textbackslash textwidth}}&{Average\,character\,width}&{Average\,alphabet\,width}\\             \midrule             \the\mytextwidth&\fp_eval:n {round(\g_aw_avg_width_fp,5)}pt&\the\myalphabetwidth\\             \bottomrule           \end{tabular}\par         \end{table}             \vfil             \small           \begin{center}             Characters\,=\,\fp_eval:n {\g_aw_tot_alph_int}           \end{center}             \[%             \mathrm{Line\,of\,types}=\frac{\fp_eval:n {\g_aw_tot_alph_int}\cdot\fp_eval:n {round(\g_aw_avg_width_fp,5)}\mathrm{pt}}%                                                  {\mathrm{\the\mytextwidth}}%                                            =\fp_eval:n {round(\g_aw_tot_alph_int*{round(\g_aw_avg_width_fp,5)}/\mytextwidth,5)}             \]             \vfil         \begin{table}             \centering             \small             \sisetup{round-mode = places,round-precision = 5,output-decimal-marker={,},table-format = 3.5}           \begin{tabular}{cS}             \toprule             {Letter}&{Actual}\\             \midrule             \textvisiblespace&\fp_eval:n {\g_rat_space_fp*100}\%\\             \tl_use:N \l_aw_tab_rows_tl             \bottomrule           \end{tabular}\par         \end{table}         }          \cs_new:Npn \aw_generate_row:n #1         {            \tl_put_right:Nn \l_aw_tab_rows_tl {#1&}            \tl_put_right:Nx \l_aw_tab_rows_tl {\fp_eval:n {100*{\fp_use:c {g_rat_#1_fp}}}\%}            \tl_put_right:Nn \l_aw_tab_rows_tl {\\}         }     }     \ExplSyntaxOff     \ifthenelse{\boolean{@parts}}{\useifmybooltrue}          \begin{document}          \avgwidthstart     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla eu purus eros. Aenean scelerisque fermentum nisi, ut tincidunt est viverra ac. Proin diam eros, ultrices sit amet aliquam at, accumsan sit amet magna. Integer nec nunc tincidunt metus scelerisque lacinia quis eget diam. Sed quis purus eros. Phasellus molestie dolor placerat lectus imperdiet tincidunt. Praesent aliquet metus eu elit ornare viverra. Ut nulla elit, convallis id adipiscing facilisis, laoreet et eros.     \avgwidthend          \end{document}      ## Error               Undefined control sequence }{}      * * *               ! Undefined control sequence.     <argument> ...etry} \par \ExplSyntaxOn \par \bool     _new:N \g _has_run_bool \t...     l.208 }{}     ^^M     The control sequence at the end of the top line


title: dtx file and history

text: The `\changes` command of DTX file is used to record changes. The `\PrintChanges` command print the list of change, sorted by number ... except when a number is greater than 10. To see the problem, I invite you to read the change in the documentation of the `eledmac` package. You can see:   * v0.1   * v0.10   * v0.11   * ...   * v0.18   * v0.2 Or the version 0.2 should be after v0.1. I tried some technics with the `@` (like in index), but I could'nt solve this problem.


title: Matching the delimiters \{ and \} in AUCTeX

text: I'm using AUCTeX and would like the delimiters `\\{` and `\\}` to be matched. **How can I (permanently) achieve matching of these delimiters?** The link I provided indicates that I should edit a syntax table, but I cannot determine which one and how, exactly, I am to edit it. **Why aren't the given delimiters automatically matched?** Since they're so common in LaTeX, I'd think they would be. (I asked this last question on the AUCTeX mailing list, but received no reply.) Based on Tyler's comment, my question is technically ill-founded. However, I suspect there's still a way to get done what I want done, so I'll leave the question as is under the assumption that the answerer will know what I'm _really_ asking.


title: Whitespace macro

text: I would like to have a macro which produces N white spaces if called like this               \mulspc{3} % Produces exactly 3 spaces          \newcommand{\mulspc}[1]{         \newcounter{ctra}         \setcounter{ctra}{0}         \whiledo {\value{ctra} < #1}%         {           \hspace*{2mm}           \stepcounter{ctra}         }     }      But I have problems that this macro does not produce 0mm spacing in a table cell (just at the beginning of the cell!) if I call zero times `\multspc{0}`. There is always some indent, but where does this come from? I need this macro to indent some algorithm in the table cell, its nasty but manualy formating gives me the best result in a longtable, because its multiple pages long... Thanks for your help!


title: Reference the line number in which a (new) word occurred for the first time

text: I would like to cross-reference the line number in which a word occurred for the first time in some texts. For example, a text is given:               LESSON I     In the traffic court of a large mid-western city, a young     lady was brought before the judge to answer a ticket given     her for driving through a red light. She explained to his     honor that she was a school teacher and requested an imme-     diate disposal of her case in order that she might hasten     on to her classes. A wild gleam came into the judge's eye.     "You are a school teacher, eh?" said he. "Madam, I shall     realize my lifelong ambition. Sit down at that table and     write 'I went through a red light' five hundred times."       In it, the new word "disposal" occurred in line 5, so the NEW WORDS LIST is given as below:               ----------------------------------------------------     1. disposal (L.5)     2. hasten   (L.5)     3. gleam    (L.6)     ...     ----------------------------------------------------      How to cross-reference such a number?


title: Show the number of lines in margin

text: How to show the number of lines in a short passage like that:               (EVEN PAGE STYLE)                                                             margin                                                                  on                                                           rightside     The pilot and the passenger got into the plane. It        |   1     was a small plane. It had one engine. It was an old       |   2     plane. The pilot started the engine. "Are you okay?"      |   3     he asked the passenger. She said she was okay. They       |   4     were flying to an island. The island was only 30 mi-      |   5     nutes away. It would be a short flight. She was a         |   6     nurse. Her husband was a doctor. The doctor was on        |   7     the island. The doctor needed some medicine. She had      |   8     the medicine in her bag. The medicine would save a        |   9     young boy. The young boy was very sick. The plane         |  10     took off. The engine sounded funny. The pilot frowned.    |  11     "Is everything okay?" the passenger asked. "I'm afraid    |  12     not," said the pilot. "There's something wrong with       |  13     the engine. We have to land." He landed the plane. The    |  14     nurse got out of the plane. She looked around the air-    |  15     port. She saw another plane. This plane had two en-       |  16     gines. She walked over to the plane. "Is this a new       |  17     plane or an old plane?" she asked the pilot. The pilot    |  18     said it was a new plane. "Good," she said. "Please take   |  19     me to the island."                                        |  20      Related to Refer the line number in which a (new) word occured first time (typesetting book on English learning)


title: TikZ - flowchart nodes alignment

text: I'm trying to code a flowchart and I'm almost there, but I can't get the nodes properly aligned. Lets say my flowchart has 3 columns: the nodes of the first are ok, but I need the nodes from 2nd and 3rd to be aligned as well. My code and a picture of my actual drawing:               \begin{tikzpicture}[         node distance = 1cm,  auto,         status/.style={rectangle, draw, fill=red!10, text width=2.5cm, align=center, rounded corners, minimum height=1cm},         acao/.style={regular polygon, regular polygon sides=6, draw, text width=2.5cm, align=center},         decision/.style={diamond, draw, fill=blue!20, text width=2.5cm, align=center, inner sep=0pt},         block/.style={rectangle, draw, text width=4.5cm, align=center, minimum height=1cm},         line/.style={draw, -latex'}            ]              \node [status] (inicio) {Situação de Emergência};              \node [block, below=of inicio]  (equipe)  {Equipe de Radiografia};         \node [acao, below=of equipe] (planejamento) {Planejamento para controlar a Situação};              \node [decision, below=of planejamento]   (decide) {Situação sob controle?};         \node [status, node distance = 2cm, right=of decide] (pode) {Situação Normal};         \node [block, node distance = 2cm, right=of pode] (SPR_ok) {Supervisor de Proteção Radiológica};                   \node [block,    below=of decide] (SPR_fu) {Supervisor de Proteção Radiológica};         \node [acao, node distance = 2cm, below=of SPR_fu] (planejamento2) {Planejamento para controlar a Situação};         \node [decision, node distance = 2cm, right=of planejamento2]   (decide2) {Situação sob controle?};         \node [status, below=of decide2]  (auth)  {Autoridades Competentes};         \node [status, node distance = 3cm, right=of decide2] (cnen) {Comunicar a CNEN};                   \path [line] (inicio) -- (equipe);         \path [line] (equipe) -- (planejamento);         \path [line] (planejamento) -- (decide);         \path [line] (decide) -- node [near start] {Sim} (pode);         \path [line] (decide) -- node [near start] {Não} (SPR_fu);             \path [line] (pode) -- (SPR_ok);                 \path [line] (SPR_ok) -| (cnen);                     \path [line] (SPR_fu) -- (planejamento2);                         \path [line] (planejamento2) -- (decide2);                             \path [line] (decide2) -- node [near start] {Sim} (cnen);                             \path [line] (decide2) -- node [near start] {Não} (auth);                                                 \path [line] (auth) -| (cnen);          \end{tikzpicture}      ![Actual flowchart](http://i.stack.imgur.com/CC0VU.png)


title: Adding headers and footers using Pandoc

text: Pandoc uses Tex as an intermediary step when generating PDF, so I thought asking this question on the Tex part of StackExchange may be the right place. If not, please let me know, and I will delete it. How do you specify that Pandoc should use a specific header and footer when generating a PDF from Markdown? Currently I use the following to create my doc from the command line:               pandoc -s -V geometry:margin=1in --number-sections -o doc.pdf doc.mkd      This gives a lovely result with numbered sections. What I would like to do, is to include a header and footer on each page. How do I go about it? The extensions mechanism, e.g. `pandoc_title_block` may hold the key, but how do you use it? Lastly (as a bonus), is there some way to create a title page for a document using pandoc?


title: lstlisting environment as item in description

text: I would like to show some listings inside a `description` environment like this:               \usepackage{listings}   % fancy code listings     \usepackage{caption}    % fancy chapters for fancy code listings     \captionsetup[lstlisting]{singlelinecheck=false, margin=0pt, font={sf,sl,footnotesize}}          \lstset{%       language=[ISO]C++,       basicstyle=\ttfamily\footnotesize,       frame=lines,       keywordstyle=\color{blue}\textbf,       commentstyle=\color[rgb]{0.0,0.4,0.0}\scriptsize,       extendedchars=true,                breaklines=true                  }          \begin{description}     \item[Example:]       \begin{lstlisting}[caption=Do not do this]         /* increment a by one */         a = a + 1       \end{lstlisting}     \end{description}      But for some reason the caption _'Do not do this'_ is always visible above the `\item` entry _'Example:'_. This problem however vanishes if I write something between `\item` and the `lstlisting` environment like this:               \begin{description}     \item[Example:] Bad code example       \begin{lstlisting}[caption=Do not do this]         /* increment a by one */         a = a + 1       \end{lstlisting}     \end{description}      I would like to get this to work without the extra text, _'Bad code example'_ in this case. I tried to use `\vspace{}` and `\phantom{text}` instead of extra text, but both seem to be ignored. Could someone please help me out?


How do you test whether or not a ConTeXt module is installed? I have run `first-setup.bat --modules=all` but how do I test if all the modules are installed?


title: Text in quote style with caption

text: I need to put a output of a program in a quote stile but i need to put a `\caption` tag like an image or a table. I need to do something like: text   other text   ...   Output X: something What i can do this? Edit 1: I have a multiline quote like this:               \begin{quote}         {\bf Percorso del dataset:} Utile in caso di approccio \ac{MC} per individuare il dataset con le epoche random che ha portato allo score migliore;\\         {\bf Numero totale di epoche:} Utile nel caso 3 per specificare qual'è il numero di epoche che portato allo score migliore; \\         {\bf Istanti di transizione da un epoca all'altra:} Utile in caso di approccio \ac{MC} per caratterizzare la sequenza di epoche appresa che ha portato allo score migliore; \\         {\bf Score globale:} Score dell'intera sequenza di strutture; \\         {\bf Lista dei NaN:} Eventuale lista degli score con valore \ac{NaN};     \end{quote}      I need to put a label "Quote X: blablabla" at the bottom of the quote. I don't like the figure tag, because it isn't a figure.


title: Timeline for overlapping (multi-year) events

text: I'd like to generate a timeline similar to the one shown below: ![http://www.projects.science.uu.nl/tm5/TM5_PW/TM5_presentations_May2011/basu.pdf](http://i.stack.imgur.com/n22pV.jpg) [original at: http://www.projects.science.uu.nl/tm5/TM5_PW/TM5_presentations_May2011/basu.pdf] How can I go about doing that? thanks! Cheers, M.


title: How to disable indentation in subsubsection using IEEEtran?

text: I am using `IEEEtran` and my sub subsections are indented. I tried using `\parindent0pt` but that removes the indentation of the paragraphs too. Any suggestion?


title: Cutting corners - how to delete 1 pt (0.3515 mm) or so

text: There is no way to reformulate the sentence. When I for example delete the letter "i" within the sentence, I'm good, everything fits perfectly. So I was thinking about cutting the corners of blank space. It just concerns one particular row. Any idea? I guess this is against the laws of typography, but... When I was the MS user, this occured to me once and I simply changed the size of blank space. **MWE**               \documentclass[12pt]{article}               \begin{document}          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.           Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.           Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.           Neither text reformulation nor deleting any characters is not the option (btw, is neither A nor B considered singular or plural?). Anyway, any idea????          \end{document}      This document needs to be just a one page. I want to deteriorate something on the last row (hopefully the space) so that I can still have there four questions marks. If you delete a letter 'i' in 'considered', it works, so I'm looking for some minor cheat.


title: comma in node name [TikZ]

text: In my database some objects have name in `A,B` format, i.e there is comma in between. I wanted to do something like this               \node (A,B) {Comma};     \node (x) {normal};     \draw (A,B) -- (x);      However, this is not permitted. How can I use comma in in the node names, or in general other special characters in node name?