[Tex/LaTex] Does LaTeX define a semantic equivalent of \textbf

boldemphasissemantics

In HTML, there's the distinction between <em> as semantic markup and <i> as its pure-formatting equivalent. LaTeX has the same distinction: \emph is semantic markup, rendered using \textit.

HTML also includes an analogous distinction between <strong> and <b>. Does LaTeX define a semantic command (e.g. \strong{...}, but that doesn't exist) that gets rendered using \textbf?

EDIT: on very similar lines, does LaTeX define a semantic command like \quote{...} that will render using quotation marks (of some preferred type)? (HTML has <q>.)

Best Answer

You can define your own \strong command which switches between strong and normal text like \emph does with italic:

\documentclass{article}

\makeatletter
\newcommand{\strong}[1]{\@strong{#1}}
\newcommand{\@@strong}[1]{\textbf{\let\@strong\@@@strong#1}}
\newcommand{\@@@strong}[1]{\textnormal{\let\@strong\@@strong#1}}
\let\@strong\@@strong
\makeatother

\begin{document}

Text \strong{strong text \strong{strong2 \strong{st-\strong{st}-st}  yyy } xxxx} after

\end{document}

Result1


Or you can define different levels of "strong" using a counter:

\documentclass{article}
\usepackage{xcolor}

\newcounter{stronglevel}
\setcounter{stronglevel}{1}
\newcommand{\strong}[1]{%
    \csname strong\roman{stronglevel}\endcsname{{%
        \advance\value{stronglevel} by 1\relax
        #1%
    }}%
}
\newcommand{\strongi}[1]{\textbf{#1}}
\newcommand{\strongii}[1]{{\blendcolors*{!50!red}\color{.}#1}}
\newcommand{\strongiii}[1]{\textsf{#1}}
\newcommand{\strongiv}[1]{{\blendcolors*{!50!red}\color{.}#1}}

\begin{document}

Text \strong{strong text \strong{strong2 \strong{st-\strong{st}-st}  yyy } xxxx} after \strong{next}.

\end{document}

Result2

Related Question