The Stack Overflow podcast is back! Listen to an interview with our new CEO.

# Tag Info

25

I'd suggest using the package savetrees loaded with the [extreme] option which its purpose is exactly the scenario you are describing by minimizing all the margins to the extreme, fitting as much text as possible on a page. More than that you'd print out of the paper. Its sample page, specifically the last page showcase the results that can be obtained.

19

The geometry package can do what you want, if you let it do the whole job of page layout instead of just part of it. I'm not sure exactly what physical margins your adjustments to \textwidth etc wind up producing, but these geometry settings produce something that looks roughly like your screenshot, except for better placement of the page number: \...

16

The following uses two slightly shifted coloured \dot macros. The placement is not perfect and might be really bad for some letters. \documentclass[]{article} % for colours \usepackage{xcolor} % for mighty interface to define new macros, it also loads the l3 kernel \usepackage{xparse} % for \mathrlap \usepackage{mathtools} % change to the coding language ...

16

Second try EDIT I have 25 July added \setlength{\headsep}{0.25\baselineskip} to reduce distance between header and body text. Here is my second try on this article. As far as I can see, most of the layout is in place, including different footnotes, header and footer, captions etc. What is left is the title page, which is not optimal, and I consider to ...

13

Adapting from the definition of \dddot in amsmath. The bottom line in the picture shows the symbol superimposed on each other; the difference is really negligible. \documentclass{article} \usepackage{amsmath} \usepackage{xcolor} \makeatletter \DeclareRobustCommand{\colorddot}[3]{% % #1=color of first dot, #2=color of second dot, #3=accentee {\mathop{\...

13

by default \setminus is \DeclareMathSymbol{\setminus}{\mathbin}{symbols}{"6E} That is a smallish \, set as a binary operator with the same spacing as - but \backslash is \DeclareMathDelimiter{\backslash}{\mathord}{symbols}{"6E}{largesymbols}{"0F} That is a large \ that can grow with \left right but otherwise set as an ordinary symbol, so acting like | ...

10

I use Courier New/Consolas/Source Code Pro as well as Mathematica Mono (can be found in the directory of your local installation) to format it: \documentclass{article} \usepackage{fontspec,xcolor} % Default colors of Mathematica \definecolor{mma@string}{RGB}{102,102,102} \definecolor{mma@symbol}{RGB}{0,44,195} \definecolor{mma@comment}{RGB}{69,148,174} \...

10

I don't think there's anything wrong with standard center alignment. Consider the case where you have -1/6 and -1/30: if you center align the fractions, the minus signs will be off. I can offer a new column type for the columns with negative entries. \documentclass{article} \usepackage{amsmath,mathtools} \usepackage{booktabs,array,calc} \newcolumntype{n}{@...

10

The behavior you encountered is duly documented in the TikZ & PGF manual, precisely on page 247 for version 3.1.4b. Relevant quotes: The 〈angle〉 is used to determine a position on the border of the main node. (...) Then, an anchor point for the label node is computed. It is determined in such a way that the label node will “face away” from the ...

10

In the Computer Modern math font family, the shapes of \setminus and \backslash are identical. (Aside: the vertical size of \backslash can be modified by \left and \right directives; that's not the case for \setminus.) That does not mean, though, that the symbols get typeset identically. This is because \backslash has status mathord ("math ordinary"), ...

9

My recommendation would be to use siunitx's \num{} macro (which by default will add a \thinspace, but can be configured to add a comma if so desired): References: How to display numbers using comma as a thousands separator?. How to set the precision in numbers. Code: \documentclass{article} \usepackage{siunitx} \begin{document} \num{10000}: Recommended ...

9

\start...\stoptextbackground is the correct thing to do but you have to set location=text. To collapse interword spaces, I define a new spacing method collapse and use it in \setuptype. I also add a little bit of stretch and shrink to the interword space for better linebreaking. % The original version, which only collapses interword spaces. %\unprotect %\...

9

\emph is defined to be a "text command" and therefore sets its argument in text mode. That's why you're allowed to use $\emph{\bfseries <stuff>}$ since \bfseries occurs within text mode. The other way around, $\bfseries\emph{<stuff>}$ \bfseries occurs inside math mode, which is not allowed. If you want to set text in bold inside math, ...

9

The comments have pointed you at existing answers describing the general issue but I'll try to describe the log output you show (it would have been a lot easier if you had posted that as text not an image) but I OCR'd the image here: (/usr/local/texlive/2018/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] )...

9

For example: \documentclass[tikz]{standalone} % tikz loads graphicx \begin{document} \begin{tikzpicture}[ declare function={boxW=1.2cm;}, box/.style={minimum size=boxW,draw}, ] \foreach \x in {0,...,15} { \ifnum\x=0 \node [box,fill=blue!20] at ({mod(\x,4)*boxW}, {-ceil((\x+1)/4)*boxW}) {$C_{\x}$}; \else \node [box] at ({mod(\x,4)*...

9

Use the size of subscripts linked to the current font size. \documentclass{article} \usepackage{amsmath} \makeatletter \DeclareRobustCommand{\HI}{% \mbox{H\check@mathfonts\fontsize\sf@size\z@\selectfont I}% } \makeatother \textheight=3cm % just to shorten the image \begin{document} \section{About \HI} Here we talk about \HI.\footnote{Yes, about \HI.} ...

9

You can try glyphtounicode: \documentclass{article} \input glyphtounicode \pdfgentounicode=1 \begin{document} $a \star b$. \end{document}

9

You could use an overlay. \documentclass[12pt]{article} \usepackage[skins]{tcolorbox} \usepackage{fontawesome5} \begin{document} \begin{tcolorbox}[enhanced, title = Code Python, coltitle = black, colbacktitle = black!10!white, colback = white, center title, overlay={% \begin{tcbclipframe} \node[anchor=...

8

Don't use the enumerate package with beamer since it provides templates to set these things. Specifically, you're interested in the [default] template for enumerate item: \documentclass{beamer} \usetheme{Boadilla} \usecolortheme{seahorse} \begin{document} \begin{frame} \begin{enumerate} \item La \item La La \end{enumerate} \...

8

Section 9 Watch Out! of the embrac documentation explains that embrac only applies to \emph{...}, but not to {\em ...} and {\itshape ...}. Since amsthm's lemma uses \itshape to typeset its body in italics, embrac can't be used here. It would be a non-trivial (impossible?) exercise to convert embrac's behaviour for the macro \emph to the switch \itshape, so ...

8

Verbatim Contrary to what you claim in your question, verbatim supports spaces and indentation, so why not use it? \documentclass[]{article} \begin{document} \begin{verbatim} if (n == 0 || n == 1){ return n; } j = 0; for (i = 0; i < n-1; i++){ if (arr[i] != arr[i+1]){ arr[...

8

I have two proposals: \documentclass[12pt]{article} \usepackage[a4paper]{geometry} \usepackage{mathtools} \usepackage{lipsum} \begin{document} \lipsum[1][1-3] \begin{equation*} u(x) = \left\{ \begin{aligned} &\makebox[0.8\displaywidth][s]{$u_0(x)$\hfill for all $x \in \mathcal{D}_0$} \\[2ex] &\begin{multlined}[c][0.8\displaywidth] u_{i}(x) + \...

7

The following example fixes a number of issues: Generic formatting of the \caption to use \scshape without explicitly stating it; Using keyword formatting for the \Input and \Find; Redefining the way the if clause is set using capitalization; and Using \; end-of-line characters consistently. \documentclass{article} \usepackage[linesnumbered,ruled,vlined]{...

7

You can redefine \@listi (I use a large 2cm to show the effect): \documentclass{beamer} \makeatletter \def\@listi{\leftmargin\leftmargini \parsep 4.5\p@ \@plus2\p@ \@minus\p@ \topsep 9\p@ \@plus3\p@ \@minus5\p@ \itemsep 2cm \@plus2\p@ \@minus\p@} %adapt \let\@listI\@listi \@listi \begin{document} \begin{frame} \begin{...

7

this starts with the first line being half width and then getting longer... It does warn a lot in the log... \documentclass{article} \usepackage{shapepar} \makeatletter \def\zzshape#1{% {0}% {0}b{0}\\% {0}t{0}{10}\\% {#1}t{0}{20}\\% {#1}e{20}% } \def\zzzshape{\zzshape\count@} \def\zz#1{% \count@=1 % \loop \setbox0\hbox{\Shapepar\zzzshape#1\par}% \ifdim\...

7

Add an \ignorespaces at the end of the environment entry point. Also, bfseries is not an environment (to my knowledge) but a declaration: \bfseries. It is automatically terminated by the end of the environment. \documentclass{article} \renewenvironment{abstract} {% \par % \noindent\bfseries\ignorespaces% } {% } \begin{document} \begin{abstract} ...

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