Update generated nvim config
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
TESTS := $(wildcard test*.vim)
|
||||
TESTS := $(TESTS:.vim=)
|
||||
|
||||
.PHONY: test $(TESTS)
|
||||
|
||||
test: $(TESTS)
|
||||
|
||||
$(TESTS):
|
||||
@$(MYVIM) -u $@.vim
|
||||
|
||||
test-large: | syntax/asy.vim
|
||||
|
||||
syntax/asy.vim:
|
||||
@echo -n "-- Fetching asy.vim ... "
|
||||
@mkdir -p syntax
|
||||
@wget \
|
||||
https://raw.githubusercontent.com/vectorgraphics/asymptote/master/base/asy.vim \
|
||||
-O syntax/asy.vim >/dev/null 2>&1
|
||||
@echo "done"
|
||||
@ -0,0 +1,45 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
syntax enable
|
||||
|
||||
set nomore
|
||||
set spell
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
" Use a more colorful colorscheme
|
||||
colorscheme morning
|
||||
|
||||
highlight Conceal ctermfg=4 ctermbg=7 guibg=NONE guifg=blue
|
||||
highlight texCmdRef ctermfg=6 guifg=cyan
|
||||
|
||||
if empty($INMAKE)
|
||||
augroup Testing
|
||||
autocmd!
|
||||
autocmd CursorMoved * echo join(vimtex#syntax#stack(), ' -> ')
|
||||
augroup END
|
||||
endif
|
||||
|
||||
function Edit(file) abort
|
||||
let g:vimtex_syntax_conceal_disable = 1
|
||||
execute 'silent edit' a:file
|
||||
set conceallevel=2
|
||||
endfunction
|
||||
|
||||
function EditConcealed(file, bang) abort
|
||||
execute 'silent edit' a:file
|
||||
|
||||
if a:bang
|
||||
split
|
||||
else
|
||||
vsplit
|
||||
endif
|
||||
|
||||
silent wincmd w
|
||||
silent windo set scrollbind
|
||||
set conceallevel=2
|
||||
endfunction
|
||||
|
||||
command! -nargs=1 Edit call Edit(<q-args>)
|
||||
command! -nargs=1 -bang EditConcealed call EditConcealed(<q-args>, <q-bang> == '!')
|
||||
@ -0,0 +1,82 @@
|
||||
\documentclass{amsart}
|
||||
\usepackage{amsmath}
|
||||
|
||||
\DeclareMathOperator{\GL}{GL}
|
||||
\newcommand{\SL}{\operatorname{SL}}
|
||||
|
||||
\numberwithin{equation}{section}
|
||||
|
||||
\subjclass[2010]{Primary: 11F67}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{align}
|
||||
f(x) &= \bigg\lvert 0 \bigg\rvert \\
|
||||
f(x) &= \Bigg\lVert 0 \Bigg\rVert
|
||||
\tag{mylabel}
|
||||
\end{align}
|
||||
|
||||
\begin{equation}
|
||||
\sum_{\begin{subarray}{l}i\in\Lambda\\ 0<j<n\end{subarray}} P(i,j)
|
||||
\end{equation}
|
||||
|
||||
\begin{alignat}{3}
|
||||
f(x) &= \bigg\lvert 0 \bigg\rvert \\
|
||||
f(x) &= \Bigg\lVert 0 \Bigg\rVert
|
||||
\tag*{mylabel}
|
||||
\end{alignat}
|
||||
|
||||
\begin{alignat*}{3}
|
||||
f(x) &= \bigg\lvert 0 \bigg\rvert \\
|
||||
f(x) &= \Bigg\lVert 0 \Bigg\rVert
|
||||
\end{alignat*}
|
||||
|
||||
\begin{xalignat}{3}
|
||||
f(x) &= \bigg\lvert 0 \bigg\rvert \\
|
||||
f(x) &= \Bigg\lVert 0 \Bigg\rVert
|
||||
\end{xalignat}
|
||||
|
||||
\begin{xalignat*}{3}
|
||||
f(x) &= \bigg\lvert 0 \bigg\rvert \\
|
||||
f(x) &= \Bigg\lVert 0 \Bigg\rVert
|
||||
\end{xalignat*}
|
||||
|
||||
\begin{xxalignat}{3}
|
||||
f(x) &= \bigg\lvert 0 \bigg\rvert \\
|
||||
f(x) &= \Bigg\lVert 0 \Bigg\rVert
|
||||
\label{speled wronng}
|
||||
\end{xxalignat}
|
||||
|
||||
See also \eqref{speled wronng}.
|
||||
Spelling: {speled wronng}.
|
||||
$ operatorname{ Re } = 1 $
|
||||
$ \operatorname{ Re } = 1 $
|
||||
|
||||
\begin{equation}
|
||||
\begin{Vmatrix}
|
||||
a & b \\
|
||||
c & d \\
|
||||
\end{Vmatrix}
|
||||
\begin{vmatrix}
|
||||
a & b \\
|
||||
c & d \\
|
||||
\end{vmatrix}
|
||||
\begin{Bmatrix}
|
||||
a & b \\
|
||||
c & d \\
|
||||
\end{Bmatrix}
|
||||
\begin{bmatrix}
|
||||
a & b \\
|
||||
c & d \\
|
||||
\end{bmatrix}
|
||||
\begin{pmatrix}
|
||||
a & b \\
|
||||
c & d \\
|
||||
\end{pmatrix}
|
||||
\begin{smallmatrix}
|
||||
a & b \\
|
||||
c & d \\
|
||||
\end{smallmatrix}
|
||||
\end{equation}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,22 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-amsmath.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texCmdDeclmathoper', 4, 1))
|
||||
call assert_true(vimtex#syntax#in('texDeclmathoperArgName', 4, 22))
|
||||
call assert_true(vimtex#syntax#in('texDeclmathoperArgBody', 4, 27))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texCmdOpname', 5, 18))
|
||||
call assert_true(vimtex#syntax#in('texOpnameArg', 5, 32))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texCmdNumberWithin', 7, 1))
|
||||
call assert_true(vimtex#syntax#in('texNumberWithinArg1', 7, 15))
|
||||
call assert_true(vimtex#syntax#in('texNumberWithinArg2', 7, 25))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texCmdSubjClass', 9, 1))
|
||||
call assert_true(vimtex#syntax#in('texSubjClassOpt', 9, 12))
|
||||
call assert_true(vimtex#syntax#in('texSubjClassArg', 9, 18))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,27 @@
|
||||
\documentclass{article}
|
||||
\usepackage{amsthm}
|
||||
|
||||
\theoremstyle{plain}
|
||||
\newtheorem{thm}{Theorem}[section]
|
||||
\newtheorem{prp}[thm]{Proposition}
|
||||
\newtheorem{lemma}{Lemma}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{thm}[description of theorem abc \cite{abc}]
|
||||
My theorem goes here.
|
||||
\end{thm}
|
||||
|
||||
\begin{prp}[pleaze spelll check]
|
||||
My proposition goes here.
|
||||
\end{prp}
|
||||
|
||||
\begin{lemma}
|
||||
A lemma here.
|
||||
\end{lemma}
|
||||
|
||||
\begin{proof}[Proof of theorem abc]
|
||||
Proof goes here.
|
||||
\end{proof}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,23 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-amsthm.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texCmdThmStyle', 4, 1))
|
||||
call assert_true(vimtex#syntax#in('texThmStyleArg', 4, 15))
|
||||
call assert_true(vimtex#syntax#in('texNewthmOptNumberby', 5, 32))
|
||||
call assert_true(vimtex#syntax#in('texNewthmOptCounter', 6, 19))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texProofEnvBgn', 23, 1))
|
||||
call assert_true(vimtex#syntax#in('texProofEnvOpt', 23, 15))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texTheoremEnvBgn', 11, 1))
|
||||
call assert_true(vimtex#syntax#in('texTheoremEnvBgn', 15, 1))
|
||||
call assert_true(vimtex#syntax#in('texTheoremEnvBgn', 19, 1))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texTheoremEnvOpt', 11, 36))
|
||||
call assert_true(vimtex#syntax#in('texCmdRefConcealed', 11, 42))
|
||||
call assert_true(vimtex#syntax#in('texRefConcealedArg', 11, 47))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,38 @@
|
||||
\documentclass{article}
|
||||
\usepackage{tabularx}
|
||||
\usepackage{array}
|
||||
|
||||
\newcolumntype\vcenter[1]{>{$\vcenter\bgroup\hbox\bgroup}#1<{\egroup\egroup$}}
|
||||
\newcolumntype{d}[1]{>{\rightdots{#1}}r<{\endrightdots}}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{tabular}{*{3}{>{$}c<{$}}}
|
||||
\hline
|
||||
Hello world !\tabularnewline
|
||||
\hline
|
||||
\end{tabular}
|
||||
|
||||
\begin{tabular}{l*{4}{m{1cm}}}
|
||||
\hline
|
||||
Hello world !\tabularnewline
|
||||
\hline
|
||||
\end{tabular}
|
||||
|
||||
% Array specific math separators
|
||||
\begin{tabular}[ht]{|@{.}>{\centering$}m{1cm}<{$}|}
|
||||
\hline
|
||||
Hello world !\tabularnewline
|
||||
\hline
|
||||
\end{tabular}
|
||||
|
||||
% Array environment also supports similar constructs
|
||||
\[
|
||||
\mathrm{a} =
|
||||
\begin{array}{l*{4}{m{1cm}}r}
|
||||
\mathrm{b} & bar & baz & a & b & 2\\
|
||||
foo & bar & baz & a & b & 2\\
|
||||
\end{array}
|
||||
\]
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,12 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-array.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texTabularCol', 10, 17))
|
||||
call assert_true(vimtex#syntax#in('texTabularCol', 16, 18))
|
||||
call assert_true(vimtex#syntax#in('texTabularMathdelim', 10, 24))
|
||||
call assert_true(vimtex#syntax#in('texTabularCol', 32, 18))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,57 @@
|
||||
\documentclass{article}
|
||||
\usepackage[inline]{asymptote}
|
||||
|
||||
\begin{document}
|
||||
|
||||
Here is a venn diagram produced with Asymptote, drawn to width 4cm:
|
||||
|
||||
\begin{asy}
|
||||
size(4cm,0);
|
||||
pen colour1=red;
|
||||
pen colour2=green;
|
||||
|
||||
pair z0=(0,0);
|
||||
pair z1=(-1,0);
|
||||
pair z2=(1,0);
|
||||
real r=1.5;
|
||||
path c1=circle(z1,r);
|
||||
path c2=circle(z2,r);
|
||||
fill(c1,colour1);
|
||||
fill(c2,colour2);
|
||||
|
||||
picture intersection=new picture;
|
||||
fill(intersection,c1,colour1+colour2);
|
||||
clip(intersection,c2);
|
||||
|
||||
add(intersection);
|
||||
|
||||
draw(c1);
|
||||
draw(c2);
|
||||
|
||||
// draw("$\A$",box,z1); // Requires [inline] package option.
|
||||
// draw(Label("$\B$","$B$"),box,z2); // Requires [inline] package option.
|
||||
draw("$A$",box,z1);
|
||||
draw("$\V{B}$",box,z2);
|
||||
|
||||
pair z=(0,-2);
|
||||
real m=3;
|
||||
margin BigMargin=Margin(0,m*dot(unit(z1-z),unit(z0-z)));
|
||||
|
||||
draw(Label("$A\cap B$",0),conj(z)--z0,Arrow,BigMargin);
|
||||
draw(Label("$A\cup B$",0),z--z0,Arrow,BigMargin);
|
||||
draw(z--z1,Arrow,Margin(0,m));
|
||||
draw(z--z2,Arrow,Margin(0,m));
|
||||
|
||||
shipout(bbox(0.25cm));
|
||||
\end{asy}
|
||||
|
||||
\begin{asydef}
|
||||
// Global Asymptote definitions can be put here.
|
||||
import three;
|
||||
usepackage("bm");
|
||||
texpreamble("\def\V#1{\bm{#1}}");
|
||||
// One can globally override the default toolbar settings here:
|
||||
// settings.toolbar=true;
|
||||
\end{asydef}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,9 @@
|
||||
source common.vim
|
||||
|
||||
set runtimepath^=.
|
||||
|
||||
EditConcealed test-asymptote.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,8 @@
|
||||
\documentclass{article}
|
||||
\usepackage{babel}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\glq \grq \glqq \grqq \hyp
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,7 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-babel.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,12 @@
|
||||
\documentclass[12pt,article,draft]{memoir}
|
||||
|
||||
\usepackage[notes, useibid]{biblatex-chicago}
|
||||
\addbibresource{biblatex-examples.bib}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\mancite
|
||||
Just the title:
|
||||
\headlesscite[23]{worman}.
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,11 @@
|
||||
source common.vim
|
||||
|
||||
" let g:vimtex_syntax_conceal_cites = {
|
||||
" \ 'type': 'icon',
|
||||
" \}
|
||||
|
||||
EditConcealed! test-biblatex-chicago.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,40 @@
|
||||
\documentclass{beamer}
|
||||
\usepackage{biblatex}
|
||||
\usepackage{csquotes}
|
||||
|
||||
% \addbibresource{biblatex-examples.bib}
|
||||
\addbibresource{../common/local1.bib}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\textit{Text goes here~\cite{Local1}.}
|
||||
|
||||
% Conceal example
|
||||
Bla bla bla, see Ref.~\cite{Local1,Local1}. For more info, see also \cite{Local1}.
|
||||
|
||||
\autocite{}
|
||||
\bibentry{}
|
||||
\footcite{}
|
||||
\smartcite{}
|
||||
\Textcite[e.g.][]{}
|
||||
|
||||
\cite{fooBar}
|
||||
\Cite{fooBar}
|
||||
\citealp*{}
|
||||
\citealp{}
|
||||
\citealt*{}
|
||||
\citealt{}
|
||||
\citeauthor*{}
|
||||
\citeauthor{asd}
|
||||
\citenum{}
|
||||
\citep{Local1}
|
||||
\citep[e.g.][]{Local1}
|
||||
\citet*{}
|
||||
\citetext{}
|
||||
\citeyear{}
|
||||
\citeyearpar{}
|
||||
|
||||
\volcite{1}[23]{worman}
|
||||
\volcite[23]{worman}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,11 @@
|
||||
source common.vim
|
||||
|
||||
" let g:vimtex_syntax_conceal_cites = {
|
||||
" \ 'type': 'icon',
|
||||
" \}
|
||||
|
||||
EditConcealed! test-biblatex.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,12 @@
|
||||
\documentclass{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\textit {\textbf {This is bold-italic, but it looks italic}}
|
||||
\textbf{\textit{This is bold-italic, but it looks italic}}
|
||||
\textbf{\textbf{This is bold-italic, but it looks italic}}
|
||||
\textbf{\emph{This is bold-italic, but it looks italic}}
|
||||
\textit{\emph{This is bold-italic, but it looks italic}}
|
||||
\emph{\textbf{This is bold-italic, but it looks italic}}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,14 @@
|
||||
source common.vim
|
||||
|
||||
" let g:vimtex_syntax_conceal = {'styles': 0}
|
||||
|
||||
EditConcealed test-bold-italic.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texStyleBoth', 5, 50))
|
||||
call assert_true(vimtex#syntax#in('texStyleBoth', 6, 50))
|
||||
call assert_true(vimtex#syntax#in('texStyleBoth', 8, 50))
|
||||
call assert_true(vimtex#syntax#in('texCmdStyle', 7, 14))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,17 @@
|
||||
\documentclass{article}
|
||||
\usepackage{booktabs}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{table}
|
||||
\centering
|
||||
\begin{tabular}{cr}
|
||||
\toprule
|
||||
1234 \\
|
||||
\midrule
|
||||
2345 \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{table}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,7 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-booktabs.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,19 @@
|
||||
\documentclass{minimal}
|
||||
\usepackage{physics}
|
||||
\usepackage{breqn}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{dmath}
|
||||
[a,f(a,a^\dagger)]
|
||||
= \sum_{n_1=0}^{\infty} \sum_{n_2=0}^{\infty} \frac{1}{n_1! n_2!}
|
||||
\frac{\partial^{n_1+n_2}f(0,0)}{\partial X^{n_1} \partial Y^{n_2}}
|
||||
[a,a^{n_1} {a^\dagger}^{n_2}]
|
||||
= \sum_{n_1=0}^{\infty} \sum_{n_2=0}^{\infty} \frac{1}{n_1! n_2!}
|
||||
\frac{\partial^{n_1+n_2}f(0,0)}{\partial X^{n_1} \partial Y^{n_2}} n_2 a^{n_1} {a^\dagger}^{n_2-1}
|
||||
= \sum_{n_1=0}^{\infty} \sum_{n_2=1}^{\infty} \frac{1}{n_1! (n_2-1)!}
|
||||
\frac{\partial^{n_1+n_2}f(0,0)}{\partial X^{n_1} \partial Y^{n_2}} a^{n_1} {a^\dagger}^{n_2-1}
|
||||
= \pdv{f}{a^\dagger}.
|
||||
\end{dmath}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,10 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-breqn.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 9, 1))
|
||||
|
||||
call vimtex#test#finished()
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
\documentclass{article}
|
||||
\usepackage{cases}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{numcases}{y_1 = }
|
||||
f_1(x) & $x > 0$\\
|
||||
f_2(x) & $x \leqslant 0$
|
||||
\end{numcases}
|
||||
|
||||
\begin{subnumcases}{y_1 = }
|
||||
f_1(x) & $x > 0$\\
|
||||
f_2(x) & $x \leqslant 0$
|
||||
\end{subnumcases}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,7 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-cases.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,27 @@
|
||||
\documentclass{article}
|
||||
\usepackage{chemformula}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\ch{M -> M^{n+} + ne^{-}}
|
||||
\ch{A + B ->[a] C}
|
||||
|
||||
\ch[options]{input}
|
||||
\ch[decimal-marker={,}]{3.5}
|
||||
\ch[frac-style=xfrac]{3/2}
|
||||
|
||||
\ch{ "escaped text" }
|
||||
\ch{ 'escaped text' }
|
||||
\ch{"\ldots\," Na + "\ldots\," Cl2 -> "\ldots\," NaCl}
|
||||
|
||||
\ch{ $escaped math$ }
|
||||
\ch{ \(escaped math\) }
|
||||
\ch{$2n$ Na + $n$ Cl2 -> $2n$ NaCl}
|
||||
|
||||
\begin{equation}
|
||||
\ch{M -> M^{n+} + ne^{-}}
|
||||
\end{equation}
|
||||
|
||||
\footnote{For these citations, see Stephen's quotation.}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,10 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-chemformula.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texFootnoteArg', 25, 48))
|
||||
call assert_true(!vimtex#syntax#in('texCHText', 25, 48))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,12 @@
|
||||
\documentclass[border=10pt]{standalone}
|
||||
\usepackage[siunitx, RPvoltages]{circuitikz}
|
||||
\newcommand{\myflow}[3][above]{%arguments: [options (default above)] {component name} {label to add}
|
||||
\draw [-{Triangle[open]}] (#2-Ffrom) -- (#2-Fto) node[pos=0.5, #1]{#3};
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
\begin{circuitikz}
|
||||
\draw (0,0) to[short, f, name=S1] ++(3,0);
|
||||
\myflow{S1}{$I$}
|
||||
\end{circuitikz}
|
||||
\end{document}
|
||||
@ -0,0 +1,23 @@
|
||||
\documentclass{beamer}
|
||||
\usepackage{cleveref}
|
||||
|
||||
\crefname{equation}{Eq}{Eqs}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\label[asd]{sec:cleveref}
|
||||
|
||||
\cref{eq:test}
|
||||
\crefrange{eq:test}{eq:test2}
|
||||
|
||||
\nameCrefs{eq:test}
|
||||
\nameCref{eq:test}
|
||||
\namecrefs{eq:test}
|
||||
\namecref{eq:test}
|
||||
\lcnamecrefs{eq:test}
|
||||
\lcnamecref{eq:test}
|
||||
|
||||
Spelling error here: FooBar
|
||||
\Cref{FooBar}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,9 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-cleveref.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_equal(3, len(filter(b:vimtex_syntax, 'v:val.__loaded')))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,29 @@
|
||||
\documentclass{article}
|
||||
\usepackage{comment}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{comment}
|
||||
Test accents \v! and \v@ here.
|
||||
|
||||
Line with inline verbatim: \verb+verb+
|
||||
Line with inline verbatim: \verb*+verb+
|
||||
|
||||
Line with $inline math$ here.\footnote{here {asd} with \cmd also}.
|
||||
\end{comment}
|
||||
|
||||
\begin{comment}
|
||||
text text text text text text text text text text text text text
|
||||
\begin{equation}
|
||||
a=b
|
||||
\end{equation}
|
||||
text text text text text text text text text text text text text
|
||||
\begin{empheq}[box=\widefbox]{align*}
|
||||
c_1 &= a\\
|
||||
c_2 &= b\\
|
||||
c_3 &= c
|
||||
\end{empheq}
|
||||
text text text text text text text text text text text text text
|
||||
\end{comment}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,143 @@
|
||||
\documentclass{minimal}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{hyperref}
|
||||
|
||||
\renewcommand{\emph}{\textbf}
|
||||
\renewcommand\emph{\textbf}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{description}
|
||||
\item[testing] This is an item
|
||||
\item [tested] This is another item
|
||||
\end{description}
|
||||
|
||||
$\binom{a}{b}$
|
||||
|
||||
$a_1$
|
||||
$a_+$
|
||||
$a_-$
|
||||
$a_=$
|
||||
$a_{i + 1}$
|
||||
$a_{i+1}$
|
||||
$a_{\beta k}$
|
||||
$a_{\hat k}$
|
||||
$a_{\delta}$
|
||||
$a_\delta$
|
||||
$a_\rho$
|
||||
$\ket{\psi_{i+1}}$
|
||||
|
||||
$a^q$
|
||||
$a^C$
|
||||
$a^F$
|
||||
$a^Q$
|
||||
$a^{\beta}$
|
||||
$a^{\gamma}$
|
||||
$a^{\delta}$
|
||||
$a^{\epsilon}$
|
||||
$a^{\theta}$
|
||||
$a^{\iota}$
|
||||
$a^{\phi}$
|
||||
$a^{\chi}$
|
||||
|
||||
$a^1$
|
||||
$a^+$
|
||||
$a^-$
|
||||
$a^=$
|
||||
$a^{i + 1}$
|
||||
$a^{i+1}$
|
||||
$a^{\hat k}$
|
||||
|
||||
\begin{equation}
|
||||
\lvert x \rvert
|
||||
\bigl\lvert x \bigr\rvert
|
||||
\operatorname{test}(a) = 1
|
||||
\int f = \iiint g
|
||||
\end{equation}
|
||||
|
||||
$\langle \| \\ \rangle$
|
||||
|
||||
% Concealed and styled (bold; italic)
|
||||
\textup{asd $\alpha$}
|
||||
\textbf{test}
|
||||
\textit{test}
|
||||
\textsl{test}
|
||||
$4 \mathit{x} = \mathbf{test}$
|
||||
$\mathrm{Re} = \cdots$
|
||||
|
||||
\begin{equation}
|
||||
\mathbb{P}(x \,|\, y) \!= \dots
|
||||
\label{eq:test-ref}
|
||||
\end{equation}
|
||||
|
||||
Let's refer to \eqref{eq:test-ref}.
|
||||
|
||||
Let's refer to Eq. \ref{eq:test-ref}.
|
||||
|
||||
$\bar a$
|
||||
$\bar{a}$
|
||||
|
||||
\begin{equation}
|
||||
\text{test}
|
||||
\textnormal{test $asd$}
|
||||
\textrm{test}
|
||||
\textup{test}
|
||||
\texttt{test}
|
||||
\textsf{test}
|
||||
\textsc{test}
|
||||
\end{equation}
|
||||
|
||||
\href{url}{text}
|
||||
|
||||
\keyw{Piecewise \textbf{test} splines}
|
||||
|
||||
\begin{equation}
|
||||
\sum_{i=1}^n a_i = 0
|
||||
\end{equation}
|
||||
|
||||
$$\lVert \mathrm{w} \rVert_2^2$$
|
||||
|
||||
\chapter{test}
|
||||
|
||||
\section{test}
|
||||
|
||||
\subsection{testing}
|
||||
|
||||
\subsubsection{testing}
|
||||
|
||||
Test tilde: \tilde n
|
||||
|
||||
Hello
|
||||
\thinspace
|
||||
\medspace
|
||||
\thickspace
|
||||
\bigskip
|
||||
\hspace{1em}
|
||||
\hfill
|
||||
\vspace{1em}
|
||||
\vfill
|
||||
With \phantom{\text{here}} here.
|
||||
With \hphantom{\text{here}} here.
|
||||
Moon
|
||||
|
||||
1 \, \: \; \! \quad \qquad 2
|
||||
|
||||
$1 \, \: \; \! \quad \qquad 2$
|
||||
|
||||
$Hello
|
||||
\thinspace
|
||||
\medspace
|
||||
\thickspace
|
||||
\bigskip
|
||||
\hspace{1em}
|
||||
\hfill
|
||||
\vspace{1em}
|
||||
Moon$
|
||||
And~other spacing. (p.~181) \citet[Sect.~3]{MyRef:2023}
|
||||
Also in math $f~x$.
|
||||
The songs \textit{Red Guitar}, etc.\ are by Loudon Wainwright~III\@.
|
||||
|
||||
$\{x\}$
|
||||
$\left\{x\right\}$
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,24 @@
|
||||
source common.vim
|
||||
|
||||
let g:vimtex_syntax_conceal = {'sections': 1}
|
||||
let g:vimtex_syntax_custom_cmds = [
|
||||
\ {'name': 'keyw', 'mathmode': 0, 'argstyle': 'boldital' , 'conceal': 1},
|
||||
\]
|
||||
let g:vimtex_syntax_custom_cmds_with_concealed_delims = [
|
||||
\ {'name': 'ket',
|
||||
\ 'mathmode': 1,
|
||||
\ 'cchar_open': '|',
|
||||
\ 'cchar_close': '>'},
|
||||
\ {'name': 'binom',
|
||||
\ 'mathmode': 1,
|
||||
\ 'nargs': 2,
|
||||
\ 'cchar_open': '(',
|
||||
\ 'cchar_mid': '|',
|
||||
\ 'cchar_close': ')'},
|
||||
\]
|
||||
|
||||
EditConcealed test-conceal.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,3 @@
|
||||
|
||||
^^A asdasd
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
%% VimTeX: simple test for syntax
|
||||
|
||||
\ProvidesPackage{none}
|
||||
|
||||
\def\MyCommand#1{#1}
|
||||
\def\@asd{asd}
|
||||
|
||||
\v!
|
||||
\v@
|
||||
|
||||
\endinput
|
||||
|
||||
%% End of file
|
||||
@ -0,0 +1,137 @@
|
||||
%! TeX program = lualatex
|
||||
\documentclass{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{graphicx}
|
||||
|
||||
\@asd{asd}
|
||||
|
||||
\makeatletter
|
||||
\newlength{\my@beamer@itemsepi}\setlength{\my@beamer@itemsepi}{3ex}
|
||||
\newlength{\my@beamer@itemsepii}\setlength{\my@beamer@itemsepii}{1.5ex}
|
||||
\newlength{\my@beamer@itemsepiii}\setlength{\my@beamer@itemsepiii}{1.5ex}
|
||||
\def\extractcoord#1#2#3{
|
||||
\path let \p1=(#3) in \pgfextra{
|
||||
\pgfmathsetmacro#1{\x{1}/\pgf@xx}
|
||||
\pgfmathsetmacro#2{\y{1}/\pgf@yy}
|
||||
\xdef#1{#1} \xdef#2{#2}
|
||||
};
|
||||
}
|
||||
\makeatother
|
||||
|
||||
% TODO fixme
|
||||
%
|
||||
% bad speled text
|
||||
% ABC
|
||||
% https://www.example.com
|
||||
%
|
||||
|
||||
% VimTeX: SynIgnore
|
||||
\catcode`\$=11
|
||||
$
|
||||
\catcode`\$=3
|
||||
\newcommand{\testsimplified}[2]{#1 something #1 here #2}
|
||||
% vimtex: SynIgnore off asdasd
|
||||
|
||||
\newcommand{\testnc}[2]{#1 something #1 here #2}
|
||||
\def \foo #1#2 {#1 foo #1 bar #2 baz}
|
||||
\newenvironment{test}[3]{#1 before #2}{#3 after #1}
|
||||
|
||||
\newtheorem{theorem}{Theorem}
|
||||
|
||||
\begin{document}
|
||||
|
||||
Test accents \v! and \v@ here.
|
||||
|
||||
Line with inline verbatim: \verb+verb+
|
||||
Line with inline verbatim: \verb*+verb+
|
||||
|
||||
Line with $inline math$ here.\footnote{here {asd} with \cmd also}. $n$th
|
||||
|
||||
\section{First}
|
||||
\label{sec:first}
|
||||
|
||||
% Various cite and ref commands
|
||||
\ref{sec:first}
|
||||
\pageref{sec:second}
|
||||
\nocite{bibkey0}
|
||||
\cite{bibkey1}
|
||||
\citet*{bibkey2}
|
||||
\citep{bibkey3}
|
||||
\citep[e.g.][]{bibkey4}
|
||||
|
||||
\section{Second}
|
||||
\label{sec:second}
|
||||
|
||||
\author{A. Author\thanks{An Institute}}
|
||||
|
||||
\section{Math}
|
||||
\label{sec:math}
|
||||
|
||||
\begin{equation}
|
||||
( )
|
||||
[ ]
|
||||
1 = 3 < 4 > 2 | f(x) / 3 .1.
|
||||
\left( \right)
|
||||
\left\{ \right\}
|
||||
\left\lvert \right\rvert
|
||||
\left] \right[
|
||||
\end{equation}
|
||||
|
||||
\begin{table}
|
||||
\centering
|
||||
\caption{asdfasdf}
|
||||
\label{tab:}
|
||||
\begin{tabular}{cr}
|
||||
1234 \\
|
||||
2345 \\
|
||||
\end{tabular}
|
||||
\end{table}
|
||||
|
||||
\begin{equation}
|
||||
\begin{array}{ccc}
|
||||
asd & \left( f \right] & c \\
|
||||
asd & f & c \\
|
||||
asd & f & c
|
||||
\end{array}
|
||||
\end{equation}
|
||||
|
||||
\begin{equation}
|
||||
\begin{cases}
|
||||
[0,1)
|
||||
\end{cases}
|
||||
\end{equation}
|
||||
|
||||
% Nested math
|
||||
Let \(F = \{f : S \to S \mid \textnormal{\(f\) is a cool function}\}\).
|
||||
Let \(F = \{f : S \to S \mid \textnormal{$f$ is a cool function}\}\).
|
||||
|
||||
\section*{Acknowledgement}
|
||||
|
||||
\begin{equation}
|
||||
\parbox[c][1pt][b]{10cm}{fooparbox $bar$}
|
||||
f(x) = 1
|
||||
\end{equation}
|
||||
|
||||
\begin{minipage}[c][1pt][b]{10cm}
|
||||
foominipage $bar$
|
||||
\end{minipage}
|
||||
|
||||
\begin{theorem}[Foo {\cite[Theorem 1.1]{Bar}}]
|
||||
Lorem ipsum \dots
|
||||
\end{theorem}
|
||||
|
||||
\begin{thebibliography}{1}
|
||||
\bibitem{abc} a citation.
|
||||
\bibitem[label]{abc} a citation.
|
||||
\end{thebibliography}
|
||||
|
||||
\begin{tabular}{*{1}{p{1cm}}}
|
||||
0
|
||||
\end{tabular}
|
||||
|
||||
%% Some basic stuff re. #2877
|
||||
foo\\~bar \~More test; in math: $f(x) ~ \~ 1$
|
||||
|
||||
Foo \phantom{\{} bar
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,28 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-core.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texNewenvParm', 37, 36))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texVerbZoneInline', 45, 36))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texAuthorArg', 65, 20))
|
||||
call assert_true(vimtex#syntax#in('texDelim', 65, 39))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texNewthmArgPrinted', 39, 23))
|
||||
" call assert_true(vimtex#syntax#in('texTheoremEnvOpt', 115, 18))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texMathTextConcArg', 106, 59))
|
||||
call assert_true(vimtex#syntax#in('texMathTextConcArg', 105, 59))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texCmdBibitem', 124, 3))
|
||||
call assert_true(vimtex#syntax#in('texBibitemArg', 124, 13))
|
||||
call assert_true(vimtex#syntax#in('texBibitemOpt', 125, 13))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texTabularChar', 133, 5))
|
||||
call assert_true(vimtex#syntax#in('texSpecialChar', 133, 6))
|
||||
call assert_true(vimtex#syntax#in('texCmdAccent', 133, 11))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,35 @@
|
||||
\documentclass{minimal}
|
||||
|
||||
\usepackage{listings}
|
||||
\lstnewenvironment{code}[1][]{\lstset{#1}}{}
|
||||
\lstnewenvironment{python_code}{\lstset{language=python}}{}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{MyMathEnv}
|
||||
f(x) = 1
|
||||
\end{MyMathEnv}
|
||||
|
||||
\begin{python_code}
|
||||
def test(argument: str) -> str:
|
||||
"""
|
||||
Test function.
|
||||
"""
|
||||
return argument
|
||||
\end{python_code}
|
||||
|
||||
\begin{code}[language=rust]
|
||||
fn main() {
|
||||
println!("Hello World!");
|
||||
}
|
||||
\end{code}
|
||||
|
||||
\begin{code}[language=C]
|
||||
#include<stdio.h>
|
||||
main() {
|
||||
int i = 0;
|
||||
printf("Hello World");
|
||||
}
|
||||
\end{code}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,28 @@
|
||||
source common.vim
|
||||
|
||||
let g:vimtex_syntax_custom_envs = [
|
||||
\ {
|
||||
\ 'name': 'MyMathEnv',
|
||||
\ 'math': v:true
|
||||
\ },
|
||||
\ {
|
||||
\ 'name': 'python_code',
|
||||
\ 'region': 'texPythonCodeZone',
|
||||
\ 'nested': 'python',
|
||||
\ },
|
||||
\ {
|
||||
\ 'name': 'code',
|
||||
\ 'region': 'texCodeZone',
|
||||
\ 'nested': {
|
||||
\ 'python': 'language=python',
|
||||
\ 'c': 'language=C',
|
||||
\ 'rust': 'language=rust',
|
||||
\ },
|
||||
\ },
|
||||
\]
|
||||
|
||||
Edit test-custom-envs.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,33 @@
|
||||
\documentclass{minimal}
|
||||
\newcommand\mygls\gls
|
||||
|
||||
\begin{document}
|
||||
|
||||
\cmdnormal[opt]{normal}
|
||||
\footnote{bolded text}
|
||||
\cmda[opt]{concealed command}
|
||||
\cmdb[opt]{concealed command and opts}
|
||||
|
||||
$\mathcmdnormal{normal math}$
|
||||
$\mathcmda{bold and concealed}$
|
||||
$\mathcmdb{concealed}$
|
||||
$\R -> ℝ$
|
||||
$\E -> 𝔼$
|
||||
$\P -> ℙ$
|
||||
$\mathnote{$Math$ + text}$
|
||||
$\mathnoteC{$Math$ + text concealed}$
|
||||
$\text{$Math$ + text reference}$
|
||||
|
||||
\undline{underlined}
|
||||
|
||||
\gls{spellingerror}
|
||||
\mygls{spellingerror}{spellingerror}
|
||||
\slurp{spellingerror}{spellingerror}{spellingerror}
|
||||
|
||||
% regex cmd name
|
||||
\Ac*{arg}
|
||||
\iacsp{arg}
|
||||
|
||||
$\mather{some text}$
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,37 @@
|
||||
source common.vim
|
||||
|
||||
let g:vimtex_syntax_custom_cmds = [
|
||||
\ {'name': 'footnote', 'argstyle': 'bold'},
|
||||
\ {'name': 'cmda', 'conceal': 1, 'optconceal': 0},
|
||||
\ {'name': 'cmdb', 'conceal': 1},
|
||||
\ {'name': 'mathcmda', 'mathmode': v:true, 'conceal': 1, 'argstyle': 'bold'},
|
||||
\ {'name': 'mathcmdb', 'mathmode': v:true, 'conceal': 1},
|
||||
\ {'name': 'R', 'mathmode': v:true, 'concealchar': 'ℝ'},
|
||||
\ {'name': 'E', 'mathmode': v:true, 'concealchar': '𝔼'},
|
||||
\ {'name': 'P', 'mathmode': v:true, 'concealchar': 'ℙ'},
|
||||
\ {'name': 'undline', 'argstyle': 'bolditalunder'},
|
||||
\ {'name': 'mathnote', 'mathmode': 1,
|
||||
\ 'nextgroup': 'texMathTextArg', 'hlgroup': 'texMathCmdText'},
|
||||
\ {'name': 'mathnoteC', 'mathmode': 1, 'conceal': 1,
|
||||
\ 'nextgroup': 'texMathTextConcArg', 'hlgroup': 'texMathCmdText'},
|
||||
\ {'name': 'mygls', 'argspell': 0},
|
||||
\ {'name': 'slurp', 'argspell': 0, 'arggreedy': v:true},
|
||||
\ {'name': 'regex', 'cmdre': '[iI]?[aA]c[slaf]?p?\*?', 'conceal': 1},
|
||||
\ {'name': 'mather', 'mathmode': 1,
|
||||
\ 'nextgroup': 'texMatherArg', 'hlgroup': 'texOpt'},
|
||||
\]
|
||||
|
||||
call vimtex#syntax#add_to_mathzone_ignore('texMatherArg')
|
||||
|
||||
EditConcealed test-custom.tex
|
||||
|
||||
call vimtex#syntax#core#new_arg('texMatherArg', {
|
||||
\ 'opts': 'contained keepend'
|
||||
\})
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in_mathzone(31, 5))
|
||||
call assert_false(vimtex#syntax#in_mathzone(31, 15))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,10 @@
|
||||
\documentclass{minimal}
|
||||
\usepackage{minted}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{minted}{dockerfile}
|
||||
FROM java:8
|
||||
\end{minted}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,9 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-dockerfile.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_notequal('# %s', &commentstring)
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,11 @@
|
||||
\documentclass{article}
|
||||
\usepackage{empheq}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{empheq}{align*}
|
||||
a&=b \tag{*}\\
|
||||
E&=mc^2 + \int_a^a x\, dx
|
||||
\end{empheq}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,9 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-empheq.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 7, 1))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,67 @@
|
||||
\ExplSyntaxOn
|
||||
\str_new:N \g_myfile_name_str
|
||||
\str_gset:Nn \g_myfile_name_str {myfile.txt}
|
||||
\str_new:N \g_myfile_old_mdfive_str
|
||||
\str_new:N \l_myfile_mdfive_str
|
||||
\cs_new_protected:Npn \getmdfive % get hash is not expandable, so protect
|
||||
{
|
||||
\file_get_mdfive_hash:nN {\str_use:N \g_myfile_name_str} \l_myfile_mdfive_str
|
||||
\str_use:N \l_myfile_mdfive_str
|
||||
}
|
||||
\cs_new:Npn \getoldmdfive
|
||||
{
|
||||
\str_use:N \g_myfile_old_mdfive_str
|
||||
}
|
||||
\cs_new:Npn \IfMyfileChanged #1 #2
|
||||
{
|
||||
\str_if_eq:NNTF \g_myfile_old_mdfive_str \l_myfile_mdfive_str {#2} {#1}
|
||||
}
|
||||
\AtEndDocument
|
||||
{
|
||||
\iow_now:cx { @auxout }
|
||||
{
|
||||
\token_to_str:N \ExplSyntaxOn
|
||||
\iow_newline:
|
||||
\str_gset:Nn \token_to_str:N \g_myfile_old_mdfive_str {\str_use:N \l_myfile_mdfive_str}
|
||||
\iow_newline:
|
||||
\token_to_str:N \ExplSyntaxOff
|
||||
}
|
||||
}
|
||||
\ExplSyntaxOff
|
||||
|
||||
\ExplSyntaxOn
|
||||
\ExplSyntaxOn
|
||||
\ExplSyntaxOn
|
||||
\str_new:N \g_myfile_name_str
|
||||
\ExplSyntaxOff
|
||||
\str_new:N \g_myfile_name_str
|
||||
|
||||
% Example from #1945
|
||||
\ExplSyntaxOn
|
||||
\use:x
|
||||
{
|
||||
\exp_not:N \includegraphics
|
||||
[ \clist_use:Nn \g__pdfoverlay_graphics_options_clist { , } ]
|
||||
{ \g__pdfoverlay_pdf_file_name_str }
|
||||
}
|
||||
\ExplSyntaxOff
|
||||
|
||||
% Example from #2272
|
||||
\ExplSyntaxOn
|
||||
\c_tmpa_str
|
||||
\c_tmpa_str:nx
|
||||
\l_@@_int
|
||||
\cs_new:Nn \@@_shift_item:nn {
|
||||
\str_set:Nx \l_tmpa_str { \str_head:n { #1 } }
|
||||
\str_case:VnF \l_tmpa_str {
|
||||
{ x } {
|
||||
\prop_put:Nnx \l_@@_b { #1 }
|
||||
{ \dim_eval:n { #2 + \l_@@_shiftx_dim } } }
|
||||
{ y } {
|
||||
\prop_put:Nnx \l_@@_b { #1 }
|
||||
{ \dim_eval:n { #2 + \l_@@_shifty_dim } } }
|
||||
} {
|
||||
\prop_put:Nnn \l_@@_b { #1 } { #2 }
|
||||
}
|
||||
}
|
||||
\ExplSyntaxOff
|
||||
@ -0,0 +1,9 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-expl3.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(!vimtex#syntax#in('texGroupError', 29, 1))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,139 @@
|
||||
\documentclass[draft]{article}
|
||||
|
||||
\usepackage{fixme}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{anfxnote}{Lorem ipsum}
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque id
|
||||
ultricies felis, eu mollis risus. Cras gravida mollis finibus. Suspendisse
|
||||
potenti. Pellentesque porttitor ac tortor in rhoncus. Ut porta, sem eget
|
||||
cursus semper, lorem odio volutpat quam, eget pretium odio mi luctus dolor.
|
||||
Phasellus at purus in diam consequat semper a ut lacus. Morbi in urna nisl.
|
||||
Pellentesque pretium iaculis enim, ut viverra ante rhoncus a.
|
||||
\end{anfxnote}
|
||||
|
||||
Donec sit amet risus augue. Pellentesque non auctor orci. Sed a est vel risus
|
||||
aliquet congue ut nec nibh. Suspendisse potenti. Aliquam erat volutpat.
|
||||
\fxerror{Proin nec} Cras vitae nisi neque. Curabitur lobortis nisi sagittis,
|
||||
pharetra magna id, dictum lorem. Nullam posuere lobortis enim quis euismod.
|
||||
Suspendisse tincidunt egestas lorem. Vestibulum tempor libero sed feugiat
|
||||
dictum.
|
||||
|
||||
\begin{anfxwarning}{Nulla a ipsum}
|
||||
Etiam at sollicitudin arcu. Cras ipsum justo, pulvinar eu nunc vitae, ornare
|
||||
congue odio. Donec purus quam, laoreet nec ante vitae, condimentum dapibus
|
||||
lectus. In hac habitasse platea dictumst. Morbi vulputate, felis at finibus
|
||||
dignissim, dui turpis dapibus odio, sed consectetur elit ligula sit amet
|
||||
velit. Pellentesque non nisi metus. Pellentesque habitant morbi tristique
|
||||
senectus et netus et malesuada fames ac turpis egestas. In hac habitasse
|
||||
platea dictumst. Fusce sem diam, vehicula in metus vitae, commodo rhoncus
|
||||
dui. Donec nec tincidunt nisl. Vestibulum sed orci eget est euismod efficitur.
|
||||
\end{anfxwarning}
|
||||
|
||||
Aliquam ornare orci enim, in bibendum enim porta eu. Sed vitae augue a sem
|
||||
consectetur rutrum. Sed risus arcu, blandit porttitor nunc et, lobortis congue
|
||||
ex.
|
||||
\fxnote{Mauris interdum magna sapien, nec fermentum ante aliquam vitae.}
|
||||
Orci varius natoque penatibus et magnis dis parturient montes, nascetur
|
||||
ridiculus mus. Suspendisse consequat vel erat at congue. Cras nunc tortor,
|
||||
scelerisque in diam eu, posuere facilisis ipsum. Nulla bibendum lorem quis elit
|
||||
aliquet, quis ultrices magna ornare.
|
||||
\begin{anfxnote*}{Etiam vitae mi dolor}{Donec iaculis elit nibh, quis mollis dui facilisis a. }
|
||||
Praesent at ante massa. Donec velit neque, ornare scelerisque fermentum nec,
|
||||
finibus id erat. In hac habitasse platea dictumst. Quisque sodales metus
|
||||
mauris, in iaculis turpis tempor at. Aenean sagittis ipsum non tempor
|
||||
condimentum. Maecenas sodales fringilla lorem, nec rutrum justo varius at.
|
||||
Etiam et dolor iaculis, iaculis ante at, varius ex. Etiam fringilla varius
|
||||
purus in semper. Vivamus efficitur nunc nec arcu congue vestibulum. Donec id
|
||||
hendrerit magna. Aenean mollis turpis diam. Nam sed nisi ullamcorper, placerat
|
||||
erat ac, ornare orci. In quis diam at quam bibendum eleifend. Vivamus lobortis
|
||||
tellus a tincidunt porttitor. Fusce purus ligula, rhoncus vitae nisi vel,
|
||||
ultrices tempor nulla.
|
||||
\end{anfxnote*}
|
||||
|
||||
In hac habitasse platea dictumst. Phasellus at congue nulla.
|
||||
Suspendisse enim eros, sagittis at justo ut, dictum eleifend magna. Nunc congue
|
||||
diam urna, non laoreet ex dapibus vel. Donec aliquet quam et sem gravida
|
||||
pharetra. \fxwarning{Integer placerat $5 + \sqrt{y}$ scelerisque}
|
||||
|
||||
\begin{anfxerror}{Morbi semper enim}
|
||||
Quisque risus dolor, cursus vitae condimentum eget, aliquam nec nulla.
|
||||
Pellentesque purus sapien, laoreet eget lacus sit amet, varius imperdiet
|
||||
felis.
|
||||
\end{anfxerror}
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ultrices orci
|
||||
et metus blandit, id pellentesque nisi semper.
|
||||
\fxfatal{Nulla ornare orci quis diam.}
|
||||
Sed in tortor fermentum, tempus neque et, convallis sapien. Nam sollicitudin
|
||||
nibh sed imperdiet posuere. Mauris tellus erat, mattis in viverra eget, aliquam
|
||||
sed sem. Mauris malesuada leo placerat leo egestas pharetra. Aenean mauris
|
||||
metus, commodo eu tincidunt sed, porta eget dolor. Proin pellentesque dui eu
|
||||
rhoncus vehicula.
|
||||
|
||||
\begin{anfxerror*}{Note}
|
||||
{Vestibulum laoreet est eget libero suscipit pellentesque. }
|
||||
Aliquam diam orci, suscipit at nunc dapibus, malesuada consequat eros.
|
||||
Maecenas at sem at massa maximus condimentum vel ut nulla. Vestibulum et massa
|
||||
blandit, ullamcorper ante vel, molestie mauris. Phasellus sit amet consequat
|
||||
elit. Nunc maximus pulvinar gravida. Nullam vitae erat nulla. Aliquam erat
|
||||
volutpat.
|
||||
\end{anfxerror*}
|
||||
|
||||
\begin{anfxfatal}{Duis sit amet bibendum urna. Vestibulum sed.}
|
||||
Donec facilisis odio eu gravida efficitur. Fusce consequat sodales urna a
|
||||
pretium. Aliquam vulputate, justo eget imperdiet sollicitudin, urna erat
|
||||
eleifend est, et tempor dolor magna a nunc. Vestibulum ultrices leo libero, ac
|
||||
tincidunt nibh elementum in. Nam eget eleifend mi, et ultrices nisi. Curabitur
|
||||
interdum nisl ac nibh tempor, ac rutrum purus accumsan. Duis et nulla
|
||||
facilisis, viverra nibh sit amet, pretium augue.
|
||||
\end{anfxfatal}
|
||||
|
||||
\begin{anfxfatal*}{This is bad}
|
||||
{Ut elit tellus, volutpat sit amet luctus sit amet, tincidunt. }
|
||||
Donec justo ipsum, tincidunt venenatis purus ac, euismod imperdiet diam.
|
||||
Nullam ornare viverra dolor, vitae iaculis mi accumsan at. Sed malesuada eget
|
||||
nibh ut tristique. In quis massa ornare justo mollis efficitur eu a enim. Nunc
|
||||
vitae porttitor dolor. Aliquam eu luctus velit.
|
||||
\end{anfxfatal*}
|
||||
|
||||
Curabitur id iaculis urna, id mattis dolor.
|
||||
\fxnote*{Integer lacinia}
|
||||
{Suspendisse maximus euismod egestas. Nulla volutpat, erat eget
|
||||
facilisis semper, purus arcu porttitor ante, vitae dapibus augue orci
|
||||
quis magna.}
|
||||
Praesent neque arcu, maximus eu neque ut, dignissim euismod eros. Donec commodo
|
||||
quis ipsum vitae egestas. Pellentesque efficitur scelerisque ligula, a varius ex
|
||||
facilisis a. Nullam in feugiat urna, nec mollis turpis. Sed sodales neque ex,
|
||||
quis efficitur sapien varius quis. \fxwarning*{Sed sed enim pellentesque.}{Cras
|
||||
condimentum odio malesuada nulla mattis, quis semper felis efficitur. Fusce
|
||||
sodales libero eget augue congue sagittis.}
|
||||
|
||||
Maecenas posuere ac est id egestas. Vivamus faucibus augue vel ex auctor
|
||||
commodo. \fxerror*{Aliquam}{Praesent eu fermentum erat.} Praesent non diam vitae
|
||||
velit lacinia maximus non ut diam. Aenean faucibus consequat commodo. Aliquam
|
||||
erat volutpat. Maecenas et nisl rhoncus, eleifend ex vel, tincidunt nulla.
|
||||
Curabitur quis nisi tincidunt magna consectetur egestas. Vivamus sed
|
||||
pellentesque erat, nec scelerisque eros. Nulla nec lectus at dui elementum
|
||||
ullamcorper. Suspendisse bibendum diam tristique interdum malesuada.
|
||||
|
||||
\fxfatal*{Maecenas at velit sollicitudin.}{Integer ullamcorper eu dolor et
|
||||
varius. Vivamus cursus velit justo, in mattis nulla faucibus vitae.}
|
||||
Phasellus magna quam, rhoncus ut eros vitae, interdum eleifend urna. Ut eu erat
|
||||
posuere, bibendum urna eget, gravida velit.
|
||||
\begin{anfxwarning*}{eu mattis velit ultricies}
|
||||
{Phasellus eu mauris tincidunt, tempor nibh ut, consequat velit. Orci varius
|
||||
natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. }
|
||||
In malesuada enim vitae justo cursus sodales id eget mauris. Suspendisse
|
||||
egestas ante non lorem posuere molestie. In libero sem, laoreet sit amet metus
|
||||
eu, consequat pulvinar diam. Sed nec massa ultrices justo tincidunt ornare id
|
||||
non lorem. Vestibulum id turpis lobortis ex fermentum venenatis.
|
||||
\end{anfxwarning*}
|
||||
Maecenas tincidunt est et tincidunt
|
||||
pellentesque. Curabitur ultrices risus quis placerat pharetra. Quisque vel nisl
|
||||
non nunc iaculis aliquam. Sed malesuada, ante ac vehicula sollicitudin, magna
|
||||
felis pellentesque nunc, sit amet sollicitudin elit magna ac tellus. Vivamus
|
||||
congue lobortis ultrices.
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,11 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-fixme.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
" call assert_true(vimtex#syntax#in('texTikzSemicolon', 66, 61))
|
||||
" call assert_true(vimtex#syntax#in('texTikzZone', 66, 61))
|
||||
" call assert_true(vimtex#syntax#in('texCmdAxis', 71, 9))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,7 @@
|
||||
\documentclass{beamer}
|
||||
|
||||
\begin{document}
|
||||
|
||||
Hello world.
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,23 @@
|
||||
source common.vim
|
||||
|
||||
call vimtex#log#set_silent()
|
||||
|
||||
let s:fls = 'test-fls-reload.fls'
|
||||
|
||||
" Delete fls file (in case it is left over)
|
||||
call delete(s:fls)
|
||||
|
||||
silent edit test-fls-reload.tex
|
||||
|
||||
" Class should load, but implied package is not loaded
|
||||
call assert_true(b:vimtex_syntax.beamer.__loaded)
|
||||
call assert_true(!b:vimtex_syntax.url.__loaded)
|
||||
|
||||
" Imitate compilation process -> implied package should also be loaded
|
||||
call writefile(['INPUT /usr/share/texmf-dist/tex/latex/url/url.sty'], s:fls)
|
||||
silent call vimtex#compiler#callback(2)
|
||||
call assert_true(b:vimtex_syntax.url.__loaded)
|
||||
|
||||
call delete(s:fls)
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,24 @@
|
||||
\documentclass{article}
|
||||
\usepackage{fontawesome5}
|
||||
|
||||
\begin{document}
|
||||
|
||||
% Conceal these
|
||||
\faFile
|
||||
\faIcon{file}
|
||||
\faIcon[regular]{file}
|
||||
\faIcon[solid]{file}
|
||||
\faFile*
|
||||
\faIcon*{file}
|
||||
\faIcon*[regular]{file}
|
||||
\faIcon*[solid]{file}
|
||||
|
||||
\faIcon{500px}
|
||||
|
||||
% Don't conceal these
|
||||
\faFil
|
||||
\faFilea
|
||||
\faIcon{fil}
|
||||
\faIcon[regula]{file}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,7 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-fontawesome5.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,19 @@
|
||||
\documentclass[a4paper]{article}
|
||||
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[acronyms]{glossaries}
|
||||
|
||||
\makenoidxglossaries
|
||||
\newacronym{rl}{RL}{reinforcement learning}
|
||||
\newacronym[longplural={diagonal matrices}]{ml}{ML}{machine learning}
|
||||
% \newacronym
|
||||
% [description={\gls{ssi} enabled \gls{html}}]
|
||||
% {shtml}{SHTML}
|
||||
% {SSI enabled HTML}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\Acrfull{rl} is a fun subfield of \acrlong{ml}. \acrshort{ml} is fun.
|
||||
\printnoidxglossary[type=acronym]
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,26 @@
|
||||
\documentclass{beamer}
|
||||
\usepackage{hyperref}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\url{http://www.google.com}
|
||||
\url+http://www.google.com+
|
||||
\url{https://www.example.com/Spaces%20In%20URL/}
|
||||
\href{http://example.com}{Title text $with math$}
|
||||
\urldef{\mysite}\url{http://example.com}
|
||||
\hyperref[asdasd]{asd}
|
||||
|
||||
\begin{equation}
|
||||
e = mc^2
|
||||
\label{einstein}
|
||||
\end{equation}
|
||||
Here, I'm referring to \autoref{einstein}.
|
||||
|
||||
\section{
|
||||
\texorpdfstring{Pythagoras: $a^2 + b^2 = c^2$}{Pythagoras: a² + b² = c²}
|
||||
}
|
||||
|
||||
\subsection{\texorpdfstring{Derivative with metric entries $g_{nm}(t)$}
|
||||
{Derivative with metric entries}}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,14 @@
|
||||
source common.vim
|
||||
|
||||
let g:vimtex_syntax_conceal = {
|
||||
\ 'sections' : 1,
|
||||
\}
|
||||
|
||||
EditConcealed! test-hyperref.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texUrlArg', 6, 25))
|
||||
call assert_true(vimtex#syntax#in('texRefArg', 17, 35))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,45 @@
|
||||
\documentclass{minimal}
|
||||
\usepackage{IEEEtrantools}
|
||||
\begin{document}
|
||||
|
||||
Standard usage:
|
||||
|
||||
\begin{IEEEeqnarray}{srCl}
|
||||
text & 1\cdot1 &=& 1 \\
|
||||
text & 1 &=& 1\cdot1
|
||||
\end{IEEEeqnarray}
|
||||
|
||||
\begin{IEEEeqnarray*}{srCl}
|
||||
text & 1\cdot1 &=& 1 \\
|
||||
text & 1 &=& 1\cdot1
|
||||
\end{IEEEeqnarray*}
|
||||
|
||||
IEEEeqnarraybox
|
||||
|
||||
\begin{IEEEeqnarraybox}{sl}
|
||||
text & math
|
||||
\end{IEEEeqnarraybox}
|
||||
\begin{equation}
|
||||
\begin{IEEEeqnarraybox}{sl}
|
||||
text & math
|
||||
\end{IEEEeqnarraybox}
|
||||
\end{equation}
|
||||
|
||||
IEEEeqnarrayboxm
|
||||
|
||||
\begin{IEEEeqnarrayboxm}{sl}
|
||||
text & math
|
||||
\end{IEEEeqnarrayboxm}
|
||||
|
||||
IEEEeqnarrayboxt
|
||||
|
||||
\begin{IEEEeqnarrayboxt}{sl}
|
||||
text & math
|
||||
\end{IEEEeqnarrayboxt}
|
||||
\begin{equation}
|
||||
\begin{IEEEeqnarrayboxt}{sl}
|
||||
text & math
|
||||
\end{IEEEeqnarrayboxt}
|
||||
\end{equation}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,12 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-ieeetrantools.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 8, 1))
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 13, 1))
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 24, 1))
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 31, 1))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,35 @@
|
||||
\documentclass{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{graphicx}
|
||||
|
||||
\let\if@tempswa\iffalse
|
||||
\def\loop#1\repeat{\def\iterate{#1\relax\expandafter\iterate\fi}%
|
||||
\iterate \let\iterate\relax}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\iffalse
|
||||
Commented stuff
|
||||
Another \ifstuff here \fi
|
||||
\ifaa \else \fi
|
||||
\ifasd \fi \f \fii
|
||||
$ a \iff b $
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
|
||||
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
|
||||
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
|
||||
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
||||
\fi
|
||||
|
||||
\iffalse
|
||||
Commented stuff
|
||||
Another \ifstuff here \fi
|
||||
\ifaa \else \fi
|
||||
\ifasd \fi \f \fii
|
||||
\else
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
|
||||
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
|
||||
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
|
||||
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
||||
\fi
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,10 @@
|
||||
\documentclass{article}
|
||||
\makeatletter
|
||||
\def\something{\@ifnextchar[{\addtunablearrow@full}{\addtunablearrow@simple}}%
|
||||
\makeatother
|
||||
|
||||
\begin{document}
|
||||
|
||||
Normal text here
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,10 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-ifnextchar.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texConditionalINCChar', 3, 28))
|
||||
call assert_equal([], vimtex#syntax#stack(8, 1))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,38 @@
|
||||
\documentclass{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{graphicx}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\iftrue
|
||||
\section{asd}
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
|
||||
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
|
||||
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
|
||||
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
||||
\ifasd \fi
|
||||
\ifaa asd \else asd \fi
|
||||
\fi
|
||||
|
||||
\section{qwe}
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
|
||||
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
|
||||
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
|
||||
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
||||
|
||||
\iftrue
|
||||
\section{asd}
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
|
||||
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
|
||||
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
|
||||
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
||||
\ifasd \fi
|
||||
\ifaa asd \else asd \fi
|
||||
\else
|
||||
Commented stuff
|
||||
Another \ifstuff here \fi
|
||||
\ifaa \else \fi
|
||||
\ifasd \fi \f \fii
|
||||
\fi
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,30 @@
|
||||
\documentclass[fleqn]{article}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{expl3}
|
||||
\usepackage{xparse}
|
||||
|
||||
\ExplSyntaxOn
|
||||
\seq_new:N \l_test_A_seq
|
||||
\seq_new:N \l_test_B_seq
|
||||
\seq_new:N \l_test_C_seq
|
||||
|
||||
\cs_new:Npn \fillmyseq #1 #2 {
|
||||
\seq_set_split:Nnn #1 {,} {#2}
|
||||
}
|
||||
|
||||
\fillmyseq{\l_test_A_seq}{A_1, A_2, A_3}
|
||||
\fillmyseq{\l_test_B_seq}{B_1, B_2, B_3}
|
||||
\fillmyseq{\l_test_C_seq}{C_1, C_2, C_3}
|
||||
|
||||
\cs_new:Nn \__test_do: {
|
||||
\seq_show:N \l_test_A_seq
|
||||
\seq_show:N \l_test_B_seq
|
||||
\seq_show:N \l_test_C_seq
|
||||
}
|
||||
|
||||
\NewDocumentCommand\mydo {} {\__test_do:}
|
||||
\ExplSyntaxOff
|
||||
|
||||
\begin{document}
|
||||
\mydo
|
||||
\end{document}
|
||||
@ -0,0 +1,11 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-latex3.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texE3Zone', 7, 2))
|
||||
call assert_true(vimtex#syntax#in('texE3Func', 7, 2))
|
||||
call assert_true(vimtex#syntax#in('texE3Var', 7, 15))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,50 @@
|
||||
\documentclass{article}
|
||||
\usepackage{listings}
|
||||
|
||||
\begin{document}
|
||||
|
||||
% Comment out to compile!
|
||||
\lstinputlisting[options]{file}
|
||||
|
||||
\lstinline|asdasd|
|
||||
\lstinline{asdasd}
|
||||
|
||||
\lstinline[language=C]|int x;|
|
||||
\lstinline[language=C]{int x;}
|
||||
|
||||
\begin{lstlisting}
|
||||
testing
|
||||
\end{lstlisting}
|
||||
|
||||
\begin{lstlisting}[directivestyle={\color{black}},
|
||||
language=C,
|
||||
emph={int,char,double,float,unsigned},
|
||||
emphstyle={\color{blue}}]
|
||||
#include<stdio.h>
|
||||
main() {
|
||||
int i = 0;
|
||||
printf("Hello World");
|
||||
}
|
||||
\end{lstlisting}
|
||||
|
||||
\begin{lstlisting}[language=python]
|
||||
def function(arg):
|
||||
pass
|
||||
\end{lstlisting}
|
||||
|
||||
\lstset{language=rust,numbers=none}
|
||||
\begin{lstlisting}
|
||||
fn main() {
|
||||
println!("Hello World!");
|
||||
}
|
||||
\end{lstlisting}
|
||||
|
||||
\lstset{language=x,numbers=none}
|
||||
|
||||
\lstset{
|
||||
language=C,
|
||||
basicstyle=\color[RGB]{0,0,0},
|
||||
numberstyle=\small
|
||||
}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,20 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-listings.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texFileArg', 7, 28))
|
||||
call assert_true(vimtex#syntax#in('texLstZoneInline', 9, 14))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texLstZone', 15, 1))
|
||||
call assert_true(vimtex#syntax#in('texLstZoneC', 23, 1))
|
||||
call assert_true(vimtex#syntax#in('texLstZonePython', 30, 1))
|
||||
call assert_true(vimtex#syntax#in('texLstZoneRust', 37, 1))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texLstsetArg', 42, 10))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texCmd', 46, 18))
|
||||
call assert_true(vimtex#syntax#in('texCmdSize', 47, 18))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,7 @@
|
||||
\documentclass{beamer}
|
||||
\usepackage{glossaries-extra}
|
||||
\usepackage{mathtools}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,8 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-loading.tex
|
||||
|
||||
call assert_true(index(keys(b:vimtex_syntax), 'glossaries') >= 0)
|
||||
call assert_true(index(keys(b:vimtex_syntax), 'amsmath') >= 0)
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,28 @@
|
||||
\documentclass[notitlepage,12pt]{article}
|
||||
\usepackage{luacode}
|
||||
\newcommand{\somecommand}{
|
||||
\loop
|
||||
\begingroup%
|
||||
\directlua{loopcnt=loopcnt+1}%
|
||||
\ifnum\somecount=1%
|
||||
\directlua{prevcount=prevcount+\luastring{\pgfmathresult}}%
|
||||
\else%
|
||||
\directlua{prevcount=prevcount+\luastring{\someamt}}%
|
||||
\fi%
|
||||
\endgroup%
|
||||
\if\someothercnt0%
|
||||
\repeat%
|
||||
\directlua{linecount=math.floor(prevcount)+1;}%
|
||||
\fi
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
\directlua{
|
||||
local foo = "this is lua syntax highlighting";
|
||||
function helloworld(input)
|
||||
local output = input + \luastring{\something} + "123";
|
||||
return output
|
||||
end
|
||||
prevcount prevcount + \luastring{\something} + "123";
|
||||
}
|
||||
\end{document}
|
||||
@ -0,0 +1,18 @@
|
||||
\documentclass{article}
|
||||
\usepackage[startNumber=false,footnotes,definitionLists,hashEnumerators,hybrid=true]{markdown}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{markdown}
|
||||
_markdown_ use `hybrid=true` can insert \LaTeX code **directly**.
|
||||
|
||||
$x^2$ $x_2$
|
||||
|
||||

|
||||
|
||||
the following `README` comes from [USTC Thesis](https://github.com/ustctug/ustcthesis)。
|
||||
\end{markdown}
|
||||
|
||||
\markdownInput{README.md}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,12 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-markdown.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texMarkdownZone', 7, 1))
|
||||
call assert_true(vimtex#syntax#in('markdownItalic', 7, 1))
|
||||
call assert_true(vimtex#syntax#in('markdownLink', 11, 12))
|
||||
call assert_true(vimtex#syntax#in('texFileArg', 16, 16))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,16 @@
|
||||
%! TeX program = lualatex
|
||||
\documentclass{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{equation}
|
||||
αβγδϵεζηθϑικλμνξπϖρϱσςτυϕφχψωΓΔΘΛΞΠΣΥΦΧΨΩ
|
||||
\end{equation}
|
||||
|
||||
$\int x \delta x$
|
||||
|
||||
$∬ x ∀ y$
|
||||
|
||||
$C(x)$
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,56 @@
|
||||
\documentclass{article}
|
||||
\usepackage{mathtools}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{align}
|
||||
f(x) &= \bigg\lvert 0 \bigg\rvert \\
|
||||
f(x) &= \Bigg\lVert 0 \Bigg\rVert \\
|
||||
\end{align}
|
||||
|
||||
\[
|
||||
\begin{multlined}[b]
|
||||
\framebox[4cm]{first} \\
|
||||
\framebox[4cm]{last}
|
||||
\end{multlined} = B
|
||||
\begin{multlined}[b][7cm]
|
||||
\framebox[4cm]{first} \\
|
||||
\framebox[4cm]{last}
|
||||
\end{multlined} = B
|
||||
\]
|
||||
|
||||
\begin{align*}
|
||||
f(a) &=
|
||||
\!\begin{aligned}[t]
|
||||
& \frac{1}{2}+\cdots \\& \dots+\frac{1}{2}
|
||||
\end{aligned}
|
||||
\end{align*}
|
||||
|
||||
\begin{equation}
|
||||
\begin{lgathered}[c]
|
||||
x=1,\quad x+1=2 \\
|
||||
y=235
|
||||
\end{lgathered}
|
||||
\end{equation}
|
||||
|
||||
\[
|
||||
\begin{pmatrix*}[r]
|
||||
-1 & 3 \\
|
||||
2 & -4
|
||||
\end{pmatrix*}
|
||||
\]
|
||||
|
||||
\[
|
||||
\begin{smallmatrix*}[r]
|
||||
-1 & 3 \\
|
||||
2 & -4
|
||||
\end{smallmatrix*}
|
||||
\]
|
||||
|
||||
\begin{gather}
|
||||
f(x) = x
|
||||
\shortintertext{This is a short intertext.}
|
||||
f(x) = x
|
||||
\end{gather}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,9 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-mathtools.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 7, 1))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,25 @@
|
||||
\documentclass{article}
|
||||
\usepackage{mhequ}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{equ}[onelab]
|
||||
\sum_{i=1}^5 X_i^j X^j_i = y^j \;.
|
||||
\end{equ}
|
||||
|
||||
\begin{equs}
|
||||
f(x) &= \sin(x) + 1\;, \label{e:equ1}\\
|
||||
h(x) &= f(x) + g(x) -3\;, \label{e:equ3}
|
||||
\end{equs}
|
||||
|
||||
\begin{equs}[e:block]
|
||||
f(x) &= \sin(x) + 1\;, \\
|
||||
h(x) &= f(x) + g(x) -3\;,
|
||||
\end{equs}
|
||||
|
||||
\begin{equs}
|
||||
f(x) &= \sin(x) + 1\;, \\
|
||||
h(x) &= f(x) + g(x) -3\;.
|
||||
\end{equs}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,126 @@
|
||||
\documentclass{minimal}
|
||||
\usepackage{minted}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\newminted{cpp}{gobble=2} % -> cppcode
|
||||
\newminted[cppcode_test]{cpp}{gobble=2} % -> cppcode_test
|
||||
\newmint[pymint]{python}{linenos} % -> \pymint
|
||||
\newmintinline{vim}{linenos} % -> \viminline
|
||||
|
||||
Macros:
|
||||
- \mint[lineos]{perl}|$x =~ /foo/|
|
||||
- \mint[lineos]{perlxxx}|$x =~ /foo/|
|
||||
- \pymint{print(1 + int(r'1'))} Cool!
|
||||
- \viminline|let a=1|
|
||||
|
||||
\begin{minted}{perlxxx}
|
||||
L1045 +++$+++ u0 +++$+++ m0 +++$+++ BIANCA +++$+++ They do not!
|
||||
L1044 +++$+++ u0 +++$+++ m0 +++$+++ CAMERON +++$+++ They do to!
|
||||
L985 +++$+++ u0 +++$+++ m0 +++$+++ BIANCA +++$+++ I hope so.!
|
||||
\end{minted}
|
||||
|
||||
% This is not valid, but let's still highlight it as a texZone
|
||||
\begin{minted}
|
||||
L1045 +++$+++ u0 +++$+++ m0 +++$+++ BIANCA +++$+++ They do not!
|
||||
L1044 +++$+++ u0 +++$+++ m0 +++$+++ CAMERON +++$+++ They do to!
|
||||
L985 +++$+++ u0 +++$+++ m0 +++$+++ BIANCA +++$+++ I hope so.!
|
||||
\end{minted}
|
||||
|
||||
\begin{minted}{c}
|
||||
int main() {
|
||||
printf("hello, world");
|
||||
return 0;
|
||||
}
|
||||
\end{minted}
|
||||
|
||||
\begin{minted}[linenos]{python}
|
||||
def function(arg):
|
||||
pass
|
||||
\end{minted}
|
||||
|
||||
\begin{minted}[mathescape,
|
||||
linenos,
|
||||
numbersep=5pt,
|
||||
gobble=2,
|
||||
frame=lines,
|
||||
framesep=2mm]{python}
|
||||
def function(arg):
|
||||
pass
|
||||
\end{minted}
|
||||
|
||||
\begin{minted}[mathescape,
|
||||
linenos,
|
||||
numbersep=5pt,
|
||||
gobble=2,
|
||||
frame=lines,
|
||||
framesep=2mm]{csharp}
|
||||
string title = "This is a Unicode π in the sky"
|
||||
/*
|
||||
Defined as $\pi=\lim_{n\to\infty}\frac{P_n}{d}$ where $P$ is the perimeter
|
||||
of an $n$-sided regular polygon circumscribing a
|
||||
circle of diameter $d$.
|
||||
*/
|
||||
const double pi = 3.1415926535
|
||||
\end{minted}
|
||||
|
||||
\paragraph{Some paragraph}
|
||||
|
||||
\begin{minted}{java}
|
||||
class HelloWorld
|
||||
{
|
||||
public static void main(String args[])
|
||||
{
|
||||
System.out.println("Hello world");
|
||||
}
|
||||
}
|
||||
\end{minted}
|
||||
|
||||
\begin{cppcode}
|
||||
int main() {
|
||||
printf("hello, world");
|
||||
return 0;
|
||||
}
|
||||
\end{cppcode}
|
||||
|
||||
\begin{cppcode*}{a=0,
|
||||
b=1}
|
||||
int main() {
|
||||
printf("hello, world");
|
||||
return 0;
|
||||
}
|
||||
\end{cppcode*}
|
||||
|
||||
\begin{cppcode_test}
|
||||
int main() {
|
||||
printf("hello, world");
|
||||
return 0;
|
||||
}
|
||||
\end{cppcode_test}
|
||||
|
||||
\begin{minted}{tex}
|
||||
\begin{example}
|
||||
Hello world
|
||||
\end{example}
|
||||
\end{minted}
|
||||
|
||||
% Test newminted for stuff that does not exist
|
||||
\newminted[log]{log}{breaklines}
|
||||
\newminted[longss]{shell-session}{breaklines}
|
||||
|
||||
\begin{log}
|
||||
destination d_local { file("/var/log/syslog-ng/messages_${HOST}"); };
|
||||
\end{log}
|
||||
|
||||
\begin{longss}
|
||||
$ ls -l
|
||||
$ ls -l
|
||||
\end{longss}
|
||||
|
||||
\begin{minted}[breaklines]{json}
|
||||
{
|
||||
"test": 1
|
||||
}
|
||||
\end{minted}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,21 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-minted.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
" Minted inside \paragraphs (#1537)
|
||||
call assert_true(vimtex#syntax#in('javaScopeDecl', 72, 3))
|
||||
|
||||
" Newminted on unrecognized languages (#1616)
|
||||
call assert_true(vimtex#syntax#in('texMintedZoneLog', 112, 1))
|
||||
call assert_true(vimtex#syntax#in('texMintedZoneShellsession', 116, 1))
|
||||
|
||||
" " Doing :e should not destroy nested syntax and similar
|
||||
" call assert_true(vimtex#syntax#in('pythonFunction', 38, 5))
|
||||
" edit
|
||||
" call assert_true(vimtex#syntax#in('pythonFunction', 38, 5))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texMintedZoneJson', 121, 1))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,11 @@
|
||||
\documentclass{article}
|
||||
\usepackage{mleftright}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{equation}
|
||||
\mleft\lvert x \mright\rvert
|
||||
\mleft( x \mright)
|
||||
\end{equation}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,9 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-mleftright.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texMathDelim', 7, 19))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,55 @@
|
||||
\documentclass{article}
|
||||
\usepackage{natbib}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\textit{Text goes here~\cite{Local1}.}
|
||||
|
||||
% Conceal example
|
||||
Bla bla bla, see Ref.~\cite{Local1,Local1}. For more info, see also \cite{Local1}.
|
||||
|
||||
% These are only for biblatex - don't detect them
|
||||
\autocite{}
|
||||
\Textcite[e.g.][]{}
|
||||
\smartcite{}
|
||||
|
||||
% Cite commands
|
||||
\cite{}
|
||||
\citealp*{}
|
||||
\citealp{}
|
||||
\citealp*{Local1}
|
||||
\citealp{Local1}
|
||||
\citealt*{}
|
||||
\citealt{}
|
||||
\citealt*{Local1}
|
||||
\citealt{Local1}
|
||||
\citeauthor*{}
|
||||
\citeauthor*{Local1}
|
||||
\citeauthor{Local1}
|
||||
\citeauthor{Local1}
|
||||
\citenum{}
|
||||
\citenum{Local1}
|
||||
\citet[e.g.][]{Local1}
|
||||
\citet[e.g.][Chapter~2]{Local1}
|
||||
\citep[e.g.][]{Local1}
|
||||
\citep[e.g.][Chapter~2]{Local1}
|
||||
\citep{Local1}
|
||||
\citet*{}
|
||||
\citetext{}
|
||||
\citetext{priv.\ comm.}nfo, see also \cite{Local1}.
|
||||
\citeyear{}
|
||||
\citeyear{Local1}
|
||||
\citeyearpar{}
|
||||
\citeyearpar{Local1}
|
||||
|
||||
% Capitalized cite commands
|
||||
\Citealp{Local1}
|
||||
\Citealt{Local1}
|
||||
\Citeauthor{Local1}
|
||||
\Citep{Local1}
|
||||
\Citet{Local1}
|
||||
|
||||
\bibliographystyle{plainnat}
|
||||
\bibliography{../common/local1.bib}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,11 @@
|
||||
source common.vim
|
||||
|
||||
" let g:vimtex_syntax_conceal_cites = {
|
||||
" \ 'type': 'icon',
|
||||
" \}
|
||||
|
||||
EditConcealed! test-natbib.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,30 @@
|
||||
\documentclass{article}
|
||||
\usepackage{optidef}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{mini}
|
||||
{x}{f(x)}{}{}
|
||||
\end{mini}
|
||||
|
||||
\begin{mini!}
|
||||
{x}{f(x)}{}{}
|
||||
\end{mini!}
|
||||
|
||||
\begin{minie}
|
||||
{x}{f(x)}{}{}
|
||||
\end{minie}
|
||||
|
||||
\begin{mini*}
|
||||
{x}{f(x)}{}{}
|
||||
\end{mini*}
|
||||
|
||||
\begin{argmini}
|
||||
{x}{f(x)}{}{}
|
||||
\end{argmini}
|
||||
|
||||
\begin{maxi}
|
||||
{x}{f(x)}{}{}
|
||||
\end{maxi}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,14 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-optidef.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 7, 1))
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 11, 1))
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 15, 1))
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 19, 1))
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 23, 1))
|
||||
call assert_true(vimtex#syntax#in('texMathZoneEnv', 27, 1))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,9 @@
|
||||
source common.vim
|
||||
|
||||
try
|
||||
runtime syntax/tex.vim
|
||||
catch
|
||||
call assert_true(0, 'Bare include of VimTeX syntax should work!')
|
||||
endtry
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,18 @@
|
||||
\documentclass{article}
|
||||
\usepackage{pyluatex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{python}
|
||||
print("I am python but vimtex syntax highlighting does not know me")
|
||||
\end{python}
|
||||
|
||||
\begin{pythonq}
|
||||
print("I am python but vimtex syntax highlighting does not know me")
|
||||
\end{pythonq}
|
||||
|
||||
\begin{pythonrepl}
|
||||
print("I am python but vimtex syntax highlighting does not know me")
|
||||
\end{pythonrepl}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,11 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-pyluatex.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('pythonString', 7, 13))
|
||||
call assert_true(vimtex#syntax#in('pythonString', 11, 13))
|
||||
call assert_true(vimtex#syntax#in('pythonString', 15, 13))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,37 @@
|
||||
\documentclass{article}
|
||||
\usepackage{pythontex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\py{1+1}
|
||||
\pyb#1+1#
|
||||
\pyc@1+1@
|
||||
\pys#1+1#
|
||||
|
||||
\pyb{print('Python says hi!')}
|
||||
|
||||
\begin{pycode}
|
||||
print(r'\begin{center}')
|
||||
print(r'\textit{A message from Python!}')
|
||||
print(r'\end{center}')
|
||||
\end{pycode}
|
||||
|
||||
\begin{pyblock}
|
||||
mytext = '$1 + 1 = {0}$'.format(1 + 1)
|
||||
|
||||
def myfunction(arg1, arg2):
|
||||
"""docstring"""
|
||||
pass
|
||||
\end{pyblock}
|
||||
|
||||
\begin{pycode}
|
||||
print(r'\node {This is python};')
|
||||
\end{pycode}
|
||||
|
||||
\begin{tikzpicture}
|
||||
\begin{pycode}
|
||||
print(r'\node {This is python};')
|
||||
\end{pycode}
|
||||
\end{tikzpicture}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,10 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-pythontex.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('pythonString', 11, 13))
|
||||
call assert_true(vimtex#syntax#in('pythonRawString', 16, 13))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,15 @@
|
||||
\documentclass{article}
|
||||
\usepackage{quantikz}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\usepackage{quantikz}
|
||||
|
||||
\begin{quantikz}
|
||||
q_{1} & \gate[4]{e^{i t H_C}} & \\
|
||||
q_{2} & & \\
|
||||
q_{3} & & \\
|
||||
q_{4} & & \\
|
||||
\end{quantikz}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,7 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-quantikz.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,47 @@
|
||||
\documentclass{article}
|
||||
\usepackage{sagetex}
|
||||
\begin{document}
|
||||
|
||||
\begin{sagesilent}
|
||||
"""Example script."""
|
||||
import pickle
|
||||
import mytexmodule as tex
|
||||
|
||||
with open('modes.p', 'rb') as file:
|
||||
data = pickle.load(file)
|
||||
|
||||
def random_function(arg):
|
||||
return 3
|
||||
|
||||
ans = random_function(data)
|
||||
|
||||
# No actual data plotted
|
||||
plt = plot([], (0, 7),
|
||||
axes_labels=[r"$\omega/\omega_\lambda$",
|
||||
r"$\beta_\lambda$"],
|
||||
ticks=[[0, 1, sqrt(3), *optima], None],
|
||||
tick_formatter=[[r"$0$", r"$1$", r"$\sqrt{3}$",
|
||||
*s.serialize(*optima, data=True)], None],
|
||||
detect_poles='show')
|
||||
|
||||
xi_eta_table = tex.Table(
|
||||
title=r"Values of $\xi$ and $\eta$ for the first ten cylindrical modes")
|
||||
\end{sagesilent}
|
||||
|
||||
The answer is \sagestr{tex.texify(ans)}.
|
||||
|
||||
\begin{table}[ht]
|
||||
\centering
|
||||
\sagestr{xi_eta_table.latex}
|
||||
\caption{Some caption here.}
|
||||
\label{plot1}
|
||||
\end{table}
|
||||
|
||||
\begin{figure}[ht]
|
||||
\centering
|
||||
\sageplot[]{plt}
|
||||
\caption{Another caption here.}
|
||||
\label{plot2}
|
||||
\end{figure}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,7 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-sagetex.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,8 @@
|
||||
\documentclass{article}
|
||||
\usepackage{siunitx}
|
||||
|
||||
\begin{document}
|
||||
|
||||
$c = \SI{299792458}{m.s^{-1} asd}$
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,13 @@
|
||||
\documentclass{article}
|
||||
|
||||
\usepackage{tabularx}
|
||||
|
||||
\begin{document}
|
||||
\begin{tabularx}{6cm}{llXX}
|
||||
1 & 2 & 3 & 4 \\
|
||||
\end{tabularx}
|
||||
|
||||
\begin{tabularx}{\linewidth}[pos]{llXX}
|
||||
1 & 2 & 3 & 4 \\
|
||||
\end{tabularx}
|
||||
\end{document}
|
||||
@ -0,0 +1,16 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-tabularx.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texCmdTabularx', 6, 1))
|
||||
call assert_true(vimtex#syntax#in('texTabularxWidth', 6, 18))
|
||||
call assert_true(vimtex#syntax#in('texTabularxPreamble', 6, 26))
|
||||
|
||||
call assert_true(vimtex#syntax#in('texCmdTabularx', 10, 1))
|
||||
call assert_true(vimtex#syntax#in('texTabularxWidth', 10, 18))
|
||||
call assert_true(vimtex#syntax#in('texTabularxOpt', 10, 30))
|
||||
call assert_true(vimtex#syntax#in('texTabularxPreamble', 10, 35))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,58 @@
|
||||
\documentclass{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[english]{babel}
|
||||
\usepackage{tcolorbox}
|
||||
|
||||
\tcbuselibrary{minted}
|
||||
\tcbuselibrary{xparse}
|
||||
|
||||
\DeclareTCBListing{mintedbox}{ m !O{} }{%
|
||||
listing only,
|
||||
minted language=#1, #2
|
||||
}
|
||||
|
||||
\newtcblisting{verilog}[2][]{%
|
||||
listing engine=minted,
|
||||
minted language=verilog,
|
||||
listing only,
|
||||
breakable,
|
||||
enhanced,
|
||||
colframe=gray!75,
|
||||
title=#2,
|
||||
coltitle=black,
|
||||
colbacktitle=gray!50,
|
||||
fonttitle=\bfseries,
|
||||
top=0.5mm,
|
||||
bottom=0.5mm,
|
||||
% left=0mm,
|
||||
right=0mm,
|
||||
boxsep=0.5mm,
|
||||
minted options = {
|
||||
linenos,
|
||||
breaklines=true,
|
||||
breakbefore=.,
|
||||
numbersep=2mm,
|
||||
},
|
||||
overlay={%
|
||||
\begin{tcbclipinterior}
|
||||
\fill[gray!25] (frame.south west) rectangle ([xshift=4mm]frame.north west);
|
||||
\end{tcbclipinterior}
|
||||
},
|
||||
#1
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
|
||||
This part of the document is in regular syntax highlighting.
|
||||
|
||||
\begin{mintedbox}{text}
|
||||
$ This is a minted box that contains a single dollar sign.
|
||||
\end{mintedbox}
|
||||
|
||||
Now this part of the document has math-mode syntax highlighting.
|
||||
|
||||
\begin{verilog}{}
|
||||
$strobe("Average period = %g measured from %d periods.", period, total);
|
||||
\end{verilog}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,9 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-tcolorbox.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texTCBZone', 49, 1))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,97 @@
|
||||
\documentclass{article}
|
||||
\usepackage{tikz}
|
||||
\usepackage{pgfplots}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\tikzset{
|
||||
a = b,
|
||||
}
|
||||
|
||||
\pgfplotsset{
|
||||
a = b,
|
||||
}
|
||||
|
||||
\begin{figure}
|
||||
\centering
|
||||
\begin{tikzpicture}[
|
||||
font = \small,
|
||||
% A comment here
|
||||
xlabel = $f(x)$,
|
||||
very thick,
|
||||
]
|
||||
|
||||
% A simple line
|
||||
\draw (0,0) -- (1,0);
|
||||
\end{tikzpicture}
|
||||
\caption{A simple tikz example.}
|
||||
\label{fig:tikz-example}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[tbp]
|
||||
\centering
|
||||
\begin{tikzpicture}
|
||||
\begin{groupplot}[
|
||||
height=0.35\textwidth,
|
||||
width=0.375\textwidth,
|
||||
xlabel={$V_0$ [\si{\meter\cubed}]},
|
||||
ylabel={$t$ [\si{\second}]},
|
||||
xmax=26,
|
||||
ymax=90,
|
||||
grid=both,
|
||||
grid style={line width=.2pt, draw=gray!20},
|
||||
group style={
|
||||
group size=3 by 1,
|
||||
horizontal sep=0.5cm,
|
||||
x descriptions at=edge bottom,
|
||||
y descriptions at=edge left,
|
||||
},
|
||||
table/x = V0,
|
||||
table/y = t_RPT,
|
||||
domain=0.05:25.26,
|
||||
]
|
||||
|
||||
\nextgroupplot[
|
||||
title={Composition $z_1$},
|
||||
legend columns=3,
|
||||
transpose legend,
|
||||
legend style={
|
||||
at={(0.05,1.20)},
|
||||
/tikz/column 2/.style={
|
||||
column sep=5pt,
|
||||
},
|
||||
anchor=south west,
|
||||
},
|
||||
]
|
||||
\addplot[cl3-1] {t_rpt(x, 437.0, 0.6*0.135294, 0.891)};
|
||||
\addplot[cl3-1, sim] table {data/instspill_m0_eps0.6.csv};
|
||||
\addlegendentry{$\epsilon = 1.2$}
|
||||
\addlegendentry{Simulation}
|
||||
|
||||
\nextgroupplot[
|
||||
title={Composition $z_2$},
|
||||
]
|
||||
\addplot[cl3-1] {t_rpt(x, 437.0, 0.6*0.135294, 0.781)};
|
||||
\addplot[cl3-3, sim] table {data/instspill_m1_eps1.2.csv};
|
||||
|
||||
\nextgroupplot[
|
||||
title={Composition $z_3$},
|
||||
]
|
||||
\addplot[cl3-1] {t_rpt(x, 437.0, 0.6*0.135294, 0.672)};
|
||||
\addplot[cl3-3, sim] table {data/instspill_m2_eps1.2.csv};
|
||||
|
||||
\addplot+ [id=parable,domain=-5:5,] gnuplot {4*x**2 - 5} node [pin=180:{$4x^2-5$}] {};
|
||||
|
||||
\addplot+ coordinates {
|
||||
(0.0, 0.10) (0.1, 0.15) (0.2, 0.50)
|
||||
(0.3, 0.62) (0.4, 0.56) (0.5, 0.58)
|
||||
(0.6, 0.65) (0.7, 0.60) (0.8, 0.58)
|
||||
(0.9, 0.55) (1.0, 0.52)
|
||||
} |- (0,0) -- cycle;
|
||||
\end{groupplot}
|
||||
\end{tikzpicture}
|
||||
\caption{This example will not compile!}
|
||||
\label{fig:instspill-t}
|
||||
\end{figure}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,11 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-tikz.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_true(vimtex#syntax#in('texTikzSemicolon', 66, 61))
|
||||
call assert_true(vimtex#syntax#in('texTikzZone', 66, 61))
|
||||
call assert_true(vimtex#syntax#in('texCmdAxis', 71, 9))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,93 @@
|
||||
\documentclass{beamer}
|
||||
\usepackage{subfile}
|
||||
\usepackage{includegraphics}
|
||||
\usepackage{pdfpages}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{testx} " Package does not exist - test try catch block
|
||||
\usepackage{csquotes}
|
||||
\usepackage{varioref}
|
||||
\usepackage{dot2texi}
|
||||
\usepackage{luacode}
|
||||
\usepackage{gnuplottex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\section{General}
|
||||
\todostuff \todocommand \todo{content}
|
||||
|
||||
This text is \emph{emphasized}, \textit{italized}, \textbf{bolded}.
|
||||
|
||||
\def\A{A}
|
||||
\def\B{\V{B}}
|
||||
|
||||
\newenvironment{example}[1][]{Start #1}{Stop}
|
||||
\renewenvironment{example}[1][]{Start #1}{Stop}
|
||||
\newenvironment{nestedexample}[1][]{%
|
||||
\renewenvironment{nested}[1][0]{%
|
||||
Outerarg #1}{%
|
||||
Innerarg ##1
|
||||
}%
|
||||
\begin{nested}{title}}{%
|
||||
\end{nested}%
|
||||
}
|
||||
|
||||
\newcommand{\testA}[1]{Test #1}
|
||||
\renewcommand{\testA}[1]{Test #1}
|
||||
\newcommand{\mycommand}[1]{%
|
||||
\renewcommand{\myothercommand}[1]{%
|
||||
\dosomethingwithouterarg{#1}%
|
||||
\dosomethingwithinnerarg{##1}%
|
||||
}%
|
||||
}
|
||||
|
||||
\section{Documentclass: beamer}
|
||||
\begin{frame}[asd]
|
||||
\includegraphics[height=0.5062\linewidth]{test.png}
|
||||
\includegraphics<2>[height=0.5062\linewidth]{test.png}
|
||||
|
||||
\only{asd}
|
||||
\only<2>{asd}
|
||||
|
||||
\item asdasd
|
||||
\item<1-3> asdasd
|
||||
\end{frame}
|
||||
|
||||
\section{Package: minor stuff}
|
||||
% subfile
|
||||
\subfile{test-syntax.tex}
|
||||
|
||||
% pdfpages
|
||||
\includepdf{test.pdf}
|
||||
|
||||
\section{Package: varioref}
|
||||
\Vref{sec_one} does what you need. Still \vref{sec_one} works.
|
||||
|
||||
\section{Package: dot2texi}
|
||||
\begin{dot2tex}
|
||||
graph graphname {
|
||||
a -- b;
|
||||
b -- c;
|
||||
b -- d;
|
||||
d -- a;
|
||||
}
|
||||
\end{dot2tex}
|
||||
|
||||
\section{Package: luacode}
|
||||
\directlua{
|
||||
if pdf.getminorversion() \string~= 7 then
|
||||
print "pfd version 1.7"
|
||||
end
|
||||
}
|
||||
|
||||
\begin{luacode}
|
||||
if pdf.getminorversion() \string~= 7 then
|
||||
print "pfd version 1.7"
|
||||
end
|
||||
\end{luacode}
|
||||
|
||||
\section{Package: gnuplottex}
|
||||
\begin{gnuplot}[terminal=..., terminaloptions=...]
|
||||
plot file using 1:2 with lines
|
||||
\end{gnuplot}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,9 @@
|
||||
source common.vim
|
||||
|
||||
EditConcealed test-various-packages.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_equal(11, len(filter(b:vimtex_syntax, 'v:val.__loaded')))
|
||||
|
||||
call vimtex#test#finished()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user