Skip to content

Improve support for subequations environment #3036

@gssfaw

Description

@gssfaw

Is your feature request related to a problem? Please describe it.
I've found that vimtex does not parse labels from the subequations environment of the asmath package if they contain non-Latin characters in them for the omnifunc completions.

Describe the solution you'd like
It would be great if the subequations environment got a better support. This is probably due to the fact that Unicode characters need special handling.

On this screenshot you can see that omnifunc (C-xC-o) does not show the number of the subequation if it contains a Cyrillic character, while the equation with Latin letters works as expected.
20241026_15h28m01s_grim
Here is a minimal .tex file with examples. The first one has Cyrillic letters, the former has Latin characters.

Minimal tex file
%! TeX program = lualatex
\documentclass[12pt]{article} 
\usepackage{polyglossia}
\setdefaultlanguage[babelshorthands=true, forceheadingpunctuation=false]{russian}
\setotherlanguages{english}
\usepackage{fontspec} 
\setmainfont{FreeSerif}
\setsansfont{FreeSans}
\setmonofont{FreeMono}
\usepackage{amsmath}   
\begin{document}
% subequations with cyrillic letters
\begin{subequations}
    \renewcommand{\theequation}{\theparentequation\asbuk{equation}}
    \begin{align}
        test 1 1\label{eq:test_1_1}\\ 
        test 1 2 \label{eq:test_1_2}
    \end{align}
\end{subequations}
% subequations with latin letters
\begin{subequations}
    \begin{align}
        test 2 1\label{eq:test_2_1}\\ 
        test 2 2 \label{eq:test_2_2}
    \end{align}
\end{subequations}

\eqref{eq:test_1_2} % Does not show the number 
\eqref{eq:test_2_2} % Does show the number

\end{document}
`main.aux` has all labels and they seem to look the same way.
main.aux
\relax 
\ProvideDocumentCommand \selectlanguage {sO{}m}{}
\catcode `"\active 
\@writefile{toc}{\selectlanguage *[babelshorthands=true, forceheadingpunctuation=false]{russian}}
\newlabel{eq:test_1_1}{{1а}{1}{}{}{}}
\newlabel{eq:test_1_2}{{1б}{1}{}{}{}}
\newlabel{eq:test_2_1}{{2a}{1}{}{}{}}
\newlabel{eq:test_2_2}{{2b}{1}{}{}{}}
\gdef \@abspage@last{1}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions