[OS X TeX] TeXShop vs Ogrekit

Alain Schremmer schremmer.alain at gmail.com
Sat Jan 8 17:44:50 CET 2011


On Jan 8, 2011, at 11:04 AM, Herbert Schulz wrote:

>
> On Jan 8, 2011, at 9:59 AM, Alain Schremmer wrote:
>
>>
>> On Jan 8, 2011, at 10:20 AM, Herbert Schulz wrote:
>>
>>> Since OgreKit uses regular expressions, e.g. \n = newlinw, it  
>>> need some way to escape the \, i.e., to ``know'' that you really  
>>> mean for it to look at the \ as a character. You do this by  
>>> escaping the escape character, \\.
>>
>> Er ...
>>
>> Let us say I have \command in the Find part of Ogrekit
>>
>> If I click on \command, that selects only command and I think I  
>> understand your explanation as to why. What I don't understand is  
>> what do I do to select \command, short of clicking on one side of  
>> \command and sweeping across to the other side. In other words, I  
>> don't know what I should do to "escape the escape character" or,  
>> rather, to include it in the selection when I click. Is there a  
>> modifiying key?
>>
>> Hopeful regards
>> --schremmer
>
> Howdy,
>
> Use \\command in the find part.
> The \ alone has a special meaning in regular expressions (i.e., it  
> means the next character may have a special meaning---\n means  
> newline) so you have to double it to get one backslash.

I don't think I made myself clear. Suppose I am not dealing with  
commands.

In file Foo1 I have OldTerm1, in file Foo2 I have OldTerm2, etc

I need to replace OldTerm1 in file Foo1, OldTerm2 in file Foo2,  
OldTerm3 in file Foo3, etc by the single term NewTerm.

So, in file Foo1 I click on OldTerm1 which selects it , paste in in  
the empty Find field of Ogrekit in which I now have OldTerm1, I type  
NewTerm once and for all in the empty Replace field of Ogrekit,  and  
then click on Replace All in Ogrekit.

Perfect. All occurrences of OldTerm1 in Foo1 have now been replaced  
by NewTerm

Now I move to file Foo2 where I click on OldTerm2 which selects it  
but the Find field of Ogrekit is not empty this time as it contains  
OldTerm1 from the previous iteration. So, I click on OldTerm1 which  
selects it and then paste.

=====

But for the reason you explained it does not work quite the same with  
commands instead of terms.

When I want to replace \OldCommand2 by \NewCommand, clicking on  
\OldCommand1, still in the Find field of Ogrekit from the previous  
iteration, selects only OldCommand. So, what I do is to click on  
\OldCommand1, which selects OldCommand1 without the \ and then hit  
delete twice and then paste \OldCommand2 that I had copied in file  
Foo2 and all is well.

But I thought that there might be a modifying key so that clicking on  
\OldCommand1 in Ogrekit with the modifying key would select  
\OldCommand1 complete with the \ and then I would just have to paste  
\OldCommand2 .

It is not a big deal of course.

Best regards
--schremmer




More information about the macostex-archives mailing list