[texhax] boldfacing words from a list

Tom Schneider toms at ncifcrf.gov
Thu Sep 28 17:26:21 CEST 2006


Chris:

> cause all words from a particular list, when appearing in a
> document, to be boldfaced.

One solution would be to process the document before running
it through LaTeX.  I would perhaps write a little Unix script:

cat pretext.tex |\
sed "s/bubba/\\textbf{bubba}/g" |\
sed "s/purple/\\textbf{purple}/g" |\
cat > posttext.tex
latex posttext.tex

You would have to make sure that words like 'a' which can be part
of other words do not get used incorrectly.  One way would be to 
demand spaces on both sides of the word:

sed "s/ bubba / \\textbf{bubba} /g" |\

but that requires a bit more work.

You could make a loop to do the above based on a list ...  Once you
start programming in Unix, lots of things become possible.  (Perl or
other languages are probably better than csh though.)

Tom

  Dr. Thomas D. Schneider
  National Institutes of Health
  National Cancer Institute
  Center for Cancer Research Nanobiology Program
  Molecular Information Theory Group
  Frederick, Maryland  21702-1201
  toms at ncifcrf.gov
  permanent email: toms at alum.mit.edu (use only if first address fails)
  http://www.ccrnp.ncifcrf.gov/~toms/


More information about the texhax mailing list