Hot answers tagged

82 votes

Highlight, textcolor, and boldface simultaneously

\documentclass{article} \usepackage{xcolor} \begin{document} ~\\ \colorbox{pink}{highlight}\\ \colorbox{green}{highlight}\\ \colorbox{yellow}{highlight}\\ \bfseries\colorbox{pink}{highlight + boldface}...
user avatar
  • 4,530
63 votes

Make specific author bold using biblatex

Since biblatex 3.4/biber 2.5, there is a general "annotation" functionality to do things like this, for example: \documentclass{article} \usepackage{biblatex} \usepackage{filecontents} \begin{...
user avatar
  • 21.5k
44 votes

How do I get \texttt with bold face in LaTeX?

There are the Latin Modern Fonts, from their README: The fonts are based on Donald E. Knuth's Computer Modern fonts in the PostScript Type 1 format In family lmtt, there are even three series: \...
user avatar
33 votes

Make specific author bold using biblatex

As I couldn't use https://tex.stackexchange.com/a/73246/7561 as well, and in case others stumble into this looking for a solution, I'm updating the answers. As pointed by Adam Liter, in the comments ...
user avatar
  • 10.8k
33 votes
Accepted

How to write bold, italic and sans-serif at the same time?

Your issue is "font-dependent". Background Indeed, special shapes of a font (bold, italic, slanted, small caps) are not defined relatively to a main font (its regular shape), but independently. The "...
user avatar
  • 10.9k
29 votes
Accepted

Automatic bold for every first character of a line

Assuming you do want fixed line ends: \documentclass{article} \newcommand\dob[1]{\textbf{#1}} \newenvironment{boldfirst}{\obeylines\everypar{\dob}}{} \begin{document} \begin{boldfirst} Lorem ipsum ...
user avatar
  • 36.4k
27 votes
Accepted

Is there any reason not to use \let to redefine a deprecated control sequence to the currently recommended one?

Is there any reason(s) not to use \let to redefine \bf to \bfseries and \it to \itshape? Yes, there are good reasons. :-) With the above \let-based setup, {\bf\it ...} produces bold-italic. In ...
user avatar
  • 444k
26 votes
Accepted

bold just one line inside of lstlisting

The best way to do this would be to use the escapeinside command, like this: \documentclass{article} \usepackage{listings} \lstset{ escapeinside={(*}{*)} } \begin{document} \begin{lstlisting} //...
user avatar
  • 6,916
24 votes

Automatic bold for every first character of a line

Here's a more complicated version that tries to preserve kerning between the first two letters, as shown in the last two lines. As in Thruston's answer, accented first characters must be enclosed in ...
user avatar
  • 1.0m
24 votes

Format whole row of table as bold

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. ...
user avatar
24 votes
Accepted

How do you pronounce letters generated with \Bbb and \mathbb?

BBB stands for blackboard bold, but "double struck" is also used (e.g. ℝ). However how it should be pronounced is another matter -- between reading out the markup ("dollar dollar backlash B B B space ...
user avatar
  • 8,385
23 votes

How do I get \texttt with bold face in LaTeX?

I just ran across it and found a simpler answer here: https://en.wikibooks.org/wiki/LaTeX/Fonts \usepackage{bold-extra} ... \texttt{TT Text \textbf{Bold TT Text}}
user avatar
  • 239
23 votes

Is there any reason not to use \let to redefine a deprecated control sequence to the currently recommended one?

The commands \rm, \bf etc are called "deprecated" because they have been removed from the latex kernel. The way the commands work don't fit in the (much better) "new font selection scheme" (nfss) used ...
user avatar
21 votes

Add bold enumerate items

This is in response to this comment by Raffi Khatchadourian on the accepted answer: "I see a problem here: this answer is redefining the numbering style completely instead of enhancing it, i.e., ...
user avatar
21 votes
Accepted

\textit is to \emph as \textbf is to...?

The idea behind \emph is that it provides a high level way for giving emphasis to a part of the text. High level in the sense it is “independent” of the actual implementation. The default behavior of ...
user avatar
  • 1.0m
19 votes

How do I write "LaTeX" in LaTeX with the first letter bolded?

You can make a small extension to the metalogo package, which enables you to choose a different initial “L”. \documentclass{article} \usepackage{metalogo} \usepackage{xpatch} \makeatletter \...
user avatar
  • 1.0m
18 votes
Accepted

Why can't I get a bold Greek letter?

You can use the bm-package \documentclass[paper=a4, fontsize=12pt]{article} % A4 paper and 11pt % font size \usepackage[english]{babel} % English language/hyphenation \usepackage{amsmath,amsfonts,...
user avatar
17 votes

Small Caps and Bold Face

As an extension of accepted answer https://tex.stackexchange.com/a/27413/1340, I explain here how to use Latin Modern while taking serif bold small capitals from Computer Modern (= CM) Super. As ...
user avatar
15 votes
Accepted

Command for both bold and colored text

Simply \newcommand\boldblue[1]{\textcolor{blue}{\textbf{#1}}}
user avatar
  • 778
15 votes
Accepted

Cannot stop Latin character being emboldened after Greek character emboldened

There are two distinct issues with your code: \bf is a switch and doesn't take an argument. Its scope extends to the end of the current group. (Same for \normalfont, which incidentally is a text-mode ...
user avatar
  • 444k
14 votes
Accepted

italicization with \textit does not work

You'll notice the following warning in your .log file: LaTeX Font Warning: Font shape `OT1/cmss/bx/it' undefined (Font) using `OT1/cmss/bx/n' instead on input line 4. It suggests that ...
user avatar
  • 570k
14 votes
Accepted

Is it okay to do $\bf Text$?

LaTeX itself hasn't defined \bf in the format since LaTeX2e was introduced in 1993. So depending on the document class you use You may find that \bf is defined for compatibility with documents from ...
user avatar
13 votes

Make specific author bold using biblatex

This is more or less a copy of my answer to Highlight an author in bibliography using biblatex allowing bibliography style to format it. The following implements Audrey's solution for name hashes. The ...
user avatar
  • 161k
13 votes
Accepted

How to perform keyboard shortcuts like Ctrl+I for italics or Ctrl+U for underlining in LyX?

By default Ctrl+I may be set to "inset-toggle" which in regular use doesn't apply, while Ctrl+U should be set to "font-underline" (as is Alt+C U). You are able to change the key binding sequences to ...
user avatar
  • 570k
13 votes
Accepted

boldsymbol badly modifies spacing

Load the bm package and the problem goes away, both using \bm and \boldsymbol (which gets redefined by bm to be the same as \bm). This spacing issue is one of the reasons why \bm should be used for ...
user avatar
13 votes

How to "unbold" this?

You can just type \chapter*{\normalfont An Abstract of the Thesis of} %\addcontentsline{toc}{chapter}{\protect\numberline{}Abstract} \addcontentsline{toc}{chapter}{Abstract} (Switch comments for ...
user avatar
  • 1.0m
13 votes
Accepted

Issues with nesting \textbf and \textit

LaTeX warns to the terminal and log file LaTeX Font Warning: Font shape `OT1/cmss/bx/it' undefined (Font) using `OT1/cmss/bx/n' instead on input line 24. which says that the computer ...
user avatar

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