title: Random quadratic equation

text: I would like to produce quadratic equation with integer coefficients. Here's my code using `pgfmath`.               \documentclass{article}     \usepackage{tikz}     \pgfmathsetseed{\pdfuniformdeviate 10000000}      \begin{document}     $\pgfmathdeclarerandomlist{signe}{{+}{-}}%     \pgfmathrandomitem{\s}{signe}%     \pgfmathparse{random(2)}%     \pgfmathparse{ifthenelse(\pgfmathresult==1,"-"," ")}\pgfmathresult     \pgfmathrandominteger{\a}{1}{6}     \pgfmathparse{ifthenelse(\a==1," x^{2} ","\a x^{2}")}\pgfmathresult % coeff a     \pgfmathdeclarerandomlist{lincoeff}{{}{2}{3}{4}{5}{6}}     \pgfmathrandomitem{\b}{lincoeff}%     \pgfmathrandomitem{\s'}{signe}%     \pgfmathsetmacro{\e}{random(0,6)}     \pgfmathparse{ifthenelse(\e==0," ", " \s' \b x ")}\pgfmathresult % coeff b     \pgfmathrandominteger{\c}{0}{6}     \pgfmathrandomitem{\s''}{signe}%     \pgfmathparse{ifthenelse(\c==0,"","\s'' \c")}\pgfmathresult % coeff c     =0$     \end{document}      It works but it seems to be not a good way, I had some pain with the x-coeficient and my solution looks complicated. I tried to use an `ifthenelse` inside an other `ifthenelse` but without success. Is there a better way ?


title: Overriding italicized list counters in plain theoremstyles

text: Using a list environment inside of any theorem defined with \theoremstyle{plain} results in italicized counters. That is, the following example               \usepackage{amsthm}     \usepackage{enumerate}          \theoremstyle{plain}     \newtheorem{theorem}{Theorem}          \begin{theorem}     The following are not equivalent.     \begin{enumerate}     \item $n$ is an even integer.     \item $n$ is divisible by 4.     \item $n$ is 3 more than some positive odd integer.       \end{enumerate}     \end{theorem}      produces italicized counters (1), (2), and (3). How can I override this action?


title: How can I remove the blank space before and after a command

text: I create a command,               \newcommand{\cmd}{b}      but when I use this command               a\cmd{}c      What I get is > a b c but what I want is > abc How can I remove two blanks?


title: Headers and page numbers in external borders

text: I am trying to recreate in *TeX the same aspect that you can see in the following picture showing a document that I created a while ago with MS Publisher. ![Desired layout](http://i.stack.imgur.com/X31PH.jpg) As you can see, page numbers are rendered with a custom font, as well as headers that only display tilted chapter names (on one side for odd pages, and on the other side for even pages). Both are positioned in the page border rather than in the usual position (typically the external header and footer of the page). If possible, I would like to use the least number of packages: so far I have introduced KOMA script, `fontspec` and `xcolor`. If these packages do not allow to get the desired result, I would accept any package that gets the work done, but I would still like to use the the least number of packages. In that case, which are the best packages to use? Unfortunately, I have no clue about how to do it... could you provide some examples please? I guess `tikz` will be used, but is it possible to avoid to use `fancyhdr` (with whom I am really not familiar)? In addition, I would like to understand how to insert logo on the top external corners, the external page borders, the internal page border, and the chapter openings into the *TeX sources. I am trying to recreate those elements with `tikz` but, again, I do not know how to include them in the relevant parts of the page. I would add a minimal work example to start you with, but at the moment I do not have my sources at hand, sorry. I will possibly attach them in a second time, thanks for the understanding.


title: Page numbers only appear on pages where a chapter starts

text: I have a problem in the number of the pages in my report the problem is that the number of the page appears in the beginning of the chapter but in the next page it is absent. This is a part of my code:               \documentclass{report}     \usepackage{xcolor} %les couleurs     \usepackage{setspace}     \usepackage[justification=centering]{caption}          \begin{document}     \pagestyle{empty}          \include{title-content}     \include{dedicaces-content}     \include{remerciement-content}     \color{black}     \doublespacing     \tableofcontents          \listoftables     \listoffigures     \pagenumbering{arabic}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \chapter{Introduction générale}          Foo          \end{document}


title: What, in the custom class I use, prevents line breaking in listings?

text: I have found how to wrap code inside lstlisting block. When my document has `article` class, everything works as expected. However, when I change the document's class to one I need in my work, lines do not break anymore. I'm not an author of this class and I have not a clue where the problem can be burried. Can you help me? Minimal Working Example:               \documentclass{templates/mgragh}     \usepackage[utf8]{inputenc}     \usepackage{listings}     \usepackage[polish]{babel}     \usepackage[OT4]{fontenc}     \usepackage{color}     \lstset{       frame=single,       breaklines=true,       postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}     }     \begin{document}     \begin{lstlisting}     public void createVoiceComment(File recodedFile) throws CommentNotAddedException;     \end{lstlisting}     \end{document}      Document class available here: https://copy.com/sijTRKuBQ9L2


title: Right-align numbers in ToC

text: How do I right-align the section/subsection/.. number in the ToC? The distance between the number and the heading should be fixed. Instead of               |  1     Section     |        1.1      Subsection      I'd like to have something like               |      1 Section     |             1.1 Subsection      (`|`= left margin) There must be a package for that... (And I'd like to play with the indentation as well)


title: Weird error "Missing number treated as zero"

text: I am preparing a PhD dissertation using the report document class. I'm using TexMaker. I keep getting an error message for this table:               \documentclass[12pt,a4paper,onesided]{report}     \usepackage{booktabs}     \usepackage{amsmath}     \usepackage{setspace}     \usepackage{graphicx}     \usepackage[table]{xcolor}     \usepackage{amsfonts}     \usepackage{fixltx2e}     \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}     \usepackage[T1]{fontenc}     \usepackage{tabu}     \usepackage{sectsty}     \sectionfont{\large}         \subsectionfont{\normalsize}     \usepackage{caption}         \captionsetup[figure]{labelfont=bf, textfont=bf}         \captionsetup[table]{labelfont=bf, textfont=bf}     \setlength{\footnotesep}{\baselineskip}     \usepackage{textcomp}\usepackage{booktabs}     \usepackage{tabulary}     \usepackage{multirow}     \usepackage{hyperref}     \usepackage{float}     \usepackage{array}         \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}         \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}         \makeatletter     \newcommand{\thickhline}{%         \noalign {\ifnum 0=`}\fi \hrule height 2pt         \futurelet \reserved@a \@xhline}     \newcolumntype{"}{@{\hskip\tabcolsep\vrule width 1pt\hskip\tabcolsep}}     \makeatother          \begin{document}          \begin{table}[ht!]             \renewcommand{\arraystretch}{3.5}             \small             \begin{center}             \caption{Alternate Wordings of the Survey, Fielded on Mechanical Turk.}             \begin{tabulary}{1.1\textwidth}{|C|L|}                 \hline                 Alternate Version I & ``Would you support or oppose removing trade restrictions which would allow firms such as [\emph{Tuntyakore \& Zideying/Gordon \& Roberts}] to more freely sell their goods in the United States? (Note that all firms affected by such a policy would be highly similar to [\emph{Tuntyakore \& Zideying/Gordon \& Roberts}] in terms of their workforce characteristics.)''\\ \hline             Alternate Version II & ``Would you support or oppose removing trade restrictions which would allow [\emph{Tuntyakore \& Zideying/Gordon \& Roberts}] to more freely sell its goods in the United States?''\\ \hline             \end{tabulary}             \end{center}             \end{table}      The error message refers to the line that says "\end{tabulary} and states:               ! Missing number, treated as zero.     <to be read again>     |     l.346 \end{tabulary}     A number should have been here; I inserted `0'.     (If you can't figure out why I needed to see a number,     look up `weird error' in the index to The TeXbook.)     ! Illegal unit of measure (pt inserted).     <to be read again>     |     l.346 \end{tabulary}     Dimensions can be in units of em, ex, in, pt, pc,     cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!     I'll assume that you meant to say pt, for printer's points.     To recover gracefully from this error, it's best to     delete the erroneous units; e.g., type `2' to delete     two letters. (See Chapter 27 of The TeXbook.)      This table works fine when I build it in a smaller document but does not work in this one. Not sure what to change about it. Thanks in advance!


title: Fancyhdr problems with regular footnote!

