title: Improved kerning in fractions?

text: **Question** How can I apply selective kerning within the numerator and denominator of an inline fraction? Specifically, I'd like to:   * Tighten kerning after the numerator if it ends in 7   * Loosen kerning after the numerator if it ends in 4   * Tighten kerning before the denominator if it begins with 4   * Loosen kerning before the denominator if it begins with 5 or 7 **Background** I'm not quite satisfied with `\sfrac` or `\nicefrac` for typesetting fractions in passages of text, so I've been working on a macro called `\textfrac`. I'm pleased with the results so far, except the kerning, as mentioned above. Features of `\textfrac`:   * Uses 5-point type for numerator and denominator, rather than 7-point type.   * In Computer Modern and Latin Modern, aligns perfectly with height and depth of standard numerals.   * Works great inside of `\textit` and `\textbf`. (Except for small issue noted later.)   * Takes an integer as an optional argument. If present, it adds micro-kerning between the integer and the fraction—for example 2½ becomes 2 ½. Also adds italic correction between the integer and the fraction.   * Looks ahead using `\futurelet` to add additional a hair space after the fraction if it is not already followed by white space (for example a period or comma). The implementation of this isn't quite right yet, however, as it fails to detect the space token if the next token is `}` and then space.   * A star version typesets the fraction using a horizontal bar instead of a diagonal solidus. Here is a comparison with three popular fraction styles: ![table](http://i.stack.imgur.com/RMb9B.png) And the same comparison in paragraph form: ![paragraphs](http://i.stack.imgur.com/DLqoQ.png) **Additional question** How can I fix `\textfrac*` so that the denominator and horizontal bar are shifted to the left when used inside of `\textsl` and `\textit`? ![rm sl it bf](http://i.stack.imgur.com/kVAko.png) Closer view: ![want](http://i.stack.imgur.com/trjAd.png) **Minimal working example**               \documentclass{article}     \usepackage{ifthen}    % for use in \textfrac          \makeatletter          % Add a hair space if the fraction is followed by a non-space token.     \newcommand{\textfrac@kern}{%       \ifx\textfrac@nexttoken\@sptoken%         %       \else%         \kern.08333em%       \fi%     }          % The non-star version of \textfrac uses a diagonal solidus.     \newcommand{\textfrac@nostar}[3][]{%       \mbox{%         \ifthenelse{\not\equal{#1}{}}%  Test for integer portion [optional #1]           {#1\/\kern.05em}%                 Present? Emit integer and hair space           {}%                             Not present? Emit nothing         \raisebox{.775ex}{\tiny #2}%    Emit numerator [#2]         \raisebox{.365ex}{\kern-.15em{\scriptsize /}\kern-.15em}%  Emit solidus         \raisebox{0ex}{\tiny #3}%       Emit denominator [#3]       }%       \futurelet\textfrac@nexttoken\textfrac@kern%     }          % The star version of \textfrac uses a horizontal rule.     \newlength\textfrac@width@num%     \newlength\textfrac@width@denom%     \newlength\textfrac@width@%     \newcommand{\textfrac@star}[3][]{%       \settowidth{\textfrac@width@num}{\tiny #2\/}%       \settowidth{\textfrac@width@denom}{\tiny #3\/}%       \ifthenelse{\lengthtest{\textfrac@width@num<\textfrac@width@denom}}%         {\let\textfrac@width@\textfrac@width@denom}%         {\let\textfrac@width@\textfrac@width@num}%       \mbox{%         \ifthenelse{\not\equal{#1}{}}%  Test for integer portion [optional #1]           {#1\/\kern.08333em}%              Present? Emit integer and hair space           {}%                             Not present? Emit nothing         \ooalign{%           \relax\cr%           \noalign{\vskip-1.1ex}%           {\hss\tiny #2\/\hss}\cr%        Emit numerator [#2]           \noalign{\vskip1.1ex}%           \rule[.6666ex]{\textfrac@width@}{.4pt}\cr%   Emit horizontal rule           \noalign{\vskip.4ex}%           {\hss\tiny #3\/\hss}\cr%        Emit denominator [#3]           \noalign{\vskip-.4ex}%         }%       }%       \let\textfrac@width\undefined%       \futurelet\textfrac@nexttoken\textfrac@kern%     }          % Select between \textfrac and \textfrac*.     \def\textfrac{\@ifstar\textfrac@star\textfrac@nostar}          \makeatother          \begin{document}          \noindent\textrm{\textfrac[2]{1}{2} cups\quad \textfrac*[2]{1}{2} cups\\}     \noindent\textit{\textfrac[2]{1}{2} cups\quad \textfrac*[2]{1}{2} cups\\}          \end{document}


title: Formula sheet with columns and equation breaking

text: I'd like to make a compact formula sheet with 3 page columns in landscape orientation. I prefer the equations to break at boundaries (semi-)automatically. Currently most of my equations are formatted as `equation`. I've read on equation splitting, but I still don't know how to combine it with page columns. Here's something I glued together:               \documentclass{article}     \usepackage{breqn}     \begin{document}     \begin{minipage}{0.45\textwidth}     \begin{dmath}       Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P(O \mid \lambda ) \sum_s \sum_m \sum_t             \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} \right| + \left(    \mathbf{o}_t - \hat{\mu}_m^{(s)} \right) ^T C_m^{(s)-1} \left(\mathbf{o}_t -   \hat{\mu}_m^{(s)}\right) \right)     \end{dmath}     \end{minipage}%     \hfill     \begin{minipage}{0.25\textwidth}     \begin{tabular}{|p{\textwidth}}     This is second part \\     $f(x) = 2x + 3y$ This line may go all along the end and wrap afterwards to the next as seen here\\     This is a forced next line by ending the previous line     \end{tabular}     \end{minipage}%     \hfill     \begin{minipage}{0.25\textwidth}     \begin{tabular}{|p{\textwidth}}     This is the third column.     \end{tabular}     \end{minipage}%     \end{document}      There are a couple problems:   * I'm getting underfull/overfull warnings.   * The equations are not broken up as nice as I'd like to in the first column.   * The second and third columns overlap.   * I'd like the separator lines go across the whole page.   * It's in portrait mode.


title: use BIBINPUTS to specify other location for .bib file

text: I'm trying to run bibtex from a different directory than my .bib file. According to the description in 'man bibtex', I should be able to set the envirorment variable BIBINPUTS to include the location of my .bib file. This is not working for me. What am I doing wrong?               $ # Mac OS X 10.7.4     $ bibtex -v     BibTeX 0.99d (TeX Live 2012)     kpathsea version 6.1.0     $BIBINPUTS=/path/to/directory     $bibtex mypaper     The style file: plain.bst     I couldn't open database file thesis.bib     ---line 62 of file mypaper.aux     : \bibdata{thesis     :                  }     I'm skipping whatever remains of this command     I found no database files---while reading file mypaper.aux     Warning--I didn't find a database entry for "Hamlet"     Warning--I didn't find a database entry for "SP"     Warning--I didn't find a database entry for "Lbook"     Warning--I didn't find a database entry for "companion"     Warning--I didn't find a database entry for "book"     Warning--I didn't find a database entry for "Metafont"      I am certain that `thesis.bib` exists in `/path/to/directory`. Is there any way I can verify directory `bibtex` is trying to read from?


title: Aligning a Table and a diagram in the same line

