You are not logged in.

#1 2010-02-20 21:09:53

rgb
Member
Registered: 2010-02-11
Posts: 24

vim-latex suite "~a" issue

Well I just installed vim-latexsuite package and I'm having some strange binding problem, when I'm in the insert mode and press "~a", vim prints "\cite{}<++>", that's quite annoying cause there's a "ã" in my name. I checked the manual and found nothing like this. Here's my .vimrc:

" No VI compatibility
set nocompatible

" Mostra sempre a posição do cursor
set ruler

" vai até resultado da busca enquanto digita
set incsearch

" destaca termos buscados
set hlsearch

" indentação automática
set autoindent

" numera as linhas
set number

" ignora caixa na busca
set ignorecase

" fecha chaves
set showmatch

" allow backspacing over everything in insert mode
set backspace=indent,eol,start

" detecta o tipo de arquivo
filetype plugin indent on

" syntax highlight
syntax on

" cores de acordo com fundo negro
set bg=dark

" comando para compilar em LaTeX
" :command LaTeXbuild !clear && mkdir -p ./output && rubber --pdf --maxerr -1 --warn all --force --short --into ./output v:this_session && gnome-open ./output/main.pdf

" keybinding para compilação em LaTeX
" :nmap <S-F12> :LaTeXbuild<CR>

" usar mouse no modo visual 
:set mouse=a

" paste-mode
:map <F10> :set invpaste<CR>

" make backup files
set backup
set backupdir=~/.vim/backup

" vim-latex suite
filetype plugin on
set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex'

Any idea?

Offline

#2 2010-02-21 03:50:35

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Re: vim-latex suite "~a" issue

I think the correct way to write "ã" in latex is

\tilde{a}

The tilde sign (~) is a special character in latex (I think it's used for non-braking spaces) and cannot be used on its own, ie. has to be escaped by using "\".

If you need futher information on special characters in latex, have a look at this:

Overview:
http://ctan.unsw.edu.au/info/symbols/co … ymbols.pdf

Comprehensive:
http://www.ctan.org/tex-archive/info/sy … letter.pdf

Edit: copied wrong link from google

Last edited by JackH79 (2010-02-21 03:51:41)

Offline

#3 2010-02-21 15:38:53

rgb
Member
Registered: 2010-02-11
Posts: 24

Re: vim-latex suite "~a" issue

Thanks man but that's not actually what I was looking for, I had to set some mappings to use accents (I'm brazillian). Help can be found here: http://www.tex-br.org/index.php/Latex-suite

Last edited by rgb (2010-02-21 15:39:25)

Offline

#4 2010-02-21 17:56:57

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: vim-latex suite "~a" issue

Did you escape it. This one does work here:

%        File: mytest.tex
%     Created: So Feb 21 06:00  2010 C
% Last Change: So Feb 21 06:00  2010 C
%
\documentclass[a4paper]{article}
\begin{document}
print a tilde a: \~a. Done.
\end{document}

There should be no problem at all if you use UTF-8. Just load this package in your prambles:

\usepackage[utf8]{inputenc}

Edit: Sorry, I obviously misunderstood. It is not about latex not printing ã but vim-latexsuite interpreting your "~a" keypresses as command, is it?
Well, tried it, and got the "\cite{}<++>" as well.

It should be possible to redefine such sequences. This is mentioned somewhere in the latexsuite help. You may grep the latexsuite sources for "cite" as well.

If I get the time I will possibly give it a try later and report back. smile

Last edited by bernarcher (2010-02-21 18:12:34)


To know or not to know ...
... the questions remain forever.

Offline

#5 2010-02-21 19:33:24

moose jaw
Member
From: Milwaukee
Registered: 2007-08-20
Posts: 104

Re: vim-latex suite "~a" issue

Have you tried altering the value for g:Tex_Leader in your ~/.vim/ftplugin/tex.vim?  On the default install of vim latex-suite when I downloaded it, the backtick (`) followed by various letters would auto-expand into various greek letters and other things (I believe `a expanded into \alpha). This is obviously not exactly the same as what you've described here, and I haven't been able to find default expansions into \cite{} in the latex-suite files on my machine, but perhaps there are different defaults for different keyboard layouts?  (The defaults should be specified in ~/.vim/ftplugin/latex-suite/texrc)  In any case, you might try custom-setting that variable, e.g. with  "let g:Tex_Leader='!'" in your tex.vim, and see if that helps.

Offline

#6 2010-02-22 03:12:24

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: vim-latex suite "~a" issue

@moose jaw
Redefinition of g:Tex_Leader does not work. I use '#' as Tex_Leader (because it is easier to type on a QWERTZ keyboard), but the ~a problem persists. As far as I understand now this appears to be a real bug, probably caused by the UTF-8 code sequence for ã.

