카운터를 어떻게 재설정하나요?

카운터를 어떻게 재설정하나요?

\begin{equation}방정식 옆에 나타나는 카운터를 재설정 하여 마지막 숙제 문제가 방정식 42와 같이 여러 줄의 방정식을 참조하지 않도록 하고 싶습니다 \begin{align}. 그렇게 할 수 있는 방법이 있습니까?

편집하다:

템플릿을 준수해야 하기 때문에 섹션을 사용할 수 없으므로 \numberwithin사용할 수 없습니다.

편집 #2:

템플릿은 다음과 같습니다

\documentclass[letterpaper,12pt,twoside]{article}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[letterpaper, top = 1.5in, left = 1in, right = 1in, bottom = 1.5in]  
\usepackage{fancyhdr}       
\usepackage{amsfonts,amsmath,amsthm,amssymb}    

\title{}
\author{Author}     
\date{\today}               

\makeatletter               
\let\Author\@author         
\let\Date\@date             
\makeatother

\newcommand{\Problem}{\relax}
\newcounter{problemcount}
\newcommand{\nextproblem}[1]{\renewcommand{\Problem}{#1}\setcounter{equation {0}\setcounter{page}{0}}

\pagestyle{fancy}
\lhead{\Problem}
\chead{}
\rhead{
\Author
\\
Class
\\
Section
\\
\Date
}

\renewcommand{\headrulewidth}{0.4pt}
\setlength{\headheight}{56.2pt}
\setlength{\parindent}{0pt}

\makeatother

\begin{document}
\nextproblem{Problem 1}
\begin{proof}\begin{align*}1+1&=2\\2&=2\end{align*}\end{proof}
\newpage

\nextproblem{Problem 2}\begin{proof}\begin{align*}1+1&=2\\2&=2\end{align*}\end{proof}

\end{document}

답변1

각 문제를 다른 섹션에서 설명하는 경우numberwithin에서 제공되는 명령amsmath패키지. 예를 들어: \numberwithin{equation}{section}. 그냥 \setcounter{equation}{0}자동으로 됩니다.

답변2

귀하의 코드는 있는 그대로 컴파일되지 않았습니다. 원하는 내용을 얻기 위해 몇 가지 수정을 하고 필요한 줄을 추가했습니다. 제가 잘 이해한 바에 따르면, 방정식 번호와 마찬가지로 문제마다 페이지 번호가 재설정됩니다.

후자의 문제는 chngcntr선택한 카운터가 변경될 때마다 카운터를 재설정할 수 있는 패키지를 로드하여 해결됩니다. 그러나 이는 페이지 카운터에서는 작동하지 않지만 명령 \page numbering{arabic}을 정의하는 코드에 간단히 추가하면 \nextproblem작업이 수행됩니다.

\documentclass[letterpaper,12pt,twoside]{article}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[letterpaper, top = 1.5in, left = 1in, right = 1in, bottom = 1.5in]{geometry}
\usepackage{fancyhdr}
\usepackage{amsfonts,amsmath,amsthm,amssymb}
\usepackage{chngcntr}
\title{}
\author{Author}
\date{\today}

\makeatletter
\let\Author\@author
\let\Date\@date
\makeatother

\newcommand{\Problem}{\relax}
\newcounter{problemcount}
\setcounter{problemcount}{0}

\newcommand{\nextproblem}[1]{\clearpage\stepcounter{problemcount}\pagenumbering{arabic}\renewcommand{\Problem}{#1}}
\counterwithin*{equation}{problemcount}

\pagestyle{fancy}
\lhead{\Problem}
\chead{}
\rhead{
\Author
\\
Class
\\
Section
\\
\Date
}

\renewcommand{\headrulewidth}{0.4pt}
\setlength{\headheight}{56.2pt}
\setlength{\parindent}{0pt}

\makeatother

\begin{document}
\nextproblem{Problem 1}
\begin{proof}\begin{align}1+1&=2\\2&=2\end{align}\end{proof}
\newpage

\nextproblem{Problem 2}
\begin{proof}\begin{align}1+1&=2\\2&=2\end{align}\end{proof}

\end{document} 

여기에 이미지 설명을 입력하세요

여기에 이미지 설명을 입력하세요

관련 정보