text: I wish to align a table and a diagram vertically on a line. Here is my code:               \begin{flushleft}     \begin{tabular}{l||c|r}                   & a & b \\     \hline     $q_0           & q_1 & q_0$ \\     $q_1           & q_1 & q_2$ \\     $q_2           & q_2 & q_2$     \end{tabular}     \end{flushleft}     \begin{flushright}     \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]        \node[state,initial,accepting] (q_0)   {$q_0$};        \node[state,accepting] (q_1) [above right=of q_0] {$q_1$};        \node[state] (q_2) [below right=of q_1] {$q_2$};         \path[->]         (q_0) edge  node {a} (q_1)               edge  [loop above] node {b} ()         (q_1) edge  node  {b} (q_2)               edge [loop above] node {a} ()         (q_2) edge [loop below] node {a,b} ();     \end{tikzpicture}     \end{flushright}      Currently, my output is as follows: ![enter image description here](http://i.stack.imgur.com/pIsTb.png)   1. How do I get the table and diagram to be aligned vertically? Thanks for all the help


title: Gym Workout log template in LaTeX

text: Can anyone suggest or, maybe, share their own gym workout logs created using LaTeX? Something like this, for instance. Template 1: From Builtlean Source ![enter image description here](http://i.stack.imgur.com/NlIPL.png) Template 2: From Builtlean Source ![enter image description here](http://i.stack.imgur.com/gVDei.png)


title: in PGFPlots, use meta data for markers?

text: Is there (I'm sure there must be) a way to use meta data for markers? I have something like the below:               Year              coeff        meta     2005               1.2183       o     2006               0.1073       star     2007               0.5629       square     2008               1.0168       diamond     2009               -4.4083      otimes      And I'd like a scatter plot that uses meta data for the markers. Thanks!


title: Using subfloat to place figures side by side

text: Hi am using the following code to place two figures side by side:               \usepackage{subfig}     \usepackage{graphicx}          %other part of code which compiles fine          \begin{figure}          \centering          \subfloat[][a]{\includegraphics{<figure1>}\label{<figure1>}}          \subfloat[][b]{\includegraphics{<figure2>}\label{<figure2>}}          \caption{Comparison of steady state results (a) x method (b) y method}          \label{steady_state}     \end{figure}          %remaining part      this gives me an error: `\subfloat` outside float. what would be incorrect in this ??


title: Merge PDFs, fix page numbering and compress

text: Say there is a book that has been split into several PDFs. I want to do two things:   1. Merge the PDFs and reduce the size of the resulting PDF.    2. Fix the page numbering. (1) can be done with `pdftk` or Ghostscript. For me, Ghostscript creates considerably smaller PDFs and is the only program (of the two) available on my PC. Example:               gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -q -sOutputFile=output.pdf input_1.pdf input_2.pdf [...] input_n.pdf      Why is (2) a problem at all? Because different books start counting page numbers on different pages whereas your PDF reader starts counting at page 1 if you don't do anything. This can be fixed with an empty document, the package `pdfpages`, `\setcounter`, and `\pagenumbering`. Example:               \documentclass{article}     \usepackage{pdfpages}     \usepackage{hyperref}     \begin{document}     \pagenumbering{Roman}     \setcounter{page}{4}     \includepdf[pages=-]{input_1_with_TOC.pdf}     \pagenumbering{arabic}     \includepdf[pages=-]{input_2.pdf}     \includepdf[pages=-]{input_3.pdf}     % ...     \end{document}      My problem is now: I want to fix the page numbering _and_ create a small PDF but calling pdflatex and then Ghostscript creates a PDF that is considerably bigger than a PDF that has been merged with Ghostscript. How do I create PDFs as small as with (1) while having (2)? EDIT: Forgot to add `hyperref` to the LaTeX code.


title: Unable to display citations using "plainnat" style

text: I noticed that it my document I get a "?" where the citation should be when using               \bibliographystyle{plainnat}      However, the numbers appear when I use               \bibliographystyle{apalike}      I have a preamble.tex file from a template which contains the following code related to bibliography               % *****************************************************************************     % *************************** Bibliography  and References ********************          %\usepackage{cleveref} %Referencing without need to explicitly state fig /table          % Add `custombib' in the document class option to use this section     \ifsetBib % True, Bibliography option is chosen in class options     \else % If custom bibliography style chosen then load bibstyle here             %\RequirePackage[square, sort, numbers, authoryear]{natbib} % CustomBib        \RequirePackage[round]{natbib} % CustomBib          % If you would like to use biblatex for your reference management, as opposed to the default     `natbibpackage` pass the option `custombib` in the document class. Comment out the previous     line to make sure you don't load the natbib package. Uncomment the following lines and spec    ify the location of references.bib file          % \RequirePackage[backend=biber, style=numeric-comp, citestyle=numeric, sorting=nty, natbib=    true]{biblatex}     % \bibliography{References/references} %Location of references.bib only for biblatex          \fi      I tried both including and not including "custombib" in the documentclass options but it didn't make a difference. My main file report.tex contains               \input{preamble}      to use preamble.tex. And then the bibliography is called as follows:               \bibliographystyle{plainnat} % use this to have URLs listed in References     \cleardoublepage     \bibliography{References/references} % Path to your References.bib file      I also made sure to delete the .aux, .bib, etc. (all the intermediate) files before recompiling. I am using vim-latex with the default compilation sequence to generate the PDF. Any thoughts on why the citations aren't showing up? Thanks!


title: renewcommand for bibliography numbers in each chapter

text: Update to code:               \documentclass[11pt,fleqn]{book}     \usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry} \usepackage{xcolor}     \definecolor{ocre}{RGB}{243,102,25}     \usepackage{avant}     \usepackage{mathptmx}     \usepackage{microtype}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{calc}          \usepackage[refsection=chapter,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}     \defbibheading{bibempty}{}     \usepackage{empheq}     \usepackage{calc}     \usepackage{makeidx}     \makeindex     \newcommand*{\refname}{Bibliography}     \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @book{book1,         address = {New York},         publisher = {John Wiley \& Sons},         author = {Egan, Willian F.},         title = {Phase-Lock Basics},         year = {1998},         %volume = {3},         %series = {2},         edition = {1},         pages = {3--4},         %month = {January}     }          @article{art1,         address = {City},         publisher = {Myself},         author = {Doe, John},         title = {Synthesizer Modulation},         year = {1979},         %volume = {14},         %number = {6},         %pages = {1--8},         month = {June}     }          @book{book2,         address = {New York},         publisher = {John Wiley \& Sons},         author = {Gardner, Floyd M.},         title = {Phaselock Techniques},         year = {2005},         %volume = {14},         %number = {6},         pages = {6--28},         %month = {June}     }          @book{book3,         address = {California},         publisher = {Benjamin/Cummings},         author = {Norman S.},         title = {Control Systems Engineering},         year = {1995},         %volume = {3},         %series = {2},         edition = {2},         pages = {231--232},         %month = {February}     }          @article{art2,         address = {Plantation},         publisher = {Myself},         author = {Me.},         title = {Lock Time Performance},         year = {1990},         %volume = {14},         %number = {6},         %pages = {1--8},         month = {June}     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          \chapter{Chapter 1}     Some  text \autocite{book1,art1}.               \section{Second}          Some  text \autocite{book2}.          Some  text \autocite{art1}.          Some  text \autocite{art2}.          Some  text \autocite{book2}.          \chapter*{Bibliography}     \addcontentsline{toc}{chapter}{\textcolor{ocre}{Bibliography}}     \section*{Books}     \addcontentsline{toc}{section}{Books}     \printbibliography[heading=bibempty,type=book,prefixnumbers={B}]     \section*{Articles}     \addcontentsline{toc}{section}{Articles}     \printbibliography[heading=bibempty,type=article,prefixnumbers={A}]          \chapter{Chapter 2}     Some  text \autocite{art1}     \chapter*{Bibliography}     \addcontentsline{toc}{chapter}{\textcolor{ocre}{Bibliography}}     \section*{Books}     \addcontentsline{toc}{section}{Books}     \printbibliography[heading=bibempty,type=book,prefixnumbers={B}]     \section*{Articles}     \addcontentsline{toc}{section}{Articles}     \printbibliography[heading=bibempty,type=article,prefixnumbers={A}]          \end{document}      but this is output that I get: ![enter image description here](http://i.stack.imgur.com/d9M3H.png) instead of B1, B2...then A1, A2... How do I get consecutive numbering for Books, then restart the number to get consecutive numbering for Articles?


title: How to make a two bar duevolte?

text: How do I make a duevolte that repeats the two preceding bars, with a double diagonal line and a big "2" above it, like the right one in this image: ![enter image description here](http://i.stack.imgur.com/0hvCp.png) The left one is `\duevolte`, but I can't figure out how to get the right one... As requested, a minimal working example:               \documentclass[a4paper,oneside]{article}          \usepackage{musixtex}     \input musixper          \begin{document}          \begin{music}     \setclefsymbol1{}\nostartrule\nobarnumbers\parindent0pt     \startpiece\addspace\afterruleskip     \Notes\qu{jjjj}\en\bar     \Notes\duevolte\en     \endpiece     \end{music}          \end{document}


title: Keep float out of a environment (for example definitions)

text: I knew that floats float around and sometimes are placed far away from where one wants them to be. With the times I learned to work with it, and there are already many posts about it. I have a kind of different problem. I'm writing my bachelor thesis and defined some environments for definitions and such. And of course I'm using floats as well. But now I have the problem that one of my floats are placed in one of my definitions. This is of course something I really don't want to have. If some of the floats are one page after or before they are referenced, that is ok, but having them in my definitions is no option. I don't know how to create a MWE for this without posting my whole thesis, but this is as close as I can get:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{blindtext}     \usepackage{graphicx}          \newenvironment{myblock}{%     \vspace{.5\baselineskip}     \hrule\nopagebreak\vspace{.35\baselineskip}\nopagebreak}     {\nopagebreak\vspace{.5\baselineskip}\nopagebreak\hrule\vspace{.5 \baselineskip}\noindent}          \newcounter{definition}[section]     \renewcommand*\thedefinition{\thesection.\arabic{definition}}     \newenvironment{definition}{%     \refstepcounter{definition}     \begin{myblock}     \noindent\textbf{Definition \thedefinition}     }     {\end{myblock}}          \begin{document}     \Blindtext     \section{MWE}     \begin{definition}     \blindtext     \end{definition}     \begin{figure}     \includegraphics[scale=.5]{lorem}     \end{figure}     \Blindtext     \end{document}      This is the picture I used for this example. ![The pciture I used in the MWE](http://i.stack.imgur.com/pvLIR.jpg) Well in this example the picture isn't placed that bad, but in my thesis it is placed inside the definition environment. So my real question is, how can I keep the figure out of that environemnt? PS: If you see any problems with my definition environment that is not related to this question, please let me know. I'm always happy to learn something new.


title: Pushing \qed to the right within a displayed formula

text: In my own custom theorem environment, I'm using the `\qed` command to create a white box. This works wonderfully when the theorem ends with a regular paragraph -- the box is pushed to the right where it should be. Note that I just type out the `\qed` manually whenever I need it. It works fine. I don't need it automated. However, if I use this command when the theorem ends with displayed mathmode, the box is just put there right beside the formula -- it is not pushed to the right. How can I accomplish that?


title: How to do a shift/offset of ycomb or ybar **in y-direction** without stacking in pgfplots?

text: I am looking for a way to shift the reference bars in an XRD plot in order to be able to compare two or more plots in the same axis environment but have the references only where they apply.   This should be equivalent to the existing bar shift key but in the direction of the bar plot, e.g. an easy way of adjusting the minimum value of the bar plot or the ycomb. My minimum example contains two analysis plots and the references which are just coordinates in a different text file. I would want to shift the purple one upwards to the second plot. This is what it looks like now: ![MWE_ycomb](http://i.stack.imgur.com/F8rub.png).               \documentclass[]{article}          \usepackage{textcomp}     \usepackage{chemmacros}          % % % Plotting % % %     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usetikzlibrary{plotmarks}     \pgfplotsset{compat=1.10}          \begin{document}              \begin{figure}[htb]             \centering                 \begin{tikzpicture}                     \begin{axis}[                     width = 14 cm,                     height = 6 cm,                     xlabel={2$\theta$ (\textdegree)},                     axis x line=bottom,                     ylabel={intensity (a.\,u.)},                     axis y line=left,                     tick align=outside,                     xmin=10,                     xmax=80,                     ymin=0,                     yticklabels= ,                     scaled ticks=false,                     ]                                % XRD             \axispath\draw  (500,500) node[anchor=west, green!60!black] {\footnotesize{\ch{La2CuO4} (\#80-0579)}}             (500,450) node[anchor=west, purple] {\footnotesize{\ch{La2O2CO3} (\#48-1113)}}             (0,80) node[anchor=west, black] {\footnotesize{LCO}}             (0,500) node[anchor=west, black] {\footnotesize{post-test}};                  %\addplot[black, solid, mark=none] table[header=false, x index={0}, y expr=\thisrowno{1}, skip first n={53}] {fresh.uxd};  % only necessary for the real plots             %\addplot[black, solid, mark=none] table[header=false, x index={0}, y expr=\thisrowno{1}+3000, skip first n={53}] {pt.uxd}; % only necessary for the real plots                  % references: PDF files             \addplot[ybar,bar width=0.01pt,green!60!black, fill=green!60!black, ybar legend] table[header=false, x index={0}, y expr=\thisrowno{1}*1.1, skip first n={1}] {01-080-0579_La2CuO4_PDF.dat};                  \addplot+[ycomb, solid, mark={}, mark options={purple}, purple] table[header=false, x index={0}, y expr=\thisrowno{1}*4, skip first n={1}] {00-048-1113_La2O2CO3_PDF.dat};  % , yshift=4000, only works in x direction...             %\addplot[ybar, bar width=0.01pt, purple, fill=purple, ybar legend] table[header=false, x index={0}, y expr=\thisrowno{1}*5, skip first n={1}] {\PfadXRD 00-048-1113_La2O2CO3_PDF.dat}; % bar shift=300pt, only works in x direction...             %\addlegendentry[purple]{\ch{La2O2CO3} \footnotesize{(\#48-1113)}}                          \end{axis}                 \end{tikzpicture}             \label{fig:XRD_MWE}         \end{figure}          \end{document}      Is there any way to achieve this that I have overlooked? edit2: I took down the data files since Jake wholly answered the question and removed the corresponding inactive links from the thread.


title: Built arguments not getting properly passed

text: I've got some rather complicated arguments that I must build gradually and then pass to another macro. The MWE is greatly simplified. Here's my attempt using `expl3`. The problem is that no matter how I try `\exp_args:....` (whether `NnV`, `Nno`, `Nnx`) the expansion is not happening as I expect.               \documentclass{article}     \usepackage{xparse}     \ExplSyntaxOn     \tl_new:N \l_aepoly_arguments_tl     \NewDocumentCommand\macroA{ mmmm }       {         \tl_set:Nx \l_aepoly_arguments_tl           {             {\fp_eval:n { #1*#3 }}             {\fp_eval:n { #1*#4 + #2*#3 }}             {\fp_eval:n { #2*#4}}           }         \iow_term:x {===> \l_aepoly_arguments_tl }         \exp_args:NnV \_aepoly_parse:nnnn {SIMPLIFIED} \l_aepoly_arguments_tl       }          \NewDocumentCommand\macroB{ mmmm }       {         \_aepoly_parse:nnnn {#1}{#2}{#3}{#4}       }          \cs_new:Npn \_aepoly_parse:nnnn #1#2#3#4 {       %% something elaborate, but below will suffic for MWE       \iow_term:n {===>(#1)[#2][#3][#4]}       \fbox{#1} $\rightarrow #2x^2 + #3x + #4$     }          \ExplSyntaxOff     \pagestyle{empty}     \begin{document}          \macroB{Poly}{3}{4}{5}          \macroA{2}{3}{5}{2}     {NOT}{THIS}          \end{document}      If I were to have written this without `expl3` I would have done something along the following lines which work as I expect.               \documentclass{article}     \makeatletter          \def\aetypeout#1{\typeout{===>#1}}          \newcommand\macroA[4]{%%       \def\ae@tmp@A{%%           {\number\numexpr #1*#3\relax}%%           {\number\numexpr #1*#4 + #2*#3\relax}%%           {\number\numexpr #2*#4\relax}}%%       \expandafter\aetypeout\expandafter{\l_aepoly_arguments_tl}%%       \def\ae@tmp@B{{SIMPLIFIED}}%%       \expandafter\ae@parse\expandafter\ae@tmp@B\ae@tmp@A     }          \newcommand\macroB[4]{\ae@parse{#1}{#2}{#3}{4}}          \def\ae@parse#1#2#3#4{%%       \typeout {===>(#1)[#2][#3][#4]}%%       \fbox{#1} $\rightarrow #2x^2 + #3x + #4$%%     }            \makeatother          \begin{document}          \macroB{Poly}{3}{4}{5}          \macroA{2}{3}{5}{2}     {NOT}{THIS}          \end{document}      The advantage of the `expl3` is its ability to handle better arithmetic (among other things). I know I could have saved each part of the argument to a token list and then create a variant of `\_aepoly_parse:nnnn` such as `\_aepoly_parse:nVVV`. But currently that would overly complicate things for the document I'm actually working on.


title: How to construct a coloured box with rounded corners

text: Here is the specs of the box.   1. Color of the bar rule should be:              \definecolor{mycolor}{rgb}{0.122, 0.435, 0.698}        2. Radius of the 4 corners of the box: `4pt`   3. Thick line = `0.5pt`   4. Text should be `6pt` indention on all sides


title: Anchoring TiKZ pics

text: Is it possible to anchor a `TiKZ-pic` on an internal anchor? I know (more or less) how to use `TiKZ pics` and know that they are draw arround their origin. What I would like to be sure is that it's not possible to use another internal coordinate as origin. As an example consider next code.               \tikzset{         mytest/.pic = {              \node  (-A) at (0,0) {A};              \node  (-B) at (0,1) {B};                  \node[fit=(-A) (-B),draw] (-C) {};         }     }      It defines a pic with three nodes: `A`, `B` and `C` being `A.center` the `pic` origin. A command like               \draw pic (T) at (2,1) {mytest};      draws the pic with `A.center` at `(2,1)`. Now, I would like to draw this `pic` but selecting `B.center` (or any other internal anchor like `C.120`) as anchoring (pic-origin) point. Is it possible? In case you needed, there is some complete code:               \documentclass[tikz,border=2mm]{standalone}     \usetikzlibrary{fit}          \tikzset{         mytest/.pic = {              \node  (-A) at (0,0) {A};              \node  (-B) at (0,1) {B};                  \node[fit=(-A) (-B),draw] (-C) {};         }     }          \begin{document}     \begin{tikzpicture}          \draw[blue!20] (0,0) grid (3,3);          \draw pic (S) at (0,0) {mytest};          \draw pic (T) at (2,1) {mytest};          \draw (S-A.north) to [out=90,in=-90] (T-B.south);          \end{tikzpicture}     \end{document}      Question updates:   * I would like a general solution. For this particular case I know that node `B.center` is `1cm` above `A.center` and it's easy to shift the whole picture, but it's more difficult to shitf it if the origin must be at `C.120` or `C.100-|B.35`. Consider also some `pic` with variable size nodes.   * The example is just an example. I'm not trying to solve a particular problem. The question is more ... conceptual(?).    * The answer could be `no, it's not possible`. But, please, with some explanation as I always ask to my students ;-)


title: How does \path, and the like, parse its argument?

text: I'm really curious whether someone would care to take the time to explain how to create macros which work similar to some of the macros in the `pgf/TiKz` bundle. What I'm particularly interested in is how to create a command that works as               \<csname> <content> [bare word directive] <more content>;      To make clear what I mean, I'm referring to how `\path` and `\draw` (among others) are parsed and can contain _bare word_ commands such as `node` and `edge` as illustrated below:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}     \begin{document}          \begin{tikzpicture}       \path[blue] node (B) at (0,3) {CORNER} edge [->] (0,0) edge [->] (2,4);       \draw  (0,0) -- (2,4) node [midway] {HELLO} edge [->] (B);       \draw  (2,4) -- (4,2) edge [->] (B)         node [midway] {HELLO} ;     \end{tikzpicture}          \end{document}      What I'm **not** interested in is how `node` knows what to work with or how `edge` knows where to draw to and from. Instead, what I'm curious is how does `LaTeX` wind up seeing the bare word `node` as, _essentially_ , a further command, and likewise with `edge`. So this is a question about parsing arguments and interpreting the content of those arguments. I've dug through quite a bit of the `tikz.code.tex` and other files trying to figure out how this parsing is achieved, but I very quickly get lost in the code. I can't even get something so simple as the following to work:               \documentclass{article}     \makeatletter          \newcommand\hello{Hello World!}     \newcommand\ciao{ciao?}     \newcommand\secretmessage{\ae@message}     \def\ae@message(#1)#2;{%%       \def\ae@continue{}%%       \hspace{1em}\emph{#1}%%       \expandafter\ifx\expandafter\relax\detokenize\expandafter{#2}\relax       \else         \def\ae@continue{\ae@parse #2 ;}%%       \fi       \ae@continue       \def\ae@continue{}%%       }     \def\ae@parse#1 ;{\typeout{===>"#1"}\csname#1\endcsname}     \def\ae@trim#1{\ignorespaces#1\unskip}          \makeatother     \setlength\parskip{2ex}     \setlength\parindent{0pt}     \begin{document}          \secretmessage(This is my message.);          \secretmessage(This is my message.) hello;          \secretmessage(This is my message.) ciao;          \secretmessage(This is my message.);          The above should have been interpreted as equivalent to:          \secretmessage(This is my message.);          \secretmessage(This is my message.); \hello          \secretmessage(This is my message.); \ciao          \secretmessage(This is my message.);          \end{document}      ![enter image description here](http://i.stack.imgur.com/eXqAC.png) I can't begin to figure out how to get the spaces out of the above without creating horrible cludges like                \csname\space hello\endcsname      Though I would really like to be able to do something more complicated like:               \secretmessage(This is my message.) hello ciao;      which should effectively be interpreted to               \secretmessage(This is my message.); \hello\space \ciao      Though I strongly suspect that without the aid of further arguments to either `hello` or `ciao` such adjacent bare word directives are unlikely to get parsed correctly without an extreme amount of work.


title: How can I draw this reservoir diagram with TikZ?

text: I am trying to draw the diagram below in Tikz. I have been unable to do so, I need the minimalist and a 3D representation. ![Mixing Problem unequal flow rates](http://i.stack.imgur.com/RmceF.png)


title: squared bracketed citation in references list

text: I'm using `\usepackage[backend=biber,style=authoryear]{biblatex}` in my document followed by square brackets and full hyperlink which gives me this in the document `[MacRae and Pattison 2002]` and this in the references               MacRae, K. and J. Pattison (2002). “Home chemotherapy.” In: Nursing Times 98.35, pp. 34–35.      How can I get it so that I also have the same squared-bracketed citation in the references please?


title: I want to write a letter in Hindi

text: I want to write a letter in Hindi. I want to use mikTeX to create the PDF document in Hindi. I don't want to have transliteration from English to Hindi. How can I do this?


title: beamer: suppress frames in handout mode gives spurios inclusion

text: While making lecture slides with _XeTeX_ & _beamer_ I stumbled across a problem with the exclusion of certain slides in handout mode. Since this appears to be spurious I have difficulties in providing a minimal code example right now. I have one slide contents in a separate file, which contains a list of `\onslide<i>{}` points. I include this file several times in order to go through the list step by step intermixing it with other slides on the _beamer_. On the _handout_ on the other hand I only want to show the full list once.               \begin{frame}<beamer:1-3>{title}  % should appear both on the beamer and in the handout       \input{external_file}     \end{frame}          \begin{frame}{other title}        % beamer & handout       \input{other_external_file}     \end{frame}          \begin{frame}<beamer:4-6| handout:0>{title}   % on beamer only       \input{external_file}     \end{frame}      What happens if I do it like this, is that contents from the suppressed frame suddenly appears two slides later down the road on the handouts. I have been using _beamer_ for several years and many lectures by now - am I missing something here? Some (stupid) mistake from my side?


title: How to align tabular to the top of the side-by-side minipage?

text: How do I align the table with contact info to the top of the page? My best try is this:               \documentclass[draft]{article}          \renewcommand{\familydefault}{\sfdefault}          \usepackage[showframe,margin=3cm]{geometry}     \usepackage{blindtext,booktabs,cmap,hyperref,multirow,tabularx}     \usepackage[T2A]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \setlength\parindent{0pt}          \begin{document}          \pagestyle{empty}          %{\bfseries\LARGE Egor Tensin}\\     %\begin{flushright}     %\end{flushright}          \begin{minipage}[t]{.4\textwidth}     {\bfseries\LARGE John Smith}\\     \blindtext     \end{minipage}     \hfill     \begin{minipage}[t]{.5\textwidth}     \begin{tabular}[t]{>{\itshape}rl}     \toprule     Email:& \href{mailto:John.Smith@gmail.com}{\ttfamily John.Smith@gmail.com} \\     \midrule     Tel.:& +0\,(000)\,00-00-000 \\     \midrule     Address:& 221B Baker Street \\     & London, England \\     \bottomrule     \end{tabular}\\     \blindtext[2]     \end{minipage}          \end{document}      and see how the `tabular` is aligned to the bottom of the "John Smith" line? How do I align it to the top of the `minipage`?


title: Space before section titles with twocolumns and sections that cross both columns

text: I'm writing a document in twocolumn mode, but I am starting pages with sections with some long titles that I'm trying to spread over both columns. The vertical space before subsequent section titles seems to be reduced compared to normal. The following example illustrates what is happening.               \documentclass[twocolumn]{article}          \begin{document}          \twocolumn[\section{A very very very very very long title}]          The paragraph is then followed by somewhat reduced space before:          \subsection{The subsection}          aaaa          \end{document}      (Compare with the vertical space before the `\subsection` if I replace the line beginning `\twocolumn` with a simple `\section{Short title}`.) What is the correct way to attempt to do what I'm doing? I wasn't sure whether the `multicol` package would help - since I wanted the twocolumn setup to cover the whole document, it didn't quite feel right structurally to have twocolumn environments sprinkled liberally throughout the document. (Finally, I'm using (pdf)LaTeX, so please no LuaLaTeX or XeTeX answers please! :-) )


title: Adding dashed line below element in matrix

text: Consider the following code:               \documentclass[12pt]{article}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{pdfpages}     \usepackage{easybmat}     \title{Test}     \author{Bob}     \date{}     \begin{document}     \maketitle           $\left[\begin{BMAT}(@){c}{c.c.c}     X_1 \\ X_2 \\ X_3     \end{BMAT}\right]$     \end{document}      This adds a dashed line below X_1 and a dashed line below X_2. I only want a dashed line below X_2. How would I fix this?


title: How to select conditional text?

text: I've three variable statements :   * Statement1 = You are Great Student.    * Statement2 = You are average Student.    * Statement3 = You Need improvement on list of topics mentioned below. In the report card for student, I want to show one of this statement based on marks scored by the student [I'm reading marks from external csv file as `\markscore`]   * If value of `\markscore` is greater than or equal to 90 i want to print Statement1   * If value of `\markscore` is greater than or equal to 80 but less than 90 i want to print Statement2   * Else I want to print Statement3 in the report card. Can you please suggest latex package to print statements conditionally?


title: Keep margins in latex when using inline maths equations for small equations

text: So say I have the following paragraph               \documentclass[12pt]{article}     \usepackage{amsmath}          \begin{document}     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $\hat{\sigma}_w(kn)$ Here are some other random words in order to show where the margins should be. I'll switch to lorem ipsum now. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque in diam ipsum. Vestibulum pretium orci eu dui dictum suscipit. Proin suscipit consectetur risus in placerat. Donec id interdum diam. Donec eleifend non justo in fermentum. Nullam varius feugiat ipsum, in fringilla magna vehicula consequat. Pellentesque ut arcu bibendum, pulvinar neque semper, tincidunt eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam erat volutpat. Proin eget placerat ipsum. Proin pharetra velit turpis, a condimentum dui scelerisque quis. Vestibulum consequat libero vel odio auctor mattis. Quisque ipsum nulla, sagittis at sagittis eget, convallis a odio. Suspendisse potenti.     \end{document}      When looking at this document in a PDF we see the following: ![Bad Margins](http://i.stack.imgur.com/PdbCH.png) How do I fix this so that the margins are enforced? It seems like latex _should_ be pushing the equation down to the next line, but for some reason it's not. It's a super small equation so it really doesn't make sense to create a whole new line for something that tiny. I can't seem to find any parameters that force this to squeeze into its current line (which currently can't happen since I'm using just xxxxx...xxxx, but technically my actual code has words in front of it so it 'could' squeeze if it wanted) and/or fall to the next line. I've already tried writing the equation like this:               ${\hat{\sigma}_w(kn)}$      (added {}) but that didn't seem to change anything. I can't seem to find anything in the documentation that would fix this issue. Anyone have thoughts?


title: Fancy Labels for Tables

text: I am trying to draw relational database tables with `tabular`. I would like to label each table with a label at the top left of the table. Neither solution that comes to my mind is exactly what I want. I would like a rectangular label with the following properties:   * Border width is same as that of table   * Left border aligns with left border of table   * Bottom border overlaps top border of table   * Width is less than column width of table In the first solution, I use `Tikz` and try to draw the label as a rectangular node. I can never quite get the bottom border of the label to overlap the top border of the table. Nor can I get the left border to align with that of the table. In the second solution, I use `multicolumn`. This comes very close, the only problem remaining is the width.               \documentclass[a4paper]{article}          \usepackage{tikz}     \usetikzlibrary{calc, positioning}          \begin{document}          \begin{tikzpicture}          \node (A) {     \begin{tabular}{|l|l|l|||l|}     \hline     $\texttt{o\_orderkey}$ & $\texttt{o\_orderdate}$ & $\texttt{o\_custkey}$ & rest \\     \hline     0 & 1992-01-01   & 100 & A \\     1 & 1992-01-15   & 3 & B \\      200 & 1993-01-01 & 26 & C \\     201 & 1993-01-15 & 42 & D \\     300 & 1994-01-01 & 88 & E \\     301 & 1994-01-01 & 74 & F \\     \hline     \end{tabular}     };          \node[draw, anchor=south west, inner sep=2pt] at (A.north west) {Table};          \end{tikzpicture}          \begin{tabular}{|l|l|l|||l|}     \cline{1-1} \multicolumn{1}{|l|}{Label} \\     \hline     $\texttt{o\_orderkey}$ & $\texttt{o\_orderdate}$ & $\texttt{o\_custkey}$ & rest \\     \hline     0 & 1992-01-01   & 100 & A \\     1 & 1992-01-15   & 3 & B \\      200 & 1993-01-01 & 26 & C \\     201 & 1993-01-15 & 42 & D \\     300 & 1994-01-01 & 88 & E \\     301 & 1994-01-01 & 74 & F \\     \hline     \end{tabular}          \end{document}      ![Tables](http://i.stack.imgur.com/u30dY.png)


title: Why doesn't \vDash work?

text: I am trying to set some logical expressions, but unfortunately I cant get the command `\vDash` working. What am I missing?               \documentclass[10pt,twoside]{memoir}     \usepackage[english,german]{babel}     \usepackage{polyglossia} % Vgl. http://tex.stackexchange.com/questions/135185     \setmainlanguage[spelling=old,babelshorthands=true,script=latin]{english}     \usepackage{fontspec}     \setmainfont[Numbers={OldStyle},Ligatures={Common, Historic}]{Adobe Garamond Pro}     \usepackage{mathtools}     \begin{document}          \begin{english}          $ A,\neg A \vDash B $          \end{english}     \end{document}


title: What generically CANNOT be compiled inside an equation environment?

text: Certain macros or whole environments which are themselves not equations, like whole tikz diagrams can be placed in the equation environment and compile. For example Diagram displayed as an equation Some other objects, like text generated by macros, apparently General way to split a line by a rule of thumb and displaying results, cause the equation environment to not compile. There are quite a few of them. 1) Is there some particular kind of macro (due to its structure or use of particular symbols...) that cannot be compiled inside an equation environment? 2) If a given macro does cause (1)-type problems, are there one or more environments (call them E*) which a) each by itself can be (placed inside and) compiled inside the equation environment, b) E* does not much change the output of what is placed inside of E*, and c) E* can have a macro using symbols or structure (1) that crash the equation environment but not E* placed inside of it and then have E* placed inside the equation environment and compile? [I observe generally that, for example, tikzpicture does compile always inside the equation environment for every (1)-type macro placed inside _it_ but tikpicture is not a (2)-type environment, because the only thing printed in such cases inside the equation environment with the tikzpicture in it with the macro in it is an empty line that is numbered, so tikzpicture for example is a) and c) but not b) for obvious reasons. Does a (2)-type environment exist? I would imagine it would have to output an image which is treated as such and then loaded as a picture if the macros used otherwise do not compile inside the equation environment. Oh, yes, custom counters that replicate the equation functionality and center whatever is displayed are easy to make, and can replace equation mode, but journals typically dislike that sort of adhoc solution.]


