On Sat, 14 Apr 2012 18:39:15 -0500 stefano franchi <stefano.fran...@gmail.com> 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? 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 > > 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 Note that the c on the end of each of those commands causes it to ask, on each one, whether it's OK to make the change. If you don't want to be asked, eliminate the trailing c on each command and they'll do the job in a matter of seconds for a 100K word book. Obviously, you'll need to back up the original in case my commands do more harm than good. Anyway, if you can get your LyX to treat straightdoublequotes like ascii characters, I'd anticipate this solution will take you a few minutes. As far as single quotes, I'd do those manually. If your writing is anything like mine, the VAST majority of single quotes are apostrophes, and as far as I know those SHOULD be straightquotes. From what I understand, you use straight double quotes only in a quotation within a quotation, which are rare. I'd seek out such instances, delete the straight single quote, and type in Ctrl+' to insert the proper curly quote. LyX knows by context whether to make it a beginning or ending singlequote. HTH SteveT