text: I am using `fancyhdr` package. I want a fancy footer but, also want regular footnote to come...is there some way to do both? My code is as follows:               \documentclass{article}     \usepackage{fancyhdr}     \fancypagestyle{plain}{%       \cfoot{\thepage}       \renewcommand{\headrulewidth}{0.4pt}       \renewcommand{\footrulewidth}{0.4pt}     }     \pagestyle{plain}          \begin{document}          The family of exponential densities would be useful in Maximum Likelihood estimators later in the course. \footnote{Lets try and do some mathematica simulations for showing these densities and the effect of parameter variations.}          \end{document}      ![My fancy footnote conflicts with regular footnote](http://i.stack.imgur.com/4SLdN.png)


title: How to remove the self-reference of the ToC in Latex book class

text: I want to remove the self-reference of the ToC in Latex book class as in the picture below ![enter image description here](http://i.stack.imgur.com/xVz4n.png) Can you help me?


title: PDF size limit - load only labels from files

text: I have huge amount of figures in thesis (72 pages) but I'm limited in size of thesis.pdf to 20MB and size of appendix.pdf to 30 MB When I compiled my thesis it got 280MB, I thought that I can split the file into thesis_text_only.pdf and appendix.pdf but if I comment appendix section it break my links to labels. Is there any way how to load only labels from file to get right links in text. And second question how can I reduce the size of produced pdfs to 30MB? I also need that output format will be PDF/A, to reduce size of PDF I found this questions already answered but the output is not PDF/A and I'm not so fast with learning how that GS works.. (How to make the PDFs produced by `pdflatex` smaller?) The situation is like this: I have a lot of files named like this DE-FSS_BetweennessCentrality_1.pdf, just changing the number or 1 attribute from string, all these files are about 500 - 800 kB. The file structure is like: main.tex contains               \input{figures.tex}      Is it possible to call only those labels from figures.tex? Thank you. Packages I'm using:               \documentclass{article}     \begin{document}         \usepackage{amsmath}         \usepackage{enumerate}         \usepackage{amssymb}         \usepackage{graphicx}         \usepackage{caption}         \usepackage{subcaption}         \captionsetup{compatibility=false}         \usepackage{listings}         \usepackage{algorithm2e}         \usepackage{url}         \usepackage[space]{grffile}         \usepackage{pgf,tikz}         \usetikzlibrary{arrows}          How the figures are defined:          \begin{figure}[t]             \begin{subfigure}[b]{0.49\textwidth}                     \includegraphics[width=\textwidth, height = 0.3\textheight, keepaspectratio=true]{Figures/DE-FSS_BetweennessCentrality_1.pdf.pdf}             \end{subfigure}%             ~ %add desired spacing between images, e. g. ~, \quad, \qquad etc. %(or a blank line to force the subfigure onto a new line)                 %             \begin{subfigure}[b]{0.49\textwidth}                     \includegraphics[width=\textwidth, height = 0.3\textheight, keepaspectratio=true]{Figures/DE-FSS_BetweennessCentrality_2.pdf.pdf}             \end{subfigure} %              \caption{EDE FSS - Adjacency Graph}\label{fig:DE FS Adjacency Graph}     \end{figure}     \end{document}      **EDIT1:** the links to labels are solved, I got it working by `\usepackage{xr}` I would use the zref-xr but the documentation was hard to understand for me.


title: Is there a text-replacing package for LaTeX?

text: It's function is using the wanted text to replace specified text in `.tex` file.


title: Centering two tables in landscape modus

text: The posts seems very similar to the one's already posted two tables side by side in landscape mode but I have difficulties centering my first tables in the middle of a landscape page. This is only a script of my thesis which spans a lot of pages. As it is my whole thesis, I excuse the long preamble. I would like to fit in these two landscape tables below into my thesis. The tables are too big by nature, therefore I scaled them. How can I set the tables to be in the middle of the page. I have tried `\centering` in both, the `\table` and `\minipage` modus. I also tried it without `\table`, but I wish one caption above both minipage tables. Any help is highly appreciated. Thanks               \documentclass[a4paper, 11pt, oneside]{report}      %========= PACKAGES     \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}     %========= LAYOUT     \usepackage{fullpage}     \usepackage{pdflscape}     \usepackage{afterpage}     %========= MATH     \usepackage{amsmath}      \usepackage{amssymb}      \usepackage{amsfonts}     \usepackage{siunitx}     %========= TABLES     \usepackage{longtable}     \usepackage{wrapfig}     \usepackage{booktabs}     \usepackage{multirow}     \sisetup{input-symbols = {()},  % do not treat "(" and ")" in any special way              group-digits  = false} % no grouping of digits     %========= GRAPHICS     \usepackage{caption}     \usepackage{subcaption}     %========= DOKUMENT =================     \begin{document}     \clearpage % begin landscape tables     \begin{landscape}     \begin{table}[htp]     \centering     \caption[]{GARCH-VaR - out-of-sample estimates} \label{tab:VaRresultsgarch}     \begin{minipage}{0.48\columnwidth}     \resizebox{\columnwidth}{!}{%     \begin{tabular}{@{}         S[table-number-alignment = right,         table-figures-integer = 1,         table-figures-decimal = 3]         S         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = right,         table-figures-integer = 1,         table-figures-decimal = 3]         S         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 4,         table-space-text-post = \textsuperscript{*}]         @{}}     \toprule      & & \multicolumn{3}{c}{GARCH} & & &  \multicolumn{3}{c}{GARCH}\\     \cmidrule(rl){3-5} \cmidrule(l){8-10}     {\textbf{CHF}} & {Test} & {Normal} & {Std-$t$} & {GED} & {\textbf{EUR}} & {Test} & {Normal} & {Std-$t$} & {GED} \\     \cmidrule(r){1-5} \cmidrule(l){6-10}     \SI{5.0}{\percent} & {VR} & 5.213 & 5.611 & 5.054 & \SI{5.0}{\percent} & {VR} & 4.584 & 4.895 & 4.429 \\     \end{tabular}%     }     \end{minipage}\quad     %=========== new tabular =============     \begin{minipage}{0.48\columnwidth}     \resizebox{\columnwidth}{!}{%     \begin{tabular}{@{}         S[table-number-alignment = right,         table-figures-integer = 1,         table-figures-decimal = 3]         S         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = right,         table-figures-integer = 1,         table-figures-decimal = 3]         S         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 4,         table-space-text-post = \textsuperscript{*}]         @{}}     \toprule      & & \multicolumn{3}{c}{GARCH} & & &  \multicolumn{3}{c}{GARCH}\\     \cmidrule(rl){3-5} \cmidrule(l){8-10}     {\textbf{CHF}} & {Test} & {Normal} & {Std-$t$} & {GED} & {\textbf{EUR}} & {Test} & {Normal} & {Std-$t$} & {GED} \\     \cmidrule(r){1-5} \cmidrule(l){6-10}     \SI{1.0}{\percent} & {VR} & 1.512 & 1.114 & 1.114 & \SI{1.0}{\percent} & {VR} & 1.243 & 0.932 & 0.932 \\     \end{tabular}%     }     \end{minipage}     \end{table}     \clearpage     %=========== new page and tabular =============     \begin{table}[htp]     \centering     \begin{minipage}{0.48\columnwidth}     %\caption{GARCH-VaR - out-of-sample estimates $p = 0.005$}     \resizebox{\columnwidth}{!}{%     \begin{tabular}{@{}         S[table-number-alignment = right,         table-figures-integer = 1,         table-figures-decimal = 3]         S         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = right,         table-figures-integer = 1,         table-figures-decimal = 3]         S         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 4,         table-space-text-post = \textsuperscript{*}]         @{}}     \toprule      & & \multicolumn{3}{c}{GARCH} & & &  \multicolumn{3}{c}{GARCH}\\     \cmidrule(rl){3-5} \cmidrule(l){8-10}     {\textbf{CHF}} & {Test} & {Normal} & {Std-$t$} & {GED} & {\textbf{EUR}} & {Test} & {Normal} & {Std-$t$} & {GED} \\     \cmidrule(r){1-5} \cmidrule(l){6-10}     \SI{0.5}{\percent} & {VR} & 0.836 & 0.358 & 0.398 & \SI{0.5}{\percent} & {VR} & 0.777 & 0.622 & 0.622 \\     \end{tabular}%     }     \end{minipage}\quad     %=========== new tabular =============     \begin{minipage}{0.48\columnwidth}     \resizebox{\columnwidth}{!}{%     \begin{tabular}{@{}         S[table-number-alignment = right,         table-figures-integer = 1,         table-figures-decimal = 3]         S         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = right,         table-figures-integer = 1,         table-figures-decimal = 3]         S         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 3,         table-space-text-post = \textsuperscript{**}]         S[table-number-alignment = center,         table-figures-integer = 2,         table-figures-decimal = 4,         table-space-text-post = \textsuperscript{*}]         @{}}     \toprule      & & \multicolumn{3}{c}{GARCH} & & &  \multicolumn{3}{c}{GARCH}\\     \cmidrule(rl){3-5} \cmidrule(l){8-10}     {\textbf{CHF}} & {Test} & {Normal} & {Std-$t$} & {GED} & {\textbf{EUR}} & {Test} & {Normal} & {Std-$t$} & {GED} \\     \cmidrule(r){1-5} \cmidrule(l){6-10}     \SI{0.1}{\percent} & {VR} & 0.239 & 0.08 & 0.159 & \SI{0.1}{\percent} & {VR} & 0.233 & 0.078 & 0.078 \\     \end{tabular}%     }     \end{minipage}     \end{table}     \end{landscape}     \end{document}      ![enter image description here](http://i.stack.imgur.com/BgyIj.jpg)


title: Remove "Chapter #" string from bibliography?

text: I have a book document and use bibtex for bibliography. When I put code               \bibliography{file}      the default is to start a new chapter and show a title like the one that code               \chapter{Bibliography}      would produce. How can I make it show only the word "Bibliography" at the title, omitting the "Chapter 5" string? I tried               \bibliography*{file}      but it won't work. I also tried using package etoolbox and code               \patchcmd{\bibliography}{\chapter}{\chapter*}{}{}      but in vain.


title: MikTeX and TeXmaker are unable to compile

text: Please, I need help with some issues that happens with my TeX editors. I've installed MikTeX and TeXmaker on my computer and I got some troubles: The first of them is, when I try to compile my `.tex` file on MikTeX, there are no errors, the program only generates `.aux` and `.log` files, no `.pdf` files are generated during the compilation. The second is, I've saved a file in my Hard Drive and try to compile it, but TeXmaker returns an error message saying `> File not found.` I don't know what should I do. Please I need help because I need to compile an article to bring to my professor. This is the content of .txt file. I really don't understando that.               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9) (preloaded format=pdflatex 2013.5.22)  22 MAY 2013 13:14     entering extended mode     **C:/Users/Luis*Jr/Documents/Tex.tex     ("C:/Users/Luis Jr/Documents/Tex.tex"     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar     abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,      croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga     lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland     ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,      lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n     german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman     ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm     an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl     ishmax, welsh, loaded.     ("C:\Program Files (x86)\MiKTeX 2.9\tex/latex\base\article.cls"     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     ("C:\Program Files (x86)\MiKTeX 2.9\tex/latex\base\size10.clo"     File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     )     \c@part=\count79     \c@section=\count80     \c@subsection=\count81     \c@subsubsection=\count82     \c@paragraph=\count83     \c@subparagraph=\count84     \c@figure=\count85     \c@table=\count86     \abovecaptionskip=\skip41     \belowcaptionskip=\skip42     \bibindent=\dimen102     )     ("C:\Users\Luis Jr\Documents\Tex.aux")     LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.      ("C:\Users\Luis Jr\Documents\Tex.aux") )      Here is how much of TeX's memory you used:      201 strings out of 493921      2252 string characters out of 3144870      49031 words of memory out of 3000000      3582 multiletter control sequences out of 15000+200000      3640 words of font info for 14 fonts, out of 3000000 for 9000      841 hyphenation exceptions out of 8191      23i,1n,17p,162b,36s stack positions out of 5000i,500n,10000p,200000b,50000s          No pages of output.     PDF statistics:      0 PDF objects out of 1000 (max. 8388607)      0 named destinations out of 1000 (max. 500000)      1 words of extra memory for PDF output out of 10000 (max. 10000000)      When I compile a `.tex`, in case, trying to compile `Tex.tex` the compiler only generates a `.aux` and a `.txt` like the image above. Files


title: control margins with geometry or fullpage

text: Is there a better way to set               \topmargin     -1.5cm     \textwidth     15.5cm     \textheight     23.5cm     \oddsidemargin     0.7cm     \evensidemargin     1.2cm      perhaps using `\usepackage{geometry}` or `\usepackage{fullpage}`? What are the options to be invoked?


title: What other macros like \pdffilesize exist?

text: So I just learned about `\pdffilesize` from this answer. Are there other similar things like this? I learned about `\the\inputlineno` a while ago which prints the line number of the input file. In particular, is there a pdf page count? What other information about the file can you extract in this way? To clarify, what I'm asking is what other commands like `\pdffilesize` exist?


title: color text in bibliography text

text: I am trying to make blue color text in some of the bibliography. I have tried with the following code. It does not work. Please help me.               //myReference.bib file          @article{nature,     author = {\color{blue}Rosa Rademakers and Manuela Neumann and Ian R. Mackenzie}},     title = {\color{blue}Advances in understanding the molecular basis of frontotemporal dementia - elongated title}},     journal = {\color{blue} {Nature Reviews Neurology}},     volume = {\color{blue}{8}},     year = {\color{blue}{2012}},     pages = {\color{blue}{423-434}},     doi = {\color{blue}{10.1038/nrneurol.2012.117}},     }          @article{fuente,     author = {D. de la Fuente and J.G. Castaño and M. Morcillo},     title = {Long-term atmospheric corrosion of zinc},     journal = {Corrosion Science},     volume = {49},     year = {2007},     pages = {1420–1436},     }                    \documentclass{article}     \begin{document}     This is my document \cite{nature} and we have another \cite{fuente}     \bibliography{myReference}     \end{document}


title: \textcolor within lstlisting?

text: I have some pseudo-code where I want to highlight some sections in a different color (this is why: in an assignment at university, I have some code given and have to adapt it. I want to highlight what I changed for enhanced readability).               \documentclass[english, a4paper, 11pt]{article}     \usepackage{xcolor}     \usepackage{listings}     lstset(language=C)  //best for pseudo-code IMHO          \begin{document}     \begin{lstlisting}[frame=single]        public class A<T> extends B<T> {           \textcolor{red} {Stack stack};  //how can I achive this? Nothing should change, except for the textcolor. This code just prints the \textcolor command though.                 //ctor            public A() {};        }     \end{lstlisting}     \end{document}


title: using macros within a (new) environment

text: I'm working on my CV, and am trying to format job/education listings to look something like follows: > **Company or University (Location)**   >  _Job title or degree received_   >  Some description of what I did there. I'm putting enough of these in that I'd like to define an environment to handle the formatting so I don't have to hard-code it (and/or have to re-do every single one individually when I change my mind!). I.e. I'd like to be able to do something like               \begin{job}     \institution{Company or University}     \location{Location}     \position{Job title or degree received}     \description{Some description of what I did there.}     \end{job}      And have it output the above. I kind of blindly tried to define new commands for \institution, \location, \position, etc. using e.g.               \def\institution#1{\gdef{\@institution}{#1}}      and then create a new environment that does the formatting in the "after environment" code, like so:               \newenvironment{job}{}{\textbf{\@institution}}      I put both of these inside a `\makeatletter`...`\makeatother` block, and my document compiles fine with this in the preamble. But as soon as I try to actually use this environment, e.g. insert               \begin{job}     \institution{Someplace I worked}     \end{job}      somewhere in the document body, I get an error that says               Missing control sequence inserted: <inserted text>      \inaccessible      when it reads the `\institution{Someplace I worked}` line and a second that says               Undefined control sequence: <recently read> \@institution      when it reads the `\end{job}` line. So, clearly my naive approach doesn't work - any better ways to go about this?


title: Aligning itemize elements both from left and right

text: I do this               \documentclass[12pt]{article}     \usepackage{enumitem}     \setlist[enumerate]{labelwidth=3cm,labelsep=0.5cm,leftmargin=4cm,align=left}          \begin{document}         \begin{enumerate}[label=  Example \arabic*:]     \item 5 + 7 = 12     \item 9 + 1 = 10     \end{enumerate}          \end{document}      ![enter image description here](http://i.stack.imgur.com/cXThf.png) as you can see **1:** and **2:** are not aligned. since I use a different font, it has different widths for 1 and 2. How can I align by leftmost letter (E) and :. So I get something like                  Example   1:        Example  11:


title: MATLAB Plot Alignment in latex

text: I have two plots in which the x-axis are the same and I'd like to have the y-axis positions to be aligned. As the numbering of the y-axes are different when I print them in MATLAB as two eps files, they appear misaligned in the latex (Please see the figure)![enter image description here](http://i.stack.imgur.com/YnurD.png). Is there any way to align them? Thanks in advance, Reza


title: How to select a font for the main Chinese character and another font for its Furigana?

text: The objective is to make a list of Japanese vocabularies with Kanji stroke order for the main characters, its furigana (small kana characters placed above the main characters), and its meaning (in English). I have `KanjiStrokeOrders` font installed in my machine. I download it from this site (click).               \documentclass[border=12pt,12pt,preview,varwidth]{standalone}          \usepackage{xcolor}     \usepackage{fontspec}     %\usepackage{xeCJK}     \usepackage{ruby}     \renewcommand\rubysep{.05ex}          \AtBeginDocument{\fontsize{20}{20}\selectfont}          \let\temp\ruby     \renewcommand\ruby[2]{\temp {\fontsize{60}{60}\fontspec{KanjiStrokeOrders}\selectfont#1}{#2}}          \def\mean#1{: \textcolor{red}{#1}}          \begin{document}     \begin{enumerate}         \item \ruby{会}{かい}\ruby{社}{しゃ}　\mean{company}         \item \ruby{朝}{あさ} \mean{morning}     \end{enumerate}     \end{document}      ## without `xeCJK` Without `xeCJK` the main characters appears but their furigana disappear. ![enter image description here](http://i.stack.imgur.com/KUht5.png) ## with `xeCJK` With `xeCJK` the furiganas appear but the main characters no longer use `KanjiStrokeOrder` fonts. ![enter image description here](http://i.stack.imgur.com/P9AmI.png) ## Question: How should I select the font to achieve my objective mentioned above?


title: Using \foreach to manage ticks in axis, Tikz

text: I want to add minor distance between y ticks. The default distance is 0.5, I need to set for 0.2. It seems easy to set different space for ticks according to **pgfplots** , in 4.15, page 271. I add the suggested `ytick={\foreach \y in {.2,.4,.6}{\y}`, varying to get results, but I couldn't. Help me, please. My code graph is, with `\usepackage{tikz}` and `\usepackage{pgfplots}`, in the preamble:               \begin{figure}[!h]     \centering     \caption{Rigidez Efectiva para Columnas Rectangulares}     \begin{tikzpicture}[domain=0:.7]     \begin{axis}[xlabel={$P/A_{g}f'{c}$},ylabel={$EI_{ef}/EI_{g}$}, xmin=-.1,xmax=.7,ymin=0,ymax=1.4, ytick={\foreach \y in {.2,.4,.6}{\y}}]     \addplot[domain=-.1:.1,color=red,very thick]{.3};     \addplot[domain=.1:.5,color=red,very thick]{.2+\x};     \addplot[domain=.5:.7,color=red,very thick]{.7};          \end{axis}     \end{tikzpicture}     \end{figure}


title: Latex use other languages in section title

text: I am writing in english, greek `babel` and I have custom commands to change between languages. The problem is that I can change to english for example, anywhere in my text except in `\chapter{}`, `\section{}` etc. How can I use different languages in section titles? This doesn't work:               \section{Παράδειγμα \eng{Something}}      I don't want to use XeLaTeX.


title: Applying edge path to a specific level in Forest

text: This is a followup to the question at Is it possible to change the edges for some tree level using forest package? for lack of a followup question option. The modified MWE below does almost 100% of what I was looking for, but there is still minor tweaking to do in the anchoring of the last level's parent and corresponding edge path. Why does the edge path work fine in the first `forest` which grows `east`, but not in the last level of the second `forest` which grows east as well? Should the `edge path` of the last level in the second `forest` work exactly the same? Also, I tried to push the child nodes down (after creating the screen shot!), but the `s` option seemed to only work for the bottom child node N1C2 but not for the top node N1C1.               \documentclass{article}     \usepackage{forest}          \begin{document}     \begin{forest}      for tree={         draw=black,align=center,l sep=4em,grow=east,parent anchor=east,child anchor=west,         where n children=0{draw=red,for parent={calign=last}}{},         edge path={             \noexpand\path[\forestoption{edge}]           (!u.parent anchor) -- +(15pt,0) |-        % used with east-west growth           (.child anchor)\forestoption{edge label};         }        }     [P\\1\\2       [N1\\1\\2,name=_N1         [N1C1\\1\\2]         [N1C2,name=_N2]       ]       [N2         [N2C1]         [N2C2]       ]     ]     \end{forest}          \begin{forest}      for tree={         draw=black,align=center,l sep=4ex,         where n children=0{             child anchor=west,             edge path={                 \noexpand\path[\forestoption{edge}]                 (!u.parent anchor) -- +(15pt,0) |-      % used with east-west growth                 (.child anchor)\forestoption{edge label};             },             draw=red,for parent={                 parent anchor=east,                 grow'=east,calign=first,}}{},       edge path={         \noexpand\path[\forestoption{edge}]           (!u.parent anchor) -- +(0,-25pt) -|       % used with normal north-south growth           (.child anchor)\forestoption{edge label};       }     }     [P\\1\\2       [N1\\1\\2,name=_N1         [N1C1\\1\\2,s=-8ex]         [N1C2,name=_N2,s=-16ex]       ]       [N2         [N2C1]         [N2C2]       ]     ]\end{forest}          \end{document}      ![enter image description here](http://i.stack.imgur.com/ccPYm.png) **UPDATE:** After more tweaking the code below gets within hair width of the ideal solution. Just a note: the top 2 levels cannot be hardcoded, there can be any number of them, and the issues in this question apply to the last level in red only. The only 2 remaining issues are how to push the red nodes down to start below their parents?               \documentclass{article}     \usepackage{forest}          \begin{document}     \begin{forest}      for tree={         draw=black,align=center,l sep=4ex,parent anchor=south,child anchor=north,         edge path={             \noexpand\path[\forestoption{edge}]             (!u.parent anchor) -- +(0,-2ex) -|      % used with normal north-south growth             (.child anchor)\forestoption{edge label};         },         where n children=0{             child anchor=west,node options={minimum width=22em}, % to make nodes same width             edge path={                 \noexpand\path[\forestoption{edge}]                 (!u.parent anchor) -- +(-1em,0) |-      % used with east-west growth                 (.child anchor)\forestoption{edge label};             },             draw=red,for parent={                 parent anchor=south,l sep=1em,                 grow'=east,calign=child edge%first             }         }{}     }     [P0\\1\\2       [N111111111111111111111\\1\\2,name=N1         [N1C1\\1\\2,name=N1C1]         [N1C2\\1\\2,name=N1C2]       ]       [N2222222222\\1\\2,name=N2         [N2C1\\1\\2,name=N2C1]         [N2C2\\1\\2,name=N2C2]       ]       [N3333333333333\\1\\2,name=N3         [N3C1.............\\1\\2,name=N3C1]         [N3C2....\\1\\2,name=N3C2]         [N3C3........\\1\\2,name=N3C3]       ]     ]     \end{forest}     \end{document}      ![enter image description here](http://i.stack.imgur.com/Hdxia.png)


title: I need a bbl file with specific format?

text: I am using a latex template for my thesis. The template has a bbl file with following format:               \begin{thebibliography}{3}     \expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi          \bibitem[{Knuth(1984)}]{texbook}     {\sc Knuth, D.E.} (1984). {\em The {{\TeX}book}\/}. Addison-Wesley.          \bibitem[{Lamport(1986)}]{latex}     {\sc Mohsen, L.} (1986). {\em {\LaTeX:} {A} Document Preparation System\/}.     Addison-Wesley.          \bibitem[{Rudin(1973)}]{Rud73}     {\sc Rudin, W.} (1973). {\em Functional {Analysis}\/}. McGraw-Hill, New York.          \bibitem[{Taylor R.L(1991)}]{Zienkiewicz}     Zienkiewicz, O.C, Taylor R.L(1991) The Finite Element Method, Vol 2: Solid and Fluid Mechanics, Dynamics and Non-Linearity. McGraw-Hill           \end{thebibliography}      I am going the take my reference list from Mendeley but I face two issues: 1.Mendeley creates a bib file not a bbl file 2.I need to have the format shown above but it gives me something like this:               @article{,     file = {:C$\backslash$:/Users/mohsen/AppData/Local/Mendeley Ltd./Mendeley Desktop/Downloaded/Unknown - 1991 - Rheologica Acta Calculation of residual stresses in injection molded products.pdf:pdf},     keywords = {\_flow-,\_numerical analysis,\_thermally-induced residual stresses,amorphous,c\_ompressible l\_eonov model,induced residual s\_tresses,injection \_molding,notation and symbols,polymers,viscoelasticity},     pages = {284--299},     title = {{Rheologica Acta Calculation of residual stresses in injection molded products}},     volume = {299},     year = {1991}     }      I was wondering if anybody could help me how to resolve the problem.


title: How do I write a Physical Review or APS paper in lyx?

text: I am using RevTex 4.1 Document class in Lyx to write an APS paper. I do not find an option to enter Author or Abstract without the words 'Abstract' and 'Author' appearing. Also, when I convert to pdf, it does not exactly give me a 2-column document even though I have chosen that in the settings. Do I have to add some things ? Is there a lyx template available for an APS paper- I could not find it online ? Thanks.


title: Multiple labels for enumerated item

text: In an enumerate-environment, I have merged two previously separate items being too similar in content. In my text, I refer to both, i.e. with two different labels. Now that they are merged this is a problem: Is there some way I can give this item two labels? Before:               \begin{enumerate}     \item bla bla \label{first}      \item blu blu \label{second}     \item something     \item some other thing     \end{enumerate}      Wanted result:               \begin{enumerate}     \item bla bla blu \label{first} \label{second}     \item something     \item some other thing     \end{enumerate}      (But the above does not work)


title: Indexing with biblatex - how to filter out publication titles of indexed authors?

text: I am creating an index with biblatex, but want to filter out the publication titles. The goal is to have only the names of the authors in the index of authors, right now I end up with all author entries as desired but the titles of their books or articles create additional entries in the index file. How to surpress these listing? MWE would be as follows:                  \documentclass[a4paper,     12pt,     twoside,     ]{scrbook}     \usepackage{filecontents}     \begin{filecontents}{\bibliography.bib}     @ARTICLE{article,       author = {Nachname, Vorname},       title = {Titel des Zeitschriftenartikels},       journal = {Zeitschrift},       year = {2006},       volume = {6},       pages = {19--75}     }     @BOOK{book,       author = {Buchautor, Hans-Wilhelm},       title = {Irgendein Buch},       address = {Buch am Wald},       year = {2000}     }     \end{filecontents}     \usepackage{scrpage2}     \usepackage[T1]{fontenc}      \usepackage[ansinew]{inputenc}     \usepackage{mathptmx}     \usepackage[ngerman]{babel}     \usepackage[split,makeindex]{splitidx}     \newindex[List of authors]{aut}     \usepackage[%bibencoding=utf8,     backend=bibtex8,      natbib=true,     style=authoryear-icomp,     maxnames=3, minnames=1,     sorting=nyt,     indexing=true,     abbreviate=false,     dashed=true,     eprint=false,     block=none,     %bibencoding=auto     ]{biblatex}     %     \begin{document}     The example is really short MWE \parencite{article}. Maybe something is missing, please correct me if I forgot something as mentioned by \textcite{book}.     %     \printbibliography     \printindex     \end{document}      Additional question would be (I left it out of the MWE): In the current form, everybody is indexed that ist cited in the text. The publisher I am preparing the book for would like to have only names of authors indexed that are cited in the main text: How to filter out authors from the index that are cited in footnotes?


title: xkeyval: how to use default key value?

text: I am trying to use the `xkeyval` package to include key arguments in a new environment. It seems to work except for default values. Here's my best try so far:               \documentclass{article}          \usepackage{xkeyval}               \makeatletter     \define@key{Mystuff}{foo}[what]{\def\foo{#1}}     \define@key{Mystuff}{bar}[whatever]{\def\bar{#1}}     \savekeys{Mystuff}{foo,bar}     \makeatother          \newenvironment{myenv}[1][]%     {\setkeys{Mystuff}{#1}BEGIN \foo}     {END \bar}          \begin{document}          \begin{myenv}[bar=BAAAR]     Uh?     \end{myenv}          \end{document}      But this will cause LaTeX to complain about `\foo` being undefined:               ! Undefined control sequence.     \\myenv [#1]->\setkeys {Mystuff}{#1}BEGIN \foo           l.18 \begin{myenv}[bar=BAAAR]      And the output will be something like "`BEGIN Uh? END BAAAR`" (without the default "what" value to `\foo`). What am I doing wrong there, and how can I change this example so the default value for `\foo` will be used?


title: normal high asterisk in equation mode

text: I was looking back at some of the equations that I had written and noticed that the asterisks weren't behaving how _I_ was expecting it to (I also understand that my expectations may differ from other users). The point is, I'm trying to get Q* but instead I get something like this Q✶. I've tried using the caret (^) for superscript but it looks awfully small. Does anyone know a way to get the asterisk to behave as if it is in the normal text environment while in the equation mode?


title: Color in multirows

text: I have a similar problem to that on the post xcolor package; color multirows with the following table. The four-row-cell containing the word 'HHeader' should be completely gray. I have tried to implement the solution reported in the aforementioned post but it does not work for me. How can I solve this problem?               \documentclass[a4paper]{report}          \usepackage{multirow}     \usepackage[table]{xcolor}     \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \usepackage{hhline}          \begin{document}              \begin{tabular}{ ll | C{2.1cm} | C{2.1cm} | >{\centering}m{2.1cm} | C{2.1cm} | }             \hhline{~~|----|}             \multicolumn{2}{l|}{ } & \multicolumn{4}{|c|}{\cellcolor{lightgray}\textbf{VHeader}} \\ \hhline{~~|----|}             \multicolumn{2}{l|}{ } & \cellcolor{lightgray}\textbf{h1} & \cellcolor{lightgray}\textbf{h2} & \cellcolor{lightgray}\textbf{h3} & \cellcolor{lightgray}\textbf{h4} \\ \hhline{|------|}             \multicolumn{1}{|l|}{ } & \cellcolor{lightgray}\textbf{h5} & & & & \\ \hhline{|~|-----|} %\cline{2-6}             \multicolumn{1}{|l|}{ } & \cellcolor{lightgray}\textbf{h6} & & & & \cellcolor{red!40} \\ \hhline{|~|-----|}             \multicolumn{1}{|l|}{ } & \cellcolor{lightgray}\textbf{h7} & & & \cellcolor{red!40} & \cellcolor{red!40} \\ \hhline{|~|-----|}             \multicolumn{1}{|l|}{\multirow{-4}[0]{*}{\cellcolor{lightgray}\textbf{HHeader}}} & \cellcolor{lightgray}\textbf{h8} & & \cellcolor{red!40} & \cellcolor{red!40} & \cellcolor{red!40} \\ \hline         \end{tabular}          \end{document}      ![enter image description here](http://i.stack.imgur.com/uCUw5.jpg)


title: Cyrillic symbols in math equation xetex

text: I use Times New Roman font for my report. But in the math expressions are not displayed Cyrillic characters. Example:               \begin{equation}       S_{ном.} = S_{123}     \end{equation}      output               \documentclass[a4paper, 14pt]{extreport}           \usepackage[cm-default]{fontspec}     \setmainfont{Times New Roman}          \usepackage{titlesec}     \usepackage{indentfirst}     \usepackage{fncychap}     \usepackage{fancyhdr}     \usepackage[warn]{mathtext}          \usepackage[utf8]{inputenc}          \newfontfamily\cyrillicfont{Times New Roman}     \usepackage{polyglossia}     \setdefaultlanguage{russian}          \usepackage{amssymb,amsfonts,amsmath,mathtext,cite,enumerate,float, mathtext}


title: using pattern inside tikz shapes with dropped shadows

text: please, consider the mwe below. Question: why the fill of second node become transparent? Subquestion: why lines in pattern, then are thicker than 1pt are not smooth?                   \documentclass[tikz,border=5mm]{standalone}     \makeatletter         \usetikzlibrary{chains,patterns,shadows}     \tikzset{% customization of pattern              % based on <m.wibrow@gm...> - 2013-03-24 07:20:              hatch distance/.store in=\hatchdistance,             hatch distance=5pt,             hatch thickness/.store in=\hatchthickness,             hatch thickness=5pt             }     \pgfdeclarepatternformonly[\hatchdistance,\hatchthickness]{north east hatch}% name         {\pgfqpoint{0pt}{0pt}}% below left         {\pgfqpoint{\hatchdistance}{\hatchdistance}}% above right         {\pgfpoint{\hatchdistance-1pt}{\hatchdistance-1pt}}%         {             \pgfsetcolor{\tikz@pattern@color}             \pgfsetlinewidth{\hatchthickness}             \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}             \pgfpathlineto{\pgfqpoint{\hatchdistance}{\hatchdistance}}             \pgfusepath{stroke}         }     \makeatother     \begin{document}         \begin{tikzpicture}[         start chain=going below,         node distance=2mm,        Node/.style = {minimum width=#1,                       shape=rectangle, draw, fill=white,                       on chain},     Pattern/.style = {pattern=north east hatch,                       pattern color=teal!30,                       hatch distance=7pt, hatch thickness=2pt},                             ]\small\sffamily     %----------------     \node[Node=24mm,Pattern]    (a) {without shadow};     \node[Node=24mm,Pattern,           drop shadow]          (b) {with shadow};     \node[Node=24mm,           drop shadow]          (c) {without pattern};     %---         \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/hWh5R.jpg)


title: Using tikzscale along with correct references in externalized tikzpictures

text: It is not advised to use `tikzscale` package along with `mode=list and make` based on Patrick's comment here: http://tex.stackexchange.com/a/89595/24167 However, the references (e.g. `\cite`) does appropriately shown when using `mode=convert with system call` as discussed in: References in externalized pgfplots When using externalization and `tikzscale` package, is there any way to get the references in tikzpictures correct when using `mode=convert with system call`? A MWE can be found here: http://tex.stackexchange.com/a/40684/24167


title: Are there good comprehensive lists of LaTeX commands online?

text: I'm relatively new to actual LaTeX scripting, much of my experience comes from using MathJax over at math.stackexchange.com and I'm kinda self-taught, just picking things up as I need them. However, I'd like to write an entire paper in LaTeX now and I need to do a bit more than MathJax offers to me, such as page allignment, font selection, etc. However, it would be nice to view a list of all (or most) the commands, preferably categorized and easy to navigate. Does such a place exist and where can I find them?


title: Problem with refcheck

text: The following code does not do what it should:               \documentclass{article}     \usepackage{refcheck}          \begin{document}          \begin{thebibliography}{1111}          %% This works:     \bibitem[Ccc]{FP}     The Frog, Kermit, and Piggy, Miss.     \newblock Sesame Street.          %% This does not work:     \bibitem[CCC]{FP2}     The Frog, Kermit, and Piggy, Miss.     \newblock Sesame Street.          \end{thebibliography}          \end{document}      I get the follwing error:               ! Undefined control sequence.     \\bibitem ...$}}\@@@biblabel@@ }\fi }\ifx #1\@nil                                                        \@@bibitem@@ {#2}\else \@@...     l.14 \bibitem[CCC]{FP2}      It seems that `refcheck` has a problem with certain optional labels in `\bibitem`. What I am doing wrong here?


