\newcomand 导致失败

\newcomand 导致失败

我是 Latex 的新手,请简单解释一下;)我正在使用 miktex 上最新的 latex 版本

\newcommand今天尝试了一些,并导致此命令出错:\newcommand{\N0}{ n_{0} }。当我删除此命令时,故障消失,所以这看起来像是一个错误。但作为 Windows 用户,我知道大多数时候问题出在电脑前。错误消息如下:

! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.34 \newcommand{\N0}[1]{ n_{0} }
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! Missing $ inserted.
<inserted text>
$
l.34 \newcommand{\N0}[1]{ n_{0} }
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
LaTeX Font Info: Try loading font information for U+msa on input line 34.
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\umsa.fd"
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
)
LaTeX Font Info: Try loading font information for U+msb on input line 34.
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\umsb.fd"
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)
! Extra }, or forgotten $.
\@argdef ...definable #1{\@yargdef #1\@ne {#2}{#3}
}
l.34 \newcommand{\N0}[1]{ n_{0} }
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Extra }, or forgotten $.
\@argdef ...efinable #1{\@yargdef #1\@ne {#2}{#3}}
l.34 \newcommand{\N0}[1]{ n_{0} }
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
! Missing $ inserted.
<inserted text>
$
l.36
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
("C:\Users\Daniel\Dropbox\Uni\03 SS 2015\ANA\LATEX Skript\ANA-Skript.aux")
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 37.
LaTeX Font Info: ... okay on input line 37.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 37.
LaTeX Font Info: ... okay on input line 37.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 37.
LaTeX Font Info: ... okay on input line 37.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 37.
LaTeX Font Info: ... okay on input line 37.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 37.
LaTeX Font Info: ... okay on input line 37.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 37.
LaTeX Font Info: ... okay on input line 37.
("C:\Program Files\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count104
\scratchdimen=\dimen116
\scratchbox=\box30
\nofMPsegments=\count105
\nofMParguments=\count106
\everyMPshowfont=\toks23
\MPscratchCnt=\count107
\MPscratchDim=\dimen117
\MPnumerator=\count108
\makeMPintoPDFobject=\count109
\everyMPtoPDFconversion=\toks24
)
LaTeX Font Info: Try loading font information for T1+cmss on input line 39.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1cmss.fd"
File: t1cmss.fd 1999/05/25 v2.5h Standard LaTeX font definitions
)
LaTeX Font Info: Try loading font information for OMS+cmr on input line 52.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\omscmr.fd"
File: omscmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions
)
LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10> not available
(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 52.

所以我不知道这是关于什么的,我的乳胶文档在这里:

\documentclass[a4paper, 10pt]{scrreprt}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{graphicx} 

\title{Erstes Dokument}
\author{ich}
\date{2015}


\newcommand{\changefont}[3]{
\fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}
%Modifikationen
\changefont{ppl}{m}{n}
\parindent 0pt
\parskip 9pt
%Mathematische Kommandos und Abkürzungen
\newcommand{\<}{\lbrace}
\renewcommand{\>}{\rbrace}
\newcommand{\NEN}{n \in \mathbb{N}}
\newcommand{\FANEN}{\< a_{n} \> _{\NEN}}
\newcommand{\FBNEN}{\< b_{n} \> _{\NEN}}
\newcommand{\FGNEN}{\< g_{n} \> _{\NEN}}
\newcommand{\FAKEN}{\< a_{k} \> _{\NEN}}
\newcommand{\FNKEN}{\< n_{k} \> _{\NEN}}
\newcommand{\AN}{ a_{n} }
\newcommand{\BN}{ b_{n} }
\newcommand{\AK}{ a_{k} }
\newcommand{\N0}{ n_{0} }
\newcommand{\NF}{Nullfolge }

\begin{document}
.
.
.

答案1

命令通常不能包含数字。请尝试定义NoNO(即大写和小写的字母“o”)。

我在序言中已经定义了\NNo例如\mathbb N_0

相关内容