方程式编号从方程式 2 开始,而不是从 1 开始

方程式编号从方程式 2 开始,而不是从 1 开始

有人能提示一下,为什么我的 latex 文件开始用方程 2 而不是方程 1 来编号方程?

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}


\usepackage{amsmath, amsthm}
\allowdisplaybreaks  % para que pueda partir fórmulas que ocupan más de una línea, 
necesita el paquete anterior
\usepackage{amssymb} % para cargar algunos símbolos como \blacksquare y \square
\setcounter{equation}{1}
\usepackage{amsfonts} % para cargar algunas fuentes en estilo matemático
\usepackage{enumerate}

\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[export]{adjustbox}

\usepackage{blkarray}

\usepackage{fancyhdr}



% Crossing text in equation
\usepackage[makeroom]{cancel}

% no indent
\setlength{\parindent}{0in}

% Set size of figure font
% The different size options are: scriptsize, footnotesize, small, normalsize, large, 
Large
\usepackage[font=footnotesize,labelfont=bf]{caption}

% Área de impresión de una página:
\usepackage[a4paper]{geometry}
%  \geometry{hmargin={2.5cm,2.5cm}, height=22cm}
\geometry{top = 2.5cm, left = 2cm, right = 2cm, bottom=2cm}

% Set borders
%\usepackage{geometry}
%\geometry{top = 2cm, left = 2cm, right = 2cm, bottom=2cm}  % 
{a4paper,left=40mm,right=30mm, top=1cm, bottom=2cm}

% Hyperlinks
\usepackage{hyperref} %\href

% Drawing a graph in Latex
\usepackage {tikz}
\usepackage{float}
\usetikzlibrary {positioning}
\definecolor {processblue}{cmyk}{0.96,0,0,0}
\newcommand{\Cross}{$\mathbin{\tikz [x=1.4ex,y=1.4ex,line width=.2ex, red] \draw (0,0) - 
- (1,1) (0,1) -- (1,0);}$}
\usepackage{tkz-euclide}
%\usetkzobj{all}

% Package to draw a pie chart
\usepackage{pgf-pie}

% Space in tabular above and below every line, needs to at it at the end of the line. 
\newcommand\Tstrut{\rule{0pt}{2.6ex}}         % = `top' strut
\newcommand\Bstrut{\rule[-0.9ex]{0pt}{0pt}}   % = `bottom' strut


\theoremstyle{definition}

\usepackage{thmtools}
\usepackage{mdframed}
\mdfsetup{skipbelow = 10pt}

% itemize indent (set margin)
%\usepackage{lipsum, enumitem}

% set line spacing
\usepackage[onehalfspacing]{setspace}

% Für multicolums in itemize
\usepackage{multicol}   

\usepackage{tkz-euclide}
\usepackage{pgfplots}

%Set equation counter to 0.
\newcommand{\startparent}{%
\setcounter{equation}{0}%
\xdef\theparentequation{\arabic{parentequation}}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\section{Lineare Funktionen}
\subsection{Einführung}
In Alltagssituationen begegnen uns ständig Anwendungen von linearen Funktionen. Nehmen 
wir an, wir möchten eine lineare Funktion aufstellen, die uns die jährlichen Stromkosten 
(in CHF) in Abhängigkeit von unserem Stromverbrauch (in kWh) liefert. \\
Die Eniwa (Stromversorger in Aarau) verrechnet eine Grundgebühr von 9.50 CHF pro Monat 
für einen Stromanschluss und 0.098 CHF/kWh Stromverbrauch.\\


\begin{tikzpicture}
\begin{axis}[
/pgf/number format/.cd,
use comma,
set thousands separator={},
xmin=0,xmax=5000,
ymin=0,ymax=600,
grid=both,
grid style={line width=.1pt, draw=darkgray!10},
major grid style={line width=.2pt,draw=darkgray!50},
axis lines=middle,
samples=1,
xlabel={Stromverbrauch [kWh]},
ylabel={Jahresstromkosten [CHF]}]
]
\end{axis}
\end{tikzpicture}

Zwischen der Definitionsmenge $\mathbb{D}$, dem Stromverbrauch v in kWh, und der 
Wertemenge $\mathbb{W}$, den monatlichen Stromkosten k in [kWh], besteht ein linearer 
Zusammenhang, der durch die folgende Funktionsgleichung ausgedrückt werden kann:
\begin{equation}
k(v) = \frac{49}{500}v+114
\end{equation}
\end{document}

正如您所见,尝试将 %Set 方程计数器设置为 0,但并没有什么不同。

答案1

如果我删除所有不相关的行,您的示例的更合理版本将是

\documentclass{article}

\setcounter{equation}{1}
\end{document}
\begin{equation}
k(v) = \frac{49}{500}v+114
\end{equation}
\end{document}

这会强制编号从 2 开始。如果删除,\setcounter{equation}{1} 那么您将获得默认编号。

相关内容