[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 06:37:35 EDT 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



More information about the MacOSX-TeX mailing list