Skip to content

Commit

Permalink
feat(syntax): initial support for witharrows
Browse files Browse the repository at this point in the history
refer: #2755
  • Loading branch information
lervag committed Jul 11, 2023
1 parent bab96ed commit b861aeb
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
14 changes: 14 additions & 0 deletions autoload/vimtex/syntax/p/witharrows.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
" VimTeX - LaTeX plugin for Vim
"
" Maintainer: Karl Yngve Lervåg
" Email: [email protected]
"

function! vimtex#syntax#p#witharrows#load(cfg) abort " {{{1
call vimtex#syntax#core#new_region_math('DispWithArrows')

syntax match texMathCmdText "\\Arrow\>"
\ contained skipwhite nextgroup=texMathTextArg
endfunction

" }}}1
14 changes: 14 additions & 0 deletions test/test-syntax/test-witharrows.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
\documentclass{article}
\usepackage{physics}
\usepackage{witharrows}

\begin{document}

\begin{DispWithArrows}
\dv{i_2}{t} &= - \frac{M}{L_2} \dv{i_1}{t}
\Arrow{par intégration} \\
\Rightarrow
i_2 &= -\frac{M}{L_2}i_1 + \mathrm{cte}
\end{DispWithArrows}

\end{document}
7 changes: 7 additions & 0 deletions test/test-syntax/test-witharrows.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source common.vim

EditConcealed test-witharrows.tex

if empty($INMAKE) | finish | endif

call vimtex#test#finished()

0 comments on commit b861aeb

Please sign in to comment.