section
나는 각각의 새로운 강의에 대해 이야기하고 싶습니다 . 나는 \counterwithin
이 일을 할 수 있다는 것을 배웠다. 성공적으로 컴파일되었지만 지금은 작동하지 않습니다.
\newcounter{lecnum}
\renewcommand{\thepage}{\thelecnum-\arabic{page}}
\renewcommand{\thesection}{\thelecnum.\arabic{section}}
\renewcommand{\theequation}{\thelecnum.\arabic{equation}}
\renewcommand{\thefigure}{\thelecnum.\arabic{figure}}
\renewcommand{\thetable}{\thelecnum.\arabic{table}}
\newcommand{\lecture}[4]{
\pagestyle{myheadings}
\thispagestyle{plain}
\newpage
\setcounter{lecnum}{#1}
\setcounter{page}{1}
\noindent
\begin{center}
\framebox{
\vbox{\vspace{2mm}
\hbox to 6.28in { {\bf ECCV2020
\hfill August 2020} }
\vspace{4mm}
\hbox to 6.28in { {\Large \hfill Lecture #1: #2 \hfill} }
\vspace{2mm}
\hbox to 6.28in { {\it Lecturer: #3 \hfill Scribes: #4} }
\vspace{2mm}}
}
\end{center}
\markboth{Lecture #1: #2}{Lecture #1: #2}
}
\counterwithin*{section}{lecnum}
감사해요
답변1
\stepcounter
관련 카운터를 재설정하려면 필요합니다 .
\documentclass{article}
\usepackage[a4paper,textwidth=7in]{geometry}
\geometry{textheight=6cm}% just to make a smaller picture
\newcounter{lecnum}
\renewcommand{\thepage}{\thelecnum-\arabic{page}}
\counterwithin{section}{lecnum}
\counterwithin{equation}{lecnum}
\counterwithin{figure}{lecnum}
\counterwithin{table}{lecnum}
\pagestyle{myheadings}
\newcommand{\lecture}[4]{%
\clearpage
\thispagestyle{plain}
\stepcounter{lecnum}% resets every associated counter
\setcounter{lecnum}{#1}%
\setcounter{page}{1}
\begin{center}
\framebox{%
\parbox[t]{6.28in}{%
\vspace{2mm}
{\bfseries ECCV2020\hfill August 2020\par}
\vspace{2mm}
{\Large\hspace*{\fill}Lecture #1: #2\hspace*{\fill}\par}
\vspace{4mm}
{\itshape Lecturer: #3\hfill Scribes: #4\par}
\vspace{2mm}
}%
}
\end{center}
\markboth{Lecture #1: #2}{Lecture #1: #2}
}
\begin{document}
\lecture{1}{Boxes}{egreg}{Rabbittac}
This is the first lecture.
\section{First}
First section with an equation
\begin{equation}
a=b
\end{equation}
\lecture{3}{Counters}{egreg}{Rabbittac}
This is the third lecture.
\section{First}
First section with an equation
\begin{equation}
a=b
\end{equation}
\end{document}
일반 명령 대신 LaTeX 명령을 사용하도록 상자의 코드를 리팩터링했습니다. 명령 \bf
및 \it
이와 유사한 명령은 약 25년 동안 더 이상 사용되지 않습니다.