New answers tagged

0

The book class uses headings as the default page style. This page style provides only headers and no footer (not using twoside, as in your case): \def\ps@headings{% \let\@oddfoot\@empty \def\@oddhead{{\slshape\rightmark}\hfil\thepage}% \let\@mkboth\markboth \def\chaptermark##1{% \markright {\MakeUppercase{% \ifnum \c@secnumdepth >\m@ne ...


5

The position of the angle depends on the material to be typeset inside it. If you want that all \phase command produce the angle as if a comma is in the number, you can patch it as follows \documentclass{article} \usepackage{steinmetz} \usepackage{xpatch} \xpatchcmd{\phase}{#2}{\vphantom{,}#2}{}{} \begin{document} $220\phase{0^{\circ}}$ $220\phase{0{,}5^...


7

An implementation with expl3 for a cleaner syntax: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\bigtext}{mm} { % #1 = width, #2 = text, with \\ to separate lines \ebo_bigtext:nn { #1 } { #2 } } \seq_new:N \l_ebo_bigtext_text_seq \box_new:N \l_ebo_bigtext_line_box \cs_new_protected:Nn \ebo_bigtext:nn { \begin{...


10

Here is a solution using adjustbox The vertical spacing between lines could be altered a bit, and the syntax could probably need some approvements. Output Code \documentclass[11pt, margin=5pt]{standalone} \usepackage{adjustbox} \usepackage{xcolor} \usepackage{pgffor} \usepackage{helvet} \definecolor{Pink}{HTML}{E22E3B} \definecolor{Blue}{HTML}{0C2153} \...


5

Here's one option, just using resizebox \documentclass{article} \usepackage{graphicx} \begin{document} \newlength\foo \setlength\foo{15em} \noindent \resizebox{\foo}{!}{SOME}\\ \resizebox{\foo}{!}{TOTALLY}\\ \resizebox{\foo}{!}{HIPSTER}\\ \resizebox{\foo}{!}{QUOTE}\\ \resizebox{\foo}{!}{ABOUT}\\ \resizebox{\foo}{!}{LIFE}\\ \end{document} It's inelegant ...


5

Here's a solution that uses side-by-side minipage environments but no multicols environment. Since the minipages are quite narrow, I suggest you use raggedright rather than full justification; this may be achieved by loading the ragged2e package with the option document. To align the variables within an equation, use \phantom statements along the lines used ...


3

This may not be ideal visually, but addresses your concern: \documentclass{article} \usepackage{amsmath,eqparbox} \usepackage{xcolor,booktabs,tabularx} \usepackage[makeroom]{cancel} \usepackage[margin=1cm]{geometry} \begin{document} \begin{enumerate} \item[34.] Solve the system using elimination by addition. \begin{alignat*}{3} x + y + z &...


4

How about this: two aligned environments and an \eqparbox in between, nested in flalign. Eqparbox allows to have a \parbox of width the longest line width of the paragraph: \documentclass[10pt]{article} \usepackage{amsmath, amsthm, amssymb} \usepackage{array, eqparbox} \usepackage{booktabs} \usepackage[makeroom]{cancel} \begin{document} Solve the system. \...


8

Something like this? \documentclass[10pt]{article} \usepackage{amsmath, amsthm, amssymb} \usepackage{array} \usepackage{booktabs} \usepackage[makeroom]{cancel} \begin{document} \noindent \begin{minipage}{0.45\textwidth} Solve the following system: \begin{align*} 6x-5y &= 11 \\ 7x+5y &= 2 \end{align*} \end{minipage} \bigskip\...


1

The idea for this comes from David Carlisle in chat. Basically, you put the listing in a box that will be scaled down if wider than some width. The adjustbox package provides an easy interface for doing just this. Note however, as Ulrike Fischer mentions in chat, that this may well end up looking horrible (such as my example below), but if looks are ...


1

Here's the centered \section* version with code from latex.ltx (as is used in standard classes) \documentclass{article} \makeatletter \def\@sect#1#2#3#4#5#6[#7]#8{% \refstepcounter{#1}\edef\@svsec{\csname the#1\endcsname.\hskip 0.6em} \begingroup \ifnum #2=1\bf\centering {\interlinepenalty \@M \large{\@svsec #8}\par}\else\...


-1

You can get this effect by alternating row and column color like following: \newcolumntype{g}{>{\columncolor{Gray}}c} \begin{table}[ht] \centering \begin{tabular}{c|g|g|g|g|g|g|g} \hline \rowcolor{white} &col1 &col2 &col3 &col4 & col5 &col6 &col7\\ \hline \rowcolor{white} row1& \ra & \ra & \ra & \ra & \ra &...


16

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}}% \...


11

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 ...


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) (...


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 \...


4

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

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}{\...


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} \...


0