title: xtable function generated latex does not get parsed for special char such as square brackets

text: I'm using the `knitr` package for putting my `R` output into PDF. I have two problems using `xtable`:   1. When my table data has chars like this: `[`, `]` in them, the conversion from `.tex` to `.pdf` fails with error   2. When I use the package `seqinr:stresc()` to escape such chars, I'm able to get the content at least displayed (better than the situation 1 above). But remains the problem that the final PDF ends up displayed like this: `\lbrack{}ABD\rbrack{} r22` instead of displayed like this: `[ABD] r22`. Could anyone throw some light on how we can get this solved?


title: biblatex - content of .bib-file breaks biblatex

text: * TeX Live 2013, last update was on 2013-08-20   * biblatex uses biber  I am experiencing a weird and terrible problem: I think the content of my .bib-file breaks biblatex/biber. When I run my biblatex style with my .bib- file generated by Citavi 4 on 2013-08-20, the bibliography does not get printed and the following code bit can be found in the .log-file:               Package biblatex Info: Trying to load biblatex default data model...     Package biblatex Info: ... file 'blx-dm.def' found.          (c:/texlive/2013/texmf-dist/tex/latex/biblatex/blx-dm.def)     Package biblatex Info: Trying to load biblatex style data model...     Package biblatex Info: ... file 'authoryear-ibid.dbx' not found.     Package biblatex Info: Trying to load biblatex custom data model...     Package biblatex Info: ... file 'biblatex-dm.cfg' not found.      and later on:               (c:/texlive/2013/texmf-dist/tex/latex/biblatex/cbx/authoryear-ibid.cbx     File: authoryear-ibid.cbx 2013/07/15 v2.7a biblatex citation style (PK/JW/AB)     Package biblatex Info: Redefining '\cite'.     Package biblatex Info: Redefining '\parencite'.     Package biblatex Info: Redefining '\footcite'.     Package biblatex Info: Redefining '\footcitetext'.     Package biblatex Info: Redefining '\smartcite'.     Package biblatex Info: Redefining '\textcite'.     Package biblatex Info: Redefining '\textcites'.     )     Package biblatex Info: Trying to load configuration file...     Package biblatex Info: ... file 'biblatex.cfg' found.        * When I run the full .bib-file with an MWE, I can reproduce it (see code bit above).   * When I edit the .bib-file to the one source in the MWE and run it, it works flawlessly. This is why I think something in the .bib-file breaks biblatex.   * I also compared the most recent .bib-file with one that worked from before via Notepad++'s Compare-plugin, but to the best of my knowledge everything is just fine in the most recent file. => Would anyone have a clue of what is going on here? I actually doubt that the content breaks biblatex but it's the next best conclusion I can make at this point. I suppose I could upload the whole .bib-file and ask for someone to check it, but I can't imagine anyone would do that nor that Citavi suddenly got something wrong during the export. Plus I don't want to do that really.


