HI Steve,

On Sun, Apr 15, 2012 at 4:50 PM, Steve Litt <[email protected]> wrote:
> On Sat, 14 Apr 2012 18:39:15 -0500
> stefano franchi <[email protected]> wrote:
>
>> I have a (long) manuscript imported from Framemaker via Latex where
>> all the quotation marks (both single and double) appear in Lyx as
>> straight quotes instead of the properly curly ones. The source view,
>> in fact, shows me countless \texquotedbl commands instead of regular
>> quotes.
>
> When you say "source view", do you mean viewed in a text editor?

No, I meant the LateX code you get to see with Lyx's own "View Source" command.
In Lyx (not Latex) source code, they are just straight ascii double quotes

>
> My LyX 2.0.0 April 29, 2011 on Ubuntu 11.04 errored out when I put an
> ERT symbol of \texquotedbl into a document. In my LyX, when I put in a
> straight quote (Ctrl+Shift+"), in Vim it's just an ascii doublequote.
> In my LyX, viewed in Vim, my curly quotes look like this:
>
> \begin_inset Quotes eld
> \end_inset
>
> phrase to be quoted
> \begin_inset Quotes erd
> \end_inset

Same here

>
>
>>
>> Is there any way to do a global find and replace that would properly
>> substitute opening straight quotes with open single|double quotes and
>> viceversa for closing quotes?
>
> Personally, I think this is a job for Vim. Or maybe a short program in
> awk, Perl, Python, Ruby or Lua.
>
> I just experimented with it, and assuming you can get your LyX to treat
> a straight quote as the ascii character (maybe by changing your
> fontenc), then I think the following two commands, within Vim, should
> do what you want:
>
> :%s/\(\s\)"\(\S\)/\1\r\\begin_inset Quotes eld\r\\end_inset\r\r\2/gc
>
> :%s/\(\S\)"\(\s\)/\1\r\\begin_inset Quotes erd\r\\end_inset\r\r\2/gc
>


That's pretty much what I was trying to do in Kile (even though my
RegEx was way simpler than yours...)
Unfortunately I cannot find a way to do it automatically, because
there are instances where the straight double quotes are actually used
by Lyx. So I guess I'll have to confirm every single one. Long night
ahead (book is close to 300K words...)

Thanks for confirming my hunch and providing the regex.


Cheers,

Stefano
-- 
__________________________________________________
Stefano Franchi
Associate Research Professor
Department of Hispanic Studies            Ph:   +1 (979) 845-2125
Texas A&M University                          Fax:  +1 (979) 845-6421
College Station, Texas, USA

[email protected]
http://stefano.cleinias.org

Reply via email to