图 1 计数器不工作

图 1 计数器不工作

因此,在获得一些很大的帮助之后,我一直在使用自定义的计数器设置(谢谢,egreg)。

问题是,我遇到了一个非常奇怪的计数器问题,我无法以可靠的方式重现和查明问题所在。但我终于找到了罪魁祸首……我想。

有没有一种可靠的方法可以libertineamsmath我避免这种体验?或者我可能错误地配置了某些

图 1 计数器不工作

编译amsmathlibertine加载,因此计数器不起作用:

在此处输入图片描述

图 2 计数器正在工作

编译amsmathlibertine注释掉:

在此处输入图片描述

平均能量损失

% !TeX spellcheck = de_DE
\documentclass[
11pt,
a4paper,
DIV=15,
twoside,
headings=normal,
parskip=single,
twopage,
]
{scrartcl}

\usepackage[german]{babel}
\usepackage{
multicol,
setspace,
enumitem,
xcntperchap,
}
\usepackage{amsmath}
\usepackage{textcomp}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% the problematic package
\usepackage[oldstyle,proportional]{libertine}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{libertinust1math}
\usepackage[scaled=0.832]{beramono}
\usepackage[scale=0.8558]{tgheros}
\usepackage{microtype}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\pdfgentounicode=1

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%    A4    %%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{TOTALcounter} % for 'total' counters
\newcounter{counterPERsection}[section]
\RegisterTrackCounter{section}{counterPERsection}
\newcounter{questioncounter}
\RegisterTrackCounter{TOTALcounter}{questioncounter}
% initialize the total counters
\stepcounter{TOTALcounter}
\newcommand{\flashc}[2]{%
\noindent\fbox{%
\begin{minipage}[t]{\columnwidth}%
\stepcounter{counterPERsection}%
\arabic{counterPERsection}.%
\ObtainTrackedValueExp{section}{counterPERsection}%
\newline
\stepcounter{questioncounter}\arabic{questioncounter}.%
\ObtainTrackedValueExp{TOTALcounter}{questioncounter}\newline%
{#1}%
\end{minipage}}\\[2pt]
#2\vspace{3pt}}

\newcommand{\personone}{\subsection{Stuff by Person1}}
\newcommand{\stufftwo}{\subsection{Stuff by Person2}}
\newcommand{\stuffthree}{\subsection{Stuff by Person3}}

\listfiles

\begin{document}
\begin{multicols*}{2}
\section{AAAAAAAA}
\personone
\flashc{444444444444}{}

\flashc{444444444444}{}

\stufftwo
\flashc{444444444444}{}
\flashc{gggggggggggggg}{}
\stuffthree
\flashc{gggggggggggggg}{}
\flashc{ggggggg}{}

\section{BBBBB}
\personone
\flashc{gggggggggggggg!}{}
\flashc{gggggggggggggg}{}
\stufftwo

\flashc{444444444444}{}
\flashc{ggggggg}{}
\flashc{gggggggggggggg}{}
\end{multicols*}
\end{document}

日志

https://pastebin.com/V4yCDGtz

答案1

amsmath(或更准确地说amstext)重新定义\stepcounter并覆盖了 的更改xcntperchap。如果您在之前加载 amsmath,xcntperchap它可能会起作用(如果 的添加xcntperchap不会在某些地方混淆 amsmath)。

相关内容