title: Measure rendering progress

text: I have some large reports that are automatically generated and compiled using XeLaTeX. Just wondering if anyone knows of a way to track the rendering progress as these reports can take over a minute to render (many TikZ figures and 2-300 pages). I'm using XeLaTeX on Ubuntu.


title: Predefined settings in Wrapfig

text: I would like to use:               \begin{wrapfigure}{r}[Xcm]{Ycm}     \itshape     \SomeSymbolHere\\     \fontsize{16}{16}     \textbf{bla bla bla.}     \end{wrapfigure}      many times within my document, preferably writing something like \mywrap{bla bla bla.}. I guess I somehow have to invoke the `\renewcommand` as well. According to the documentation 1 page 3 , we _should_ be able to implement some of it:               \setlength{\wrapoverhang}{\marginparwidth}     \addtolength{\wrapoverhang}{\marginparsep}      This doesn't work for me, however. But how do I add all of the abovementioned settings?


title: TexMaker's internal PDF-viewer crashes when there is figure

text: I have been using TexMaker for one year and everything was pretty smooth until recently. Right now as long as there is a figure in the pdf, when I compile the file (successfully) and scroll down to that figure, the whole program freezes and never responds again. However, the pdf files themselves are fine and can be opened using any pdf reader. It happens to any manuscript with any type of figure, despite the fact that I could open all of them before. When there is no figure, or there is a figure at the end of the paper and I don't scroll to the figure, everything seems to be fine. I tried deleting the software (and the preference file) and installed a newer version, but it did not work. I didn't do anything serious(that I can remember) to my system before this problem came up. I am using a Windows 8 Pro (upgraded from Win 7 a long time ago), with Adobe Reader 11. Does anyone know where the problem is? Thanks a lot!


