Thread: [Vim-latex-devel] Vim-LaTeX problem with "
Brought to you by:
srinathava,
tmaas
From: Alexander S. <ale...@sc...> - 2003-01-14 12:49:29
|
First of all, thank you very much for the vim-latex package. unfortunately I have a small, but awkward problem. When you press the " key, vi replaces it with `` at the beginning or '' at the end of the quotation. this is nice, when you do edit english texts, unfortunately, this is no such good idea, when I edit german texts. because in german it should start with "`. even worse, I do not see a possibility to get the " to do it manually, because it is always immediately replaced by ``. could you give me a hint how to solve this problem? thank you! -- mfg / with best regards Alexander Schatten ===================================================================== Dipl.Ing. Alexander Schatten Email: ale...@sc... URL: http://www.schatten.info Address: Gallitzinstr.7-13/7/7 1160 Vienna/Austria Tel: 0699/10 862 175 FAX: 0699/40 862 175 ===================================================================== Dusk is dawn is day // Where did it go? |
From: Benji F. <be...@me...> - 2003-01-14 14:12:23
|
Alexander Schatten wrote: > First of all, thank you very much for the vim-latex package. > > unfortunately I have a small, but awkward problem. When you press the " > key, vi replaces it with `` at the beginning or '' at the end of the > quotation. > > this is nice, when you do edit english texts, unfortunately, this is no > such good idea, when I edit german texts. because in german it should > start with "`. > > even worse, I do not see a possibility to get the " to do it manually, > because it is always immediately replaced by ``. > > > could you give me a hint how to solve this problem? This is a documentation problem. Have a look at the file ftplugin/latex-suite/texrc . First, see the installation instructions in the comments at the top. Then, search for /Quote/ and you will get to the lines === " Pressing " (english double quote) will insert `` or '' by making an " intelligent guess about whether we intended to open or close a quote. TexLet g:Tex_SmartKeyQuote = 1 " Users of other languages might want to change the quote characters to suit " their locale. TexLet g:Tex_SmartQuoteOpen = "``" TexLet g:Tex_SmartQuoteClose = "''" === Just change the last two lines. These changes will not take effect until you restart vim. You can change the variables on the fly: :let Tex_SmartQuoteOpen = '"`' should work (untested). (I hope the closing character is something like '", which you would have to enter as "'\"", and not "', because I think the system will be buggy if the open and close quotes start with the same character. In this case, you can turn it off completely with :let Tex_SmartKeyQuote = 0 You may have to do this in the texrc file; I am not sure if it will work on the fly.) HTH --Benji Fisher |
From: Benji F. <be...@me...> - 2003-01-14 15:25:39
|
Alexander Schatten wrote: > Benji Fisher wrote: > >> Alexander Schatten wrote: >> >> >> :let Tex_SmartKeyQuote = 0 >> >> You may have to do this in the texrc file; I am not sure if it will >> work on the fly.) >> >> HTH --Benji Fisher >> > thank you very much for this fast and concise answer. in fact it solved > the problem immediately. the problem is, that I have to write english as > well as german texts, so it seems to be a little uncomfortable, but > however, I switched this feature out at all. If you have to write English and German in the same file, this seems like the only reasonable solution. If each file is either English or German, it might be worth having the TexQuote() function figure out which language is being used. If anyone is interested in helping with this, the main thing I do not know is how to guess what language is in use. --Benji Fisher |
From: Benji F. <be...@me...> - 2003-01-14 16:31:37
|
Alexander Schatten wrote: > Benji Fisher wrote: > >> >> If you have to write English and German in the same file, this >> seems like the only reasonable solution. If each file is either >> English or German, it might be worth having the TexQuote() function > > well, yes. this is usually the case- > unfortunately I do not really understand what you meant by the > TeXQuote() function... That is the function that gets invoked when you type " . But you do not have to worry about that: the rest of us can handle the implementation. What I need to know is how to tell whether to use English or German quotes. Is there a \documentclass option or a \usepackage line that you use to tell TeX that you are writing in German? I think there must be something like this, because TeX uses different hyphenation patterns for different languages. --Benji Fisher |
From: Mikolaj M. <mi...@wp...> - 2003-01-14 22:00:33
|
On Tue, Jan 14, 2003 at 11:41:50AM -0500, Benji Fisher wrote: > That is the function that gets invoked when you type " . But you > do not have to worry about that: the rest of us can handle the > implementation. What I need to know is how to tell whether to use > English or German quotes. Is there a \documentclass option or a > \usepackage line that you use to tell TeX that you are writing in > German? I think there must be something like this, because TeX uses > different hyphenation patterns for different languages. Oops. I did not understand (post about v:lang). For Polish it will be package polski and: opening quotes: ,, closing quotes: '' Names of detected packages are stored in g:Tex_package_detected. But this variable is created by packages.vim which is sourced at the end of main.vim. Mikolaj |
From: Benji F. <be...@me...> - 2003-01-14 23:13:31
|
Mikolaj Machowski wrote: > On Tue, Jan 14, 2003 at 11:41:50AM -0500, Benji Fisher wrote: > >> That is the function that gets invoked when you type " . But you >>do not have to worry about that: the rest of us can handle the >>implementation. What I need to know is how to tell whether to use >>English or German quotes. Is there a \documentclass option or a >>\usepackage line that you use to tell TeX that you are writing in >>German? I think there must be something like this, because TeX uses >>different hyphenation patterns for different languages. > > > Oops. I did not understand (post about v:lang). > For Polish it will be package polski and: > opening quotes: ,, > closing quotes: '' > > Names of detected packages are stored in g:Tex_package_detected. But > this variable is created by packages.vim which is sourced at the end of > main.vim. > > Mikolaj That is good: it is quite possible that a user will edit two files, one in Polish and the other in German, during the same session. When the user types ", it triggers the s:TexQuotes() function. This function can extract matchstr(g:Tex_package_detected, 'german\|polski\|french') and then use g:Tex_SmartQuoteOpen_{lang} if it exists, and otherwise use the current default. I'll try to implement this tomorrow. --Benji |
From: Mikolaj M. <mi...@wp...> - 2003-01-14 18:35:03
|
On Tue, Jan 14, 2003 at 10:35:53AM -0500, Benji Fisher wrote: > which language is being used. If anyone is interested in helping with > this, the main thing I do not know is how to guess what language is in use. Checking for "v:lang" and/or "v:ctype" value? Mikolaj |
From: Benji F. <be...@me...> - 2003-01-14 19:01:19
|
Mikolaj Machowski wrote: > On Tue, Jan 14, 2003 at 10:35:53AM -0500, Benji Fisher wrote: > >>which language is being used. If anyone is interested in helping with >>this, the main thing I do not know is how to guess what language is in use. > > > Checking for "v:lang" and/or "v:ctype" value? > > Mikolaj I do not think this helps someone who writes in two different languages. Alexander Schatten wrote: [snip] > when I write german texts, I use the > german package: > > \usepackage{german} > > I think it has to do with german Umlauts, as well as hyphenation and > that stuff... > however: I guess, every german document should have this package loaded. > > btw: the german quotations are like this. "`a text"' That sounds more like it. Do the package scripts already extract this information? --Benji |
From: Mikolaj M. <mi...@wp...> - 2003-01-14 23:56:41
|
On Tue, Jan 14, 2003 at 02:11:37PM -0500, Benji Fisher wrote: > > I think it has to do with german Umlauts, as well as hyphenation and > > that stuff... > > however: I guess, every german document should have this package loaded. > > > > btw: the german quotations are like this. "`a text"' > That sounds more like it. Do the package scripts already extract > this information? yes. IMO data for creating mappings (opening quote, closing quote) should go to the package file. Function can be everywhere (most suitable is main.vim). m. |