Hot answers tagged

11

Define an environment within which counter stepping and ToC-writing is disabled. This allows great freedom: \documentclass{article} \usepackage{xparse} \newcounter{savesection} \newcounter{savesubsection} \newcounter{savesubsubsection} \newenvironment{quietsections} {% Store sectional counters \setcounter{savesection}{\value{section}}% \...


7

UPDATE at the end, with automatic restoration of arbitrary counters!!!! Use a dummycounter that resets with the upper section level and \let\c@subsection\c@dummycounter, i.e. explicitly use the count register c@dummycounter instead of c@subsection If this is used inside of the minipage, the \let operation does not leak outside (since minipage is an ...


4

It's still too big really but this will get you started, tabularx does nothing useful here so I removed it. \documentclass[11pt]{article} \usepackage{setspace,amssymb,amsmath} \usepackage[tablename=TABLE,labelsep=newline, aboveskip=0pt,font=bf,justification=centering]{caption} \usepackage{booktabs,tabularx} \usepackage[margin=1in]{geometry} \usepackage[...


4

As the manual says: use \percent for that purpose. Quote from the manual: The \percent macro makes everyone happy. For example \documentclass{article} \usepackage{sagetex} \begin{document} \sage{"\percent.3f"\percent(.1*.1)} \end{document} gives


3

An appropriately-placed patch in the ToC can correct this behaviour. Below I've patched \l@chapter - the macro responsible for setting the chapter-related content in the ToC - and removed \bfseries: \documentclass{report} \usepackage[toc,page,titletoc]{appendix} \usepackage{etoolbox} \makeatletter \g@addto@macro\appendices{% \addtocontents{toc}{\...


3

Using csplain and encTeX: \mubytein=0 \mubyte\Sw Software\endmubyte \mubyte\Sws Softwares\endmubyte \mubyte\sw software\endmubyte \mubyte\sws softwares\endmubyte \def\Sw{{\it Software}} \def\Sws{{\it Softwares}} \def\sw{{\it software}} \def\sws{{\it softwares}} \mubytein=1 Aha, here is software and so softwares. \bye


3

Others have mentioned \percent, and the use of .n(), but I wanted to mention a third way which is a little silly but the method is sometimes useful for more complex formatting. Try something like this: \begin{sagesilent} def twodigits(x): return "%.3f" % x # or, more in the Python 3 spirit: def threedigits(x): return "{:.3f}".format(float(x)) \end{...


3

One of the advantages of using sagetex is that you get Python plus all the other mathematical ability such as graph theory, built in functions, and more. The documentation here explains how to get decimal digits of precision by using .n(digits=k) to get k decimal digits. Note that digits=1 is an exceptional case. \documentclass[12point]{article}% \...


3

You might try something like one of these (note: I have simplified your original .tex file): \documentclass[11pt]{article}% note the change from 11Pt to 11pt \usepackage{hyperref,wasysym,array} % Not needed for minimal working example (MWE): % \usepackage{fancyhdr} % \pagestyle{fancy} % \fancyhf{} % \fancyhead[LE,RO]{ATA-27} % \fancyhead[RE,LO]{Acceptance ...


2

You could put it into a minipage, or use the samepage-package. I've added here the mathtools-package, which I would advice you to use. As commented by David Carlisle, you shouldn't spell out complete words in math-environments, as each individual letter will be typeset as a variable. You could put them in \text{Word}. Code \documentclass[11pt]{article} \...


2

\newcommand*\rub[1] {\begin{center}\large\bfseries\color{red}\fontfamily{pbk}\selectfont#1\end{center}} ... \rub{This text will be centered, boldfaced, colored red and with font `pbk'} But since you did not say what you are going to use it for, we don't know if there is a more precise and correct approach.


2

\documentclass[preprint,showpacs,preprintnumbers,amsmath,amssymb]{revtex4} \usepackage{amsmath} \newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}} \begin{document} $\let\left\relax\let\right\relax \frac{1}{250} \left(50 (2 k+7)+\sqrt{50-10 \sqrt{5}} \left(-3 \sin \left(\frac{2}{5} \pi (1-2 k)\right)+2 \sin \left(\frac{4 \pi k}{5}\...


2

There is no standard option to do this, but you can create your own preamble file for latexdiff to replace the highlighting commands. All you need to do after a standard run of latexdiff is to copy the lines latexdiff writes in to the header of the diff file and change those that do not fit your style. In your case the command to change is \DIFadd that by ...


2

Really it is the same question: \documentclass[preprint,showpacs,preprintnumbers,amsmath,amssymb]{revtex4} \usepackage{amsmath} \newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}} \begin{document} \begin{center} $\let\left\relax\let\right\relax \def\frac#1#2{((#1)/(#2))} \frac{2 (\alpha +3) (2 \alpha +5) (10 \alpha +17) (10 \alpha +19) (...


2

Grab the argument supplied to \rub and set it inside a centred box that has the width of \linewidth: \newcommand{\rub}[1]{\noindent\makebox[\linewidth]{\large\bfseries\fontfamily{pbk}\selectfont\color{red}#1}} Here is a minimal example (without the font changes, as it's not part of the discussion): \documentclass{report} \usepackage{xcolor} \...


1

Is this what you want? \documentclass[a4paper,12pt]{report} \usepackage{titlesec} \usepackage{xcolor} \begin{document} \newcommand{\rub}{\large\bfseries\fontfamily{pbk}\selectfont\color{red}\filcenter} \rub Mytext \end{document} If you want to use as \rub{only inside here will be affected}, then: \newcommand{\rub}[1]{\large\bfseries\fontfamily{pbk}\...


1

I see no problem with the following: \begin{filecontents}{fungie-intro.tex} \chapter*{Introduction} \addcontentsline{toc}{chapter}{Introduction} \lipsum \end{filecontents} \documentclass{report} \usepackage{lipsum} % just for the example \begin{document} \pagenumbering{roman} \tableofcontents \listoftables \listoffigures \cleardoublepage \...


1

Set \postdisplaypenalty to 10000 for the special case: \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{lipsum} % just for the example \newcommand{\commentedequationtext}{} % initialize \newenvironment{commentedequation}[1] {\renewcommand\commentedequationtext{#1}% \postdisplaypenalty=10000 \equation} {\endequation\...


1

Here's a method which demonstrates two different approaches: one uses a tabular and the other not. The code: fixes the order of package loading to put hyperref last`; eliminates inconsistent layout by reading the console and using geometry with the value fancyhdr provides for headheight; demonstrates how to avoid TeX's complaints about bad boxes while ...


1

Here is a simpler code with enumitem, which has a resume option for lists: \documentclass[a4paper]{article} \usepackage[T2A]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english ,russian,]{babel} \usepackage{amsmath,amsthm,amssymb} % amssymb also loads amsfonts \usepackage[cm]{fullpage} \usepackage{titling} % \usepackage{hyperref} \usepackage{xspace} \...



Only top voted, non community-wiki answers of a minimum length are eligible