title: Change line thickness in thmtools

text: I am using the `thmbox=M` option with `thmtools` and I would like to change the line thickness of the box. I found how to change the colour in here: thmbox color bar. Is there an easy modification of what is in that post to apply here?!


title: Latex info help on Ubuntu?

text: If this is better as an Ubuntu question, I'll direct it there. Anyway, as a diehard emacs/AucTeX user I'm used to opening up `latex-info` (which uses GNU texinfo) for quick confirmation or reminder on the correct syntax of a command. However, it doesn't seem to be installed with my current texlive, nor can I find an Ubuntu package which contains it. I can find latex-info on CTAN, but it doesn't seem to be installed on my system. I suppose I could install it manually, but that would mean fiddling with info "dir" files. Is there a package which includes latex-info, or is there another version of latex docs on my system? (I do have `preview-latex` docs as info files, but not latex itself.)


title: How to expand row height while using long text in multirow?

text: I m working on one table which has one row which spans over 3 rows but text in this row is very lengthy so it uses more than 3 lines so all text is not visible. How can i increase row height dynamically to fit this row.               \documentclass[crop]{standalone}     \usepackage{multirow}          \begin{document}          \Huge     \begin{tabular}{|c|c|c|}      \hline       \multirow{3}{*}{\parbox{8cm}{This is line1 ~\\ ~\\ This is line 2 ~\\ ~\\ This is line3 ~\\ ~\\ This is line 4}} & cell1 & cell2 \\ \cline{2-3}     & cell3 & cell4 \\ \cline{2-3}     & cell5 & cell6 \\ \hline     \end{tabular}           \end{document}      line3 and line4 are not visible as it uses more than 3 row space. As shown in the image: ![enter image description here](http://i.stack.imgur.com/dzspO.png) How can i control it? Regards


title: Can I have the \overfullrule rule colored in pdfLaTeX?

text: I know that I can use `\overfullrule=5pt` to get overfull lines marked with a black marker. I am using pdfLaTeX. Is there a way I can get this marker or something similar in magenta instead?


title: How can I set up the left/right margin of the page to 1 inch, the top/bottom one to ½ inch?

text: I try to set up the left and right margins to 1 inch, top and bottom margins to 0.5 inch. The following is my code:               % Setup the margin     \usepackage[centering, margin={1in, 0.5in}, includeheadfoot]{geometry}     \setlength{\headheight}{0.6in}      \setlength{\headsep}{25pt}     \setlength{\topmargin}{0pt}     \setlength{\footskip}{25pt}     \setlength{\marginparsep}{11pt}      But I don't know why the result doesn't show me the correct page setup. ![enter image description here](http://i.stack.imgur.com/cCpfP.png) As you can see, obviously the bottom margin is 0 and the footer is missing. That's not what I set up. Could anybody tell me what's wrong with my code? and how to fix it? Thank you very much.


title: Keywords and MSC Classification in LaTeX article class

text: In the amsart document class, one has the commands `\keywords{foo}` and `\subjclass{foo}`. I was wondering, how does one make similar commands for the standard LaTeX article class?


title: Verbatim text can't be shown correctly in pdf

text: I try to change the font of verbatim text as below               % Used by @verbatim ... @endverbatim     \newenvironment{DoxyVerb}{%       \verbatim%       \fontencoding{OT1}\fontfamily{ptm}\fontseries{m}\fontshape{n}%       \fontsize{10pt}{10}\selectfont%     }{%       \endverbatim%       \normalsize%     }      But I don't know why some characters cannot be shown in pdf ![enter image description here](http://i.stack.imgur.com/A7wZF.png) The example call is the verbatim text in the above figure. The variable name should be parameter_table_build_number, but pdf shows the underscore as an upper dot. I copied that dot and paste into notepad, it shows me the underscore. I searched the underscore in pdf, and it also indicates that dot is the underscore. However, if I change the font to \footnotesize, it show me the correct character but the verbatim text will exceeds the paper's boundary. ![enter image description here](http://i.stack.imgur.com/rjN4m.png) Could anybody tell me how to fix this problem? Thanks a lot.


title: putting \psframebox with the left corner coordinate in PSTricks

text: Using the auto-generated codes by LaTeXdraw, I put a text box with the following code in PSTricks:               \rput(9, -1){\psframebox[linewidth=0.04,fillstyle=solid]{Text Goes Here}}      I guess the coordinate `(9,-1)` corresponds to the center of the text box. Can I assign the coordinate for the left-top corner of the text box? I wanted to put several text boxes vertically and arrange them with the left sides of the boxes aligned.


title: Don't print year for online entries in biblatex 2.7

text: With the new version of `biblatex` (probably implemented in version 2.6, cf. http://tex.stackexchange.com/a/126261/9077), `ONLINE` entries are now printed with full dates, with that information taken from the `URLDATE` field. I would like to suppress that (so that it appears like it did in version 2.5). I can add `\clearfield{labelmonth}` and `\clearfield{labelday}` to my preamble to suppress the month and the day, but I can't add `\clearfield{labelyear}`, since that will remove the year from all other entries in the bibliography as well. What can I add to my preamble to suppress printing the year in `ONLINE` entries only?               \documentclass{article}     \usepackage{csquotes,filecontents}     \usepackage[style=authoryear]{biblatex}     \AtEveryBibitem{\clearfield{labelmonth}}     \AtEveryBibitem{\clearfield{labelday}}     %\AtEveryBibitem{\clearfield{labelyear}}     \begin{filecontents}{\jobname.bib}     @BOOK{lennon1972,         AUTHOR = "John Lennon",         TITLE = "Peace on earth",         YEAR = "1972"}     @ONLINE{googletranslate,         TITLE = "Google Translate",         SHORTHAND = "Google Translate",         URL = "http://translate.google.com/",         URLDATE = "2013-08-01"}     \end{filecontents}     \addbibresource{\jobname.bib}     \begin{document}     I managed to read \cite{lennon1972} with the help of \cite{googletranslate}.     \printbibliography     \end{document}      ![enter image description here](http://i.stack.imgur.com/hlBxu.png)


title: How can I modify a fontinst encoding (e.g. t1.etx)?

text: I am modifying the adobecaslon package to support the Adobe Caslon Expert fonts, basing my work on an old package by Ulrik Vieth for which only some sources are available; I'm also trying to make the package more modular, building on fontinst 1.9. Adobe Caslon's Expert fonts include st and ct ligatures. To use these, Vieth produced a modified t1.etx encoding file. I would prefer merely to use it an override it. I tried thusly:               \relax          \encoding          %% First load the base encoding     \inputetx{t1}          %% Then override some slots     \nextslot{99}     \setslot{\lc{C}{c}}      \ligature{LIG}{\lc{T}{t}}{ct}        \comment{The letter `{c}'.}     \endsetslot          \nextslot{115}     \setslot{\lc{S}{s}}      \ligature{LIG}{\lc{T}{t}}{st}        \comment{The letter `{s}'.}     \endsetslot          \nextslot{141}     \setslot{ct}      \comment{The `old style' ligature ct}     \endsetslot          \nextslot{173}     \setslot{st}      \comment{The `old style' ligature st}     \endsetslot          \endencoding      This seems to work nicely, but I get warnings from fontinst like this:               This character already appeared in a LIGTABLE LABEL (line 4312).        (LABEL D 99                    ) (COMMENT c)        Indeed, if I check the .vpl files output, I find duplicate entries. However, the later entry contains all the same information as the earlier one, plus my modifications, and the output seems to work OK. What I'd like to know is, am I doing this the right way, and can I ignore the warnings?


title: Insert Image from multipage pdf file in Lyx

text: I am writing a report and I have all the images in a pdf file with very high resolution. With limited skills in editing, I am loosing the quality of the image when I try to save the individual images. I am wondering, if there is any option in LyX to include the images directly from the pdf file by specifying the page number. I happen to stumble across this post here which I can use in LaTeX. Is it possible to do similarly in LyX as well?


title: making pdflatex look in the right place for texlive

text: I have followed the install instructions for texlive for unix, and have set the path permanently - i.e. "echo $PATH" gives the following output -               /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/jtait/.script:/usr/local/texlive/2013/bin/x86_64-linux      (the correct texlive directory being at the end). Also, tlmgr is working fine, so it certainly is the right path. However, when I run pdflatex everything it loads is in /user/share, and it using this version:               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)      If I remove tex-live (which I thought I had - I since purged it), it still won't work. Is there something other than setting the path that I should be doing? I don't know if this is pdflatex specific. I am on an Ubuntu install, 13.04. This question on the Ubuntu stack exchange appears to be related (though with no answers). I left all the install options as default, in case that is relevant.


title: TeX includepdf works differently on Mac vs Linux

text: I'm developing on a Mac for a Linux-hosted web app that generates PDF files with TeX. The feature overlays dynamic text data on top of static PDF backgrounds (scanned copies of paper forms). Everything works fine on the Linux box using pdflatex: the PDF includes appear as backgrounds, with the text data appearing on top. On the Mac however (using MacTeX), the text either doesn't show (apparently covered by the PDF includes) or the PDF includes and text are printed on different pages. Here's an abbreviated example of the TeX file (full headers included):               \documentclass[letter,12pt]{article}     \usepackage[absolute]{textpos}     \usepackage{latexsym,fancyhdr}     \usepackage[pdftex]{graphicx}     \usepackage{pdfpages}     \pdfcompresslevel=9     \usepackage{eso-pic}     \usepackage{color}     \usepackage{type1cm}     \setlength{\TPHorizModule}{1in}     \setlength{\TPVertModule}{\TPHorizModule}     \textblockorigin{0in}{0in}     \setlength{\parindent}{0pt}     \renewcommand{\ttfamily}{ptm}     \definecolor{gray}{cmyk}{0,0,0,0.1}          \begin{document}          \newpage          \begin{textblock}{2.4}[0,1](5.75,0.451){\sf HELLO}\end{textblock}          \includepdf{/path/to/foo.pdf}          \newpage          \textblockcolor{}             \begin{textblock}{1.2}[0,1](4.28,0.53)     \begin{tabular}{p{0.01cm}p{0.01cm}p{0.01cm}p{0.01cm}p{0.01cm}}W & O & R & L & D\end{tabular}      \end{textblock}          \includepdf{/path/to/bar.pdf}          \end{document}      In the above example, page 1 properly shows foo.pdf and "HELLO" on both Linux and Mac, but page 2 shows only bar.pdf on the Mac, while the Linux box properly shows both bar.pdf and "WORLD". If I move the includepdf before the textblock on page 2, the Mac gives me bar.pdf on page 2 and "WORLD" on page 3. Note that I'm using tables to achieve a monospace effect, as the bar.pdf form background has letter-boxes that are normally filled in by hand. This seems to be unrelated to the bug however, as bypassing the pseudo-monospace effect yields the same result. Cheers to any TeX gurus out there who can shed some light!


title: Too much space between full paragraph and subequations env

text: I have a document using subequations and the parskip package. If the paragraph before a subequations environment is completely filled up to the last line, then additional vertical whitespace is introduced between this paragraph and the following subequations. I guess this is a bug, but I'm not sure, nor do I have enough TeX knowledge to try and fix it. How can I fix this whitespace issue? Below is a MWE which shows the behaviour, at least on LaTeX2e <2003/12/01> with pdfeTeX 3.141592-1.21a-2.2 (unfortunately on this machine only an old tetex distribution is installed).               \documentclass[a4paper,11pt]{article}          \usepackage{parskip}     \usepackage{amsmath}          \begin{document}          The subequations environment provides a convenient way to number a foos     \begin{subequations}\label{foo}       \begin{align}         x^2 + y^2 &= z^2\\         a &= b + c       \end{align}     \end{subequations}          \end{document}


title: How to remove \BODY defined in the algorithmic package?

text: The `algorithmic` package defines a command `\BODY` which evidently clashes when used in conjunction with the `environ` package. More specifically, LaTeX failes to compile when an `algorithmic` environment is used inside another environment created using `\NewEnviron`. How can I undo, or rename, the `\BODY` which is provided by the `algorithmic` package?


title: Creating a footnote in a paper title

text: I'm trying to create a footnote in my document title, but coming a bit unstuck - the document starts as so:               \documentclass{acm_proc_article-sp}     \begin{document}          \title{This is my title\footnote{Just a note.}}      I get a dot after the title, presumably the footnote indicator, but the footnote text is nowhere to be seen. Could anyone shed some light on this?


title: Putting text next to a kmap

text: I want to put the equation next to the kmap, but it seems the kmap is located higher. How can I align the text and the kmap to start at the same height?               \documentclass[12pt]{article}          \usepackage{tikz}     \usetikzlibrary{matrix,calc}          \begin{document}     \tikzset{     table nodes/.style={        rectangle,        draw=black,        align=center,        minimum height=7mm,        text depth=0.5ex,        text height=2ex,        inner xsep=0pt,        outer sep=0pt     },           table/.style={        matrix of nodes,        row sep=-\pgflinewidth,        column sep=-\pgflinewidth,        nodes={            table nodes     },     execute at empty cell={\node[draw=]{0};}     }     }               $a$:     \begin{tikzpicture}        \matrix (kmap) [every node/.style={anchor=base},table,text width=10mm,name=kmap]        {         \node (a11){1}; & \node (a12){}; & \node (a13){1}; & \node (a14){1}; \\         \node (a21){1}; & \node (a22){1}; & \node (a23){}; & \node (a24){1}; \\         \node (a31){1}; & \node (a32){1}; & \node (a33){1}; & \node (a34){1};  \\         \node (a41){}; & \node (a42){1}; & \node (a43){}; & \node (a44){1};  \\        };        \draw (a12.north west) -- ++(0,.3) node (lx3) {};        \draw (a13.north east) -- ++(0,.3) node (rx3) {};        \draw (lx3.north) to node[midway,above]{$x_0$} (rx3.north);             \draw (a21.north west) -- ++(-0.3,0) node (lx4) {};        \draw (a31.south west) -- ++(-0.3,0) node (rx4) {};        \draw (lx4.west) to node[midway,left]{$x_1$} (rx4.west);             \draw (a14.north east) -- ++(0.3,0) node (lx5) {};        \draw (a24.south east) -- ++(0.3,0) node (rx5) {};        \draw (lx5.east) to node[midway,right]{$x_3$} (rx5.east);             \draw (a41.south west) -- ++(0,-.3) node (lx2) {};        \draw (a42.south east) -- ++(0,-.3) node (rx2) {};        \draw (lx2.south) to node[midway,below]{$x_2$} (rx2.south);     \end{tikzpicture}     \begin{tabular}{cccc}        $a$ & $=$ && $x_3 \overline{x_0}$\\        $$   && $+$ & $x_2 x_1$\\        $$   && $+$ & $\overline{x_2}\; \overline{x_1}$\\        $$   && $+$ & $x_3 \overline{x_1}$\\        $$   && $+$ & $x_3 x_2 x_0$\\        $$   && $+$ & $x_3 \overline{x_2}\; \overline{x_1}$\\     \end{tabular}          \end{document}      ![result so far](http://i.stack.imgur.com/45zlk.jpg) Added a second picture to clarify ![result I wish for](http://i.stack.imgur.com/orXcI.jpg)


title: Itemize item on new line when nested in a description

text: I have a itemize list within a description list. Each description defines a item and the content is an itemize list. (As per the code example below and the output at the end of this question)               \documentclass[a4paper,11pt]{article}     \begin{document}     \begin{description}         \item[foo bar foo bar]          \begin{itemize}             \item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.             \item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.          \end{itemize}         \item[bar foo]         \begin{itemize}             \item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.             \item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.          \end{itemize}          \end{description}     \end{document}      I would like my itemize list to be flush left but with no other content the list starts to the right of the description item. If I try to end the line by going                   \item[foo bar foo bar] \\      I get the following complaint               ! LaTeX Error: There's no line here to end.      Which seems reasonable, there is no line to end. How do I force latex to start the itemize list below the description? ## Output ![Output](http://i.stack.imgur.com/uk74e.png)


title: Equation tags in lining numerals

text: This is a follow-up to this question; I'd like also the tags (typeset by the `\tag` command) to be in lining numerals. However, inspecting the definition of `\tag` in `amsmath` didn't reveal too much to me - it is `\let` to different macros, depending on (I guess) which exactly environment is being used.


title: QED symbol on the same page as proof

text: I'm using the `proof` environment from the `amsthm` package. In some cases, the last line of a proof falls at the end of a page, but the QED symbol (the little white box) ends up on the following page. Is there any way to guarantee that in each instance of `\begin{proof} ... \end{proof}` in my document, the QED symbol will always be on the same page as the last line of the proof? Here is an MWE which demonstrates this problem:               \documentclass{article}          \usepackage{lipsum}     \usepackage{amsthm}          \begin{document}          \begin{proof}          \lipsum[1-5]     This is the concluding line of the proof.          \end{proof}          This line is on the second page, below the QED symbol.          \end{document}


title: Decorate tikz path with cyrillic text

text: I'm trying to decorate tikz path with cyrillic symbols without any success. I can use ASCII symbols but not cyrillic.               \documentclass{standalone}     \usepackage{tikz}     \usepackage[utf8]{inputenc}     \usepackage[T2A,T1]{fontenc}     \usepackage[english,russian]{babel}          \usetikzlibrary{decorations.text}          \begin{document}          \begin{tikzpicture}          \draw (0,0) circle (1cm);     \path[        postaction={          decorate,          decoration={            text along path,            reverse path=false,            text={very long long text}          }       }     ] (0,0) circle (1cm);          \end{tikzpicture}          \end{document}      If I put cyrillic symbols in `text={}` this cause many errors. **UPDATE:** I have processed my tex file with XeLaTex and it works partially. It shows only first symbol. Also I need to pass the text as parameter as follow:               \newcommand\PathWithText[1]{     \draw (0,0) circle (1cm);     \path[       postaction={         decorate,           decoration={             text along path,             reverse path=false,             text={#1}           }         }     ] (0,0) circle (1cm);     }     \PathWithText{очень длинный текст}


title: footnote and autocite=footnote don't behave the same under fnpct

text: This may sound like a crazy scenario, but whilst using `fnpct` (and the `after-punct-space` option especially) and the `\autocite` command from `biblatex` (using the option `autocite=footnote`), I realized the spacing around the footnote mark wasn't treated the same way as with the command `\footnote`. This is hardly noticeable in `british`, but very severe in `french` (from `babel`). A weird thing is that it is `\footnote` that doesn't seem to react to the `after-punct-space` option when `french` is the language, whereas `\autocite` does. I'm using v2.8a of `biblatex` and `fnpct` v0.2k (2013/04/07). Variants I tried:   * neither `\frenchbsetup{FrenchFootnotes=false}` nor `\usepackage[hang]{footmisc}` help   * not using anything from `biblatex` at all (`footnote` is still problematic) I'd be satisfied if I could redefine the basic `\footnote` like it's `autocite=footnote` version, but I'm not savvy enough to know how to dig that information up. Here's a code example, tuned for maximal graphical effect (the right alignment just helps visualize things, for example):               \documentclass[french,12pt]{article}          \usepackage{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{fnpct}     \usepackage[babel]{csquotes}     \usepackage[autocite=footnote,autopunct=false]{biblatex}          \AdaptNoteOptNoMult\autocite          \renewcommand{\thempfootnote}{\arabic{mpfootnote}}          \begin{document}          \begin{minipage}{6cm}     \emph{Without \texttt{after-punct-space}:}     \begin{flushright}          Here I'm using footnote\footnote[2]{Check!}.          \setcounter{mpfootnote}{1}          And here\ldots\ autocite\autocite{nokeyneeded}.     \end{flushright}     \end{minipage}          \vspace*{1cm}          \setfnpct{after-punct-space=-1em}          \begin{minipage}{6cm}     \emph{With \texttt{after-punct-space}:}     \begin{flushright}     Here I'm using footnote\footnote[2]{Check!}.          \setcounter{mpfootnote}{1}          And here\ldots\ autocite\autocite{nokeyneeded}.     \end{flushright}     \end{minipage}          \end{document}      ![enter image description here](http://i.stack.imgur.com/ajqVc.png) [edited to add the `fnpct` package version]


title: Floating text around listing

text: I can't manage to let my text float around an listing. Assuming I have a text paragraph and I want the listing to be at the top right place with a certain width, and to be floated by the text.               \documentclass[letterpaper]{article}          \usepackage{listings}     \usepackage{blindtext}          \begin{document}          \blindtext          \begin{lstlisting} % this should be printed to the right of the text     public void Main (string[] args)     {        // here goes some code     }     \end{lstlisting}          \end{document}      How can I do this? **Solution according to Guido's answer:**               \begin{wrapfigure}[6]{r}{.6\textwidth}     \begin{minipage}{.6\textwidth}     \vspace{-2em}     \begin{lstlisting}     ....     \end{lstlisting}     \end{minipage}     \end{wrapfigure}      With two modifications:   * My listings produces captions with a box that is spanned over the whole textwidth, so I added a minipage.   * The listing was a bit to far below, so I added a vspace.


title: Two-column layout with left column just as wide as its content

text: Here is image of desired layout, from PDF-ed MS Word version of the documment: ![](http://i.stack.imgur.com/54pMs.png) It's A5 format. What I exactly want is:   * have it in two columns, each of them left-aligned   * lyrics should take as much space as they need; so, simple `\begin{multicols}{2}` is not enough How can I achieve such layout using LaTeX?


title: Drawing a Markov chain using Tikz

text: I want to draw the following Markov chain using tikz, but I have a few problems that I do not know how to handle: I want the transition grid to look exactly like the picture. All outgoing edges are parallel and so are all the incoming edges. At each intersection, there must be an arrow as depicted in the picture and the labels appear above the intersections. Also, some edges are not continuous and have dots in the middle. ![Markov chain - hand drawn](http://i.stack.imgur.com/G91RT.jpg) Below is what I have worked out so far, but it is very incomplete with lots of problems that I do not know how to fix.               \documentclass[12pt]{article}          \usepackage[landscape]{geometry}     \usepackage{tikz}     \usetikzlibrary{arrows,automata}          \begin{document}          \begin{tikzpicture}[->,>=stealth',shorten >=1pt,node          distance=2cm,looseness=2,bend right=40]          \draw[help lines] (-1,-3) grid (16,1);          \tikzset{every state/.style={minimum size=35pt,scale=0.6}}     \node [state] (0)                    {$0$};     \node [state] (1)   [right of = 0]   {$1$};     \node [state] (2)   [right of = 1]   {$2$};     \node         (d1)  [right of = 2]   {$\cdots$};     \node [state] (km1) [right of = d1]  {$k-1$};     \node [state] (k)   [right of = km1] {$k$};     \node [state] (kp1) [right of = k]   {$k+1$};     \node         (d2)  [right of = kp1] {$\cdots$};     \node [state] (mmk) [right of = d2]  {$m-k$};     \node         (d3)  [right of = mmk] {$\cdots$};     \node [state] (mm2) [right of = d3]  {$m-2$};     \node [state] (mm1) [right of = mm2] {$m-1$};          \path (0)   edge (1)                 edge (2)                 edge (km1)                 edge [loop above] node {$\mu_0$} (0);     \path (1)   edge (2)                 edge (km1)                 edge (k)                 edge [loop above] node {$\mu_0$} (1);     \path (2)   edge (km1)                 edge (k)                 edge (kp1)                 edge [loop above] node {$\mu_0$} (2);     \path (km1) edge (k)                 edge (kp1)                 edge [loop above] node {$\mu_0$} (km1);     \path (k)   edge (kp1)                 edge [loop above] node {$\mu_0$} (k);     \path (mmk) edge (mm2)                 edge (mm1)                 edge [loop above] node {$0$} (mmk);     \path (mm2) edge (mm1)                 edge [loop above] node {$0$} (mm2);     \path (mm1) edge [loop above] node {$1$} (mm1);     \end{tikzpicture}          \end{document}


title: Passing day, month and year to my macro

text: I just wanted to ask, how to do something like this - I have my own macro, that needs custom date passed as arguments:               \newcommand{\introduction}[3]{     This is regarding your loan application that was on \formatdate{#1}{#2}{#3}.}      And then I use this macro in the text with custom day, month and year. But LaTeX shows me current date. So, what is wrong? Is it because the date isn't known in the preambule (and current date is used as default)? Thank you for your hints.


title: How to put align two things between a long vertical bar?

text: Basically what I want is something like this               ###### | ######     ###### | ######     ###### | ######     ###### | ######     ###### | ######     ###### | ######      where # represents a derivation for an equation or something. I also cannot figure out the vertical line option with just `\vline[30pt]`.


title: Uniform distribution symbol

text: What is the symbol for uniform distribution in LaTeX? I'm assuming that it is this symbol? Or should I just use a simple U?


title: Caption formatting with babel French

text: I have a problem override the default formatting of float captions when using babel’s French option. When babel’s `francais` setting is chosen, captions are formatted with the label (“Figure X”) in small caps. I'm trying to override that with the `caption` package, but to no avail. The following minimal example:               \documentclass{article}     \usepackage[labelfont=it]{caption}     \usepackage[francais]{babel}     \usepackage[T1]{fontenc}     \begin{document}     \begin{figure}\caption{xxxxx}\end{figure}     \end{document}      gives ![enter image description here](http://i.stack.imgur.com/CyVxF.png) where only the digit is italicized. If I comment out the `babel` line, it works correctly: ![enter image description here](http://i.stack.imgur.com/VFxqp.png) `caption`’s doc says that it should be loaded after `babel` to override it, but here it does not seem to be the case. Anyone knows how to work around this issue?


title: Incorrect page number in ToC and minitoc

text: In the following MWE, the section number is reset at the beginning of each chapter. If, in the ToC, you click S4 it goes to S1, which is wrong. Both S4 and S1 have the same page number. The same thing happens in the second chapter's minitoc. Is there a way to make sure the links only point to the corresponding section of the same chapter despite the fact the sections have the same page number?               \documentclass{book}          \usepackage{minitoc}          \usepackage{hyperref}          \begin{document}     \dominitoc          \tableofcontents          \chapter*{Test 1}     \mtcaddchapter[Test 1]     \pagenumbering{arabic}     \minitoc          \section{S0}     \clearpage          \section{S1}     \clearpage          \section{S2}               \chapter*{Test 2}     \setcounter{section}{0}     \mtcaddchapter[Test 2]     \pagenumbering{arabic}     \minitoc          \section{S3}     \clearpage          \section{S4}     \clearpage          \section{S6}          \end{document}


title: REVTeX 4 author issue

text: I am trying to use the REVTeX 4 package for the first time, my code is               \documentclass[aps]{revtex4}     \usepackage[spanish]{babel}     \title{Title}     \author{Myname}     \begin{document}     \begin{abstract}          This is my abstract          \end{abstract}     \maketitle          This is my document          \end{document}      The problem is that whenever I try to compile it into the pdf file, it tells me:               ! Undefined control sequence.<argument> \collaboration@sw{\expandafter \appdef \expandafter \AU@grp \exp... \author{Myname}      And whenever I try to compile it without an author's name, no title appears, like if `\maketitle` didn't work. Does anybody know what's wrong? I've been trying to fix it but I'm pretty new to LaTeX...


title: Section should automatically start new page if the whole section does not fit on current page

text: I would like my sections to start on a new page if they do not fit on the current page. In other words: if a section fits on the current page print it, if it does not fit start printing it on the next page. I would like this to be done **automatically**. `\usepackage{titlesec}` seems to be the solution, but I can not get it to do the job.   * Should it be done with `titlesec`? how ?   * Is there a better approach?


title: Captions for tables included via pdfpages

text: I have a large number of multipage longtables as independent pdfs. I am including these pdfs in my main document using the `pdfpages` package. My code for including the PDFs currently looks like this:               \section{Analysis}          We first present the data for group A (Table~\ref{tab:groupadata}).     {     \includepdf[pages={-},nup=1x1,templatesize={5.45in}{8.5in}, pagecommand={}, addtolist={1,table,Caption for the LOT,tab:groupadata}     ]{directory/firstgroupdata.pdf}     }      I can get the captions for these tables to go into the List of Tables with the `addtolist= option` but how do I get the inserted PDF tables to have auto- captions like regular tables? I thought of hardcoding the caption into the longtable in the pdfs, but if I shuffle the position of the tables, it is a pain to go into the tex files and change the caption once more for each of the tables. Any solutions or workarounds for adding captions to these external tables would be great. Thanks for your time!


title: Arrows at right angles on a tikzpicture matrix

text: I'm trying to do something pretty simple but haven't been able to find an answer so far. I have a flow chart and I want to draw straight arrows at right angles instead of 'bent' arrows, inside of a `matrix` environment. This is the code I have, and I just need a way to replace the bent arrows to the left with straight arrows bent at right angles like the ones on the right:               \documentclass[a4paper,10pt]{article}     \usepackage[utf8x]{inputenc}     \usepackage{tikz}     \usetikzlibrary{matrix,shapes,arrows,positioning,chains}          \begin{document}          % Define block styles     \tikzstyle{desicion} = [diamond, draw, text width=3em, text badly centered, inner sep=0pt]%, node distance=3cm]     \tikzstyle{block} = [rectangle, draw, text width=10em, text centered, rounded corners]%, minimum height=4em]     \tikzstyle{cloud} = [draw, ellipse, minimum height=2em]          \begin{tikzpicture}[descr/.style={fill=white,inner sep=2.5pt}]     \matrix (m)[matrix of nodes, column  sep=2cm,row  sep=8mm, align=center, nodes={rectangle,draw, anchor=center} ]{     \node [block] {A. Campos [1;14]}; & \\     \node [block] {B. Bineado [1;4]}; & \\     \node [cloud] {call \texttt{analisis\_campo}}; & \\     \node [block] {C. Modelos [1;2]}; & \\     \node [block] {D. Extinción [1;31]}; &  \node [block] {E. Fracción de binarias [1;2]}; \\     \node [cloud] {call \texttt{analisis\_modelo}}; & \\     \node [cloud] {call \texttt{analisis\_final}}; & \node [desicion] {\scriptsize{Fin E}}; \\     \node [desicion] {\scriptsize{Fin D}}; & \\     \node [desicion] {\scriptsize{Fin C}}; & \\     \node [desicion] {\scriptsize{Fin B}}; & \\     \node [desicion] {\scriptsize{Fin A}}; & \\     \node [block] {Stop}; & \\      };     \path [>=latex,->] (m-1-1) edge (m-2-1);     \path [>=latex,->] (m-2-1) edge (m-3-1);     \path [>=latex,->] (m-3-1) edge (m-4-1);     \path [>=latex,->] (m-4-1) edge (m-5-1);     \path [>=latex,->,dashed] (m-5-1) edge node[auto] {\scriptsize{MODEL}} (m-5-2);     \draw [>=latex,->] (m-5-2) |- (m-6-1);     \path [>=latex,->] (m-5-1) edge (m-6-1);     \path [>=latex,->] (m-6-1) edge (m-7-1);     \path [>=latex,->,dashed] (m-7-1) edge node[auto] {\scriptsize{MODEL}} (m-7-2);     \path [>=latex,->] (m-7-1) edge (m-8-1);     \path [>=latex,->,font=\scriptsize] (m-7-2) edge [bend right=60] node[descr] {No} (m-5-2);     \path [>=latex,->,font=\scriptsize] (m-8-1) edge [bend left=60] node[descr] {No} (m-5-1);     \path [>=latex,->,font=\scriptsize] (m-9-1) edge [bend left=60] node[descr] {No} (m-4-1);     \path [>=latex,->,font=\scriptsize] (m-10-1) edge [bend left=60] node[descr] {No} (m-2-1);     \path [>=latex,->,font=\scriptsize] (m-11-1) edge [bend left=60] node[descr] {No} (m-1-1);     \draw [>=latex,->,font=\scriptsize] (m-7-2) |- node[descr] {Sí} (m-8-1);     \path [>=latex,->,font=\scriptsize] (m-8-1) edge node[descr] {Sí} (m-9-1);     \path [>=latex,->,font=\scriptsize] (m-9-1) edge node[descr] {Sí} (m-10-1);     \path [>=latex,->,font=\scriptsize] (m-10-1) edge node[descr] {Sí} (m-11-1);     \path [>=latex,->,font=\scriptsize] (m-11-1) edge node[descr] {Sí} (m-12-1);     \end{tikzpicture}          \end{document}      Here's what I get whit this code: ![enter image description here](http://i.stack.imgur.com/CgMaG.png)


title: Question about tabular

text: I need some `table` in LaTeX. As you can see, my LaTeX code is following               \setlength{\extrarowheight}{7.6pt}     \begin{footnotesize}     \begin{tabular}{l|m{7cm}}     \hline     \hline     Workloads & Applications  \\     \hline     \hline     mix-1 & mcf, libquantum, \\     \hline     mix-2 & sphinx3, soplex, \\     \hline     mix-3 & omnetpp, xalancbmk, \\     \hline     \hline     \end{tabular}     \end{footnotesize}      Actually, I could not understand `array` packages. I meant it's `m{2.5cm}`'s use method. I want to align a text in right side into vertical center like left side. Can you help me? Some explain in other site make me confused because I'm not expert in LaTeX.


title: Boolean based environments

text: I know that this question is basically identical to that of Hide custom environment content based on boolean Except I want to avoid using the `environ` package, which, otherwise, would be the best option in my opinion, and **very simple** to implement what I want. I am using the `xifthen` package, to easily manage my booleans, I know I could use TeX privatives, i.e. `\newif\if<name>`, but it gets a little complicated when I want to create booleans as arguments without using `\csname` and `expandafter`, which I don't fully understand. I am wanting to _hide_ some content, based on a boolean, and in other environments change it 's formatting. I tried at first:               \newboolean{full}     % ...     % a little later     % ...     \newenvironment{full}{%         \ifthenelse{\boolean{full}}{%     }{%         }{}     }      Which of course didn't work, so I tried:               \newboolean{full}     % ...     % a little later     % ...     \newenvironment{full}{%         \ifthenelse{\boolean{full}}\begingroup     }{%         \endgroup{}     }      Hoping that did the trick, but coming up with an `Incomplete \iffalse` error I then tried a TeX based approach:               \newboolean{full}     % ...     % a little later     % ...     \def\full{\iffull\begingroup}     \def\endfull{\fi\endgroup}      resulting in the same error. Can someone lend me a hand? I've been searching the net for about an _hour_ or so not getting anywhere. I stress again, I want to avoid using other packages, I would like to using pure TeX/LaTeX commands here. Thanks. * * * ### Edit I have been using @MarcoDaniel for a while now, but decided to try and make it _more my own_ , using more LaTeX then TeX code. I _have_ complicated it a bit, to make it more general so that I can have multiple environment working in a similar way, DRY programming, etc.. But It's _not_ working, and I was wondering if people can see my mistake. The **currently** used (fully working) code:               \newenvironment{full}{%         \ifthenelse{\boolean{full}}%          {\let\full@i\relax\let\endfull@i\relax}%         {\def\full@i{\setbox\z@\vbox\bgroup}%           \def\endfull@i{\egroup}}%         \full@i%     }{%       \endfull@i%     }      The code I'm _trying_ (but failing) to get to work:               \newcommand{\BooleanHideEnvironment}[1]{%         \newenvironment{#1}{%             \ifthenelse{\boolean{#1}}{%                 \newenvironment{#1@body}{}{}             }{%                 \newsavebox{#1@bin}                 \newenvironment{#1@body}{\savebox{#1@bin}\begingroup}{\endgroup}             }             \begin{#1@body}         }{\end{#1@body}}     }          \BooleanHideEnvironment{full}     \BooleanHideEnvironment{brief}     \BooleanHideEnvironment{refs}      Any further thoughts where I am going wrong? _To note, all the booleans are already defined, and this is located in a *.cls file, and like a *.sty file, does not require the`\makeatletter` and `\makeatother`._


title: Komascript style for empty page after page with `\part` title, or how to get page numbers there cleanly

text: My question is very similar to this question, and solutions there might work, but I'm using KOMA-script. I'd like page numbers on every page, including empty ones. To this end, I passed `cleardoublepage=plain` as an argument to the `scrbook` class. This has the intended effect for empty pages introduced before `\chapter`, but not for empty pages introduced after `\part`.               \documentclass[cleardoublepage=plain]{scrbook}     \begin{document}     \part{One}     \chapter{One-A}     Hello     \chapter{Two-A}     Hello     \end{document}          Several solutions are offered in the linked question, but all seem rather hackish to me, boiling down to a temporary redefinition of `\empty`. Is there a KOMA-script specific solution? `\partpagestyle` defines the _Page style for the pages with`\part` titles._ (KOMA-script 2012-07-22 user manual, page 71). Is there a KOMA-script way to define the page style for the empty page _after_ the page with the `\part` title?