Skip to content

Commit 0a57390

Browse files
committed
Make solutions use section/subsection/... number instead of just section number
Fixes Gp2mv3#844
1 parent 12ced29 commit 0a57390

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/epleval.cls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
{0.5ex} % sep
6464
{} % before-code
6565

66-
\newcommand{\QAlabel}{\IfLanguageName{english}{}{la }Question}
67-
\newcommand{\theQA}{\thesection}
68-
6966
\RequirePackage[eval]{../../../../../../eplqa}
7067

68+
\newcommand{\QAlabel}{\IfLanguageName{english}{}{la }Question}
69+
\renewcommand{\theQA}{\thesection}
70+
7171
\endinput

src/eplexercises.cls

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@
5050
{0.5ex} % sep
5151
{} % before-code
5252

53+
\RequirePackage{../../../eplqa}
5354

5455
\newcommand{\QAlabel}{\IfLanguageName{english}{Exercise}{l'Exercice}}
55-
\newcommand{\theQA}{\thesubsection}
56-
57-
\RequirePackage{../../../eplqa}
5856

5957
% \comment and \endcomment of the environment solution
6058
% does not work with newcommand

src/eplmcq.cls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
{} % before-code
4242

4343

44-
\newcommand{\QAlabel}{\IfLanguageName{english}{MCQ}{le QCM}}
45-
\newcommand{\theQA}{\thesubsection}
46-
4744
\RequirePackage{../../../eplqa}
4845

46+
\newcommand{\QAlabel}{\IfLanguageName{english}{MCQ}{le QCM}}
47+
\renewcommand{\theQA}{\thesubsection}
48+
4949
\endinput

src/eplqa.sty

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
\usepackage{tikzpagenodes}
1010
\usetikzlibrary{calc, arrows}
1111

12+
\RequirePackage{titlesec} % Provides the \thetitle command.
13+
\newcommand{\theQA}{\thetitle} % Default definition of this command: it uses the current section/subsection/... label
14+
1215
\newcommand{\SolutionLabel}{Solution \IfLanguageName{english}{to}{à} \QAlabel~\theQA}
1316

1417
\usepackage[framemethod=tikz]{mdframed}

0 commit comments

Comments
 (0)