Closed alexandreroberts closed 2 years ago
Actually, I think I don't use a latexmkrc file. But I suspect that it is not relevant to this particular issue.
Unfortunately, I have been unable to isolate what is causing the problem. When I produce very simple .tex and .vim test files, I can't reproduce the behavior. Even opening a simple .tex file with my big, bloated .vimrc doesn't result in the problem. I thought I would post it here, in case anything occurs to you as to what might be causing it and what I should test further -- with apologies that I have not produced the most helpful bug report.
Does this mean that the minimal tex file and the test.vim
file you provided is not sufficient to reproduce the problem? If so, why did you even post that?
I have not seen this issue before and I can't immediately say I understand what the problem is. It would help much if you can provide any reproducible example (even if it is bloated).
Yes, that's right, sorry for the confusion; I just thought it might be useful to include the test files even though they didn't work. I will now put together as minimal an example as I can.
OK, I think I've figured it out: it seems to be a bug related to the package chemformula
.
Using the files pasted below, I obtain the buggy behavior using nvim -u test-bloated.vim main.tex
:
Using nvim -u test.vim main.tex
doesn't produce the obvious syntax highlighting mistake, but it does erroneously label the footnote's close-brace as mismatched:
main.tex
:
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[12pt,article,draft]{memoir}
\usepackage{chemformula}
\begin{document}
\footnote{For these citations,
see Stephen's quotation.}
Xenocrates was also a philosopher. The \emph{Souda} has two entries under this name, the first for Plato's second successor.
\end{document}
test.vim
:
set nocompatible " No vi compatility, this first because it resets some options
set mmp=5000 " Some files need more memory for syntax highlight
call plug#begin('~/.vim/plugged')
Plug 'lervag/vimtex'
Plug 'ale-cci/aqua-vim'
call plug#end()
" Allow crosshair cursor highlighting.
hi CursorLine cterm=NONE ctermbg=0
hi CursorColumn cterm=NONE ctermbg=0
"nnoremap <Leader>cu :set cursorline! cursorcolumn!<CR>
set cursorline! cursorcolumn!
" HIGHLIGHTING
syntax enable
set background=dark
"colorscheme afterglow
colorscheme aqua-vim
" LINE NUMBERS
set nu
set numberwidth=3
highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
au ColorScheme * hi texFootnoteArg cterm=italic
Description
Using vimtex syntax highlighting, I have found that an apostrophe character in a
\footnote
or other command (e.g.,\emph
) disrupts the syntax highlighting, leading vimtex apparently to think that the footnote has ended. This behavior is coupled with the closing brace for a footnote being highlighted in red, as if it were unpaired:Unfortunately, I have been unable to isolate what is causing the problem. When I produce very simple .tex and .vim test files, I can't reproduce the behavior. Even opening a simple .tex file with my big, bloated .vimrc doesn't result in the problem. I thought I would post it here, in case anything occurs to you as to what might be causing it and what I should test further -- with apologies that I have not produced the most helpful bug report.
Steps to reproduce
main.tex
:test.vim:
my whole bloated .vimrc file (comments stripped):
```vim set nocompatible let mapleader="," set timeoutlen=250 nnoremapExpected behavior
I expect an apostrophe not to affect syntax highlighting at all.
Actual behavior
Instead, it is sometimes being treated as if it were something like an open- or close-brace } {.
The problem goes away entirely if I replace every
'
with’
, but that is not very convenient.Do you use a latexmkrc file?
Yes (I think)
VimtexInfo