我对 Latex 还很陌生,因此我使用我得到的“基础”来撰写我的论文。在 tex 文件的开头,放置了以下几行来定义定理和定义:
\newtheorem{theorem}{Tétel}[section]
\newtheorem{lemma}{Lemma}
\newtheorem{definition}{Definíció}[section]
我的问题是,当我尝试使用它时,会发生这种情况代码:
\begin{definition}
Az $S\in[a,b]\to\mathbb{R}$ függvényt \textbf{l-ed fokú spline}-nak nevezzük, ha
\begin{enumerate}
\item $S\arrowvert_{I_{k}}\in\mathbb{P}_{l} (k\in1..n+1)$
\item $S \in \mathcal{C}^{l-1} $
\item $S$ spline \textbf{interpolációs spline}, ha
$S(t_{i})=f(t_{i}) \forall t_{i}\in \tau$ alappontra.
\end{enumerate}
\end{definition}
我的问题是定义后的括号此外,我在第二行收到以下错误
出了点问题——可能缺少一个 \item
这是我的文档的一个非常简化的版本
\documentclass[oneside,titlepage,12pt,a4paper]{report}
%\documentclass[12pt]{report}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{newlfont}
%\usepackage[ansinew]{inputenc}
\usepackage[magyar]{babel}
\usepackage[utf8]{inputenc}
\usepackage{t1enc}
\usepackage{graphicx}
\usepackage{color}
%\usepackage[colorlinks]{hyperref}
%\usepackage[active,new,noold,marker]{xrcs}
\usepackage{euler}
\usepackage{amssymb,latexsym}
\usepackage{amsmath}
\usepackage{graphics}
\usepackage{algorithm}
\usepackage{algpseudocode} %ezzel összeakadhat \usepackage{algorithmic}
\usepackage{rotating}
\usepackage{bigstrut}
\usepackage{subfigure}
\usepackage{appendix}
\usepackage{setspace}
\usepackage{pdfpages}
\newtheorem{theorem}{Tétel}[section]
\newtheorem{lemma}{Lemma}
\newtheorem{definition}{Definíció}[section]
\textwidth=6.truein \textheight=9.truein \hoffset=-.5truein
\voffset=-.8truein
\frenchspacing
\setlength{\parskip}{\smallskipamount}
\renewcommand{\appendixtocname}{Függelék}
\renewcommand{\appendixpagename}{Függelék}
\DeclareMathOperator{\grad}{grad}
\DeclareMathOperator{\sgn}{sign}
\DeclareMathOperator{\PRD}{PRD}
\DeclareMathOperator{\CR}{CR}
\newcommand{\conj}[1]{\overline{#1}}
\newenvironment{myprogfont}{\fontfamily{pcr}\selectfont}{\par}
\DeclareTextFontCommand{\textprogfont}{\myprogfont}
\begin{document}
\section{Spline-ok}
\label{sec:Spline}
Ebben a fejezetben a spline-ok és az interpolációs problémák témakörének a dolgozathoz kapcsolódó részeit fogom ismertetni.
\subsection{Alapfogalmak, tulajdonságok}
\label{subsec:Def}
A továbbiakban legyen $[a,b]\subset\mathbb{R}$, ennek $\tau=\{t_{0}, t_{1}, .. t_{n+1}\}$: $a=t_{0}<t_{1}<...<t_{n}<t_{n+1}=b$ egy felosztása.
$I_{k}:=[x_{k-1}, x_{k}] (k\in1..n+1)$
\begin{definition}
Az $S\in[a,b]\to\mathbb{R}$ függvényt \textbf{l-ed fokú spline}-nak nevezzük, ha
\begin{enumerate}
\item $S\arrowvert_{I_{k}}\in\mathbb{P}_{l} (k\in1..n+1)$
\item $S \in \mathcal{C}^{l-1} $
\item $S$ spline \textbf{interpolációs spline}, ha
$S(t_{i})=f(t_{i}) \forall t_{i}\in \tau$ alappontra.
\end{enumerate}
\end{definition}
\end{document}
答案1
我可以使用这个最简单的文档重现您的问题:
\documentclass{report}
\usepackage[magyar]{babel}
\usepackage{amsthm}
\newtheorem{definition}{Definíció}[section]
\begin{document}
\begin{definition}
Az $S\in[a,b]$
\end{definition}
\end{document}
但仅有的使用 TeX Live 2012 进行编译。这是控制台输出,请注意错误消息。
> /usr/local/texlive/2012/bin/x86_64-darwin/pdflatex andesz.tex
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
restricted \write18 enabled.
entering extended mode
(./andesz.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,
piedmontese, polish, portuguese, romanian, romansh, russian, sanskrit, serbian
, serbianc, slovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, u
ppersorbian, welsh, loaded.
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/report.cls
Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2012/texmf-dist/tex/generic/babel/babel.sty
(/usr/local/texlive/2012/texmf-dist/tex/generic/babel/magyar.ldf
(/usr/local/texlive/2012/texmf-dist/tex/generic/babel/babel.def)))
(/usr/local/texlive/2012/texmf-dist/tex/latex/amscls/amsthm.sty) (./andesz.aux)
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.11 A
z $S\in[a,b]$
?
[1{/usr/local/texlive/2012/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./andesz.aux) )</usr/local/texlive/2012/texmf-dist/fonts/type1/public/amsfonts
/cm/cmbxti10.pfb></usr/local/texlive/2012/texmf-dist/fonts/type1/public/amsfont
s/cm/cmmi10.pfb></usr/local/texlive/2012/texmf-dist/fonts/type1/public/amsfonts
/cm/cmr10.pfb></usr/local/texlive/2012/texmf-dist/fonts/type1/public/amsfonts/c
m/cmsy10.pfb></usr/local/texlive/2012/texmf-dist/fonts/type1/public/amsfonts/cm
/cmti10.pfb>
Output written on andesz.pdf (1 page, 40242 bytes).
Transcript written on andesz.log.
选项magyar
与babel
不兼容amsthm
,你对此无能为力,除非
删除对的调用
amsthm
;或更新你的(非常旧的)TeX 发行版。
第二种策略似乎最好。事实上,如果我用 TeX Live 2013 或更高版本运行你的测试文件,就没有问题了。
补充说明
您正在调用非常过时的软件包。
\usepackage{newlfont}
并\usepackage{latexsym}
应予以删除\usepackage{t1enc}
应该成为\usepackage[T1]{fontenc}
\usepackage{subfigure}
应该成为\usepackage{subfig}
(但这需要改变\subfigure
并\subtable
变成\subfloat
。