Here is a solution which does not use center environment, which adds unnecessary vertical space. Output Code \documentclass[11pt]{article} \usepackage{xcolor} \usepackage{lipsum} \newcommand{\rub}[1]{% \par\hfil{% \centering% \large% \bfseries% \fontfamily{pbk}% \selectfont% \color{red}% #1% }\hfil\par} \begin{...


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}\...


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.


0

I've manage to do what you need with nested tcolorbox. I've painted in red just to demonstrate a very long equation, the white background area inside is the description box. \documentclass{article} \usepackage{tcolorbox} \tcbuselibrary{breakable} \usepackage{amssymb} \usepackage{amsmath} \usepackage{lipsum} \begin{document} \begin{tcolorbox}[...


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

\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 ...


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

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


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\...


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} \...


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 ...


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 ...


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[...


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} \...


1

While \midrule works in aligned, you get much finer control with array. \documentclass{article} \usepackage{amsmath,booktabs,cancel,array,xcolor} \newcommand{\rs}[1]{\textcolor{red}{#1}} \begin{document} \begin{equation} \renewcommand{\arraystretch}{1.2} \begin{array}{@{}r@{}>{{}}l@{}} 6x\; {\cancel{-\;5y}} &= 11 \\ 7x\; {\cancel{+\;5y}} &= 2 ...


1

You can use flalign with two "equations" in order to write a comment. Here's an example: \documentclass{article} \usepackage[fleqn]{amsmath} \setlength{\mathindent}{0pt}% No indent for full length equations (flush left) \begin{document} \noindent X \dotfill X \begin{flalign} f(x) &= ax^2 + bx + c && \text{Comment} \label{eqn:comment} \end{...


5

It's a good habit to have a thin space in front of “dx”, which emphasizes the fact that the “d” is attached to the variable “x”, forming a single unit (which is, mathematically, what really happens). So a savvy typist will input your formula as \[ \int k\,dx = kx+C \] and, similarly, \[ \iint\limits_{\mathbb{R}^2} e^{-x^2-y^2}\,dx\,dy \] Typing in the ...


3

I use this, borrowed from an answer on this side, but I can't remember as an answer to which question: \documentclass[12pt, a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{amsmath,amsfonts,amssymb}% \AtBeginDocument{\renewcommand*{\d}{\mathop{\kern0pt\mathrm{d}}\!{}}} \begin{document} \[ \int_a^b ...


1

I don't know about a package for overlapping underline, but I once solved this by using regular underline and \vphantom{} for lowering parts of the line. With \vphantom{} you can make sure the lines don't overlap, but are spaced underneath each other. \documentclass[a5paper]{article} \usepackage{ulem} \begin{document} \underline{aba}\underline{ab\...


4

Until geometry package is updated, you can use \RequirePackage{luatex85} on the first line to offer a compatibility layer between the new luatex and pdftex.


1

well it is a two steps process, it visually makes more sense to go with a horizontal line between the spaces as for the redundant text you can use it as header of a third row (before step1). Furthermore the same text is present for your concentration c, time t and temperature T. For clarity I'd use an explanation in the caption of the table for the redundant ...


0

I propose a slightly different layout, playing with the overhang parameter of \columncolor, still based on siunitx. tabularx is not needed. Note that, with the table option for xcolor, you don't have to load colortbl. Also, the code is simplified with the \rowcolors command. \documentclass[a4paper,11pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{...


1

The tokens \vspace{2.5pt}\noindent are completely out of place there. Here's a realization with siunitx: \documentclass[a4paper,11pt]{article} \usepackage{array} \usepackage{tabularx} \usepackage[table]{xcolor} % don't load colortbl after xcolor, use the option \usepackage{siunitx} \definecolor{Grey}{gray}{0.8} \definecolor{Groy}{gray}{0.9} \begin{...


2

Using titlerule and vspace : \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[frenchb]{babel} \usepackage{titlesec} \titleformat{\section}{\large\scshape\raggedright}{}{0em}{} [{\vspace{1cm}\titlerule[1pt]}] \begin{document} \section{TEST} Bla bla \titleformat{\section}{\large\scshape\...


2

I think you're making life difficult for yourself with all those minipages and \hspaces. Use one minipage per "column", and make use of \uncover. \documentclass{beamer} \usepackage{amsmath} \begin{document} \begin{frame} \frametitle{What is a word?} \begin{minipage}[c]{.3\linewidth} \centering \uncover<1->{``cat''} \bigskip \uncover<2->{2} ...


2

If you insist on that particular output, you could use shorthand = {CVS11} on the entry in question, which is offered by BibLaTeX. Usually, you want one letter per person (and not per surname), which makes it also easier to estimate the number of authors in an alpha-fashioned style. Such an output would be CS11. It is achieved by: author = {Colin de ...


4

If you're using one of "basic" LaTeX document classes -- article, report, and book -- or a document class that is built on one of these classes, you could proceed as follows: \documentclass{article} \everymath{\bf} \everydisplay{\bf} \begin{document} $a^2+b^2=c^2$ $\cos^2{\theta}+\sin^2(\theta)=1 $ \end{document} Observe that a, b, c, 1 and 2 are ...


10

Change the math code of the letters; some brute force is necessary. \documentclass{article} \DeclareSymbolFont{boldletters}{OT1}{cmr}{bx}{n} \DeclareSymbolFontAlphabet{\mathbf}{boldletters} % not to waste a family \DeclareMathSymbol{a}{\mathalpha}{boldletters}{`a} \DeclareMathSymbol{b}{\mathalpha}{boldletters}{`b} \DeclareMathSymbol{c}{\mathalpha}{...


1

Warning: This will leave all chapter names in upper case characters. The spacing between Chapter Number 1 and Chapter Title is controlled in \@makechapterhead, there's a \vskip 20\p@, i.e. 20pt, being hardcoded. This can be changed by a patch, inserting some other length, which can be changed easily. Warning 2: times is a deprecated package. Use mathptmx ...


7

\documentclass[a4paper]{scrbook} \usepackage{fancyvrb} \usepackage[utf8]{inputenc} \usepackage{pmboxdraw} \pmboxdrawsetup{ Block/box={\texttt{0}}, } \begin{document} \begin{verbatim} NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 32G 0 disk ├─sda1 8:1 0 99M 0 part /boot └─sda2 8:2 0 31,9G 0 part / sr0 11:0 1 55,5M 0 ...



Top 50 recent answers are included