在多列环境中,end/begin{multicols} 命令会破坏 mycounter 的上限值(请参阅我的 MWE)。请问如何避免这种情况?非常感谢。
\documentclass[paper=a4,pagesize=pdftex,twoside]{scrbook}
\usepackage[extramarks]{titleps}
\usepackage{multicol}
\setlength{\columnseprule}{0.1mm}
\usepackage{lipsum}
\newcounter{mycounter}
\newmarkset{mycounter}
\newextramark*{mycounter}{mycounter}
\newpagestyle{mystyle}{%
\setheadrule{.009pt}
\sethead%
[pg(\thepage)][][\topextramarks{mycounter}{\arabic{mycounter}}---\botextramarks{mycounter}{\arabic{mycounter}}]%
{\topextramarks{mycounter}{\arabic{mycounter}}---\botextramarks{mycounter}{\arabic{mycounter}}}{}{pg(\thepage)}%
}
\pagestyle{mystyle}
\newcommand\updatemark{%
\stepcounter{mycounter}%
\extramark{mycounter}%
}
\begin{document}
\begin{multicols}{2}
\updatemark\Huge{\textbf{\themycounter}} --- \lipsum[2][1-2]
\updatemark\Huge{\textbf{\themycounter}} --- \lipsum[2][1-2]
\updatemark\Huge{\textbf{\themycounter}} --- \lipsum[2][1-2]
\end{multicols}
\Huge{\textit{some text}}
\begin{multicols}{2}
\updatemark\Huge{\textbf{\themycounter}} --- \lipsum[2][1-2]
\updatemark\Huge{\textbf{\themycounter}} --- \lipsum[2][1-2]
\updatemark\Huge{\textbf{\themycounter}} --- \lipsum[2][1-2]
\end{multicols}
\end{document}