I am new to using the paracol
package and while I have learnt the basics of the package I am stuck on the following. Here is a MWE.
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{polyglossia}
\usepackage{metalogo}
\usepackage{fontspec}
\newfontfamily\greekfont[Script=Greek]{GFS Neohellenic}
\setdefaultlanguage{greek}
%set gfsartemisia as main font
\usepackage{gfsartemisia}
%load hyperref package to enable links
\usepackage{hyperref}
%switch effortlessly between 1 column and 2 column document
\usepackage{paracol}
\setlength{\columnseprule}{1pt}
%define custom environment for exercises
\def\UrlFont{\ttfamily}
% Counter for exercises
\newcounter{exercise}
% Define the environment with 3 optional arguments:
% #1 = proposer
% #2 = url
% #3 = post-body (e.g., a hyperlink to the solution)
\NewDocumentEnvironment{exercise}{O{} O{} O{}}
{
\refstepcounter{exercise}%
\par\medskip
\noindent\textbf{Exercise \theexercise}%
\IfNoValueF{#1}{\ \textit{(Proposed by #1)}}%
%\IfNoValueF{#3}{\ \textnormal{ #3}}%
\par\medskip
\begingroup
\setlength{\parindent}{0pt}%
\itshape
}
{
\par\medskip
\normalfont
\IfNoValueF{#2}{\noindent\textbf{Link:} \raggedright \href{#2}{#3}\par}
\medskip
\endgroup
}
\begin{document}
\begin{paracol}{2}
\begin{exercise}[George][www.domain.com][www.domain.com]
Here is the first exercise
\end{exercise}
\switchcolumn
\begin{exercise}[John Doe][www.domain2.com][www.domain2.com]
This is the second exercise
\end{exercise}
\end{paracol}
\end{document}
So the problem is when I switch columns the \begin{exercise}
does not auto increment but resets back to 1 as can be seen below.
I can force a change by using the \stepcounter{exercise}
command but I would like something more automated.