Look at these tilde characters as input in my mytest.tex file:

õĩũ\cite{}ÕĨŨÃ

BTW, the UTF-8 sequence for ã is 0xC3 0xA3.

Edit:
As a temporary workaround you may want to define an imap replacement in your  .vimrc, like:

" Provisional ã key mapping
" (Workaround for vim-latex bug)
imap <C-a> \~a

Last edited by bernarcher (2010-02-22 03:49:08)


To know or not to know ...
... the questions remain forever.

Offline

#7 2010-02-22 09:27:12

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Re: vim-latex suite "~a" issue

Sorry rgb for the misunderstanding.

I was able to reproduce your problem with the "\cite{}<++>" output. I had to copy the letter from this webpage, as I have a US keyboard. Funnily enough though, when I saved that character in a UTF-8 encoded file, opened that with vim in split screen and yanked it from one file to the other, it copied the ã without a problem.
Maybe someone can offer an explanaion as to what's going on.

Offline

#8 2010-02-22 11:06:58

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: vim-latex suite "~a" issue

The issue is obviously on the character input side. I tried some debug runs but as yet to no avail. sad
Perhaps some googling will provide more insight. I will try this tonight (german time).


To know or not to know ...
... the questions remain forever.

Offline

#9 2010-03-05 16:31:12

hugonobrega
Member
Registered: 2010-03-05
Posts: 1

Re: vim-latex suite "~a" issue

Hello,

I had also been scratching my head trying to figure out a solution to this problem (I'm also Brazilian and absolutely NEED to type the characters é, ã, and â very often).

Today I finally found it!

http://thisblog.runsfreesoftware.com/files/vimrc

The relevant part is this, which you should copy and paste into your .vimrc:

"To solve the propleme with vim-latexsuite has with ã and â
imap <buffer> <silent> <M-C> <Plug>Tex_MathCal
imap <buffer> <silent> <M-B> <Plug>Tex_MathBF
imap <buffer> <leader>it <Plug>Tex_InsertItemOnThisLine
imap <buffer> <silent> <M-A>  <Plug>Tex_InsertItem
"imap <buffer> <silent> <M-E>  <Plug>Tex_InsertItem
"imap <buffer> <silent> <M-e>  <Plug>Tex_InsertItemOnThisLine
imap <buffer> <silent> \c <Plug>Traditional
map <buffer> <silent> é é
map <buffer> <silent> á á
map <buffer> <silent> ã ã
"imap ã <Plug>Tex_MathCal
"imap é <Plug>Traditional

Now, I'm not exactly sure what it does to the rest of latex-suite, but it worked for me.

Best of luck to you.

Offline

#10 2011-01-22 12:19:56

robsonpeixoto
Member
From: Brazil
Registered: 2007-01-14
Posts: 11
Website

Re: vim-latex suite "~a" issue

I'm have problem with '`i', '~a', '^A'
`i -> \label{}<++>
~a -> \cite{}<++>
^A -> \mathbf{}

Know anybody how to fix this bug ?

thanks

Last edited by robsonpeixoto (2011-01-22 12:20:06)

Offline

#11 2011-01-22 12:26:49

robsonpeixoto
Member
From: Brazil
Registered: 2007-01-14
Posts: 11
Website

Offline

#12 2016-12-30 16:34:47

iamunhoz
Member
Registered: 2016-12-30
Posts: 1

Re: vim-latex suite "~a" issue

This solution worked for me as well. I'm also Brazilian and this was driving me crazy.

Just a reminder, I had to put these lines in the file /etc/vimrc.

hugonobrega wrote:

Hello,

I had also been scratching my head trying to figure out a solution to this problem (I'm also Brazilian and absolutely NEED to type the characters é, ã, and â very often).

Today I finally found it!

http://thisblog.runsfreesoftware.com/files/vimrc

The relevant part is this, which you should copy and paste into your .vimrc:

"To solve the propleme with vim-latexsuite has with ã and â
imap <buffer> <silent> <M-C> <Plug>Tex_MathCal
imap <buffer> <silent> <M-B> <Plug>Tex_MathBF
imap <buffer> <leader>it <Plug>Tex_InsertItemOnThisLine
imap <buffer> <silent> <M-A>  <Plug>Tex_InsertItem
"imap <buffer> <silent> <M-E>  <Plug>Tex_InsertItem
"imap <buffer> <silent> <M-e>  <Plug>Tex_InsertItemOnThisLine
imap <buffer> <silent> \c <Plug>Traditional
map <buffer> <silent> é é
map <buffer> <silent> á á
map <buffer> <silent> ã ã
"imap ã <Plug>Tex_MathCal
"imap é <Plug>Traditional

Now, I'm not exactly sure what it does to the rest of latex-suite, but it worked for me.

Best of luck to you.

Offline

Board footer

Powered by FluxBB