Text FormattingOne word - color

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
karic_a
Posts: 3
Joined: Tue Nov 06, 2012 12:02 am

One word - color

Post by karic_a »

Hi guys, I am newbie here on forum and on Latex :)

I am writing one document with Latex and I have some troubles.. I need to make one word blue in the whole document, for example:

WORD... some text, WORD... text again... etc...

I need command that will detect (cant use \command{word} for every single word case I that word is quite often :D) that word and make it blue

greets

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

One word - color

Post by Stefan Kottwitz »

Such word detection can be done with LuaTeX or XeTeX. Would you be able to use XeTeX?

However, I would use the "search and replace" feature of the editor and replace WORD by \WORD. Afterward I would define a macro:

Code: Select all

\usepackage{xspace}
...
\newcommand*{\WORD}{\textcolor{colorname}{WORD}\xspace}
Stefan
LaTeX.org admin
karic_a
Posts: 3
Joined: Tue Nov 06, 2012 12:02 am

Re: One word - color

Post by karic_a »

on my faculty we use ubuntu and kile.. so I have to use latex

I will do it with "search and replace" feature, thx for the help :)
Post Reply