I write in Vim and when ready to format/publish dump documents in LyX for formatting as LaTeX documents. When I do so, double quotes show up in LyX with closing quotes at the beginning and end of the quote. When dumped in a word processor, opening and closing quotes are identical as well, but they are the vertical quotation marks, not the ones that curve in and out that is standard in LyX. I'm guess the latter is what is meant by "smart quotes."
I'm wondering if it's possible to change the encoding of double quotes in Vim so they don't get translated the way they do in LyX.
Thanks,
--------------------------------------------------------------------------- ---------------
Eric Weir
Decatur, GA
eew...@bellsouth.net
"What is man without the beasts? If all the beasts were gone, men would die from a great loneliness of spirit."
> I write in Vim and when ready to format/publish dump documents in LyX
> for formatting as LaTeX documents. When I do so, double quotes show up
> in LyX with closing quotes at the beginning and end of the quote. When
> dumped in a word processor, opening and closing quotes are identical as
> well, but they are the vertical quotation marks, not the ones that curve
> in and out that is standard in LyX. I'm guess the latter is what is
> meant by "smart quotes."
> I'm wondering if it's possible to change the encoding of double quotes
> in Vim so they don't get translated the way they do in LyX.
> Thanks,
> --------------------------------------------------------------------------- ---------------
> Eric Weir
> Decatur, GA
> eew...@bellsouth.net <mailto:eew...@bellsouth.net>
Vim's double quotes are Latin1 0x22, Unicode U+0022 QUOTATION MARK; Unicode adds about them:
* neutral (vertical), used as opening or closing quotation mark
* preferred characters in English for paired quotation marks are U+201C and U+201D .
If LyX modifies your neutral (") quotation marks to make them closing ones ( ) that's a LyX problem, not a Vim problem.
If you want to be able to type pretty quotation marks in Vim (as I just did here in my mailer), there are several possibilities:
- find out if your keyboard has them (on mine, it's AltGr+v and AltGr+b)
- use Ctrl-V u 201c and Ctrl-V u 201d (see :help i_CTRL-V_digit)
- make up (or find) a keymap which has them, see http://vim.wikia.com/wiki/How_to_make_a_keymap - make Insert-mode mappings for them, for instance (with the and single quotes for good measure):
and put them in your vimrc (see :help <Char> about the values I used above in the {rhs} of the mappings). The above assumes that 'encoding' has been set to UTF-8 before you define those mappings, see http://vim.wikia.com/wiki/Working_with_Unicode
Best regards,
Tony.
-- Don't cook tonight -- starve a rat today!
>> I write in Vim and when ready to format/publish dump documents in LyX
>> for formatting as LaTeX documents. When I do so, double quotes show up
>> in LyX with closing quotes at the beginning and end of the quote. When
>> dumped in a word processor, opening and closing quotes are identical as
>> well, but they are the vertical quotation marks, not the ones that curve
>> in and out that is standard in LyX. I'm guess the latter is what is
>> meant by "smart quotes."
>> I'm wondering if it's possible to change the encoding of double quotes
>> in Vim so they don't get translated the way they do in LyX.
>> Eric Weir
>> Decatur, GA
>> eew...@bellsouth.net <mailto:eew...@bellsouth.net>
> Vim's double quotes are Latin1 0x22, Unicode U+0022 QUOTATION MARK;
> Unicode adds about them:
> * neutral (vertical), used as opening or closing quotation mark
> * preferred characters in English for paired quotation marks are U+201C
> and U+201D .
> If LyX modifies your neutral (") quotation marks to make them closing
> ones ( ) that's a LyX problem, not a Vim problem.
> If you want to be able to type pretty quotation marks in Vim (as I
> just did here in my mailer), there are several possibilities:
> - find out if your keyboard has them (on mine, it's AltGr+v and AltGr+b)
> - use Ctrl-V u 201c and Ctrl-V u 201d (see :help i_CTRL-V_digit)
Oh, and I forgot: use Ctrl-K "6 and Ctrl-K "9 (see :help digraphs-use)
> - make up (or find) a keymap which has them, see
> http://vim.wikia.com/wiki/How_to_make_a_keymap > - make Insert-mode mappings for them, for instance (with the and
> single quotes for good measure):
> and put them in your vimrc (see :help <Char> about the values I used
> above in the {rhs} of the mappings). The above assumes that 'encoding'
> has been set to UTF-8 before you define those mappings, see
> http://vim.wikia.com/wiki/Working_with_Unicode
On Sat, 4 Aug 2012 07:19:40 -0400, Eric Weir wrote:
> I write in Vim and when ready to format/publish dump documents in LyX
> for formatting as LaTeX documents. When I do so, double quotes show up
> in LyX with closing quotes at the beginning and end of the quote. When
> dumped in a word processor, opening and closing quotes are identical as
> well, but they are the vertical quotation marks, not the ones that curve
> in and out that is standard in LyX. I'm guess the latter is what is
> meant by "smart quotes."
> I'm wondering if it's possible to change the encoding of double quotes
> in Vim so they don't get translated the way they do in LyX.
As Tony puts, it should be an issue of LyX rather than Vim. However I
want to add that LyX use LaTeX as its backend and LaTeX has its rule of
typesetting quotes. You need to use `(backtick, or the grave sign) and
'(single quote) to specify a beginning quote and a closing quote. And
for the double quotes you need to say `` and ''(not " sign).
> As Tony puts, it should be an issue of LyX rather than Vim. However I
> want to add that LyX use LaTeX as its backend and LaTeX has its rule of
> typesetting quotes. You need to use `(backtick, or the grave sign) and
> '(single quote) to specify a beginning quote and a closing quote. And
> for the double quotes you need to say `` and ''(not " sign).
Thanks, Alick. So using backticks in Vim would avoid the problem in LyX I'll give it a try.
From my communication with the LyX folks I understand there's been a long-standing request for addressing this issue, and more generally to provide more flexibility in the use of commas. Again, as I understand it, I think they're talking about getting LyX to use a LaTeX package called 'csquote.' People seem to be saying it wouldn't be that difficult.
Apart from that, it's been suggested that I might be able to make use of the package myself. I've looked at the documentation, but don't have a good sense of what the possibilities might be yet.
--------------------------------------------------------------------------- ---------------
Eric Weir
eew...@bellsouth.net
"The invincible shield of caring
Is a weapon sent from the sky against being dead."
On Aug 4, 2012, at 9:26 AM, Tony Mechelynck wrote:
> Vim's double quotes are Latin1 0x22, Unicode U+0022 QUOTATION MARK; Unicode adds about them:
> * neutral (vertical), used as opening or closing quotation mark
> * preferred characters in English for paired quotation marks are U+201C “ and U+201D ”.
> If LyX modifies your neutral (") quotation marks to make them closing ones (”) that's a LyX problem, not a Vim problem.
Thanks for the information on what Vim does, Tony. As my response to Alick indicates, the LyX folks are aware of the problem and that it is their's.
> If you want to be able to type “pretty” quotation marks in Vim (as I just did here in my mailer), there are several possibilities:
> - find out if your keyboard has them (on mine, it's AltGr+v and AltGr+b)
Actually, my preference would be to have LyX use the character Vim uses, the way the word processors I've checked out on this do when I dump a Vim-composed document into them.
I'll stay open to the option of setting up a mapping.
I don't understand 'AltGr+v'. Specifically, the 'Gr' part.
Thanks again,
--------------------------------------------------------------------------- ---------------
Eric Weir
Decatur, GA
eew...@bellsouth.net
"What is man without the beasts? If all the beasts were gone, men would die from a great loneliness of spirit."
On Aug 05, 2012 at 05:16 PM -0400, Eric Weir wrote:
>Thanks for the information on what Vim does, Tony. As my response to >Alick indicates, the LyX folks are aware of the problem and that it is >their's.
I think the point people are trying to make that a) it's a property of LyX and not Vim and b) it's not necessarily a 'problem' in LyX. If LyX is using TeX for it's typesetting, the way you type open and closing quotes is with ` and ' as said before (and `` and '' for double quotes).
It's not 'fixing' the problem to do it that way - it's doing it properly that way. Typing a sentence like this with a "word" in quotes is wrong.
First, I used a " and not '', and second, I need to specify the opening and closing quotes using ` or ' as appropriate. Note, where I typed 'problem' and 'fixing' in this email wouldn't format correctly in TeX, but that's ok, because this is an email.
As stated by someone else, you might want to try the Vim package that inserts the right quote while typing TeX for you, or you could just type it correctly yourself. It's possible that there is a TeX package that does smart quoting for you, but I'm not aware if there is. I'm also not familiar with how (and if) you can add packages to LyX. I use LaTeX myself quite a bit, but I just call it from Vim with a keymap and preview it in Skim, so have never found the need for LyX. No need to paste any of my text/source into another program that way.
> On Aug 4, 2012, at 9:26 AM, Tony Mechelynck wrote:
>> Vim's double quotes are Latin1 0x22, Unicode U+0022 QUOTATION MARK; Unicode adds about them:
>> * neutral (vertical), used as opening or closing quotation mark
>> * preferred characters in English for paired quotation marks are U+201C and U+201D .
>> If LyX modifies your neutral (") quotation marks to make them closing ones ( ) that's a LyX problem, not a Vim problem.
> Thanks for the information on what Vim does, Tony. As my response to Alick indicates, the LyX folks are aware of the problem and that it is their's.
>> If you want to be able to type pretty quotation marks in Vim (as I just did here in my mailer), there are several possibilities:
>> - find out if your keyboard has them (on mine, it's AltGr+v and AltGr+b)
> Actually, my preference would be to have LyX use the character Vim uses, the way the word processors I've checked out on this do when I dump a Vim-composed document into them.
> I'll stay open to the option of setting up a mapping.
> I don't understand 'AltGr+v'. Specifically, the 'Gr' part.
> Thanks again,
On my (Belgian) keyboard, I said, is AltGr+v and is AltGr+b. IOW, to get I hold down AltGr (but not Shift) while pressing and releasing v, to get I hold down AltGr (but not Shift) while pressing and releasing b. Your keyboard may or may not have an AltGr key; on mine, it's the key immediately to the right of the space bar, and AltGr is printed on it. I suppose that on some other keyboards the key at the same position is named "the right Alt key". I've been told (but I don't know for sure) that on keyboards without an AltGr key you get the same effect by using both Ctrl and Alt modifiers together.
Just for fun (and for the RTFM effect), I looked up AltGr on Wikipedia, and found it; maybe the page would interest you: http://en.wikipedia.org/wiki/AltGr
The fact that there is no obvious relationship between and v, and b, makes me believe that the same "special key combination" could quite possibly give the same result in many other "national keyboards" (especially since V and B are in the same locations on all three of AZERTY, QWERTZ and QWERTY keyboard arrangements).
Best regards,
Tony.
-- "Approximately 80% of our air pollution stems from hydrocarbons
released by vegetation, so let's not go overboard in setting and
enforcing tough emissions standards from man-made sources."
-- Ronald Reagan
On Aug 5, 2012, at 7:34 PM, Tony Mechelynck wrote:
> On my (Belgian) keyboard, I said, “ is AltGr+v and ” is AltGr+b. IOW, to get “ I hold down AltGr (but not Shift) while pressing and releasing v, to get ” I hold down AltGr (but not Shift) while pressing and releasing b. Your keyboard may or may not have an AltGr key; on mine, it's the key immediately to the right of the space bar, and AltGr is printed on it. I suppose that on some other keyboards the key at the same position is named "the right Alt key". I've been told (but I don't know for sure) that on keyboards without an AltGr key you get the same effect by using both Ctrl and Alt modifiers together.
> Just for fun (and for the RTFM effect), I looked up AltGr on Wikipedia, and found it; maybe the page would interest you:http://en.wikipedia.org/wiki/AltGr
> The fact that there is no obvious relationship between “ and v, ” and b, makes me believe that the same "special key combination" could quite possibly give the same result in many other "national keyboards" (especially since V and B are in the same locations on all three of AZERTY, QWERTZ and QWERTY keyboard arrangements).
Thanks for the explanation, Tony. The wikipedia article says that on a mac---US keyboard I take it---the option key functions the way AltGr does.
When I do Option+v and Option+b I get, respectively, √ and ∫. When I do Shift+Option+v and +b I get ◊ and ı.
When I do Ctrl+Option+v and +b I get <Right> and ^B respectively.
--------------------------------------------------------------------------- ---------------
Eric Weir
Decatur, GA
eew...@bellsouth.net
"I have a mind-set that says bipartisanship ought to consist of the Democrats coming to the Republican point of view."
> On Aug 05, 2012 at 05:16 PM -0400, Eric Weir wrote:
>> Thanks for the information on what Vim does, Tony. As my response to Alick indicates, the LyX folks are aware of the problem and that it is their's.
> I think the point people are trying to make that a) it's a property of LyX and not Vim and b) it's not necessarily a 'problem' in LyX. If LyX is using TeX for it's typesetting, the way you type open and closing quotes is with ` and ' as said before (and `` and '' for double quotes). It's not 'fixing' the problem to do it that way - it's doing it properly that way. Typing a sentence like this with a "word" in quotes is wrong. First, I used a " and not '', and second, I need to specify the opening and closing quotes using ` or ' as appropriate.
Thanks for the clarification, Tim. I now have two ways to address the issue from within Vim, the TeX way---`` and ''---and the Mac way---Option+[ and Shift+Option+[. The former is not displayed in LyX but it compiles. The latter is displayed and it compiles.
> As stated by someone else, you might want to try the Vim package that inserts the right quote while typing TeX for you
I plan to do so.
> It's possible that there is a TeX package that does smart quoting for you, but I'm not aware if there is.
> I'm also not familiar with how (and if) you can add packages to LyX.
On a per document basis you can. I believe also in LyX per se. At least some packages.
> I use LaTeX myself quite a bit, but I just call it from Vim with a keymap and preview it in Skim, so have never found the need for LyX. No need to paste any of my text/source into another program that way.
An advantage of LyX---in addition to making LaTeX available to folks like me who can't code it---is that while composing and editing documents are more readable, since the LaTeX code is not displayed.
--------------------------------------------------------------------------- ---------------
Eric Weir
Decatur, GA
eew...@bellsouth.net
"A writer is a person for whom writing is more difficult than it is for other people."