[OS X TeX] TeXShop: a way to automate terminating each line in a block with a comment symbol

Luis Sequeira lfsequeira at gmail.com
Sun May 17 12:37:35 CEST 2020


> I have long blocks of code within a \newcommand{\cmdname}{?} definition that need to have each of the lines terminated with a comment sign (%).
> 
> Is there some way to select the block and apply that automatically?
> 
> Some trick I?ve missed? some macro I?ve overlooked?


That is very easy to do.


1) Select the block of text where you want to add the comment sign.

2) Press Command-F to open the Find window

3) Chech the box for "Regular Expressions"
   Make sure that you have selected Origin: "Top" and Scope: "Selection"

   Type "$" (without quotes) in the search box
   Type "%" (without quotes) in the replace box
   Press Replace All


Done.


Regards

LS

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.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.