我正在使用neosnippet
为latex
模板创建一个片段。该片段相当长,E745 Using a List as a Number
当我尝试扩展该片段时,我不断收到一个奇怪的错误。
这是 neovim 发出的错误消息。
[dein] Error occurred while executing hook: neosnippet.vim
[dein] Vim(let):E745: Using a List as a Number
Error detected while processing function <SNR>346 snippets_expand ...
Line 11
E15: invalid expression:
E15: invalid expression
实际的片段本身在下面——它很长。现在,当我从片段文件中取出这个长片段时,所有其他片段都可以正常工作。所以似乎我在某处使用了我不应该使用的角色或其他东西。或者也许某些东西没有正确逃脱,等等。
我所有其他的乳胶片段都可以正常工作,但也有更短的。有没有人知道为什么这个片段会造成这么多麻烦?
这是乳胶片段。
\documentclass{book}
\addtolength{\topmargin}{-.5in}
\addtolength{\headsep}{.5in}
\oddsidemargin=.5in
\evensidemargin=.5in
\textwidth=5.5in
\usepackage{
amsmath,% AMS basic math stuff
amsthm,% AMS theorem defining stuff
amsfonts,% defines the blackboard bold fonts for \Z, \R, etc
longtable,% used to create the tcproof environment below
verbatim,% allows for verbatim output, and also covering up stuff in comments
xspace,% adds an extra space an the end of some commands
multicol,% allows multicolumn output
tikz,% creates the tikzpicture drawing environment
charter,% changes the default font to charter
framed,% used to color in the TIscreen environment below
bm,
mathrsfs}
\usepackage{pifont}
\usepackage[colorlinks,unicode]{hyperref}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Tau}{\bm{\mathcal{T}}}
\newcommand{\Taup}{\bm{\mathcal{T}^{\prime}}}
\newcommand{\Bp}{\mathscr{B}^{\prime}}
\newcommand{\B}{\mathscr{B}}
\newcommand{\CCp}{\mathscr{C}^{\prime}}
\newcommand{\CC}{\mathscr{C}}
\newcommand{\Ltop}{\R_{\mathscr{L}}}
\newcommand{\Ktop}{\R_{\mathscr{K}}}
\DeclareMathOperator{\lcm}{lcm}
\newcommand{\cl}[1]{[#1]}
\newcommand{\st}{\mid}
\newcommand{\eq}{\stackrel{?}{=}}
\newcommand{\divq}{\stackrel{?}{|}}
\newcommand{\forwards}{\mbox{``$\Longrightarrow$''}\xspace}
\newcommand{\backwards}{\mbox{``$\Longleftarrow$''}\xspace}
\newcommand{\define}[1]{\textbf{#1}}
\newcommand{\threeven}{pretty\xspace}
\newcommand{\throd}{normal\xspace}
\newcommand{\throve}{ugly\xspace}
\DeclareMathSymbol{\nmid}{\mathrel}{AMSb}{"2D}
\newcommand{\notdiv}{\nmid}
\renewcommand{\tilde}{\widetilde}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\def\endclass#1{\par\noindent\hrulefill\fbox{\tiny This is where we
ended on #1}\hrulefill\vskip 5pt plus 1pt\par }
\pagestyle{headings}
\makeatletter
\edef\today{%
\the\year/\two@digits{\the\month}/\two@digits{\the\day}}
\renewcommand{\@evenhead}{\emph{Ordinary Differential Equations - Arnold}
(v. \today)
\hfill Krishna Bhogaonker \hfill \thepage}
\renewcommand{\@oddhead}{(version \today) \hfill \thepage}
\makeatother
\DeclareMathSymbol{\varnothing}{\mathord}{AMSb}{"3F}
\renewcommand{\emptyset}{\varnothing}
\colorlet{shadecolor}{gray!35}
\newenvironment{TIscreen}
{\begin{center}\tt
\renewcommand{\in}[1]{##1\\}
\newcommand{\out}[1]{\mbox{}\hfill##1\\}
\begin{minipage}{2in}\begin{snugshade}}
{\end{snugshade}\end{minipage}\end{center}}
\newenvironment{tcproof}[1]
{\smallskip\par\begin{longtable}{@{}p{.45\textwidth}p{.45\textwidth}@{}}
\multicolumn{2}{@{}l}{\emph{#1}}\\[\smallskipamount]
Assertion & Justification \endfirsthead
Assertion & Justification \endhead
\hline }
{\end{longtable}\qed\smallskip\par}
\newtheorem{lemma}{Lemma}[section]
\newtheorem{theorem}[lemma]{Theorem}
\newtheorem{cor}[lemma]{Corollary}
\newtheorem*{scholium}{Scholium}
\theoremstyle{definition}
\newtheorem{definition}[lemma]{Definition}
\newtheorem{example}[lemma]{Example}
\newenvironment{comments}{}{}
\makeatletter
\define@key{hide}{scholium}[true]{\renewenvironment{scholium}{\comment}{\endcomment}}
\define@key{hide}{proof}[true]{\renewenvironment{proof}{\comment}{\endcomment}}
\define@key{hide}{lemma}[true]{\renewenvironment{lemma}{\comment}{\endcomment}}
\define@key{hide}{comments}[true]{\renewenvironment{comments}{\comment}{\endcomment}}
\define@key{hide}{cor}[true]{\renewenvironment{cor}{\comment}{\endcomment}}
\define@key{hide}{definition}[true]{\renewenvironment{definition}{\comment}{\endcomment}}
\define@key{hide}{example}[true]{\renewenvironment{example}{\comment}{\endcomment}}
\define@key{hide}{theorem}[true]{\renewenvironment{theorem}{\comment}{\endcomment}}
\newcommand{\HideEnvirons}[1]{\setkeys{hide}{#1}}
\define@key{show}{scholium}[true]{\define@key{hide}{scholium}{}}
\define@key{show}{proof}[true]{\define@key{hide}{proof}{}}
\define@key{show}{lemma}[true]{\define@key{hide}{lemma}{}}
\define@key{show}{comments}[true]{\define@key{hide}{comments}{}}
\define@key{show}{cor}[true]{\define@key{hide}{cor}{}}
\define@key{show}{definition}[true]{\define@key{hide}{definition}{}}
\define@key{show}{example}[true]{\define@key{hide}{example}{}}
\define@key{show}{theorem}[true]{\define@key{hide}{theorem}{}}
\newcommand{\ShowEnvirons}[1]
{\setkeys{show}{#1}\HideEnvirons{%
comments,
cor,
definition,
example,
proof,
theorem,
lemma,
scholium
}}
\makeatother
\begin{document}
\tableofcontents
\newpage
\chapter{Basic Concepts}
${0}
\end{document}