[OS X TeX] Boldface

Alain Schremmer Schremmer.Alain at verizon.net
Sun Feb 13 13:28:44 EST 2005


Of course, it works very nicely but good deeds are always punished: I 
need more help as now I have the problem to

find
        \textbf{text}\index{text}
and replace it with
        \NewTerm{text}

I tinkered a bit with the Find panel but there does not seem to be a 
wild card and I know nothing of regular expressions.

Could someone
    (a) give me the magic formula?
    (b) direct me to an intro to regular expressions for dummies?

Regards
--schremmer


Alain Schremmer wrote:

> SOLD!
> (But now I have to do it!)
>
> Grateful regards
> --schremmer
>
> Maarten Sneep wrote:
>
>> On 13 feb 2005, at 14:46, Alain Schremmer wrote:
>>
>>> Maarten Sneep wrote:
>>>
>>>>  I've learned the hard way that introducing font-changing commands 
>>>> directly in your text is a bad idea.
>>>
>>>
>>>
>>> (1) Could you amplify? I use a macro for
>>>
>>>    \textbf{#SEL#}\index{#SEL#}
>>>
>>> which, so far, I find quite convenient as it corresponds to a 
>>> standard practice. Is there a drawback and, if so, what should I do 
>>> instead?
>>
>>
>>
>> This is a TeXShop (editing) macro, which is rather distinct from a 
>> (La)TeX macro. I would define a LaTeX command:
>>     \newcommand{\FirstAppearance}[1]{\textbf{#1}\index{#1}}
>> (Assuming you use a boldface type for the first appearance of an 
>> indexed term).
>> For easier editing, I would then define a TeXShop macro (never mind 
>> that I switched to BBEdit ;) :
>>     \FirstAppearance{#SEL##INS#}
>>
>> If you'd like to create an online version of your book, where you can 
>> use colour for these items, you can
>> now change the definition in a single location, and the rest is 
>> trivial. Just change the LaTeX macro to:
>>     \newcommand{FirstAppearance}[1]{\textcolor{blue}{#1}\index{#1}}
>> No further changes to your sources are needed.
>>
>>> (2) What does #INS# mean/do? (Appeared in preceding posts.)
>>
>>
>>
>> It determines the location of the insertion point after running the 
>> macro.
>>
>> Maarten
>>
>> --------------------- Info ---------------------
>> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>>           & FAQ: http://latex.yauh.de/faq/
>> TeX FAQ: http://www.tex.ac.uk/faq
>> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>>
>>
>>
> --------------------- Info ---------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>           & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>
>
>
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list