[OS X TeX] Place holder in TeXShop's Find

Alain Schremmer schremmer.alain at gmail.com
Fri Jun 9 14:35:09 CEST 2017


On , at 2017 Jun 9,1:56 AM, Michael Sharpe wrote:

> 
>> On Jun 8, 2017, at 12:33 PM, Alain Schremmer <schremmer.alain at gmail.com> wrote:
>> 
>> I would like to replace all commands of the form \colorbox{Color} by the command \hlc[Color] with TeXShop's Find. 
>> 
>> I assume that I should use the option Regular Expressions with some place holder:
>> 
>> 	Find: \colorbox{PlaceHolder}
>> 
>> 	Replace: \hlc[PlaceHolder]
>> 
>> but I have no idea what PlaceHolder ought to be.
>> 
>> The reason is that \hlc, a modification of soul's \hl, is breakable so I would much appreciate help in the matter.
>> --schremmer
> 
> Find: \\colorbox\{([A-z]*)\}
> 
> Replace: \\hlc\[\1\]
> 
> Be sure to check the Regular Expressions box on the OgreKit Find window. The above assumes that the color names are purely alphabetic, with no spaces or other characters like hyphens or periods.
> 
> Michael

Worked great. (Of course)

I just forgot that while \hlc[yellow]{$3$} works fine, $\hlc[yellow]{$3$}$ does not. So, \colorbox still has its use. But I only had a couple of those. 

Very grateful regards
--schremmer
----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://www.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex


More information about the macostex-archives mailing list