So I have been using a custom setup of counters after some great help on here (thank you, egreg).
The thing is, I have been running into a really odd problem with the counters which I am just unable to reproduce and pinpoint in a reliable way. But I finally have found the culprits... I think.
Is there a way I can use libertine
and amsmath
in a reliable fashion so I do not have this experience? Or did I perhaps mis-configure som
Picture 1 with counters not working
Compiled with amsmath
and libertine
loaded so the counters do not work:
Picture 2 with counters working
Compiled with amsmath
and libertine
commented out:
MWE
% !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}
xcntperchap
and hope that this doesn't break the amsmath usage of the counters. – Ulrike Fischer Jun 13 '20 at 16:18libertine will load
fontspec` and prevent eithertgheros
orberamono
from working. You can fix this either by loading those infontspec
as well (\defaultfontfeatures{Scale = MatchLowercase} \setsansfont{TeX Gyre Heros} \setmonofont{DejaVu Sans Mono}
) or by adding thetype1
option tolibertine
. – Davislor Jun 13 '20 at 20:46