Fixed #648: Improve natbib syntax support
This commit is contained in:
parent
6b5c633fc8
commit
0382995382
@ -64,48 +64,42 @@ highlight link texHyperref texRefZone
|
|||||||
" }}}1
|
" }}}1
|
||||||
" {{{1 Improve support for cite commands
|
" {{{1 Improve support for cite commands
|
||||||
if get(g:, 'tex_fast', 'r') =~# 'r'
|
if get(g:, 'tex_fast', 'r') =~# 'r'
|
||||||
"
|
|
||||||
" biblatex
|
|
||||||
"
|
|
||||||
execute 'syntax match texStatement /\v\\%(' . join([
|
|
||||||
\ '[Cc]iteauthor\*?',
|
|
||||||
\ '[Cc]ite%(title|year|date)?\*?',
|
|
||||||
\ 'citeurl',
|
|
||||||
\ '[Pp]arencite\*?',
|
|
||||||
\ 'foot%(full)?cite%(text)?',
|
|
||||||
\ 'fullcite',
|
|
||||||
\ '[Tt]extcite',
|
|
||||||
\ '[Ss]martcite',
|
|
||||||
\ 'supercite',
|
|
||||||
\ '[Aa]utocite\*?',
|
|
||||||
\ '[Ppf]?[Nn]otecite'], '|') . ')/'
|
|
||||||
\ 'nextgroup=texRefOption,texCite'
|
|
||||||
|
|
||||||
execute 'syntax match texStatement /\v\\%(' . join([
|
for s:pattern in [
|
||||||
\ '[Cc]ites',
|
\ 'cite[pt]\*?',
|
||||||
\ '[Pp]arencites',
|
\ 'citeal[tp]\*?',
|
||||||
\ 'footcite%(s|texts)',
|
\ 'cite(num|text|url)',
|
||||||
\ '[Tt]extcites',
|
\ '[Cc]ite%(title|author|year(par)?|date)\*?',
|
||||||
\ '[Ss]martcites',
|
\ '[Pp]arencite\*?',
|
||||||
\ 'supercites',
|
\ 'foot%(full)?cite%(text)?',
|
||||||
\ '[Aa]utocites'], '|') . ')/'
|
\ 'fullcite',
|
||||||
\ 'nextgroup=texRefOptions,texCites'
|
\ '[Tt]extcite',
|
||||||
|
\ '[Ss]martcite',
|
||||||
|
\ 'supercite',
|
||||||
|
\ '[Aa]utocite\*?',
|
||||||
|
\ '[Ppf]?[Nn]otecite',
|
||||||
|
\]
|
||||||
|
execute 'syntax match texStatement'
|
||||||
|
\ '/\v\\' . s:pattern . '\ze\s*\{/'
|
||||||
|
\ 'nextgroup=texRefOption,texCite'
|
||||||
|
endfor
|
||||||
|
|
||||||
execute 'syntax match texStatement /\\[pPfFsStTaA]\?[Vv]olcites\?/'
|
for s:pattern in [
|
||||||
\ 'nextgroup=texRefOptions,texCites'
|
\ '[Cc]ites',
|
||||||
|
\ '[Pp]arencites',
|
||||||
|
\ 'footcite%(s|texts)',
|
||||||
|
\ '[Tt]extcites',
|
||||||
|
\ '[Ss]martcites',
|
||||||
|
\ 'supercites',
|
||||||
|
\ '[Aa]utocites',
|
||||||
|
\ '[pPfFsStTaA]?[Vv]olcites?',
|
||||||
|
\ 'cite%(field|list|name)',
|
||||||
|
\]
|
||||||
|
execute 'syntax match texStatement'
|
||||||
|
\ '/\v\\' . s:pattern . '\ze\s*\{/'
|
||||||
|
\ 'nextgroup=texRefOptions,texCites'
|
||||||
|
endfor
|
||||||
|
|
||||||
execute 'syntax match texStatement /\\cite\%(field\|list\|name\)/'
|
|
||||||
\ 'nextgroup=texRefOptions,texCites'
|
|
||||||
|
|
||||||
"
|
|
||||||
" natbib
|
|
||||||
"
|
|
||||||
syntax match texStatement '\\cite\%([tp]\*\?\)\?'
|
|
||||||
\ nextgroup=texRefOption,texCite
|
|
||||||
|
|
||||||
"
|
|
||||||
" Common
|
|
||||||
"
|
|
||||||
syntax region texRefOptions contained matchgroup=Delimiter
|
syntax region texRefOptions contained matchgroup=Delimiter
|
||||||
\ start='\[' end=']'
|
\ start='\[' end=']'
|
||||||
\ contains=@texRefGroup,texRefZone
|
\ contains=@texRefGroup,texRefZone
|
||||||
|
@ -87,6 +87,19 @@ const double pi = 3.1415926535
|
|||||||
\urldef{\mysite}\url{http://example.com}
|
\urldef{\mysite}\url{http://example.com}
|
||||||
\hyperref[asdasd]{asd}
|
\hyperref[asdasd]{asd}
|
||||||
|
|
||||||
|
% Cite commands
|
||||||
|
\citet*{}
|
||||||
|
\citealt{}
|
||||||
|
\citealt*{}
|
||||||
|
\citealp{}
|
||||||
|
\citealp*{}
|
||||||
|
\citenum{}
|
||||||
|
\citetext{}
|
||||||
|
\citeauthor{}
|
||||||
|
\citeauthor*{}
|
||||||
|
\citeyear{}
|
||||||
|
\citeyearpar{}
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
|
||||||
% vim: fdl=9
|
% vim: fdl=9
|
||||||
|
Loading…
Reference in New Issue
Block a user