Fix #286 - TOC sections with optional args

This commit is contained in:
Karl Yngve Lervåg 2015-11-30 11:56:40 +01:00
parent af3f0f2226
commit 6fe6bac1a4
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ function! vimtex#toc#init_script() " {{{1
\ } \ }
" Define regular expressions to match document parts " Define regular expressions to match document parts
let s:re_sec = '\v^\s*\\%(part|chapter|%(sub)*section)\*?\s*\{' let s:re_sec = '\v^\s*\\%(part|chapter|%(sub)*section)\*?\s*%(\[.{-}\])?\{'
let s:re_sec_starred = '\v^\s*\\%(part|chapter|%(sub)*section)\*' let s:re_sec_starred = '\v^\s*\\%(part|chapter|%(sub)*section)\*'
let s:re_sec_level = '\v^\s*\\\zs%(part|chapter|%(sub)*section)' let s:re_sec_level = '\v^\s*\\\zs%(part|chapter|%(sub)*section)'
let s:re_sec_title = s:re_sec . '\zs.{-}\ze\}?$' let s:re_sec_title = s:re_sec . '\zs.{-}\ze\}?$'

View File

@ -3,6 +3,6 @@ Preface.
\section{Acknowledgements} \section{Acknowledgements}
\chapter{Other frontmatter chapter} \chapter[Other]{Other frontmatter chapter}
\tableofcontents \tableofcontents