Is there a way to make a certain word bold every time in comes in the document?
Thanks.
You can create a command with \newcommand, inside the document. For example:
\newcommand{\boldword}{\textbf{supercalifragilisticexpialidocious~}}
You can use the new command created inside the document anytime.
\documentclass[]{article}
\begin{document}
\newcommand{\boldword}{\textbf{supercalifragilisticexpialidocious}}
This word \boldword\ is bold.
\end{document}
\newcommand{\boldword}{\textbf{supercalifragilisticexpialidocious.~}}
– Mihdi Caballero
Nov 19 '16 at 16:52
This word \boldword\ is bold.
– Sigur
Nov 19 '16 at 16:55
\newcommand\boldword{\textbf{word}} and usage: \boldword\ (or \boldword<punctuation> when word ends a clause or sentence; (2) \def\boldword/{\textbf{word}} usage: \boldword/ (where / must be written or there'll be an error); (3) \usepackage{xspace} \newcommand\boldword{\textbf{word}\xspace} usage: \boldword. Overall, I'd recommend (1) or, in the right circumstances, (2); (3) should generally be avoided because it relies on \def.
– jon
Nov 19 '16 at 17:33
\def but didn't you mean (2) since (2) uses \def and (3) does not?
– cfr
Nov 20 '16 at 00:18
In case your text is already written you could use the search and replace feature of your favorite editor (or commandline tools like sed/awk) to add \textbf{} around the word in question, but you'll have repeat that for every form of the word.
\textbf{word}any text editor can add\textbf{..}around every occurrence of word far quicker and more accurately than it would take to program tex macros to try to do this – David Carlisle Nov 19 '16 at 16:42