2017-09-18 295 views
1

我使用neosnippetlatex模板创建片段。这段代码相当长,当我尝试展开代码段时,我一直在收到奇怪的错误E745 Using a List as a NumberVim错误E745在`neosnippet`中创建`Latex`片段时'使用列表作为数字'

以下是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/\[email protected]{\the\month}/\[email protected]{\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 

    \[email protected]{hide}{scholium}[true]{\renewenvironment{scholium}{\comment}{\endcomment}} 
    \[email protected]{hide}{proof}[true]{\renewenvironment{proof}{\comment}{\endcomment}} 
    \[email protected]{hide}{lemma}[true]{\renewenvironment{lemma}{\comment}{\endcomment}} 
    \[email protected]{hide}{comments}[true]{\renewenvironment{comments}{\comment}{\endcomment}} 
    \[email protected]{hide}{cor}[true]{\renewenvironment{cor}{\comment}{\endcomment}} 
    \[email protected]{hide}{definition}[true]{\renewenvironment{definition}{\comment}{\endcomment}} 
    \[email protected]{hide}{example}[true]{\renewenvironment{example}{\comment}{\endcomment}} 
    \[email protected]{hide}{theorem}[true]{\renewenvironment{theorem}{\comment}{\endcomment}} 

\newcommand{\HideEnvirons}[1]{\setkeys{hide}{#1}} 


    \[email protected]{show}{scholium}[true]{\[email protected]{hide}{scholium}{}} 
    \[email protected]{show}{proof}[true]{\[email protected]{hide}{proof}{}} 
    \[email protected]{show}{lemma}[true]{\[email protected]{hide}{lemma}{}} 
    \[email protected]{show}{comments}[true]{\[email protected]{hide}{comments}{}} 
    \[email protected]{show}{cor}[true]{\[email protected]{hide}{cor}{}} 
    \[email protected]{show}{definition}[true]{\[email protected]{hide}{definition}{}} 
    \[email protected]{show}{example}[true]{\[email protected]{hide}{example}{}} 
    \[email protected]{show}{theorem}[true]{\[email protected]{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} 

回答

0

好的,我与开发人员交谈过,他表示问题与本文档中的反引号有关。

\newcommand{\forwards}{\mbox{````$\Longrightarrow$''}\xspace} 
\newcommand{\backwards}{\mbox{````$\Longleftarrow$''}\xspace} 

我更新了neosnippet插件,也改变了latex代码。现在事情工作正常。