Update generated nvim config
This commit is contained in:
36
config/neovim/store/lazy-plugins/vimtex/test/Makefile
Normal file
36
config/neovim/store/lazy-plugins/vimtex/test/Makefile
Normal file
@ -0,0 +1,36 @@
|
||||
MYVIM ?= nvim --clean --headless
|
||||
MAKEFLAGS+=--no-print-directory
|
||||
|
||||
TESTS := $(wildcard test-*)
|
||||
|
||||
.PHONY: test $(TESTS)
|
||||
|
||||
test: $(TESTS)
|
||||
|
||||
sysinfo:
|
||||
@echo "**** SYSTEM INFORMATION ****"
|
||||
@-git log -1
|
||||
@-latexmk --version
|
||||
@-$(MYVIM) --version
|
||||
@echo "**** SYSTEM INFORMATION ****"
|
||||
|
||||
$(TESTS):
|
||||
$(MAKE) -C $@
|
||||
|
||||
|
||||
#
|
||||
# Ensure that some goals are run first/last
|
||||
#
|
||||
ifndef MAKECMDGOALS
|
||||
test: sysinfo
|
||||
$(TESTS): sysinfo
|
||||
|
||||
FILTERED := test-indentation-timing
|
||||
test-indentation-timing: | $(filter-out $(FILTERED), $(TESTS))
|
||||
|
||||
FILTERED += test-completion-bibtex-speed
|
||||
test-completion-bibtex-speed: | $(filter-out $(FILTERED), $(TESTS))
|
||||
|
||||
FILTERED += test-completion-bibtex
|
||||
test-completion-bibtex: | $(filter-out $(FILTERED), $(TESTS))
|
||||
endif
|
||||
16683
config/neovim/store/lazy-plugins/vimtex/test/common/huge.bib
Normal file
16683
config/neovim/store/lazy-plugins/vimtex/test/common/huge.bib
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,4 @@
|
||||
@article{local1,
|
||||
author = {Local-1},
|
||||
title = {Local file example one},
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
@article{local2,
|
||||
author = {Local-2},
|
||||
title = {Local file example one},
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
\chapter{Appendix 1}
|
||||
This test document is created to test advanced TOC functionality.
|
||||
|
||||
\section{Appendix subsection}
|
||||
|
||||
\subsection{sub}
|
||||
|
||||
\subsubsection{subsub}
|
||||
|
||||
\paragraph{par}
|
||||
|
||||
\subsection{Test sub section 1}
|
||||
|
||||
\chapter{Appendix 2}
|
||||
\label{chap: appendix 2}
|
||||
|
||||
\section{Testing TOC levels}
|
||||
Testing more input and TOC levels.
|
||||
|
||||
\subsection{Testing TOC sub levels}
|
||||
|
||||
\subsubsection{Testing TOC sub sub levels}
|
||||
Hello world.
|
||||
|
||||
\subsubsection{Text $\Gamma^{r}(\ensuremath{{\mathbf{Z}}}_p^d,\mathbf{K})$}
|
||||
|
||||
\subsection{Another test subsection}
|
||||
|
||||
\subsubsection{Other text $\Gamma^{r}$}
|
||||
|
||||
\section{Testing more appendix levels}
|
||||
Testing more input and TOC levels.
|
||||
|
||||
\subsection{Testing TOC sub levels}
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
\chapter{No numbers in backmatter 1}
|
||||
|
||||
\section{Section 1}
|
||||
|
||||
\section{Section 2}
|
||||
|
||||
\chapter{No numbers in backmatter 2}
|
||||
|
||||
\section{Section 1}
|
||||
|
||||
\section{Section 2}
|
||||
%\label{sec:back_section2}
|
||||
|
||||
% vimtex-include: minivimrc
|
||||
|
||||
% \bibliography{test}
|
||||
% \printbibliography
|
||||
% \printbibliography{Testing}
|
||||
% \printbibliography[Some option]{Testing}
|
||||
% \printbibheading
|
||||
% \printbibheading{Testing}
|
||||
% \printbibheading[Some option]{Testing}
|
||||
% \begin{thebibliography}
|
||||
% \end{thebibliography}
|
||||
|
||||
% \printindex
|
||||
% \printindex[Some option]
|
||||
@ -0,0 +1,3 @@
|
||||
@Test{
|
||||
test = {test},
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
% TeX Root = main.tex
|
||||
|
||||
\chapter[Short title]{Long title}
|
||||
\begin{equation}
|
||||
\label{eq:test}
|
||||
f=1
|
||||
\end{equation}
|
||||
|
||||
\chapter{Parsing {toc entries works
|
||||
also for} multi-line \texorpdfstring{stuff}{entries}
|
||||
--- Hurray!}
|
||||
|
||||
\section{\texorpdfstring{\textcolor{red}{Very important title}} {Very important title}}
|
||||
\label{sec:test2}
|
||||
|
||||
\section{Test section 1}\label{sec:TesSec1}
|
||||
|
||||
% \includegraphics{test.jpg}
|
||||
\todo[inline]{
|
||||
En test til her, ja.}
|
||||
|
||||
\begin{figure}[htpb]
|
||||
\centering
|
||||
\input{test.tikz}
|
||||
\caption{Silly example}
|
||||
\label{fig:example1}
|
||||
\end{figure}
|
||||
|
||||
\subsection{sub}
|
||||
|
||||
\subsubsection{subsub}
|
||||
|
||||
\paragraph{par}
|
||||
|
||||
\subsection{Test sub section 1}
|
||||
|
||||
\section{$\alpha$}
|
||||
|
||||
\subsection{Test sub section 1}
|
||||
|
||||
\subsection{Test sub section 2}
|
||||
Some text.
|
||||
|
||||
\chapter[Parsing toc specific entries works
|
||||
also for multi-line --- A second Hurray!]{Parsing {toc entries works
|
||||
also for} multi-line \texorpdfstring{stuff}{entries}
|
||||
--- Hurray!}
|
||||
|
||||
\chapter*{Test chapter 1}
|
||||
Test of starred chapter.
|
||||
|
||||
\chapter{Test chapter 2}
|
||||
\label{chap:second test}
|
||||
|
||||
\section{Testing TOC levels}
|
||||
Testing more input and TOC levels.
|
||||
|
||||
\subsection{Testing TOC sub levels}
|
||||
|
||||
\subsubsection{Testing TOC sub sub levels}
|
||||
Hello world.
|
||||
|
||||
\paragraph{something}
|
||||
asdasd
|
||||
|
||||
\subsubsection{Text $\Gamma^{r}(\ensuremath{{\mathbf{Z}}}_p^d,\mathbf{K})$}
|
||||
|
||||
\begin{equation}
|
||||
\label{eq:test equation label}
|
||||
f(x) = 1
|
||||
\end{equation}
|
||||
|
||||
\subsection{Another test subsection}
|
||||
|
||||
\subsubsection{Other text $\Gamma^{r}$}
|
||||
|
||||
\paragraph{something}
|
||||
asdasd
|
||||
|
||||
\section{Testing more appendix levels}
|
||||
Testing more input and TOC levels.
|
||||
|
||||
\subsection{Testing TOC sub levels}
|
||||
|
||||
\section{Testing included section contents}
|
||||
|
||||
\input{content/sections}
|
||||
@ -0,0 +1 @@
|
||||
Hello world
|
||||
@ -0,0 +1,9 @@
|
||||
\chapter{Preface}
|
||||
Preface.
|
||||
|
||||
\section{Acknowledgements}
|
||||
|
||||
\chapter[Other]{Other frontmatter chapter}
|
||||
\label{chap:test}
|
||||
|
||||
\tableofcontents
|
||||
@ -0,0 +1,38 @@
|
||||
\documentclass{book}
|
||||
\usepackage{mathtools}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{tikz}
|
||||
\usepackage{todonotes}
|
||||
|
||||
\input{preamble}
|
||||
% \addbibresource{book.bib}
|
||||
% \addglobalbib{book.bib}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\frontmatter
|
||||
\input{ frontmatter}
|
||||
|
||||
\mainmatter
|
||||
% Todo This should NOT match
|
||||
\include{content/chapters}
|
||||
\todo[inline]{Match more things}
|
||||
|
||||
\appendix
|
||||
\input{appendix}
|
||||
% TODO: This should be much better!
|
||||
|
||||
% IMPORTANT: Mucho importante
|
||||
|
||||
% IMPORTANTE: Very important
|
||||
|
||||
\backmatter
|
||||
% FIXME Be smarter
|
||||
\input{backmatter}
|
||||
\begin{equation}
|
||||
\label{eq:finito}
|
||||
f=2
|
||||
\end{equation}
|
||||
|
||||
\bibliography{book.bib,test}
|
||||
\end{document}
|
||||
@ -0,0 +1,46 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
set runtimepath+=../../after
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_toc_config = {
|
||||
\ 'layer_status' : {'include' : 0},
|
||||
\ 'layer_keys' : {'content' : '<c-c>'},
|
||||
\}
|
||||
let g:vimtex_toc_todo_labels = {
|
||||
\ 'TODO': 'TODO: ',
|
||||
\ 'FIXME': 'FIXME: ',
|
||||
\ 'IMPORTANT': 'IMPORTANT: ',
|
||||
\ 'IMPORTANTE': 'IMPORTANT: ',
|
||||
\}
|
||||
|
||||
" let g:vimtex_compiler_latexmk = {'out_dir': 'out'}
|
||||
let g:vimtex_view_automatic = 0
|
||||
let g:vimtex_quickfix_mode = 0
|
||||
|
||||
augroup vimtex_customization
|
||||
autocmd!
|
||||
autocmd FileType tex call CreateTocs()
|
||||
augroup END
|
||||
|
||||
function CreateTocs()
|
||||
let g:custom_toc1 = vimtex#toc#new({
|
||||
\ 'layers' : ['label', 'todo'],
|
||||
\ 'todo_sorted' : 0,
|
||||
\ 'show_help' : 0,
|
||||
\ 'show_numbers' : 0,
|
||||
\ 'mode' : 4,
|
||||
\})
|
||||
nnoremap <silent> \ly :call g:custom_toc1.open()<cr>
|
||||
|
||||
let g:custom_toc2 = vimtex#toc#new({
|
||||
\ 'layers' : ['include'],
|
||||
\ 'show_help' : 0,
|
||||
\})
|
||||
nnoremap <silent> \lY :call g:custom_toc2.open()<cr>
|
||||
endfunction
|
||||
|
||||
silent edit main.tex
|
||||
@ -0,0 +1,5 @@
|
||||
% Commands
|
||||
\usepackage{color}
|
||||
\usepackage{hyperref}
|
||||
|
||||
% FIXME Add more packages and commands
|
||||
@ -0,0 +1,3 @@
|
||||
\begin{tikzpicture}
|
||||
blahr
|
||||
\end{tikzpicture}
|
||||
@ -0,0 +1,128 @@
|
||||
\documentclass{book}
|
||||
|
||||
\begin{document}
|
||||
|
||||
% Folding of multiline comments
|
||||
%
|
||||
% -- 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.
|
||||
|
||||
\frontmatter
|
||||
|
||||
\chapter{Preface}
|
||||
Preface.
|
||||
|
||||
\section{Acknowledgements}
|
||||
|
||||
\chapter[Other]{Other frontmatter chapter}
|
||||
|
||||
\tableofcontents
|
||||
|
||||
\mainmatter
|
||||
|
||||
\chapter*{Test chapter 1}
|
||||
Test of starred chapter.
|
||||
|
||||
\chapter{Test chapter 1}
|
||||
This test document is created to test advanced TOC functionality.
|
||||
|
||||
\begin{table}
|
||||
\caption[foo]{bar}
|
||||
\end{table}
|
||||
\begin{table}
|
||||
\caption[foo] {bar}
|
||||
\end{table}
|
||||
|
||||
\section{Test section 1}
|
||||
|
||||
\subsection{sub}
|
||||
|
||||
\subsubsection{subsub}
|
||||
|
||||
\subsubsubsection{subsub}
|
||||
|
||||
\subsection{Test sub section 1}
|
||||
|
||||
\section{$\alpha$}
|
||||
|
||||
\subsection{Test sub section 1}
|
||||
|
||||
\subsection{Test sub section 2}
|
||||
Some text.
|
||||
|
||||
\chapter{Test chapter 2}
|
||||
|
||||
\section{Testing TOC levels}
|
||||
Testing more input and TOC levels.
|
||||
|
||||
\subsection{Testing TOC sub levels}
|
||||
|
||||
\subsubsection{Testing TOC sub sub levels}
|
||||
Hello world.
|
||||
|
||||
\subsubsection{Text $\Gamma^{r}(\ensuremath{{\mathbf{Z}}}_p^d,\mathbf{K})$}
|
||||
|
||||
\subsection{Another test subsection}
|
||||
|
||||
\subsubsection{Other text $\Gamma^{r}$}
|
||||
|
||||
\section{Testing more appendix levels}
|
||||
Testing more input and TOC levels.
|
||||
|
||||
\subsection{Testing TOC sub levels}
|
||||
|
||||
\appendix
|
||||
|
||||
\chapter{Appendix 1}
|
||||
This test document is created to test advanced TOC functionality.
|
||||
|
||||
\section{Appendix subsection}
|
||||
|
||||
\subsection{sub}
|
||||
|
||||
\subsubsection{subsub}
|
||||
|
||||
\subsubsubsection{subsub}
|
||||
|
||||
\subsection{Test sub section 1}
|
||||
|
||||
\chapter{Appendix 2}
|
||||
|
||||
\section{Testing TOC levels}
|
||||
Testing more input and TOC levels.
|
||||
|
||||
\subsection{Testing TOC sub levels}
|
||||
|
||||
\subsubsection{Testing TOC sub sub levels}
|
||||
Hello world.
|
||||
|
||||
\subsubsection{Text $\Gamma^{r}(\ensuremath{{\mathbf{Z}}}_p^d,\mathbf{K})$}
|
||||
|
||||
\subsection{Another test subsection}
|
||||
|
||||
\subsubsection{Other text $\Gamma^{r}$}
|
||||
|
||||
\section{Testing more appendix levels}
|
||||
Testing more input and TOC levels.
|
||||
|
||||
\subsection{Testing TOC sub levels}
|
||||
|
||||
|
||||
\backmatter
|
||||
|
||||
\chapter{No numbers in backmatter 1}
|
||||
|
||||
\section{Section 1}
|
||||
|
||||
\section{Section 2}
|
||||
|
||||
\chapter{No numbers in backmatter 2}
|
||||
|
||||
\section{Section 1}
|
||||
|
||||
\section{Section 2}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,17 @@
|
||||
\documentclass{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{graphicx}
|
||||
\usepackage[backend=biber]{biblatex}
|
||||
% \addbibresource{biblatex-examples.bib}
|
||||
\addbibresource{../common/huge.bib}
|
||||
\addbibresource{../common/local1.bib}
|
||||
\addbibresource{../common/local2.bib}
|
||||
|
||||
\begin{document}
|
||||
|
||||
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.
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,4 @@
|
||||
\documentclass{minimal}
|
||||
\begin{document}
|
||||
Hello world!
|
||||
\end{document}
|
||||
@ -0,0 +1,21 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
let &rtp .= ',../../after'
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_view_automatic = 0
|
||||
|
||||
silent edit main.tex
|
||||
|
||||
" Functions for profiling
|
||||
" call vimtex#profile#file('some_file')
|
||||
" call vimtex#profile#filter([
|
||||
" \ 'FUNCTIONS SORTED ON SELF',
|
||||
" \ 'FUNCTIONS SORTED ON TOTAL',
|
||||
" \ 'FUNCTION vimtex#fold#level',
|
||||
" \])
|
||||
" call vimtex#profile#print()
|
||||
" call vimtex#profile#open()
|
||||
@ -0,0 +1,21 @@
|
||||
set nocompatible
|
||||
set runtimepath^=~/.local/plugged/vimtex
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let s:cmd = 'uname -sr'
|
||||
|
||||
let s:time = vimtex#profile#time()
|
||||
for s:x in range(100)
|
||||
call vimtex#jobs#capture(s:cmd)
|
||||
endfor
|
||||
|
||||
let s:time = vimtex#profile#time(s:time)
|
||||
for s:x in range(100)
|
||||
call vimtex#jobs#cached(s:cmd)
|
||||
endfor
|
||||
|
||||
call vimtex#profile#time(s:time)
|
||||
|
||||
quitall!
|
||||
@ -0,0 +1,153 @@
|
||||
\documentclass{article}
|
||||
|
||||
% These are only here for the sake of this tutorial.
|
||||
\usepackage{amsmath}
|
||||
\newcommand{\lt}{\textbackslash{}lt }
|
||||
\newcommand{\lk}{\textbackslash{}lk }
|
||||
\newcommand{\lv}{\textbackslash{}lv }
|
||||
\newcommand{\lc}{\textbackslash{}lc }
|
||||
\renewcommand{\ll}{\textbackslash{}ll }
|
||||
\renewcommand{\le}{\textbackslash{}le }
|
||||
|
||||
\begin{document}
|
||||
|
||||
\section{Compiling}
|
||||
|
||||
Press \ll to start (or stop) compiling the document.
|
||||
This turns on automatic compiling if supported by your compiler, meaning your
|
||||
document will be compiled each time you save.
|
||||
|
||||
Press \lk to stop the compilation process
|
||||
|
||||
Press \lc to clear auxiliary files.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section{Forward and Backward Search}
|
||||
|
||||
Press \lv to forward search. This will open the compiled PDF.
|
||||
|
||||
Some PDF viewers support the ability to jump to the current location in the PDF.
|
||||
|
||||
Some also support backward search (jumping from PDF to source).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section{Errors, Warnings and the QuickFix window}
|
||||
|
||||
VimTeX will populate the QuickFix menu with any errors and warnings it finds in
|
||||
the log file.
|
||||
|
||||
This is done after (attempting to) compile or pressing \le.
|
||||
|
||||
\le also closes the QuickFix menu when it is open.
|
||||
|
||||
\emph{Example.} Let's put some undefined commands here and compile:
|
||||
|
||||
Moving to the QuickFix window and pressing enter on the error entry moves the
|
||||
cursor to the line containing the error. We can fix the error and continue.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section{Document Overview}
|
||||
|
||||
Press \lt to show a window with a table of contents for your document.
|
||||
|
||||
Also shows labels, references and TODOs.
|
||||
|
||||
Can be used to jump to sections, labels, references and TODOs.
|
||||
|
||||
% TODO: Show table of contents.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section{Motions and Text Objects}
|
||||
|
||||
VimTeX adds various LaTeX specific motions and text objects.
|
||||
|
||||
\emph{Example motion.} move between section boundaries with [[, [], ][ and ]].
|
||||
|
||||
\emph{Example text object.} ic refers to a LaTeX command excluding the
|
||||
backslash. ac includes the backslash.
|
||||
|
||||
cic: \( \alpha \)
|
||||
|
||||
dac: \( \)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section{Other Cool Stuff}
|
||||
|
||||
cse changes the surrounding environment:
|
||||
|
||||
\begin{equation}
|
||||
v \cdot \nabla_x f_1 = -\sigma_a f_1, \quad f_1 \rvert_{\Gamma_-} = \phi(x,v).
|
||||
\end{equation}
|
||||
|
||||
tsd toggles between () and \( \left( \right) \):
|
||||
|
||||
\begin{equation*}
|
||||
\frac{d}{ds} \left[ e^{\int_k^s \sigma_a(x + tv)\,dt} F_1(s) \right] = 0
|
||||
\end{equation*}
|
||||
|
||||
tse toggles the * in environments:
|
||||
|
||||
\begin{equation}
|
||||
f_1(x, v) = e^{-\int_0^{\tau_-(x, v)} \sigma_a(x - sv)\,dt} \phi(x_-, v),
|
||||
\end{equation}
|
||||
|
||||
This is only a tiny sliver of what VimTeX offers.
|
||||
Read the README for an overview, and read :h vimtex for a full description of
|
||||
all things VimTeX.
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,66 @@
|
||||
Package natbib Warning: Citation `Einstein:1905' on page 1 undefined on input line 99.
|
||||
Package refcheck Warning: Unused label `eq:my_equation_label' on input line 12.
|
||||
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
|
||||
(hyperref) removing `\gamma' on input line 9.
|
||||
Package hyperref Warning: Composite letter `\textdotbelow+u'
|
||||
(hyperref) not defined in PD1 encoding,
|
||||
(hyperref) removing `\textdotbelow' on input line 5.
|
||||
LaTeX Warning: Reference `fig:my_picture' on page 37 undefined on input line 477.
|
||||
Overfull \hbox (22.0021pt too wide) in paragraph at lines 9--9
|
||||
Package biblatex warning: No "backend" specified, using Biber backend. To use BibTex, load biblatex with the "backend=bibtex" option.
|
||||
Package biblatex Warning: Data encoding is 'utf8'.
|
||||
(biblatex) Use backend=biber.
|
||||
Package babel Warning: No hyphenation patterns were loaded for
|
||||
(babel) the language `Latin'
|
||||
(babel) I will use the patterns loaded for \language=0 instead.
|
||||
Package onlyamsmath Warning: Environment eqnarray or eqnarray* used, please use
|
||||
(onlyamsmath) only the environments provided by the amsmath
|
||||
(onlyamsmath) package on input line 18.
|
||||
Package typearea Warning: \typearea used at group level 2.
|
||||
(typearea) Using \typearea inside any group, e.g.
|
||||
(typearea) environments, math mode, boxes, etc. may result in
|
||||
(typearea) many type setting problems.
|
||||
(typearea) You should move the command \typearea
|
||||
(typearea) outside all groups on input line 21.
|
||||
Package caption Warning: Unsupported document class (or package) detected,
|
||||
(caption) usage of the caption package is not recommended.
|
||||
|
||||
Runaway argument?
|
||||
{\sqrt {{1}} \end {equation} \par \end {document}
|
||||
! File ended while scanning use of \frac .
|
||||
<inserted text>
|
||||
\par
|
||||
<*> "file with errors.tex"
|
||||
|
||||
I suspect you have forgotten a `}', causing me
|
||||
to read past where you wanted me to stop.
|
||||
I'll try to recover; but if the error is serious,
|
||||
you'd better type `E' or `X' now and fix your file.
|
||||
|
||||
! Emergency stop.
|
||||
|
||||
! ==> Fatal error occurred, no output PDF file produced!
|
||||
|
||||
Runaway argument?
|
||||
./file with errors.tex:16: Paragraph ended before \date was complete.
|
||||
<to be read again>
|
||||
\par
|
||||
l.16
|
||||
|
||||
I suspect you've forgotten a `}', causing me to apply this
|
||||
control sequence to too much text. How can we recover?
|
||||
My plan is to forget the whole thing and hope for the best.
|
||||
|
||||
Missing character: There is no ^^A (U+0001) in font [lmroman10-regular]:+tlig;!
|
||||
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux)
|
||||
|
||||
Class memoir Warning: As of 2018, \fixpdflayout\ is no longer used on input line 4.
|
||||
|
||||
./test.tex:11: Undefined control sequence.
|
||||
l.11 \cdashline
|
||||
{1-7}
|
||||
The control sequence at the end of the top line
|
||||
of your error message was never \def'ed. If you have
|
||||
misspelled it (e.g., `\hobx'), type `I' and the correct
|
||||
spelling (e.g., `I\hbox'). Otherwise just continue,
|
||||
and I'll forget about whatever was undefined.
|
||||
@ -0,0 +1,6 @@
|
||||
\documentclass{minimal}
|
||||
\begin{document}
|
||||
|
||||
Hello World!
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,9 @@
|
||||
MYVIM ?= nvim --clean
|
||||
|
||||
.PHONY: default basic
|
||||
|
||||
default:
|
||||
hyperfine --min-runs 5 '$(MYVIM) -u minivimrc'
|
||||
|
||||
basic:
|
||||
time $(MYVIM) -u minivimrc
|
||||
@ -0,0 +1,12 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
set runtimepath+=../../after
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
silent edit thesis.tex
|
||||
" call vimtex#profile#file('thesis.tex')
|
||||
|
||||
quitall
|
||||
File diff suppressed because it is too large
Load Diff
1
config/neovim/store/lazy-plugins/vimtex/test/perf-syntax/.gitignore
vendored
Normal file
1
config/neovim/store/lazy-plugins/vimtex/test/perf-syntax/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.log
|
||||
@ -0,0 +1,7 @@
|
||||
MYVIM ?= nvim --clean
|
||||
|
||||
.PHONY: default
|
||||
|
||||
default:
|
||||
$(MYVIM) -u test.vim
|
||||
head -n 30 out.log
|
||||
@ -0,0 +1,46 @@
|
||||
\documentclass{article}
|
||||
\begin{document}
|
||||
|
||||
\noindent Standard \LaTeX{} practice is to write inline math by enclosing it between \verb|\(...\)|:
|
||||
|
||||
\begin{quote}
|
||||
In physics, the mass-energy equivalence is stated
|
||||
by the equation \(E=mc^2\), discovered in 1905 by Albert Einstein.
|
||||
\end{quote}
|
||||
|
||||
\noindent Instead if writing (enclosing) inline math between \verb|\(...\)| you can use \texttt{\$...\$} to achieve the same result:
|
||||
|
||||
\begin{quote}
|
||||
In physics, the mass-energy equivalence is stated
|
||||
by the equation $E=mc^2$, discovered in 1905 by Albert Einstein.
|
||||
\end{quote}
|
||||
|
||||
\noindent Or, you can use \verb|\begin{math}...\end{math}|:
|
||||
|
||||
\begin{quote}
|
||||
In physics, the mass-energy equivalence is stated
|
||||
by the equation \begin{math}E=mc^2\end{math}, discovered in 1905 by Albert Einstein.
|
||||
\end{quote}
|
||||
|
||||
This is a simple math expression \(\sqrt{x^2+1}\) inside text.
|
||||
And this is also the same:
|
||||
\begin{math}
|
||||
\sqrt{x^2+1}
|
||||
\end{math}
|
||||
but by using another command.
|
||||
|
||||
This is a simple math expression without numbering
|
||||
\[\sqrt{x^2+1}\]
|
||||
separated from text.
|
||||
|
||||
This is also the same:
|
||||
\begin{displaymath}
|
||||
\sqrt{x^2+1}
|
||||
\end{displaymath}
|
||||
|
||||
\ldots and this:
|
||||
\begin{equation*}
|
||||
\sqrt{x^2+1}
|
||||
\end{equation*}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,20 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
set runtimepath+=../../after
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_syntax_conceal_disable = 1
|
||||
let g:vimtex_syntax_match_unicode = 0
|
||||
silent edit main.tex
|
||||
|
||||
syntime on
|
||||
for s:x in range(400)
|
||||
redraw!
|
||||
endfor
|
||||
let s:lines = split(execute('syntime report'), "\n")
|
||||
call writefile(s:lines, "out.log")
|
||||
|
||||
quitall
|
||||
@ -0,0 +1,14 @@
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
TESTS := $(wildcard test*.vim)
|
||||
TESTS := $(TESTS:.vim=)
|
||||
|
||||
.PHONY: test $(TESTS)
|
||||
|
||||
test: $(TESTS)
|
||||
|
||||
$(TESTS):
|
||||
@$(MYVIM) -u $@.vim
|
||||
@ -0,0 +1,6 @@
|
||||
\documentclass{revtex4-1}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\bibliography{../common/huge}
|
||||
\end{document}
|
||||
@ -0,0 +1,33 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_view_automatic = 0
|
||||
|
||||
call vimtex#log#set_silent()
|
||||
|
||||
let g:ready = 0
|
||||
augroup test_revtex
|
||||
autocmd!
|
||||
autocmd User VimtexEventCompileSuccess let g:ready = 1
|
||||
autocmd User VimtexEventCompileFailed cquit
|
||||
augroup END
|
||||
|
||||
silent edit test_revtex.tex
|
||||
|
||||
silent VimtexCompileSS
|
||||
|
||||
while !g:ready
|
||||
sleep 20m
|
||||
endwhile
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_equal(['../common/huge.bib'], vimtex#bib#files())
|
||||
|
||||
silent VimtexClean!
|
||||
call delete('test_revtexNotes.bib')
|
||||
call delete('test_revtex.bbl')
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,24 @@
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
TESTS := $(wildcard test-*.vim)
|
||||
TESTS := $(TESTS:.vim=)
|
||||
TESTS_KPSEWHICH := test-kpsewhich-local-a test-kpsewhich-local-b
|
||||
TESTS_ALL := $(TESTS) $(TESTS_KPSEWHICH)
|
||||
|
||||
.PHONY: test $(TESTS_ALL) test-cleanup
|
||||
|
||||
test: $(TESTS_ALL) test-cleanup
|
||||
|
||||
$(TESTS):
|
||||
@$(MYVIM) -u $@.vim
|
||||
|
||||
$(TESTS_KPSEWHICH):
|
||||
@cd $@ && $(MYVIM) -u test.vim
|
||||
|
||||
test-cleanup: $(TESTS_ALL)
|
||||
@rm kpsewhich.json
|
||||
@rm capture.json
|
||||
@rm -f nvim_servernames.log
|
||||
@ -0,0 +1 @@
|
||||
{"a": 1, "b": 2, "c": 3, "d": 4, "__validate": "cache_v2"}
|
||||
@ -0,0 +1,42 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_cache_root = '.'
|
||||
|
||||
|
||||
" Test basic open and read
|
||||
let s:cache = vimtex#cache#open('test-basic')
|
||||
call assert_equal(1, s:cache.get('a'))
|
||||
call assert_equal(4, s:cache.get('d'))
|
||||
call assert_equal(0, s:cache.get('missing'))
|
||||
call assert_true(s:cache.has('c'))
|
||||
call vimtex#cache#close('test-basic')
|
||||
|
||||
|
||||
" Similar, but now change default value
|
||||
let s:cache = vimtex#cache#open('test-basic', {'default': {'key': 1}})
|
||||
call s:cache.read()
|
||||
let s:cache.persistent = 0
|
||||
let s:current = s:cache.get('missing')
|
||||
call assert_equal({'key': 1}, s:current)
|
||||
let s:current.other = 1
|
||||
let s:again = s:cache.get('missing')
|
||||
call assert_equal(1, get(s:again, 'other'))
|
||||
|
||||
|
||||
" Test create, set and overwrite - non persistent
|
||||
let s:cache = vimtex#cache#open('test-new', {'persistent': 0})
|
||||
call s:cache.set('a', 1)
|
||||
call s:cache.set('b', 2)
|
||||
call s:cache.set('c', 3)
|
||||
call s:cache.set('d', 4)
|
||||
call assert_equal(4, s:cache.get('d'))
|
||||
call s:cache.set('d', 5)
|
||||
call assert_equal(5, s:cache.get('d'))
|
||||
call assert_true(!filereadable('test-new.json'))
|
||||
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,30 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_cache_root = '.'
|
||||
|
||||
" Clear global cache
|
||||
let s:cache = vimtex#cache#open('test-clear')
|
||||
call assert_equal('./test-clear.json', s:cache.path)
|
||||
call s:cache.set('a', 1)
|
||||
call assert_true(s:cache.has('a'))
|
||||
call assert_true(filereadable(s:cache.path))
|
||||
call s:cache.clear()
|
||||
call assert_false(s:cache.has('a'))
|
||||
call assert_false(filereadable(s:cache.path))
|
||||
|
||||
" Clear local cache
|
||||
let b:vimtex = {'tex': '/foobar.tex'}
|
||||
let s:cache = vimtex#cache#open('test-clear', {'local': 1})
|
||||
call assert_equal('./test-clear%foobar.json', s:cache.path)
|
||||
call s:cache.set('a', 1)
|
||||
call assert_true(s:cache.has('a'))
|
||||
call assert_true(filereadable(s:cache.path))
|
||||
call s:cache.clear()
|
||||
call assert_false(s:cache.has('a'))
|
||||
call assert_false(filereadable(s:cache.path))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,19 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_cache_root = '.'
|
||||
|
||||
call writefile([], 'empty.json')
|
||||
|
||||
try
|
||||
let s:cache = vimtex#cache#open('empty')
|
||||
catch
|
||||
call assert_report('Should not fail on empty cache file!')
|
||||
finally
|
||||
call delete('empty.json')
|
||||
endtry
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,17 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../../../
|
||||
filetype plugin indent on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_cache_root = '../.'
|
||||
|
||||
silent edit test.tex
|
||||
|
||||
call assert_equal(
|
||||
\ 'test-kpsewhich-local-a/local.bib',
|
||||
\ vimtex#paths#relative(
|
||||
\ vimtex#kpsewhich#find('local.bib'),
|
||||
\ expand('%:p:h:h')))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,17 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../../../
|
||||
filetype plugin indent on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_cache_root = '../.'
|
||||
|
||||
silent edit test.tex
|
||||
|
||||
call assert_equal(
|
||||
\ 'test-kpsewhich-local-b/local.bib',
|
||||
\ vimtex#paths#relative(
|
||||
\ vimtex#kpsewhich#find('local.bib'),
|
||||
\ expand('%:p:h:h')))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,28 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_cache_root = '.'
|
||||
|
||||
" Local caches
|
||||
let s:cache1 = vimtex#cache#open('test-local', {'local': 1})
|
||||
call assert_equal('./test-local.json', s:cache1.path)
|
||||
call s:cache1.set('a', 1)
|
||||
|
||||
" Local caches (this is a new cache)
|
||||
let b:vimtex = {'tex': '/foo.bar'}
|
||||
let s:cache2 = vimtex#cache#open('test-local', {'local': 1})
|
||||
call assert_equal('./test-local%foo.json', s:cache2.path)
|
||||
call s:cache2.set('a', 2)
|
||||
|
||||
" The caches are not the same!
|
||||
call vimtex#cache#write_all()
|
||||
call assert_true(s:cache1.path !=# s:cache2.path)
|
||||
|
||||
" Clean up
|
||||
call delete(s:cache1.path)
|
||||
call delete(s:cache2.path)
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,31 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_cache_root = '.'
|
||||
|
||||
" Create test files
|
||||
let s:files = {
|
||||
\ 'test-validate-pass.json': {'__validate': 1, 'a': 1},
|
||||
\ 'test-validate-fail.json': {'__validate': 0, 'a': 1},
|
||||
\}
|
||||
for [s:file, s:content] in items(s:files)
|
||||
call writefile([json_encode(s:content)], s:file)
|
||||
endfor
|
||||
|
||||
|
||||
let s:cache = vimtex#cache#open('test-validate-pass', {'validate': 1})
|
||||
call assert_true(s:cache.has('a'))
|
||||
|
||||
let s:cache = vimtex#cache#open('test-validate-fail', {'validate': 1})
|
||||
call assert_false(s:cache.has('a'))
|
||||
|
||||
|
||||
" Clean up
|
||||
for s:file in keys(s:files)
|
||||
if filereadable(s:file) | call delete(s:file) | endif
|
||||
endfor
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,30 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_cache_root = '.'
|
||||
|
||||
function! SlowFunc(argument) abort
|
||||
sleep 100m
|
||||
return a:argument + 100
|
||||
endfunction
|
||||
let SlowFuncWrapped = vimtex#cache#wrap(
|
||||
\ function('SlowFunc'), 'test-wrapper', {'persistent': 0})
|
||||
|
||||
" First call is slow
|
||||
let s:time = reltime()
|
||||
call assert_equal(101, SlowFuncWrapped(1))
|
||||
call assert_inrange(0.09, 0.11, reltimefloat(reltime(s:time)))
|
||||
|
||||
" Second call is fast
|
||||
let s:time = reltime()
|
||||
call assert_equal(101, SlowFuncWrapped(1))
|
||||
call assert_inrange(0.0, 0.01, reltimefloat(reltime(s:time)))
|
||||
|
||||
" We can also open the cache directly
|
||||
let s:cache = vimtex#cache#open('test-wrapper')
|
||||
call assert_true(s:cache.has(1))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,30 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_cache_root = '.'
|
||||
|
||||
call vimtex#log#set_silent()
|
||||
|
||||
if has('nvim')
|
||||
let s:cache_name = 'test-write-error'
|
||||
let s:cache_file = s:cache_name . '.json'
|
||||
let s:cache = vimtex#cache#open(s:cache_name)
|
||||
call s:cache.set('bad', "Usu<73>rio")
|
||||
call s:cache.write()
|
||||
|
||||
let s:log = vimtex#log#get()
|
||||
call assert_equal(1, len(s:log))
|
||||
if len(s:log) > 0
|
||||
call assert_equal(
|
||||
\ printf('Could not encode cache "%s"', s:cache_name),
|
||||
\ s:log[0].msg[0]
|
||||
\)
|
||||
endif
|
||||
|
||||
if filereadable(s:cache_file) | call delete(s:cache_file) | endif
|
||||
endif
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,14 @@
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
TESTS := $(wildcard test*.vim)
|
||||
TESTS := $(TESTS:.vim=)
|
||||
|
||||
.PHONY: test $(TESTS)
|
||||
|
||||
test: $(TESTS)
|
||||
|
||||
$(TESTS):
|
||||
@$(MYVIM) -u $@.vim
|
||||
@ -0,0 +1,17 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
||||
set nomore
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
silent edit ../test-context-cite/test-cites.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call assert_equal("Hemingway1940", vimtex#cite#get_key_at(11, 35))
|
||||
call assert_equal("wilcox.e:2021", vimtex#cite#get_key_at(14, 56))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,14 @@
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
TESTS := $(wildcard test*.vim)
|
||||
TESTS := $(TESTS:.vim=)
|
||||
|
||||
.PHONY: test $(TESTS)
|
||||
|
||||
test: $(TESTS)
|
||||
|
||||
$(TESTS):
|
||||
@chronic $(MYVIM) -u $@.vim
|
||||
@ -0,0 +1,10 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
|
||||
" csc / Change surrounding command
|
||||
call vimtex#test#keys("csctest\<cr>", '\cmd{foo}', '\test{foo}')
|
||||
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,24 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
set wildmode=longest:full,full
|
||||
set wildcharm=<c-z>
|
||||
|
||||
|
||||
" cse / Change surrounding environment
|
||||
" . / Dot repeat
|
||||
call vimtex#test#keys("cse\<c-z>\<c-z>\<c-z>\<cr>",
|
||||
\[
|
||||
\ '\begin{foo}',
|
||||
\ ' Foo',
|
||||
\ '\end{foo}',
|
||||
\],
|
||||
\[
|
||||
\ '\begin{abstract}',
|
||||
\ ' Foo',
|
||||
\ '\end{abstract}',
|
||||
\])
|
||||
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,29 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
|
||||
" cse / Change surrounding environment
|
||||
" . / Dot repeat
|
||||
call vimtex#test#keys("csebaz\<cr>}j.",
|
||||
\[
|
||||
\ '\begin{foo}',
|
||||
\ ' Foo',
|
||||
\ '\end{foo}',
|
||||
\ '',
|
||||
\ '\begin{bar}',
|
||||
\ ' Bar',
|
||||
\ '\end{bar}',
|
||||
\],
|
||||
\[
|
||||
\ '\begin{baz}',
|
||||
\ ' Foo',
|
||||
\ '\end{baz}',
|
||||
\ '',
|
||||
\ '\begin{baz}',
|
||||
\ ' Bar',
|
||||
\ '\end{baz}',
|
||||
\])
|
||||
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,105 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin indent on
|
||||
syntax on
|
||||
|
||||
set shiftwidth=2
|
||||
set expandtab
|
||||
|
||||
|
||||
" cs$ -> $
|
||||
call vimtex#test#keys("jjcs$$\<cr>",
|
||||
\ [ 'text',
|
||||
\ '\[',
|
||||
\ ' math',
|
||||
\ '\]',
|
||||
\ 'text' ],
|
||||
\ ['text $math$ text'])
|
||||
|
||||
" cs$ -> $
|
||||
call vimtex#test#keys("3jcs$$\<cr>",
|
||||
\ [ ' indented text',
|
||||
\ '',
|
||||
\ ' \[',
|
||||
\ ' m = a t_h',
|
||||
\ ' \]',
|
||||
\ ' More text' ],
|
||||
\ [ ' indented text',
|
||||
\ '',
|
||||
\ ' $m = a t_h$ More text'])
|
||||
|
||||
" cs$ -> $
|
||||
call vimtex#test#keys("jjcs$$\<cr>",
|
||||
\ [ ' indented text',
|
||||
\ ' \[',
|
||||
\ ' m = a t_h',
|
||||
\ ' \]',
|
||||
\ '',
|
||||
\ ' More text' ],
|
||||
\ [ ' indented text $m = a t_h$',
|
||||
\ '',
|
||||
\ ' More text'])
|
||||
|
||||
" cs$ -> \[
|
||||
call vimtex#test#keys("f$cs$\\[\<cr>",
|
||||
\ ['text $math$ text'],
|
||||
\ ['text',
|
||||
\ '\[',
|
||||
\ ' math',
|
||||
\ '\]',
|
||||
\ 'text'])
|
||||
|
||||
" cs$ -> \[
|
||||
call vimtex#test#keys("cs$\\[\<cr>",
|
||||
\ ['$math$ text'],
|
||||
\ ['\[',
|
||||
\ ' math',
|
||||
\ '\]',
|
||||
\ 'text'])
|
||||
|
||||
" cs$ -> \[
|
||||
call vimtex#test#keys("jcs$\\[\<cr>",
|
||||
\ ['text',
|
||||
\ '$',
|
||||
\ 'math',
|
||||
\ '$',
|
||||
\ 'text'],
|
||||
\ ['text',
|
||||
\ '\[',
|
||||
\ ' math',
|
||||
\ '\]',
|
||||
\ 'text'])
|
||||
|
||||
" cs$ -> \[
|
||||
call vimtex#test#keys("f$cs$\\[\<cr>",
|
||||
\ ['text $',
|
||||
\ 'math',
|
||||
\ '$ text'],
|
||||
\ ['text',
|
||||
\ '\[',
|
||||
\ ' math',
|
||||
\ '\]',
|
||||
\ 'text'])
|
||||
|
||||
" cs$ -> \[
|
||||
call vimtex#test#keys("jcs$\\[\<cr>",
|
||||
\ [' text $f(x)',
|
||||
\ ' = 1$ text'],
|
||||
\ [' text',
|
||||
\ ' \[',
|
||||
\ ' f(x)',
|
||||
\ ' = 1',
|
||||
\ ' \]',
|
||||
\ ' text'])
|
||||
|
||||
" cs$ -> \(
|
||||
call vimtex#test#keys("jjcs$\\(\<cr>",
|
||||
\ ['text',
|
||||
\ '\[',
|
||||
\ ' math',
|
||||
\ '\]',
|
||||
\ 'text' ],
|
||||
\ ['text \(math\) text'])
|
||||
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,34 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin indent on
|
||||
|
||||
set shiftwidth=2
|
||||
|
||||
|
||||
" ]] / Close current delimiter or environment
|
||||
call vimtex#test#keys('A]]',
|
||||
\ '$\bigl( \left. a \right) ',
|
||||
\ '$\bigl( \left. a \right) \bigr)')
|
||||
call vimtex#test#keys('Go]]', [
|
||||
\ '\documentclass{article}',
|
||||
\ '\usepackage{stackengine}',
|
||||
\ '\begin{document}',
|
||||
\ '\begin{equation}',
|
||||
\ ' \begin{array}{c}',
|
||||
\ ' a = \stackunder{p6mm}{',
|
||||
\ ' \left\{ b \right.',
|
||||
\ ' }',
|
||||
\], [
|
||||
\ '\documentclass{article}',
|
||||
\ '\usepackage{stackengine}',
|
||||
\ '\begin{document}',
|
||||
\ '\begin{equation}',
|
||||
\ ' \begin{array}{c}',
|
||||
\ ' a = \stackunder{p6mm}{',
|
||||
\ ' \left\{ b \right.',
|
||||
\ ' }',
|
||||
\ ' \end{array}',
|
||||
\])
|
||||
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,12 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
|
||||
" dsc / Delete surrounding command
|
||||
call vimtex#test#keys('dsc', '\cmd{foo}', 'foo')
|
||||
call vimtex#test#keys("f{ldsc", '$ \ce{a > b} $', '$ a > b $')
|
||||
call vimtex#test#keys("f}hdsc", '$ \ce{a > b} $', '$ a > b $')
|
||||
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,15 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
|
||||
" dse / Delete surrounding environment
|
||||
call vimtex#test#keys('dsedse',
|
||||
\[
|
||||
\ '\begin{test}',
|
||||
\ ' \begin{center} a \end{center}',
|
||||
\ '\end{test}',
|
||||
\], ' a ')
|
||||
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,30 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
syntax on
|
||||
|
||||
|
||||
" ds$ / Delete surrounding math ($...$ and \[...\])
|
||||
call vimtex#test#keys('f$ds$',
|
||||
\ 'for $ 2+2 = 4 = 3 $ etter',
|
||||
\ 'for 2+2 = 4 = 3 etter')
|
||||
call vimtex#test#keys('jds$',
|
||||
\[
|
||||
\ 'asd $',
|
||||
\ '2+2 = 4',
|
||||
\ '$ asd',
|
||||
\],
|
||||
\[
|
||||
\ 'asd',
|
||||
\ '2+2 = 4',
|
||||
\ 'asd',
|
||||
\])
|
||||
call vimtex#test#keys('ds$',
|
||||
\[
|
||||
\ '\[',
|
||||
\ '2+2 = 4',
|
||||
\ '\]',
|
||||
\], '2+2 = 4')
|
||||
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,23 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
|
||||
" tsd / Toggle surrounding delimiter
|
||||
call vimtex#test#keys('3jtsd', [
|
||||
\ '$\bigl(\begin{smallmatrix}',
|
||||
\ ' \Q^* & \\',
|
||||
\ ' & 1 \\',
|
||||
\ '\end{smallmatrix}\bigr)$',
|
||||
\], [
|
||||
\ '$(\begin{smallmatrix}',
|
||||
\ ' \Q^* & \\',
|
||||
\ ' & 1 \\',
|
||||
\ '\end{smallmatrix})$',
|
||||
\])
|
||||
|
||||
" Cf. #1620
|
||||
call vimtex#test#keys('f+tsd', '\( a^2 + b^2 = c^2 \)', '\( a^2 + b^2 = c^2 \)')
|
||||
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,14 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
|
||||
" F7 / Insert command (insert mode, normal mode and visual mode)
|
||||
call vimtex#test#keys("lla\<f7>}", 'foobar', '\foo{bar}')
|
||||
call vimtex#test#keys("llla\<f7>bar}", 'foo*', '\foo*{bar}')
|
||||
call vimtex#test#keys("llla\<f7>}", 'foo*bar', '\foo*{bar}')
|
||||
call vimtex#test#keys("fbve\<f7>emph\<cr>", 'foobar', 'foo\emph{bar}')
|
||||
call vimtex#test#keys("\<f7>emph\<cr>", 'foo', '\emph{foo}')
|
||||
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,16 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
|
||||
" tsb / Toggle line break
|
||||
for [s:in, s:out] in [
|
||||
\ ['abc', 'abc \\'],
|
||||
\ [' a + b = c', ' a + b = c \\'],
|
||||
\ ['abc \\', 'abc'],
|
||||
\ ['abc\\', 'abc'],
|
||||
\]
|
||||
call vimtex#test#keys('tsb', s:in, s:out)
|
||||
endfor
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,28 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
let g:vimtex_toggle_fractions = {
|
||||
\ 'INLINE': 'frac',
|
||||
\ 'frac': 'dfrac',
|
||||
\ 'dfrac': 'cfrac',
|
||||
\ 'cfrac': 'INLINE',
|
||||
\}
|
||||
|
||||
|
||||
" tsf / Toggle surrounding fraction
|
||||
for [s:in, s:out] in [
|
||||
\ ['$x / (x-1)$', '$\frac{x}{x-1}$'],
|
||||
\ ['$\frac{x}{x-1}$', '$\dfrac{x}{x-1}$'],
|
||||
\ ['$\dfrac{x}{x-1}$', '$\cfrac{x}{x-1}$'],
|
||||
\ ['$\cfrac{x}{x-1}$', '$x/(x-1)$'],
|
||||
\]
|
||||
if s:in =~# '\/'
|
||||
call vimtex#test#keys('f/ltsf', s:in, s:out)
|
||||
call vimtex#test#keys('f/htsf', s:in, s:out)
|
||||
else
|
||||
call vimtex#test#keys('f{tsf', s:in, s:out)
|
||||
endif
|
||||
endfor
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,58 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
|
||||
" tsf / Toggle surrounding fraction
|
||||
for [s:in, s:out] in [
|
||||
\ ['$e^{a/b}$', '$e^{\frac{a}{b}}$'],
|
||||
\ ['$n^{1/2}$', '$n^{\frac{1}{2}}$'],
|
||||
\ ['$n^{-1/2}$', '$n^{-\frac{1}{2}}$'],
|
||||
\ ['$(0/q)$', '$(\frac{0}{q})$'],
|
||||
\ ['$\frac{x+1}{x-1}$', '$(x+1)/(x-1)$'],
|
||||
\ ['$\frac {x+1} {x-1}$', '$(x+1)/(x-1)$'],
|
||||
\ ['$\frac {x-1} x$', '$(x-1)/x$'],
|
||||
\ ['$\frac x {x-1}$', '$x/(x-1)$'],
|
||||
\ ['$x / (x-1)$', '$\frac{x}{x-1}$'],
|
||||
\ ['$(x-1) /x$', '$\frac{x-1}{x}$'],
|
||||
\ ['$(x+1) /(x-1)$', '$\frac{x+1}{x-1}$'],
|
||||
\ ['$(x+1)/ (x-1)$', '$\frac{x+1}{x-1}$'],
|
||||
\ ['$\alpha/\mu$', '$\frac{\alpha}{\mu}$'],
|
||||
\ ['$\frac{\alpha}{\mu}$', '$\alpha/\mu$'],
|
||||
\ ['$(r+t)/((\mu))$', '$\frac{r+t}{(\mu)}$'],
|
||||
\ ['$((\mu))/(r+t)$', '$\frac{(\mu)}{r+t}$'],
|
||||
\ ['$\frac{\delta_{02}}{\delta_{02} + \delta_{01}}$',
|
||||
\ '$(\delta_{02})/(\delta_{02} + \delta_{01})$'],
|
||||
\ ['$(\delta_{02})/(\delta_{02} + \delta_{01})$',
|
||||
\ '$\frac{\delta_{02}}{\delta_{02} + \delta_{01}}$'],
|
||||
\ ['\(a/p_\text{b}\)', '\(\frac{a}{p_\text{b}}\)'],
|
||||
\ ['$f(x+y)/g(z)$', '$\frac{f(x+y)}{g(z)}$'],
|
||||
\ ['$f(x)g(y)/h(z)$', '$f(x)\frac{g(y)}{h(z)}$'],
|
||||
\ ['$\dfrac{x+1}{x-1}$', '$(x+1)/(x-1)$'],
|
||||
\]
|
||||
if s:in =~# '\/'
|
||||
call vimtex#test#keys('f/ltsf', s:in, s:out)
|
||||
call vimtex#test#keys('f/htsf', s:in, s:out)
|
||||
else
|
||||
call vimtex#test#keys('f{tsf', s:in, s:out)
|
||||
endif
|
||||
endfor
|
||||
|
||||
" tsf / Toggle surrounding fraction (visual mode)
|
||||
call vimtex#test#keys('f$lvf$htsf',
|
||||
\ 'testing $inline frac / something$ more text',
|
||||
\ 'testing $\frac{inline frac}{something}$ more text')
|
||||
call vimtex#test#keys('f/bvf$htsf',
|
||||
\ 'testing $inline frac / something$ more text',
|
||||
\ 'testing $inline \frac{frac}{something}$ more text')
|
||||
call vimtex#test#keys('f/bvtttsf',
|
||||
\ 'testing $inline frac / something$ more text',
|
||||
\ 'testing $inline \frac{frac}{some}thing$ more text')
|
||||
call vimtex#test#keys('f(v$hhtsf',
|
||||
\ '$(\delta_{02})/(\delta_{02} + \delta_{01})$',
|
||||
\ '$\frac{\delta_{02}}{\delta_{02} + \delta_{01}}$')
|
||||
call vimtex#test#keys('f\v$hhtsf',
|
||||
\ '$\frac{\delta_{02}}{\delta_{02} + \delta_{01}}$',
|
||||
\ '$(\delta_{02})/(\delta_{02} + \delta_{01})$')
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,19 @@
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
TESTS := $(wildcard test*.vim)
|
||||
|
||||
.PHONY: dummy test $(TESTS)
|
||||
|
||||
test: $(TESTS)
|
||||
|
||||
$(TESTS):
|
||||
@$(MYVIM) -u $@
|
||||
|
||||
|
||||
dummy:
|
||||
@echo Compiling...
|
||||
@echo SillyWalks
|
||||
@echo Compiling...Done!
|
||||
@ -0,0 +1,4 @@
|
||||
\documentclass{minimal}
|
||||
\begin{document}
|
||||
Hello world!
|
||||
\end{document}
|
||||
@ -0,0 +1,32 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:test = 0
|
||||
|
||||
function! Callback(msg)
|
||||
if a:msg =~# 'SillyWalk'
|
||||
let g:test = 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let g:vimtex_view_automatic = 0
|
||||
let g:vimtex_compiler_method = 'generic'
|
||||
let g:vimtex_compiler_generic = {
|
||||
\ 'command': 'make dummy',
|
||||
\ 'hooks': [function('Callback')],
|
||||
\}
|
||||
|
||||
call vimtex#log#set_silent()
|
||||
|
||||
silent edit test.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
call vimtex#compiler#start()
|
||||
call b:vimtex.compiler.wait()
|
||||
call assert_equal(1, g:test)
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,13 @@
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
TESTS := $(wildcard test*.vim)
|
||||
|
||||
.PHONY: test $(TESTS)
|
||||
|
||||
test: $(TESTS)
|
||||
|
||||
$(TESTS):
|
||||
@$(MYVIM) -u $@
|
||||
@ -0,0 +1,5 @@
|
||||
% arara: pdflatex
|
||||
\documentclass{minimal}
|
||||
\begin{document}
|
||||
Hello world!
|
||||
\end{document}
|
||||
@ -0,0 +1,4 @@
|
||||
\documentclass{minimal}
|
||||
\begin{document}
|
||||
Hello world!
|
||||
\end{document}
|
||||
@ -0,0 +1,30 @@
|
||||
set nocompatible
|
||||
set runtimepath^=../..
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
function! SetCompilerMethod(mainfile)
|
||||
if filereadable(a:mainfile)
|
||||
for line in readfile(a:mainfile, '', 5)
|
||||
if line =~# '^%\s*arara'
|
||||
return 'arara'
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
return 'latexmk'
|
||||
endfunction
|
||||
|
||||
let g:vimtex_compiler_method = 'SetCompilerMethod'
|
||||
|
||||
silent edit test-arara.tex
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
|
||||
call assert_equal('arara', b:vimtex.compiler.name)
|
||||
|
||||
silent edit test-fallback.tex
|
||||
call assert_equal('latexmk', b:vimtex.compiler.name)
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,11 @@
|
||||
MYVIM ?= nvim --clean --headless
|
||||
MAKEFLAGS+=--no-print-directory
|
||||
|
||||
TESTS := $(wildcard test-*)
|
||||
|
||||
.PHONY: test $(TESTS)
|
||||
|
||||
test: $(TESTS)
|
||||
|
||||
$(TESTS):
|
||||
$(MAKE) -C $@
|
||||
@ -0,0 +1,9 @@
|
||||
.PHONY: test
|
||||
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
test:
|
||||
@$(MYVIM) -u test.vim
|
||||
@ -0,0 +1,3 @@
|
||||
$pdf_mode = 4; # compile with lualatex
|
||||
|
||||
# vim: ft=perl
|
||||
@ -0,0 +1,9 @@
|
||||
% The following TeX program directive is not consistent with the value of
|
||||
% $pdf_mode in latexmkrc, therefore a warning message is expected.
|
||||
|
||||
%! TEX program = xelatex
|
||||
|
||||
\documentclass{minimal}
|
||||
\begin{document}
|
||||
Hello world!
|
||||
\end{document}
|
||||
@ -0,0 +1,23 @@
|
||||
set nocompatible
|
||||
let &rtp = '../../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
call vimtex#log#set_silent()
|
||||
|
||||
if empty($INMAKE)
|
||||
edit main.tex
|
||||
finish
|
||||
else
|
||||
silent edit main.tex
|
||||
endif
|
||||
|
||||
" Get engine
|
||||
let s:engine = b:vimtex.compiler.get_engine()
|
||||
|
||||
let s:warnings = vimtex#log#get()
|
||||
call assert_equal(len(s:warnings), 1)
|
||||
call assert_match('pdf_mode.*inconsistent', join(s:warnings[0].msg))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,9 @@
|
||||
.PHONY: test
|
||||
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
test:
|
||||
@$(MYVIM) -u test.vim
|
||||
@ -0,0 +1 @@
|
||||
$pdf_mode = 2;
|
||||
@ -0,0 +1,10 @@
|
||||
\documentclass{minimal}
|
||||
\usepackage{pst-node}
|
||||
\begin{document}
|
||||
|
||||
Hello World!
|
||||
|
||||
\begin{pspicture}(4,4)\psgrid
|
||||
\pscircle(2,2){2}
|
||||
\end{pspicture}
|
||||
\end{document}
|
||||
@ -0,0 +1,20 @@
|
||||
set nocompatible
|
||||
let &rtp = '../../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
set nomore
|
||||
|
||||
let g:vimtex_view_automatic = 0
|
||||
|
||||
if empty($INMAKE)
|
||||
edit main.tex
|
||||
finish
|
||||
else
|
||||
silent edit main.tex
|
||||
endif
|
||||
|
||||
call assert_equal('-pdfps', b:vimtex.compiler.get_engine())
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,15 @@
|
||||
.PHONY: test
|
||||
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
test: output1 output2 output3
|
||||
@diff output1.tex reference1.tex
|
||||
@diff output2.tex reference2.tex
|
||||
@diff output3.tex reference3.tex
|
||||
@rm -f output*.tex
|
||||
|
||||
output%:
|
||||
@$(MYVIM) -u test.vim
|
||||
@ -0,0 +1,5 @@
|
||||
\newenvironment{LRmath}{
|
||||
\def\E{}
|
||||
\renewcommand{\E}[2][]{\ensuremath\mathrm{E}_{##1}\!\left[##2\right]}
|
||||
\def\PP{\ensuremath\mathrm{P}}
|
||||
}{}
|
||||
@ -0,0 +1,13 @@
|
||||
\documentclass[14pt]{article}
|
||||
|
||||
\def\E{}
|
||||
\renewcommand{\E}[2][]{\ensuremath\mathrm{E}_{#1}\!\left[#2\right]}
|
||||
\def\PP{\ensuremath\mathrm{P}}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{equation}
|
||||
\PP[x\le y] = \E[x]{\max(y-x,0)/(y-x)}
|
||||
\end{equation}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,13 @@
|
||||
\documentclass[12pt]{article}
|
||||
|
||||
\newenvironment{LRmath}{
|
||||
\def\E{}
|
||||
\renewcommand{\E}[2][]{\ensuremath\mathrm{E}_{##1}\!\left[##2\right]}
|
||||
\def\PP{\ensuremath\mathrm{P}}
|
||||
}{}
|
||||
|
||||
\begin{document}
|
||||
\begin{equation}
|
||||
\PP[x\le y] = \E[x]{\max(y-x,0)/(y-x)}
|
||||
\end{equation}
|
||||
\end{document}
|
||||
@ -0,0 +1,18 @@
|
||||
\documentclass[14pt]{article}
|
||||
|
||||
\def\E{}
|
||||
\renewcommand{\E}[2][]{\ensuremath\mathrm{E}_{#1}\!\left[#2\right]}
|
||||
\def\PP{\ensuremath\mathrm{P}}
|
||||
|
||||
\begin{document}
|
||||
|
||||
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.
|
||||
|
||||
\begin{equation}
|
||||
\PP[x\le y] = \E[x]{\max(y-x,0)/(y-x)}
|
||||
\end{equation}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,16 @@
|
||||
\documentclass[14pt]{article}
|
||||
|
||||
\def\E{}
|
||||
\renewcommand{\E}[2][]{\ensuremath\mathrm{E}_{#1}\!\left[#2\right]}
|
||||
\def\PP{\ensuremath\mathrm{P}}
|
||||
|
||||
\begin{document}
|
||||
|
||||
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.
|
||||
|
||||
%%% VIMTEX PLACEHOLDER
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,17 @@
|
||||
\documentclass[12pt]{article}
|
||||
|
||||
\input{inputfile}
|
||||
|
||||
\begin{document}
|
||||
\begin{LRmath}
|
||||
|
||||
Text, Text, Text
|
||||
|
||||
\begin{equation}
|
||||
\PP[x\le y] = \E[x]{\max(y-x,0)/(y-x)}
|
||||
\end{equation}
|
||||
|
||||
Text, Text, Text
|
||||
|
||||
\end{LRmath}
|
||||
\end{document}
|
||||
@ -0,0 +1,26 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
set nomore
|
||||
|
||||
silent edit test.tex
|
||||
|
||||
call vimtex#parser#selection_to_texfile({
|
||||
\ 'range': [10, 12],
|
||||
\ 'name': 'output1',
|
||||
\})
|
||||
|
||||
call vimtex#parser#selection_to_texfile({
|
||||
\ 'range': [10, 12],
|
||||
\ 'name': 'output2',
|
||||
\ 'template_name': 'NONE',
|
||||
\})
|
||||
|
||||
call vimtex#parser#selection_to_texfile({
|
||||
\ 'range': [10, 12],
|
||||
\ 'name': 'output3',
|
||||
\ 'template_name': 'template.tex',
|
||||
\})
|
||||
|
||||
quitall!
|
||||
@ -0,0 +1,11 @@
|
||||
\documentclass[14pt]{article}
|
||||
|
||||
\def\E{}
|
||||
\renewcommand{\E}[2][]{\ensuremath\mathrm{E}_{#1}\!\left[#2\right]}
|
||||
\def\PP{\ensuremath\mathrm{P}}
|
||||
|
||||
\begin{document}
|
||||
|
||||
%%% VIMTEX PLACEHOLDER
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,37 @@
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
TESTS := $(wildcard test*.vim)
|
||||
TESTS := $(filter-out test-backend,$(TESTS:.vim=))
|
||||
|
||||
.PHONY: test $(TESTS)
|
||||
|
||||
test: test-backend $(TESTS) prepare-test-clean
|
||||
|
||||
$(TESTS):
|
||||
@$(MYVIM) -u $@.vim
|
||||
|
||||
test-backend: latexrun
|
||||
@PATH=$$PATH:. chronic $(MYVIM) -u $@.vim
|
||||
@rm -f minimal.*
|
||||
@rm -f pdflatex*.fls
|
||||
@rm -f .latexrun.db.lock
|
||||
@rm -rf out
|
||||
|
||||
test-clean: prepare-test-clean
|
||||
|
||||
prepare-test-clean:
|
||||
@touch test-clean.log
|
||||
@touch test-clean.aux
|
||||
@touch test-clean.pdf
|
||||
@touch generated-extra_files.out
|
||||
@mkdir -p _minted-test-clean
|
||||
@touch _minted-test-clean/stuffhere
|
||||
|
||||
latexrun:
|
||||
@wget \
|
||||
https://raw.githubusercontent.com/aclements/latexrun/master/latexrun \
|
||||
>/dev/null 2>&1
|
||||
@chmod u+x latexrun
|
||||
@ -0,0 +1,108 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
set nomore
|
||||
|
||||
let g:vimtex_view_automatic = 0
|
||||
let g:vimtex_log_verbose = 0
|
||||
|
||||
function! RunTests(comp, list_opts)
|
||||
if !executable(a:comp)
|
||||
echo 'Warning! "' . a:comp . '" was not executable!'
|
||||
echo "Compiler tests could not run!\n\n"
|
||||
cquit
|
||||
endif
|
||||
|
||||
let g:vimtex_compiler_method = a:comp
|
||||
|
||||
for l:opts in a:list_opts
|
||||
let g:vimtex_compiler_{a:comp} = l:opts
|
||||
|
||||
" Ensure there is no latexmk process before we start the test
|
||||
if a:comp ==# 'latexmk'
|
||||
call system('pkill -f latexmk')
|
||||
endif
|
||||
|
||||
echo 'Testing compiler "' . a:comp . '"'
|
||||
if !empty(l:opts)
|
||||
echon ' with options:'
|
||||
for [l:key, l:val] in items(l:opts)
|
||||
echo '* ' . l:key . ' =' l:val . "\n"
|
||||
endfor
|
||||
endif
|
||||
|
||||
for l:file in glob('minimal.*', 1, 1)
|
||||
call delete(l:file)
|
||||
endfor
|
||||
call writefile([
|
||||
\ '\documentclass{minimal}',
|
||||
\ '\begin{document}',
|
||||
\ 'Hello World!',
|
||||
\ '\end{document}',
|
||||
\], 'minimal.tex')
|
||||
|
||||
silent edit minimal.tex
|
||||
|
||||
" Check if the compiler was loaded
|
||||
if !has_key(b:vimtex, 'compiler')
|
||||
echo "Compiler failed to load!\n"
|
||||
cquit
|
||||
endif
|
||||
|
||||
silent call vimtex#compiler#compile()
|
||||
sleep 650m
|
||||
|
||||
" Check if continuous mode is active
|
||||
if get(b:vimtex.compiler, 'continuous')
|
||||
if !b:vimtex.compiler.get_pid()
|
||||
echo "Could not get PID for compiler\n"
|
||||
cquit
|
||||
endif
|
||||
|
||||
silent call vimtex#compiler#stop()
|
||||
else
|
||||
sleep 450m
|
||||
endif
|
||||
|
||||
" Check that the PDF has been built
|
||||
if empty(b:vimtex.compiler.get_file('pdf'))
|
||||
echo "PDF was not built properly\n"
|
||||
cquit
|
||||
endif
|
||||
|
||||
silent call vimtex#compiler#clean(1)
|
||||
sleep 650m
|
||||
|
||||
if !empty(b:vimtex.compiler.get_file('pdf'))
|
||||
\ || !empty(b:vimtex.compiler.get_file('aux'))
|
||||
echo "VimtexClean failed!\n"
|
||||
cquit
|
||||
endif
|
||||
|
||||
if !empty(get(l:opts, 'out_dir', ''))
|
||||
call delete(l:opts.out_dir, 'rf')
|
||||
endif
|
||||
|
||||
echo "\n"
|
||||
bwipeout
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
for [s:comp, s:opts] in items({
|
||||
\ 'latexmk' : [
|
||||
\ {},
|
||||
\ {'out_dir' : 'out'},
|
||||
\ {'callback' : 0},
|
||||
\ {'callback' : 0, 'continuous' : 0},
|
||||
\ {'continuous' : 0},
|
||||
\ ],
|
||||
\ 'latexrun' : [
|
||||
\ {},
|
||||
\ {'out_dir' : 'out'},
|
||||
\ ],
|
||||
\})
|
||||
call RunTests(s:comp, s:opts)
|
||||
endfor
|
||||
|
||||
quitall!
|
||||
@ -0,0 +1,4 @@
|
||||
\documentclass{minimal}
|
||||
\begin{document}
|
||||
Hello World! \failed
|
||||
\end{document}
|
||||
@ -0,0 +1,33 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
let g:status = 0
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_compiler_latexmk = {'out_dir': 'build'}
|
||||
|
||||
call vimtex#log#set_silent()
|
||||
|
||||
augroup test_builddir
|
||||
autocmd!
|
||||
autocmd User VimtexEventCompileSuccess let g:status = 1
|
||||
autocmd User VimtexEventCompileFailed let g:status = 2
|
||||
augroup END
|
||||
|
||||
silent edit test-builddir.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
silent VimtexCompileSS
|
||||
|
||||
let s:n = 0
|
||||
while g:status < 1 && s:n < 100
|
||||
sleep 20m
|
||||
let s:n += 1
|
||||
endwhile
|
||||
|
||||
call assert_equal(2, g:status)
|
||||
|
||||
silent VimtexClean!
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,28 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_compiler_method = 'arara'
|
||||
let g:vimtex_compiler_clean_paths = [
|
||||
\ '_minted*',
|
||||
\ 'generated*files*',
|
||||
\]
|
||||
|
||||
" call vimtex#log#set_silent()
|
||||
|
||||
silent edit test-clean.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
silent VimtexClean!
|
||||
|
||||
call assert_false(filereadable('test-clean.log'))
|
||||
call assert_false(filereadable('test-clean.aux'))
|
||||
call assert_false(filereadable('test-clean.pdf'))
|
||||
call assert_false(filereadable('generated-extra_files.out'))
|
||||
call assert_false(isdirectory('_minted-test-clean'))
|
||||
call assert_false(filereadable('_minted-test-clean/stuffhere'))
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,9 @@
|
||||
.PHONY: test
|
||||
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
test:
|
||||
@$(MYVIM) -u test.vim
|
||||
@ -0,0 +1,9 @@
|
||||
\documentclass{article}
|
||||
\usepackage{natbib}
|
||||
|
||||
\begin{document}
|
||||
|
||||
% Test completion of bibliographystyles
|
||||
\bibliographystyle{}
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,16 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
set nomore
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
silent edit main.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
let s:candidates = vimtex#test#completion('\bibliographystyle{', '')
|
||||
call assert_true(index(map(s:candidates, 'v:val.word'), 'unsrt') > 0)
|
||||
|
||||
call vimtex#test#finished()
|
||||
@ -0,0 +1,11 @@
|
||||
.PHONY: test
|
||||
|
||||
MYVIM ?= nvim --clean --headless
|
||||
|
||||
test:
|
||||
@INMAKE=1 BACKEND=bibtex $(MYVIM) -u bibspeed.vim
|
||||
@INMAKE=1 BACKEND=vim $(MYVIM) -u bibspeed.vim
|
||||
@INMAKE=1 BACKEND=lua $(MYVIM) -u bibspeed.vim
|
||||
@#INMAKE=1 BACKEND=bibparse $(MYVIM) -u bibspeed.vim
|
||||
@#INMAKE=1 BACKEND=bibtexparser $(MYVIM) -u bibspeed.vim
|
||||
@rm -f nvim_servernames.log
|
||||
@ -0,0 +1,18 @@
|
||||
\documentclass{article}
|
||||
% \usepackage[square,sort,comma,numbers]{natbib}
|
||||
|
||||
\usepackage{biblatex}
|
||||
\addbibresource{../common/huge.bib}
|
||||
\addbibresource{../common/local1.bib}
|
||||
\addbibresource{../common/local2.bib}
|
||||
\addbibresource{biblatex-examples.bib}
|
||||
|
||||
\begin{document}
|
||||
|
||||
Hello World!~\cite{AndersonHowCanHuman2009}
|
||||
|
||||
% \bibliographystyle{elsarticle-num}
|
||||
% \bibliography{../common/huge.bib,../common/local1.bib,../common/local2.bib,biblatex-examples.bib}
|
||||
\printbibliography
|
||||
|
||||
\end{document}
|
||||
@ -0,0 +1,41 @@
|
||||
set nocompatible
|
||||
let &rtp = '../..,' . &rtp
|
||||
filetype plugin on
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
|
||||
let g:vimtex_cache_root = '.'
|
||||
let g:vimtex_cache_persistent = 0
|
||||
if !empty($BACKEND)
|
||||
let g:vimtex_parser_bib_backend = $BACKEND
|
||||
endif
|
||||
|
||||
silent edit bibspeed.tex
|
||||
|
||||
if empty($INMAKE) | finish | endif
|
||||
|
||||
if g:vimtex_parser_bib_backend ==# 'lua' && !has('nvim')
|
||||
call vimtex#test#finished()
|
||||
endif
|
||||
|
||||
normal! 10G
|
||||
|
||||
" execute 'profile start' 'bibspeed-' . g:vimtex_parser_bib_backend . '.log'
|
||||
" profile func *
|
||||
|
||||
let s:time = vimtex#profile#time()
|
||||
silent call vimtex#test#completion('\cite{', '')
|
||||
echo 'Backend:' toupper(g:vimtex_parser_bib_backend)
|
||||
let s:time = vimtex#profile#time(s:time, 'Time elapsed (1st run)')
|
||||
|
||||
" profile pause
|
||||
|
||||
call vimtex#test#completion('\cite{', '')
|
||||
let s:time = vimtex#profile#time(s:time, 'Time elapsed (2nd run)')
|
||||
|
||||
let s:candidates = vimtex#test#completion('\cite{', '')
|
||||
let s:time = vimtex#profile#time(s:time, 'Time elapsed (3rd run)')
|
||||
echo 'Number of candidates:' len(s:candidates)
|
||||
echo "\n"
|
||||
|
||||
quit!
|
||||
1
config/neovim/store/lazy-plugins/vimtex/test/test-completion-bibtex/.gitignore
vendored
Normal file
1
config/neovim/store/lazy-plugins/vimtex/test/test-completion-bibtex/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
test_parser_*
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user