Text Formatting ⇒ Automatic formating of certain words
Automatic formating of certain words
I'm quite new to TeX and I'm wondering if there is a package or any other way to achieve the following:
I want to format certain words (could be up to 150) automatically in my TeX project.
I imagined something like this:
I define a "wordlist" and a format somewhere (in the main tex document?):
\blacklist{word1;word2;word3;word4;word5;...}
\blacklist_format{\color{red}}
The result should be that after compiling the document every word which was listed in the blacklist is automatically rendered in red.
Is something like this possible? I searched quite a while on the net but haven't found anything.
Thanks and regards,
div
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Posts: 37
- Joined: Sun Mar 29, 2009 1:41 am
Re: Automatic formating of certain words
To my knowledge, most of the time it's impossible to touch anything that's not in a command without using very low level TeX stuff... maybe someone here can help you do that. But personally, I can't think of any situation in which I would want to universally change the formatting of certain words; perhaps if you told us what you're trying to accomplish we might be able to help more.
If you're really desperate, you can always write a quick script in any programming language to take in a .tex file and color all occurrences of those words.
Re: Automatic formating of certain words
I think you're right, I think I'll write a small console application to parse the tex files.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Automatic formating of certain words
Best regards
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10