我已经设置了一个 latex 序言,它可以生成我的自定义定理框,用于定义、定理、引理等。我从这里的某个人那里复制粘贴了它,并对其进行了轻微的修改,直到昨天,它在过去三年里一直运行良好。我随机开始收到将 itemize 环境放入我的定义环境中的错误。
\documentclass[10pt, a4paper]{article}
\usepackage[slovene]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{parskip}
\usepackage{pgfplots}
\usepackage{comment}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{array}
%\usepackage{mdframed}
%\usepackage{thmbox}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[top=105pt, bottom=75pt, left=75pt, right=75pt]{geometry}
\setlength{\headsep}{15pt}
\setlength{\footskip}{45pt}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{ifthen}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{cd}
\usetikzlibrary{babel}
\tikzcdset{scale cd/.style={every label/.append style={scale=#1},
cells={nodes={scale=#1}}}}
\usepackage{adjustbox}
\graphicspath{ {./images/} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tcolorbox}
\tcbuselibrary{skins, breakable}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% with separate title
\xdefinecolor{thmTopColor}{RGB}{102, 102, 238}
\xdefinecolor{thmBackColor}{RGB}{245, 245, 255}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pgfplotsset{compat=1.18}
\newtheorem{izr}{Izrek}[section]
\newenvironment{thmbox}[1]{%
\tcolorbox[%
empty,
parbox=false,
noparskip,
enhanced,
breakable,
sharp corners,
boxrule=-1pt,
left=2ex,
right=0ex,
top=0ex,
boxsep=1ex,
before skip=2.5ex plus 2pt,
after skip=2.5ex plus 2pt,
colback=thmBackColor,
colframe=white,
coltitle=black,
colbacktitle=thmBackColor,
fonttitle=\bfseries,
title=#1,
titlerule=1pt,
titlerule style=thmTopColor,
overlay unbroken and last={%
\draw[color=thmTopColor, line width=1.25pt]
($(frame.north west)+(.5em, -4.1ex)$)
-- ($(frame.south west)+(.5em, 1ex)$) -- ++(2em, 0);
}]
}{\endtcolorbox}
\newenvironment{izrek}[1][]{% before
\refstepcounter{izr}%
\ifthenelse{\equal{#1}{}}{%
\begin{thmbox}{Izrek \theizr.}\itshape\hspace{-.75ex}%
}{%
\begin{thmbox}{Izrek \theizr%
\hspace{.75ex}(\textnormal{#1}).}\itshape\hspace{-.75ex}
}}
{\end{thmbox}
}
{\theoremstyle{plain}
\newtheorem{posledica}[izr]{Posledica}
\newtheorem{trditev}[izr]{Trditev}
}
{\theoremstyle{definition}
\newtheorem{defi}[izr]{Definicija}
\newtheorem{aksiom}[izr]{Aksiom}
}
\newenvironment{noticeB}{%
\tcolorbox[%
notitle,
empty,
enhanced, % delete the edge of the bottom page for a broken box
breakable,
coltext=black,
colback=white,
fontupper=\rmfamily,
parbox=false,
noparskip,
sharp corners,
boxrule=-1pt, % width of the box' edges
frame hidden,
left=7pt, % inner space from text to the left edge
right=7pt,
top=5pt,
bottom=5pt,
% boxsep=0pt,
before skip=2.5ex plus 2pt,
after skip=2.5ex plus 2pt,
borderline west = {1.5pt}{-0.1pt}{blue!30!black}, % second argument = offset
overlay unbroken and last={%
\draw[color=black, line width=1.25pt]
($(frame.south west)+(1.pt, -0.1pt)$) -- ++(2em, 0);
}
]}
{\endtcolorbox}
\newenvironment{definicija}{\begin{defi}\begin{noticeB}}{%
\end{noticeB}\end{defi}}
{\theoremstyle{remark}
\newtheorem*{opomba}{Opomba}
\newtheorem*{dogovor}{Dogovor}
}
\newtheorem{zgled}[izr]{Zgled}
\tcolorboxenvironment{zgled}{%
enhanced jigsaw,
boxrule=-1pt,
colframe=gray!15,
%borderline west={2pt}{0pt}{black}, % second argument is the offset
interior hidden,
sharp corners,
breakable,
before skip=2.5ex plus 2pt,
after skip=2.5ex plus 2pt
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newtheorem{lema}[izr]{Lema}
\tcolorboxenvironment{lema}{%
enhanced jigsaw,
boxrule=-1pt,
sharp corners,
colframe=white,
borderline west={2pt}{0pt}{orange}, % second argument is the offset
interior hidden,
breakable,
before skip=2.5ex plus 2pt,
after skip=2.5ex plus 2pt
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{noticeC}{%
\tcolorbox[%
notitle,
empty,
enhanced, % delete the edge of the bottom page for a broken box
breakable,
coltext=black,
fontupper=\rmfamily,
parbox=false,
noparskip,
sharp corners,
boxrule=-1pt, % width of the box' edges
frame hidden,
left=7pt, % inner space from text to the left edge
right=7pt,
top=5pt,
bottom=5pt,
% boxsep=0pt,
before skip=2.5ex plus 2pt,
after skip=2.5ex plus 2pt,
%borderline west = {1.5pt}{-0.1pt}{gray}, % second argument = offset
overlay unbroken and last={%
%\draw[color=gray, line width=1.25pt]
%($(frame.west)$);
%\draw[color=gray, line width=1.25pt]
%($(frame.east)$);
},
]}
{\endtcolorbox}
\newenvironment{dokaz}%
{\begin{noticeC}\begin{proof}}%
{\end{proof}\end{noticeC}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\newlength\xvec@height%
\newlength\xvec@depth%
\newlength\xvec@width%
\newcommand{\xvec}[2][]{%
\ifmmode%
\settoheight{\xvec@height}{$#2$}%
\settodepth{\xvec@depth}{$#2$}%
\settowidth{\xvec@width}{$#2$}%
\else%
\settoheight{\xvec@height}{#2}%
\settodepth{\xvec@depth}{#2}%
\settowidth{\xvec@width}{#2}%
\fi%
\def\xvec@arg{#1}%
\def\xvec@dd{:}%
\def\xvec@d{.}%
\raisebox{.2ex}{\raisebox{\xvec@height}{\rlap{%
\kern.05em% (Because left edge of drawing is at .05em)
\begin{tikzpicture}[scale=1]
\pgfsetroundcap
\draw (.05em,0)--(\[email protected],0);
\draw (\[email protected],0)--(\[email protected], .075em);
\draw (\[email protected],0)--(\[email protected],-.075em);
\ifx\xvec@arg\xvec@d%
\fill(\xvec@width*.45,.5ex) circle (.5pt);%
\else\ifx\xvec@arg\xvec@dd%
\fill(\xvec@width*.30,.5ex) circle (.5pt);%
\fill(\xvec@width*.65,.5ex) circle (.5pt);%
\fi\fi%
\end{tikzpicture}%
}}}%
#2%
}
\makeatother
% --- Override \vec with an invocation of \xvec.
\let\stdvec\vec
\renewcommand{\vec}[1]{\xvec[]{#1}}
% --- Define \dvec and \ddvec for dotted and double-dotted vectors.
\newcommand{\dvec}[1]{\xvec[.]{#1}}
\newcommand{\ddvec}[1]{\xvec[:]{#1}}
\newcommand{\stcomp}[1]{{#1}^{\mathsf{c}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\N}{\mathbb {N}}
\newcommand{\Z}{\mathbb {Z}}
\newcommand{\Q}{\mathbb {Q}}
\newcommand{\R}{\mathbb {R}}
\newcommand{\C}{\mathbb {C}}
\newcommand{\F}{\mathbb {F}}
\newcommand{\Ha}{\mathbb {H}}
\newcommand{\zap}[1]{(#1_n)_{n=1} ^{\infty}}
\newcommand{\podzap}[1]{(#1_{n_j})_{n=1 ^{\infty}}}
\newcommand{\limzap}[1]{\lim_{n \to \infty} {#1}}
\newcommand{\limf}[3]{\lim_{#1 \to #2} {#3}}
\newcommand{\rlimf}[3]{\lim_{#1 \downarrow #2} {#3}}
\newcommand{\llimf}[3]{\lim_{#1 \uparrow #2} {#3}}
\newcommand{\quot}[2]{{\raisebox{0em}{$#1$}\left/\raisebox{0em}{$#2$}\right.}}
\newcommand{\gen}[1]{\left\langle #1 \right\rangle}
\newcommand{\Mod}[1]{\ (\mathrm{mod}\ #1)}
\newcommand{\im}{\mathrm{im}\,}
\newcommand{\sgn}{\mathrm{sgn}\,}
\newcommand{\gal}[1]{\mathrm{Gal}\, {\left(#1\right)}}
\newcommand{\chara}{\mathrm{char}\, }
\DeclareMathOperator{\di}{d\!}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace\hspace{0pt}}m{#1}}
\setlength{\parskip}{1em}
\begin{document}
\begin{izrek}
Naj bo $M$ $R$-modul. Naslednje tri trditve so ekvivalentne:
\begin{enumerate}
\item $M$ je prost.
\item $M$ je izomorfen (lahko tudi neskončni) direktni vsoti kopij kolobarja $R$.
\item $M = \bigoplus_{\lambda \in \Lambda} M_\lambda$, kjer je $M_\lambda \leq M$ in $M_\lambda \cong R.$
\end{enumerate}
\end{izrek}
\begin{definicija}
Naj bosta $M$ in $N$ $R$-modula in $F$ prosti $R$-modul
z bazo $X = M \times N$ (kartezični produkt množic).
Naj bo $T$ podmodul v $F$, generiran z naslednjimi elementi:
\begin{itemize}
\item $(m_1 + m_2, n) -(m_1, n) - (m_2, n)$ za $m_1, m_2 \in M$ in $n \in N$.
\item $(m, n_1 + n_2) - (m, n_1) - (m, n_2)$ za $m \in M$ in $n_1, n_2 \in N$.
\item $(rm, n) - r(m, n)$ za $r \in R$, $m \in M$, $n \in N$.
\item $(m, rn) - r(m, n)$ za $r \in R$, $m \in M$, $n \in N$.
\end{itemize}
$R$-modulu $\quot{F}{T}$ pravimo tenzorski produkt modulov $M$ in $N$ in ga
označimo s
$$\quot{F}{T} = M \otimes_R N.$$
\end{definicija}
\end{document}
环境“izrek”工作正常,但环境“definicija”在第 296 行给我一个错误“出了点问题——可能缺少 \item”。这是我遇到的唯一错误。这非常令人沮丧,因为过去几年成功编译的所有文档,每当我将 itemize 放入“definicija”环境中时,都会突然给我同样的错误。另一件事是错误无法重现——上面的代码在我的另一台电脑上运行良好。我尝试过几次卸载和安装 MikTeX,但无济于事。我迫切需要一个解决方案,任何反馈都将不胜感激。