title: Understanding the linebreak at the beginning of itemize

text: I have a fundamental problem in understand how latex is typesetting documents. Consider my code               \documentclass{article}     \usepackage[margin = 0.75in]{geometry}     \begin{document}          \section*{ABC}     abc     \section*{ABC}     \begin{itemize}         \item abc     \end{itemize}     \textbf{ABC}\\     abc\\       \textbf{ABC}\\     \begin{itemize}         \item abc     \end{itemize}     \end{document}            The output it produces is :-   ![latex-out](http://i.stack.imgur.com/Uocwh.png) Now this is fundamentally problematic. When I changed               \section*{ABC}      abc      to               \section*{ABC}     \begin{itemize}         \item abc     \end{itemize}      then only the abc got a bullet beside it without any changes in formatting. However, when i do the same operation after a new line , as in the code               \textbf{ABC}\\     abc\\       \textbf{ABC}\\     \begin{itemize}         \item abc     \end{itemize}      then for some reason the itemize is adding a new line before rendering the list. Why?


title: LaTeX contents page: hiding specific page numbers automatically

text: Is it possible to have a contents page in LaTeX that doesn't show a page number of a particular subsection, if the one immediately before it shares the same page number? e.g. If there are 3 subsections on the same page, is it possible in the contents page to show the page number only at the 1st line? I'm also using the titletoc package in a way similar to the following:               \documentclass{article}          \usepackage{titletoc}     \titlecontents{section}[0pt]{\thecontentspage\quad\thecontentslabel\quad}{}{}{}     \titlecontents{subsection}[0pt]{\thecontentspage\quad\thecontentslabel\quad}{}{}{}     \titlecontents{subsubsection}[0pt]{\thecontentspage\quad\thecontentslabel\quad}{}{}{}          \begin{document}          \tableofcontents          \section{FIRST}     \subsection{FIRST first}     \subsection{FIRST third}     \newpage     \subsubsection{FIRST third b}     \section{SECOND}     \subsection{SECOND first}          \end{document}      It doesn't include dots and shows the page numbers to the left of the section/subsection/subsubsection numbers.


title: Powerdot cannot be compiled under xelatex; how to solve it?

text: I use Tex Live 2011 and test a simple example:               \documentclass{powerdot}     \begin{document}     \begin{slide}{a slide}     Contents of the slide.     \end{slide}     \section{first section}     \begin{slide}{another slide}     Contents of the slide.     \end{slide}     \begin{note}{personal note}     The note. \end{note}     \section{the end}     \end{document}      I can compile it using the compilation sequence: `latex`->`dvips`->`pstopdf`, but I can't compile it under `xelatex`. The error is               l.3932 \ProcessKeyvalOptions{Hyp}      How can this be solved?


title: METAFONT can not find d7seg.mf

text: I write a simple file (T.tex):               % T.tex     \documentclass{paper}          \newfont{\dviiseg}{d7seg scaled 1200}          \begin{document}         $\mbox{\dviiseg{c}}(c)$     \end{document}      then I put the d7seg.mf to the current directory. but miktex-mf.exe says:               Running miktex-mf.exe...          This is METAFONT, Version 2.718281 (MiKTeX 2.9)     ! I can't find file `d7seg'.      ... \mag:=magstep(1.0);nonstopmode;input d7seg          Please type another input file name          ! Emergency stop.           ... \mag:=magstep(1.0);nonstopmode;input d7seg          Transcript written on mfput.log.      My os is win7, and T.tex can not obtain output. BTW: When I run it in my laptop(XP + MikTeX 2.7), T.tex can obtain output pdf file.


title: Convert eps images to b/w

text: In Windows XP, I would like to convert a coloured .eps to black and white. If, instead of converting the .eps, I could do it for the resulting .dvi document which contains the .eps I would still be happy. Is there an easy way to do this, perhaps along with the dvips or the eps2eps commands? Any other simple way would also be appreciated of course.


title: Where to start typesetting chess with TeX

text: I noticed that there are already a few questions about typesetting chess but I have two very basic ones:   1. What are currently the "best" packages to typeset chess diagrams and game scores with comments?   2. Are any of these already included in TeXShop?


title: Larger font size in math display equation environment?

text: Consider the following MWE:               \documentclass[a4paper,12pt]{article}     \usepackage{amsmath}     \usepackage{graphicx} % \scalebox     % defaults seem to be: pslatex.sty:103: \DeclareMathSizes{12}{12}{9}{7}     % NB: Font shape `OML/cmm/m/it' in size <16> not available, size <17.28> substituted on input line 6.     % \DeclareMathSizes{12}{17.28}{9}{7} % (a)     \begin{document}     Here I'll be trying a small example... First, I am writing an inline equation here: $a + b$; also comparing plain number 123 vs. $123$ as inline equation -- and here, below, I'm using display equation:          \begin{equation}%     % \large % (b)     % \scalebox{1.5}{ % (c)     f(y) = a \cdot k^{y} %     % } % (c)     \end{equation}          ... and finally, I'm having a closing sentence, just to have some text after the display equation.          \end{document}          % # convert -density 150 test.pdf -crop 846x329+196+251 test_.png      Now - compiled as is, the output produced is: ![test_01](http://i.stack.imgur.com/Ndxqv.png) That is the default output, and I'd like to change (in this case, increase/make larger) _only_ the display equation's - the one in the `equation` environment - font size. So, if I uncomment only statement `(a)` (with `\DeclareMathSizes`), I get this: ![test_01a](http://i.stack.imgur.com/8ZLyV.png) The display equation size changed, and the equation numbering didn't, which is good - but the inline equations also changed size, which I don't want. Then, if I uncomment only statement `(b)` from the posted MWE (with `\large`), I get: ![test_01b](http://i.stack.imgur.com/wZIve.png) The display equation size changed, and the inline equations didn't, which is good - but also the equation numbering changed size, which I don't want. Finally, if I uncomment only statement `(c)` from the posted MWE (with `\scalebox` and its closure) - I cannot even compile the MWE, as it fails with:               ! Missing $ inserted.     <inserted text>                      $     l.14 }            % (c)     ? X     No pages of output.     Transcript written on test.log.      So, how could I change _only_ the math display equation font size? If there is a different approach for "case-by-case" (e.g. in individual `equation` blocks) setting, vs. a global setting (per document), that would be nice to know too.


I tried to cut all the unnecessary text and it all boils down to this: the following file does compile if I comment the \usepackage[mac]{inputenc} line.               \documentclass{frontiersSCNS}     \def\journal{Bioengineering}     \def\firstAuthorLast{Sample {et~al.}}     \usepackage[mac]{inputenc}     \begin{document}     a     \end{document}      However, with that line, the result is               Latex error: Option clash for package inputenc          \begin           {document}      It must be something trivial, but I have no idea what is happening and how to solve it. Can anyone help me?


title: How to use a command-line tool to extract a bibtex reference that contains a search term?

text: I'd like to be able to use a tool like `grep` to extract an entire bibtex reference rather than just the matching line. For example, `grep Smith mydatabase.bib` would return lines that contain the word `Smith`. I'd like to have a command-line program that returned the entire bibtex reference that encloses the word `Smith`.   * How can this be done on the command-line? In particular, I'd be interested in whether there is a way of using `sed` or `awk` to perform the task?


title: How to use 'makeglossaries'?

text: I try to make a glossary with the glossaries package. I understand that I have to run `makeglossaries` to display the glossary. (according to this link: "Processing the file will have to include a call to `makeglossaries` followed by at least one more invocation of `latex`.") How do I run `makeglossaries` on MikTeX (Win 7)? Some guides say I should put some commandline in the makefile. What is the makefile? seriously, I've googled this, but can't find any simple explanation. Do I need to do this?


title: Vim call Tex_ViewLaTeX() function not doing anything

text: I am running gvim7.4 on windows 7 and I am able to compile tex documents and view the pdf manually, but the \lv command does not return anything. The tex file has no corruptions (I can run it with TeXworks for example). I am using SumatraPDF. The following is my _vimrc:               > filetype plugin on     >      > set grepprg=grep\ -nH\ $*     >      > filetype indent on     >      > let g:tex_flavor='latex'     >      > let g:Tex_DefaultTargetFormat = 'pdf'      Here are some things I have tried.   1. Moved SumatraPDF to C:.   2. Edited PATH to include SumatraPDF.   3. Added:  `g:Tex_ViewRule_pdf= "path to sumatrapdf"` To my _vimrc. None of the above have caused the `call Tex_ViewLaTeX()` function to return anything. Also, this is my first time using Vim so I would appreciate it if the solution to this problem contained precise steps.


title: Drawing an echo state network

text: I've already asked a question for drawing nodes in ring form but this one here seems to be much more sophisticated. Is there an "easy way" to draw such a network in LaTeX? ![enter image description here](http://i.stack.imgur.com/DjwkB.png) It does not have to look like this but it should resemble the illustration.


title: How do I change the footnote style of \thanks to a letter?

text: I need to have a lowercase superscript letter for the footnote for the author, that is, I need the `\thanks` command to have footnote `a` as opposed to `*`. I'm assuming that I either need to use an option in the `\thanks` command or redefine footnote and then use `\footnote`. I've made various attempts but so far have had no luck. My document class is `article`.


title: Environment definitions with arguments in \enddef

text: I was hoping to create a custom proof environment where along with the qed symbol it also mentions what was the claim that was proved. I thought the following would work:               \newenvironment{myproof}[1]%     {\vspace{1ex}\noindent{\em Pf.}\hspace{0.5em}}%     {\hfill{\tiny \qed (#1)}\vspace{1ex}}      I thought `\begin{myproof}{Claim 42} ..\end{myproof}` would work but it doesn't. After some googling I figured that it was because the argument is not passed on to `\endmyproof`. Is there any fix to this? Or is this just bad TeX? PS: FWIW, I was writing down a proof and had a small claim inside. The QED on the claim was a bit misleading that the proof of the Theorem was done. So this seemed like a natural(?) thing to do.


title: Why does \usepackage{Sweave} change table width?

text: Recently is has been indicated (Why could \usepackage{Sweave} be affecting my graphics scaling?) that adding `\usepackage{Sweave}` to your preamble might change the width of your graphics. Peter solved this issue by noting that adding the _nogin_ parameter prevents this (`\usepackage[nogin]{Sweave`}). However, `\usepackage{Sweave}` also seems to affect table width. Adding the _nogin_ parameter does not solve this issue. I have checked the `Sweave.sty` file (located in your R folder `R/share/texmf/tex/latex/Sweave.sty`) but could not find a link to table layout. Is there a way around this or can we prevent this? My apologies for the lack of a reproducible example. I have however tried different syntax to construct tables but ended up with the same result.


title: Achieving multicolumn like this

text: I wan to achieve multi-column like shown below: ![alt text](http://i.stack.imgur.com/f8OsD.png) But the only thing I can get is: ![alt text](http://i.stack.imgur.com/KQJ2u.png) With the code below:               {\LARGE Albert Einstein}\\[1cm]      Institute for Advanced Study\\     Einstein Drive\\     Princeton, N.J. \texttt{08540}     U.S.A.\\[.2cm]     Phone: \texttt{609-734-8000}\\     Fax: \texttt{609-924-8399}\\[.2cm]     email: \href{mailto:a.einstein@ias.edu}{a.einstein@ias.edu}\\     \textsc{url}: \href{http://www.ias.edu/spfeatures/einstein/}{http://www.ias.edu/spfeatures/einstein/}\\       What should I add/modify in the code to achieve like the first screenshot ? Thanks in Advance


title: The line produced by \not looks bad on wider symbols

text: When using `\not` together with wider symbols such as `\Leftrightarrow` the diagonal line produced by `\not` is placed too far to the left. How can the line be properly aligned? For example the following code               \documentclass{article}          \begin{document}          \(\not\subset\)% Looks good          \(\not\approx\)% Looks good          \(\not\leftrightarrow\)% \not line is too far to the left          \(\not\Leftrightarrow\)% \not line is too far to the left          \end{document}      produces the following output where the last two symbols has got a misaligned diagonal line ![Aligned and not aligned examples of \\not](http://i.stack.imgur.com/aMFOH.png) Also, maybe the lines may need other changes than alignment to look good.


title: How to add the circle, star inside the diamond?

text: I wish to add the circle inside the diamond, and star inside the circle like in the photo. ![enter image description here](http://i.stack.imgur.com/VW5cY.jpg) However, using my code,               \node[draw, diamond, above=of aux] (diamond) {};     \node[draw,circle,above=of aux,minimum size=2mm,inner sep=0pt]{};     \node[draw, star,above=of aux,minimum size=0.01mm](star){};      centers of the circle, diamond and star are not the same as shown in the following picture. ![enter image description here](http://i.stack.imgur.com/dwSMz.jpg) What's the problem with the code?


title: How to reduce indentation size within loop of an algorithm

text: For the following algorithm, I get four spaces for each text line inside the loop. How can I get only two or three spaces? Some of my text lines go to next line. I want to save some horizontal spaces.               \usepackage[noline,boxruled,commentsnumbered,linesnumbered,titlenumbered]{algorithm2e}          \IncMargin{0.5em}     \begin{algorithm}     \SetKwInOut{Input}{input}\SetKwInOut{Output}{output}     \SetKwFor{Foreach}{for each}{do}{endfor}     \SetKwIF{If}{ElseIf}{Else}{if}{then}{else if}{else}{endif}     \BlankLine     \Input{A method \emph{m}}     \Output{result}     \BlankLine     \Foreach { $x \in M_{x}$}{      do something     }     \caption{Algorithm}\label{Method}     \end{algorithm}


title: Add key for new Listings environment

text: I'm trying to add a new key to a custom `listings` environment. I have tried to modify this example. My problem is that the value I am attempting to pass through in the document for the key does not seem to be used. Here is an MWE:               \documentclass{article}          \usepackage{listings}          \makeatletter     \lst@Key{pagewidth}{\linewidth}{\def\LSTwidth{#1}}     \makeatother          \lstnewenvironment{mylisting}[1][]{%     \noindent     \minipage{\LSTwidth}     \lstset{#1}     }     {\endminipage}          \begin{document}          \centering     \begin{mylisting}[pagewidth=0.5\linewidth, frame=lrtb]     NOT IMPORTANT NOT IMPORTANT     NOT IMPORTANT NOT IMPORTANT     \end{mylisting}          \end{document}


title: BibTex doesn't recognize the author field on my bibliography entry

text: I have a `pst2.bib` database with only one entry:               @book{jackson91,         author    = "Jackson, John David",         title     = "Classical Electrodynamics",         publisher = "John Wiley \& Sons, Inc.",         address  = "New Jersey, USA",         edition  = "3",         year      = "1991"     }      At the end of my `.tex` file I have the following code:               According to \citet{jackson91}, blah blah...          \bibliographystyle{plain}     \bibliography{pst2}      and at the beginning I'm importing the `natbib` package. The output of this is > According to **(author?)** [1], blah blah... If I change `\citet{jackson91}` to `\cite{jackson91}` it just goes > According to [1], blah blah... but I _want_ to use the `\citet`command from natbib. It seems that the referencing engine manages to identify my BiBTeX entry from the database, but doesn't manage to identify the various fields in the entry. Why not? How do I fix this?


title: How would I write up an integral symbol, along with the two numbers to the right of it, in LaTeX?

text: Title says it all (I think). I just want to replicate math which would normally be done in Year 11/12, and got sorta stuck here. Any help?


title: Simple line with dots, known coordinates

text: Are there any easy way to make something similar to this image in tikz, asympote or similar? I know the coordinates, to each of the points =) ![Simple numberline](http://i.stack.imgur.com/29rC3.png) ![The actuall numbers](http://i.stack.imgur.com/q2cRB.png) Ofcourse I know how to solve this, but to do it in tikz or simmilar is new to me.


title: Wraptable interferes with the next page

text: I've got a wrapped table on the right, it reaches the end of the page and stops, and the text next to it finishes its paragraph in line with where the table finishes. The line on the next page stops off halfway through like the table is still going on. Anyone know how to prevent this so that the line on the next page is full width?


title: modifying the page header

text: This is a MWE               \documentclass[paper=a4,10pt, twoside]{scrbook}%          \usepackage{tgtermes}          \usepackage[titles]{tocloft}     \setcounter{tocdepth}{3}                              \makeatletter         \renewcommand{\@tocrmarg}{4em}               \makeatother          \makeatletter         \renewcommand*\l@section[2]         {         \addpenalty{-\@highpenalty}%         \vskip 0.1em \@plus\p@         \@dottedtocline{1}{1.5em}{2.5em}{\normalfont #1}{\normalfont #2}         }     \makeatother          \makeatletter         \renewcommand*\l@chapter[2]         {         \addpenalty{-\@highpenalty}%         \vskip 0.5em \@plus\p@          \@dottedtocline{0}{0em}{1em}{\large #1}{\large #2}         }     \makeatother          \makeatletter         \newcommand*\l@problem[2]         {         \addpenalty{-\@highpenalty}%         \vskip 0.1em \@plus\p@         \@dottedtocline{1}{1.5em}{2.5em}{\normalfont #1}{\normalfont #2}         }     \makeatother               \usepackage[noindentafter, pagestyles, explicit, extramarks]{titlesec}     \newpagestyle{main}{       \sethead[\thepage ][][\chaptername \, \thechapter.  \chaptertitle]% even               {\ifthesection{\thesection \, \sectiontitle }{\theproblem \, \problemtitle}}{}{\thepage}} % odd          %chapter     \titleformat{\chapter}{\vspace{75pt}\Large} {\makebox[25 pt]{\raggedright\thechapter}}{8pt}{\hspace*{-6pt}\raggedright\Large #1}[\vspace{0.3pc} {\titlerule[3.5pt]} \vspace{50pt}]     \titlespacing{\chapter}{0 pt}{0 pt}{0 pt}[0 pt]          %section         \titleformat{\section}{\large}{\makebox[20 pt]{\large\thesection}}{15 pt}{#1}      \titlespacing{\section}{-35 pt}{3ex plus .1ex minus .2ex}{3ex plus .1ex minus .2ex}          %problem      \newcounter {problem}[chapter]     \makeatletter     \renewcommand {\theproblem}{P. \thechapter.\@arabic\c@problem}     \makeatother     \newcommand{\problemtitle}{}          \titleclass{\problem}{straight}[\chapter]             \titleformat{name=\problem}{\large }{\makebox[25 pt]{\large\theproblem}}{15 pt}{#1}[]     \titlespacing{name=\problem}{-40 pt}{4ex plus .1ex minus .2ex}{3ex plus .1ex minus .2ex}          \usepackage{lipsum}          \begin{document}          \cleardoublepage     \phantomsection     \tableofcontents          \pagestyle{main}          \chapter{This is the first chapter}     \lipsum[1]     \section{This is the first section}     \lipsum[2-20]     \problem{This is the first problem}     \lipsum[20-30]     \section{This is the second section}     \lipsum[2-10]               \end{document}      I'd like to modify the header on page number seven and to put something like `\theproblem \problemtitle` because I have defined a new sectioning command `problem`. I do not know how it is possible.


title: fancy-preview with other \ref-like commands (such as \autoref and \cref)

text: I finally got `fancy-preview` working, and I found the place (around line 97) in the script to add to the list of environments which it catches (to add propositions and so on). But what I can't find after a quick read-through is a way to have `fancy-preview` pick up `\autoref`, `\cref`, and other `\ref`-like commands. Does anybody know how to do this? (I don't know perl or low-level latex, so I could have easily missed something obvious.) I much prefer using `\autoref` to `\ref`. After spending way too much time setting up `fancy-preview`, it would be pretty disappointing to have to give up `\autoref` to use it. EDIT: After looking into this a bit further, I don't think this is controlled in the `fancy-preview` script. I think it's in the actual `fancytooltips.dtx`, around line 756. I don't yet know how to adjust this code to also redefine `\autoref`, but I think I'm at least looking in the right place.


title: Changing TOC header mid-TOC

text: In my TOC, on pages where there chapter titles listed, the page header needs to contain the word "CHAPTER". However, on pages where only appendix titles are listed, the TOC header needs to read "APPENDIX." Is it possible to change the header midway through the TOC like this? I am using the memoir class. update: I should have mentioned I am using a style package provided by my school. I'll give a MWE that is based on that style file and also give the relevant-seeming passage from the style file as well. First the MWE:               \documentclass[oneside,12pt]{memoir}     \setsecnumdepth{subsection}     \maxtocdepth{subsection}     \usepackage{appendix}     \usepackage{pwasu}           \begin{document}     \DoubleSpacing     \pagestyle{plain}     \frontmatter          \tableofcontents     \listoftables     \listoffigures          \mainmatter          \pagestyle{plain}           \addtocontents{toc}{\noindent\normalfont{CHAPTER}\par}     \chapter{Chapter the Next}      \chapter{Chapter the Next}      \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}     \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}     \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}     \chapter{Chapter the Next}      \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}     \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}     \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}     \chapter{Chapter the Next}      \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}     \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}     \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}     \chapter{Chapter the Next}      \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}     \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}     \section{My Next Section}     \subsection{And another subsection}     \subsection{And another subsection}     \subsection{And another subsection}          \addtocontents{toc}{\noindent\normalfont{APPENDIX}\par}     \appendix     \chapter{Now I have an appendix}      \chapter{Now I have an appendix}      \section{Appdx. section }     \section{Appdx. section }     \section{Appdx. section }     \chapter{Now I have an appendix}      \section{Appdx. section }     \section{Appdx. section }     \section{Appdx. section }     \chapter{Now I have an appendix}      \section{Appdx. section }     \section{Appdx. section }     \section{Appdx. section }     \chapter{Now I have an appendix}      \section{Appdx. section }     \section{Appdx. section }     \section{Appdx. section }     \end{document}      And here's the bit from the style file that needs to be different for toc pages that contain only appendix titles:               \makepagestyle{toc}     \makeevenfoot{toc}{}{\thepage}{}     \makeoddfoot{toc}{}{\thepage}{}     \makeevenhead{toc}{CHAPTER}{}{Page}     \makeoddhead{toc}{CHAPTER}{}{Page}      So when this document is created, the problematic area is the header of the last page of the toc, which should read APPENDIX instead of CHAPTER (I don't know why that header overlaps the top line of the toc in this MWE, but it doesn't happen in my real document so this is probably not important).


title: How to define the bibliography style with 4 letters author, a gap and the two numbers of the year

text: How can I make the reference list as: 4 letters a gap and the two numbers of the year, > [Taja 00a] E. Tajahuerce and B. Javidi, "Encrypting   >  three-dimensional information with digital holography," Appl. Opt., 39, > 6595-6601, (2000). where [Taja 00a] means the first four letter of the author's surname, a space, and the year (only two numbers). Also, I would like to cite this reference as [Taja 00a]. I have been reading the `natbib` package and trying different things such as `\citep` or `\citealp`, and the `\setcitestyle` command. Nothing lucky so far. Could anyone help me define this please? This is a minimal example I am testing on.               \documentclass{article}          \usepackage{xstring}     \usepackage[style=alphabetic,maxbibnames=99]{biblatex}     \addbibresource{Thesis_References.bib}          \DeclareLabelalphaTemplate{       \labelelement{         \field[strwidth=4,strside=left,names=1,lowercase]{labelname}         }       \labelelement{         \field[strwidth=2,strside=right]{year}         }     }          \renewcommand{\labelalphaothers}{}          \DeclareFieldFormat{labelalpha}{\padded{#1}}          \begin{document}          \cite{JavidiBOOK:2005}, \cite{Matoba:09}. \cite{Matoba:04, Unnikrishnan:06}          \printbibliography          \end{document}


title: Chapter descriptions in the TOC, but at a fixed width

text: I'm really in love with the TOC one gets using the accepted answer at Adding a per-chapter image along with group of entries in ToC. However, instead of having sections in my TOC, I'd like to include brief descriptions of the chapter contents. But try as I might, I can't get these descriptions to not overwrite the images. I've tried the following, yet none work:   * Martin's answer at Table of Contents with additional description of entries   * The `\cftchapterprecistoc` option in the `tocloft` package.   * Passing a `\resizebox` to `\cftchapterprecistoc` Is there a way to get this text to behave nicely, and stay away from the images? Here's an example of what I'm talking about:               \documentclass{scrbook}          \usepackage{geometry}% http://ctan.org/pkg/geometry     \usepackage{titletoc}% http://ctan.org/pkg/titletoc     \usepackage[export]{adjustbox}% http://ctan.org/pkg/adjustbox     \usepackage{xparse}% http://ctan.org/pkg/xparse     \usepackage{titlesec}     \usepackage{tocloft}               \NewDocumentCommand{\rtocstuff}{O{10pt} m O{80pt}}{% \rtocstuff[<gap>]{<content>}[<width>         \titlecontents{chapter}           [0pt]% left margin indent           {\bigskip\bfseries}% chapter ToC formatting           {\makebox[1.5em][l]{\thecontentslabel}}% chapter label (numbered)           {\hspace*{1.5em}}% chapter label (unnumbered)           {\titlerule*[1pc]{.}% dotted contents line            \thecontentspage% ToC page number            \hspace*{#1}% gap between page number & <content>            \smash{% remove vertical height of image              \raisebox{1.5ex}{% align with top of character                \hspace*{#3}% space for <content>                \llap{% left overlap                  #2\hspace*{#1}% actual <content>           }}}}%           \titlecontents{section}           [0pt]% left margin indent           {\normalfont}% section ToC formatting           {\hspace*{1.5em}\makebox[2.3em][l]{\thecontentslabel}}% section label (numbered)           {\hspace*{3.8em}}% section label (unnumbered)           {\titlerule*[1pc]{.}% dotted contents line            \thecontentspage% ToC page number            \hspace*{#1}% gap between page number & <content>            \hspace*{#3}% gap for <content>           }     }     \NewDocumentCommand{\ltocstuff}{O{80pt} m O{10pt}}{% \ltocstuff[<width>]{<content>}[<gap>]         \titlecontents{chapter}           [0pt]% left margin indent           {\bigskip\bfseries}% chapter ToC formatting           {\smash{% remove vertical height of image              \raisebox{1.5ex}{% align with top of character                \rlap{% right overlap                  #2% actual content                }\hspace*{#1}% space for <content>            }}%            \hspace*{#3}% gap between <content> and ToC entries            \makebox[1.5em][l]{\thecontentslabel}}% chapter label (numbered)           {\smash{% remove vertical height of image              \raisebox{1.5ex}{% align with top of character                \rlap{% right overlap                  #2% actual <content>                }\hspace*{#1}% space for <content>            }}%            \hspace*{1.5em}}% chapter label (unnumbered)           {\titlerule*[1pc]{.}% dotted contents line            \thecontentspage% ToC page number           }          \titlecontents{section}           [0pt]% left margin indent           {\normalfont}% section ToC formatting           {\hspace*{#1}% space for <content>            \hspace*{#3}% gap between <content> and ToC entries            \hspace*{1.5em}\makebox[2.3em][l]{\thecontentslabel}}% section label (numbered)           {\hspace*{3.8em}}% section label (unnumbered)           {\titlerule*[1pc]{.}% dotted contents line            \thecontentspage% ToC page number           }     }          \usepackage{lipsum}% http://ctan.org/pkg/lipsum          \newcommand{\ccpt}[1]{\cftchapterprecistoc{#1}}          \begin{document}          \setcounter{tocdepth}{0}     \contentsmargin{0pt}% Remove right margin in ToC     \tableofcontents          \rtocstuff{\includegraphics[valign=T,width=70pt]{tiger}}     \chapter{Coordinates of points}     \ccpt{We will explore how to find the coordinates of various points in the 2-dimensional and 3-dimensional Euclidean spaces.}          \section{Rectangular coordinates} \lipsum[1]     \section{Projections of a segment on the axes} \lipsum[2]     \section{Distance between two points} \lipsum[3]     \section{The mid-point of a segment} \lipsum[4]     \section{Division of a segment in any ratio} \lipsum[5]     \section{Oblique coordinates} \lipsum[6]          \ltocstuff{\includegraphics[valign=T,width=70pt]{tiger}}     \chapter{The locus of an equation}     \ccpt{We will explore how to find the coordinates of various points in the 2-dimensional and 3-dimensional Euclidean spaces.}          \section{First illustrations} \lipsum[1]     \section{Curve plotting} \lipsum[2]     \section{Test that a point lie on a curve} \lipsum[3]     \section{Intercepts} \lipsum[4]     \section{Points of intersection of two curves} \lipsum[5]     \section{Oblique coordinates} \lipsum[6]          \rtocstuff{\includegraphics[valign=T,width=70pt]{tiger}}     \chapter{The straight line}          \section{Equation in terms of point and slope} \lipsum[1]     \section{Line through two points} \lipsum[2]     \section{The general equation of first degree} \lipsum[3]     \section{Parallel and perpendicular lines} \lipsum[4]     \section{Angle between two lines} \lipsum[5]     \section{Distance from a point to a line} \lipsum[6]          \end{document}


title: Legend on every page

text: This is both a style question as well as a latex question:   1. What is the preferred method of providing a legend for about 30 figures having a similar or the same legend in a thesis? Is it desirable to have on legend in the appendix, one legend on each page, or to repeat the legend with each figure?   2. Is there a way to have LaTeX automatically put a legend on the page if it's not already there? What if I want to refer to the copy of the legend on the current page?


title: How to avoid page break in sections?

text: This is my code:               \documentclass[12pt,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{lipsum}     \usepackage{placeins}     \clubpenalty=10000     \widowpenalty=10000     \begin{document}     \section{First}     \lipsum[1-3]     \section{Second}     \FloatBarrier     \begin{table}[h!]     \caption{Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text!}     \begin{tabular}{|c|c|}     \hline  1&2  \\      \hline  3&4  \\      \hline      \end{tabular}      \end{table}     \FloatBarrier     \FloatBarrier     \begin{table}[h!]     \caption{Short text}     \begin{tabular}{|c|c|}     \hline  1&2  \\      \hline  3&4  \\      \hline      \end{tabular}      \end{table}     \FloatBarrier     Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text.     \end{document}      ![enter image description here](http://i.stack.imgur.com/30oNk.jpg) I have a lot of sections in my Appendix, which contain two tables and small text. I do not like when section name appears at the bottom of the page alone without table. How I can avoid it? P.S. \clubpenalty=10000 \widowpenalty=10000 This code does't help. P.S.S. I need to use `\FloatBarrier` for many other reasons. I do not like idea to use `\newpage` always I see this problem.


title: Size of letters not changing in pdflatex

text: \documentclass[60pt,a4paper,twoside,openany]{article}     \usepackage[utf8]{inputenc}     \usepackage[bulgarian]{babel}     \usepackage[pdftex]{graphicx}     \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}  % Horizontal line.          % Document body.     \begin{document}     Ляляляля!     \end{document}      I am a beginner, and am apparently missing something simple here. What I am trying to achieve is to increase the font size to 12 or maybe 14 points. However, the `12pt` option to `\documentclass` has no effect. I am using `pdflatex` to generate a pdf file from the above source.


title: Using mdframed after a section heading

text: The following is a very contrived example, but it illustrates a problem I am unable to solve with the `mdframed` package. When the `mdframed` environment follows a section heading but there is insufficient room to place the contents environment, the section heading gets orphaned. Replacing `mdframed` with `minipage` or anything else does not result in the orphan, and changing `\clubpenalty` has no effect. The same result occurs, for example, if the environment contains only a single line but has a large value for `skipabove` or `innertopmargin`; the non- breakable content I use in the MWE below is just for easily demonstrate the result.               \documentclass{article}          \usepackage{mdframed}          \newcommand{\BoxContents}{top\par\vspace*{2in}bottom}          \begin{document}          \vspace*{5in}          \section{Section}          \begin{mdframed}% this orphans the section heading         \BoxContents     \end{mdframed}          \newpage          \vspace*{5in}          \section{Section}          \begin{minipage}[t]{\linewidth}% this does not orphan the section heading         \BoxContents     \end{minipage}          \end{document}      Is there some way I can use this environment following a section heading without manually breaking pages when this occurs?


title: Decision trees in Tikz

text: So I can do this: ![tree one](http://f.cl.ly/items/1J3D2q1q2J162g2V1B0u/Screen%20Shot%202014-05-14%20at%204.17.39%20PM.png) But I want to do this: ![tree two](http://f.cl.ly/items/1c2Z0224261P2d2k0w10/Photo%20on%205-14-14%20at%204.20%20PM.jpg) That is, its easy to add text alongside the connectors (either slanting alongside them or straight), but I would like part of the connector to be flat with the caption text along the flat part for better readability. I thought perhaps I could do this by creating a fake node that would be just a line with text above it. Not sure how to implement that or if there is an easier way. Thanks for any ideas? Code for first figure:               \documentclass{article}      \usepackage{tikz}     \begin{document}          \tikzstyle{decision} = [rectangle, minimum height=18pt, minimum width=18pt, draw=blue, fill=none, ultra thick, inner sep=0pt]     \tikzstyle{chance} = [circle, minimum width=18pt, draw=blue, fill=none, ultra thick, inner sep=0pt]     \tikzstyle{line} = [draw=none]          \tikzset{     grow=right,     sloped,     join=miter,     level 1/.style={sibling distance=5cm,level distance=5.2cm},     level 2/.style={sibling distance=4cm, level distance=6.7cm},     level 3/.style={sibling distance=3cm, level distance=6.7cm},     edge from parent/.style={ultra thick, draw=blue},     edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)},     every node/.style={text ragged, inner sep=1mm}     }          \begin{tikzpicture}[]     \small     \node[decision]{}         child{node[line]{}           edge from parent             node[above]{Option 2}         }         child{node[chance]{}           child{node[line]{}}           child{node[line]{}}           edge from parent                 node[below]{Option 1}             };     \end{tikzpicture}          \end{document}


title: MiKTeX, TeXnicCenter and "cancel" package - errors

text: **EDIT2:** I answered it below. I had duplicate of my cancel.sty where my .tex file was. That made some troubles (obviously). **EDIT:**               \documentclass[a4paper,11pt]{article}     \usepackage[croatian]{babel}     \usepackage{cancel}     \begin{document}     \mbox{}\cancel{a}     \end{document}      I went to MiKTeX Package Manager, found "cancel" package, right click -> Install. Refreshed FNDB. Opened TeXnicCenter, wrote that code and tried to render it. I got 16 errors. Why (for me "normal" LaTeX, packages like **amsmath** are working and I'm able it to render it just fine, but now I need some additional functionality like this strikethrough in cancel package)?               MiKTeX 2.9     TeXnicCenter 1.0 RC1     - rendered via Sumatra PDF      ![enter image description here](http://i.stack.imgur.com/467MI.jpg)


title: How to have different colormaps for different columns in the same Heatmaps table using pgfplots

text: > I want to make a heatmap using different colors for only two columns in a > heatmap. I was able to do it using two different pgfplotstables, i.e, two > different heatmaps. But, i wan't to know whether i can do it using only one > pgfplots table and changing the properties of colors only for the last two > rows. ![enter image description here](http://i.stack.imgur.com/LtyfD.png)               \documentclass{article}     \usepackage{colortbl}     \usepackage{pgfplots}     \usepackage{filecontents}     \usepackage{pgfplotstable}     \usepackage{array}     \usepackage{graphicx}     \usepackage{longtable}     \usepackage{titlesec}     \usepackage[font=small,compatibility=false]{caption}     \usepackage{fancyhdr}     \usepackage[margin=0.5in]{geometry}     \usepackage[english]{babel}     \usepackage[T1]{fontenc}          \titleformat{\chapter}       {\normalfont\LARGE\bfseries\color{darkblue}}{\thechapter.}{1em}{}     \pagestyle{fancy}     \fancyhf{}          \lhead{Parent Feedback Report}     \chead{}     \rhead{}     \lfoot{}     \cfoot{}     \rfoot{Kaddy.co}          \addtolength{\topmargin}{.55in}     \newcolumntype{C}{>{\centering\arraybackslash}p{2mm}}          \pgfplotstableset{         /color cells/min/.initial=0,         /color cells/max/.initial=1000,         /color cells/textcolor/.initial=,         color cells/.code={%             \pgfqkeys{/color cells}{#1}%             \pgfkeysalso{%                 postproc cell content/.code={%                     \begingroup                     \pgfkeysgetvalue{/pgfplots/table/@preprocessed cell content}\value                     \ifx\value\empty                     \endgroup                     \else                     \pgfmathfloatparsenumber{\value}%                     \pgfmathfloattofixed{\pgfmathresult}%                     \let\value=\pgfmathresult                     \pgfplotscolormapaccess                         [\pgfkeysvalueof{/color cells/min}:\pgfkeysvalueof{/color cells/max}]%                         {\value}%                         {\pgfkeysvalueof{/pgfplots/colormap name}}%                     \pgfkeysgetvalue{/pgfplots/table/@cell content}\typesetvalue                     \pgfkeysgetvalue{/color cells/textcolor}\textcolorvalue                     \toks0=\expandafter{\typesetvalue}%                     \xdef\temp{%                         \noexpand\pgfkeysalso{%                             @cell content={%                                 \noexpand\cellcolor[rgb]{\pgfmathresult}%                                 \noexpand\definecolor{mapped color}{rgb}{\pgfmathresult}%                                 \ifx\textcolorvalue\empty                                 \else                                     \noexpand\color{\textcolorvalue}%                                 \fi                                 \the\toks0 %                             }%                         }%                     }%                     \endgroup                     \temp                     \fi                 }%             }%         }     }          \begin{document}     \begin{figure}     \hfill     \resizebox{2.2in}{3.94in}{\pgfplotstabletypeset[         font=\fontsize{6}{15}\selectfont,         /pgfplots/colormap={blackwhite}{color=(white) rgb255=(255,170,0)},         color cells={min=1,max=2323,textcolor=black},         /pgf/number format/fixed,         /pgf/number format/precision=1,         col sep=comma,         row sep=crcr,     ]{     SA,A,N\\     1819, 2043, 126\\     2067, 1587, 218\\     986, 2018, 655\\     1257, 2068, 424\\     1722, 1977, 212\\     1322, 2036, 445\\     1264, 2119, 466\\     1205, 1952, 467\\     1855, 1776, 250\\     1638, 2029, 239\\     1953, 1686, 254\\     2020, 1758, 140\\     1835, 1843, 229\\     1371, 2178, 287\\     }}     \resizebox{1.4in}{3.94in}{\pgfplotstabletypeset[         font=\fontsize{6}{15}\selectfont,         /pgfplots/colormap={blackwhite}{color=(white) rgb255=(255,0,0)},         color cells={min=1,max=323,textcolor=black},         /pgf/number format/fixed,         /pgf/number format/precision=1,         col sep=comma,         row sep=crcr,     ]{     D,SD\\     24, 3\\     55, 10\\     147, 33\\     61, 3\\     32, 7\\     102, 17\\     60, 11\\     252, 54\\     55, 8\\     58, 8\\     33, 10\\     23, 3\\     41, 9\\     51, 4\\     }}     \end{figure}     \end{document}


title: Is there an siunitx number formatting option equivalent to pgfplots's "fixed relative"?

text: I need to typeset a table with units, so I'd like to use `siunitx` for that. However, I don't want scientific notation, but a given number of figures. `pgfplots` has the `fixed relative` option for that purpose:               \documentclass{article}     \usepackage{pgfplots,siunitx}     \def\numA{1.23456789e3}     \def\numB{1.23456789e-3}     \begin{document}     \noindent       pgf standard format:\\       \pgfmathprintnumber{\numA}\\       \pgfmathprintnumber{\numB}\\       \pgfkeys{/pgf/number format/.cd,fixed relative,precision=3}       desired format:\\       \pgfmathprintnumber{\numA}\\       \pgfmathprintnumber{\numB}     \end{document}      This is the output of the above code: ![enter image description here](http://i.stack.imgur.com/3TgSV.png) I'd like to get the same output with `siunitx`, if possible. I've tried explicitly disabling `scientific-notation`, but as it seems that key is only useful for enabling scientific notation when `siunitx` would otherwise _not_ use it:               \num{\numA}\\     \num{\numB}\\     \sisetup{round-mode=figures,round-precision=3,scientific-notation=false}     \num{\numA}\\     \num{\numB}\\      Output: ![enter image description here](http://i.stack.imgur.com/4Ywzq.png) One possibility would be to redefine `\SI{}{}` and `\num{}` to use `\pgfmathprintnumber{}` and disabling `siunitx`'s number parsing, but I'd like to know what else I could do. My current workaround is:               \let\oldnum\num     \renewcommand{\num}[1]{\oldnum[parse-numbers=false]{\pgfmathprintnumber{#1}}}     \let\oldSI\SI     \renewcommand{\SI}[3][]{\oldSI[#1,parse-numbers=false]{\pgfmathprintnumber{#2}}{#3}}      but this doesn't let me pass options to `\pgfmathprintnumber`. Passing options to `\SI` works well, as in `\SI[per-mode=fraction]{1e-3}{\meter\per\second}`.


title: Designing latex template for song

text: ![Designing LaTeX template](http://i.stack.imgur.com/Wzalh.jpg) Please someone help me in LaTeX to create layout as shown in the figure.


title: Shifts with beamer

text: I'm trying to use `beamer`. I use Linux mint with TeX Live 2013. It seems there are some shiftings in the slides. The plain example :               \documentclass{beamer}          \title{Un titre}     \author{Moi}     \institute{ici}          \begin{document}     \begin{frame}     \titlepage     \end{frame}          \section{Un}     \subsection{a}     \begin{frame}     \frametitle{truc}     Voici un texte     \end{frame}          \end{document}      gives me a slide where the upper half is white and when I give more text it is not completely shown. Everything works fine when I use context.


title: caption package

text: I am currently preparing a paper for submission using the template files provided by SIAM (see http://www.siam.org/journals/auth-info.php). I have been writing my document under a different style file with no problems. However, when I come to add in items that rely on the subfigure command, I am presented with an error               Package caption Warning: Unsupported document class (or package) detected                              caption      I have read various posts online outlining the issues with the caption package. Therefore, my question is whether or not a reasonable workaround can be sought? I would ideally like to keep using the subcaption package, enabling my figures to be labelled (a), (b), (c), etc, however at present am not in a position to do so as the caption package will not load.


title: rtf2latex2e convert ÷ symbol to Ã· in windows

text: I am new to TEx and LaTex formats. i am using rtf2latex23 in window 8.1. from yesterday (11-sep-2014) only i am using this application. while converting the "RTF" file i found that The "÷" symbol is converted to "Ã·" kindly help               %&pdfLaTeX % !TEX encoding = UTF-8 Unicode      \documentclass{article}      \usepackage{ifxetex}      \ifxetex      \usepackage{fontspec}      \setmainfont[Mapping=tex-text]{STIXGeneral}      \else      \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}      \fi      \usepackage{textcomp}      \usepackage{graphicx}      \usepackage{amssymb}      \usepackage{fancyhdr}      \renewcommand{\headrulewidth}{0pt}      \renewcommand{\footrulewidth}{0pt}      \newcommand{\tab}{\hspace{5mm}}      \begin{document}


title: How can I append code to an item-label(-box)?

text: For executing code after the end of a **_parameterless_** macro there are `\ltx@GlobalAppendToMacro` and `\ltx@LocalAppendToMacro` from the ltxcmds- package. For executing code after the end of an environment there is `\AfterEndEnvironment` from the etoolbox-package, and without the e-TeX extension one can use `\renewenvironment` for this. But how can one "append" code after a label of an `\item`? `\item` has one (optional) parameter, thus `\ltx@GlobalAppendToMacro` and `\ltx@LocalAppendToMacro` cannot be used. At `\end{description}` would be too late. MWE:               \documentclass{article}     \begin{document}     \begin{description}      \item[Label\ReplaceMe{\textbf{OK}}] Text.      \item[Label\ReplaceMe{\textbf{abc}}] Text.      \item[Label] Text.      \item Item without label.     \end{description}     \end{document}      The               \item[Label\ReplaceMe{\textbf{OK}}] Text.      should "expand" to               \item[Label]\textbf{OK} Text.      and the others accordingly. `\item` itself (or macros called by it) as found in File A: ltlists.dtx Date: 2002/10/28 Version v1.0s (source 2e, 2011/06/27) contains `\box`, `\hbox`,... The label text is thus "boxed", and I want to "free" a part of it. With "boxed" I do not want to indicate that there would be any rectangular line around "Label". Looking at the answer provided by Werner, would it be sufficient to use the following code?               \documentclass{article}     \usepackage{letltxmacro}     \makeatletter     \newcommand*{\ReplaceMe}[1]{\gdef\saved{#1}}     \ReplaceMe{}     \LetLtxMacro{\@olditem}{\@item}%     \newenvironment{desc}%       {\renewcommand*{\@item}[1][]{% \begin{desc}          \@olditem[##1]\saved\gdef\saved{}%         }%        \begin{description}}%       {\end{description}}% \end{desc}     \makeatother          \begin{document}     \noindent Here is some text.     \begin{desc}      \item[Label\ReplaceMe{\textbf{OK}}] Text.      \item[Label\ReplaceMe{\textbf{abc}}] Text.      \item[Label] Text.      \item Item without label.     \end{desc}     Here is some more text.     \begin{description}      \item[Label\ReplaceMe{\textbf{OK}}] Text.      \item[Label\ReplaceMe{\textbf{abc}}] Text.      \item[Label] Text.      \item Item without label.     \end{description}     \end{document}


title: Why do we need to buffer the pst-eucl nodes before passing them to \rput?

text: Behavior of nodes defined `pst-eucl` seems to be different from those defined in `pst-plot`. In the section titled `Direct node`, I attempted to create a square with `pq` as it base inclined at a slope of line `pq`. Unfortunately, it produces a wrong output. But if I buffered the rotated point with a node defined in `pst-node`, I got the correct output. This inconsistent behavior might cause confusion and difficult to debug. What do you think?               \documentclass[preview,border=12pt,12pt,varwidth]{standalone}     \usepackage{pst-eucl}     \begin{document}          \section*{Direct node}     \begin{pspicture}[showgrid,saveNodeCoors,NodeCoorPrefix=N](10,10)         \pstGeonode(4,8){p}(4,6){r}         \pstRotation[RotAngle=90]{p}{r}[q]         \rput{!Nqy Nry sub Nqx Nrx sub atan}(r){\psframe(!Nqx Nqy Nrx Nry Pyth2 dup)}     \end{pspicture}          \vspace{4cm}     \section*{Indirect node}     \begin{pspicture}[showgrid,saveNodeCoors,NodeCoorPrefix=N](10,10)         \pstGeonode(4,8){p}(4,6){r}         \pstRotation[RotAngle=90]{p}{r}[temp]         \pnodes(temp){q}         \rput{!Nqy Nry sub Nqx Nrx sub atan}(r){\psframe(!Nqx Nqy Nrx Nry Pyth2 dup)}     \end{pspicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/MhoY3.png) ## Question Why do we need to buffer the `pst-eucl` nodes before passing them to `\rput`? Why don't make the behavior of nodes defined in `pst-eucl` consistent with those defined in `pst-plot`?