Hot answers tagged

7

\documentclass{article} \newcounter{emphlevel} \renewcommand\emph[1]{\stepcounter{emphlevel}% \ifnum\value{emphlevel}=1`#1'\else \ifnum\value{emphlevel}=2\textsc{#1}\else \ifnum\value{emphlevel}=3\textit{#1}\else \fi\fi\fi\addtocounter{emphlevel}{-1}% } \begin{document} \emph{Single quotes within \emph{Small Caps within \emph{more italics} and} ...


7

A simple application of grouping: \documentclass{article} \newcount\emphlevel \DeclareRobustCommand{\emph}[1]{% \begingroup \normalfont \advance\emphlevel by 1 \ifcase\emphlevel \or `\aftergroup'\normalfont \or \normalfont\expandafter\textsc \or \normalfont\expandafter\textit \else \normalfont!!!!\expandafter\textbf \fi ...


4

Maybe this? I introduce a \setrow{...} macro invoked on the first element of a row, which applies to each cell of that row (and is then reset). It employs the >{} and <{} feature of tabularx. \documentclass{article} \usepackage{tabularx} \newcommand\setrow[1]{\gdef\rowmac{#1}#1\ignorespaces} \newcommand\clearrow{\global\let\rowmac\relax} \clearrow ...


4

Quite simple: \documentclass{article} \usepackage{enumitem} \begin{document} \begin{enumerate}[align=right, font=\bfseries] \item[25-1] Compute $1 + 1$ \item[25-8] Compute $1 \times 1$ \end{enumerate} \end{document} B.t.w., note align=right is the default.


4

I decided to use another command name, but the nesting can be controlled with a counter and \ifcase...\fi conditional. The 4th level will provide an usual \@ctrerr, but this could be shifted to basically any level. \documentclass{article} \newcounter{smartlevel} \makeatletter \newcommand{\smartcmd}[1]{% \stepcounter{smartlevel}% ...


4

Please always post a mininal working example which can be compiled just by copy/pasting into an editor. To your question, I suggest you use cfr-lm.sty instead of lmodern.sty which provides a better interface to the fonts. You are looking for \sbweight. Code: \documentclass[a4paper]{article} \usepackage[T1]{fontenc} \usepackage{lipsum,geometry} ...


3

Try the upgreek package and \boldsymbol from amsmath (or mathtools. \documentclass{article} \usepackage{mathtools} \usepackage{upgreek} \begin{document} \begin{align} x'_{0} &= \gamma \left( x_{0} - \boldsymbol{\upbeta \cdot x}\right) \\ \boldsymbol{x}' &= \boldsymbol{x} + \dfrac{\gamma-1}{\boldsymbol{\upbeta}^2} \left( \boldsymbol{\upbeta ...


3

Simply \newcommand\boldblue[1]{\textcolor{blue}{\textbf{#1}}}


2

The screenshot you've posted suggests you're interested in Times Roman-based Fonts. If that's the case, I suggest you load the newtxtext and newtxmath packages. The latter package, happily, provides "upright" lowercase Greek math symbols. They may be accessed by prefixing "up" to the macro for the ordinary symbol (e.g., \upalpha, \upbeta, etc.). To typeset ...


2

For the record, I made substantial efforts to do this cleanly and failed utterly. moderncv hard codes numerous uses of bold and the use of the hooks provided by tweaklist have virtually no effect for our purposes. So, this is not a good way to do this, but it may suffice. Caveat emptor. As recommended by Arash Esbati, we first load cfr-lm. However, we ...


1

The first answer to the question you linked in your question (http://tex.stackexchange.com/a/4816/36296) seems to work just fine. If only the first entry was coloured, did you remember to adjust the alignment options to $c^c^c^r^c^c? \documentclass{article} \usepackage{tabularx} \usepackage{adjustbox} \usepackage{booktabs} \usepackage{array} ...


1

\documentclass{scrartcl} \usepackage[shortlabels]{enumitem} \newcommand*\makeboldlabel[1]{\textbf{#1}} \begin{document} \begin{enumerate}[align=right,before=\let\makelabel\makeboldlabel] \item[25-1] Compute $1 + 1$ \item[25-8] Compute $1 \times 1$ \end{enumerate} \end{document}


1

Here are two ways -- with mdframed and tcolorbox -- the numbers are bold, as well as the title by default (in book) \documentclass{book} \usepackage[x11names]{xcolor} \usepackage{mdframed} \usepackage[most]{tcolorbox} \setcounter{secnumdepth}{3} \begin{document} \chapter{Foo} \section{Foo} \subsection{Foo} \begin{mdframed}[backgroundcolor=lightgray] ...



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