Skip to content

Commit

Permalink
feat: add referencing for resq and hyp environments
Browse files Browse the repository at this point in the history
To use the automated facilities provided by the `cleveref` package, we
need to add respective names for the `resq` and `hyp` environments for
research questions and hypotheses.
  • Loading branch information
stephanlukasczyk committed Apr 19, 2024
1 parent 88f992c commit a9bb331
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to

## [Unreleased]

### Added
- Fix the referencing with cleveref's `\cref` etc. for the `resq` (research
questions) and `hyp` (hypotheses) environments
(see [#8](https://github.com/se2p/se2thesis/issues/8))

## [v3.3.1] – 2024–02–23

### Changed
Expand Down
Binary file modified examples/se2thesis-master-thesis-example.pdf
Binary file not shown.
15 changes: 12 additions & 3 deletions examples/se2thesis-master-thesis-example.tex
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
\institute{Chair of Example}
\location{Passau}

\usepackage[capitalise]{cleveref}
%\crefname{resq}{research question}{research questions}
\Crefname{resq}{Research Question}{Research Questions}

\begin{document}

\frontmatter
Expand Down Expand Up @@ -72,13 +76,18 @@

\section{Further Examples}

We could reference the \TeX{} book~\autocite{Knu86}.
We could reference the \TeX{} book~\autocite{Knu86}. And we want to reference
\cref{rq:1} and \cref{hyp:1} here.

\begin{resq}
\begin{resq}\label{rq:1}
What is \(41 + 1\)?
\end{resq}

\begin{summary}{Research Question 1}
\begin{hyp}\label{hyp:1}
We hypothesise that the answer to \cref{rq:1} is 42!
\end{hyp}

\begin{summary}{\Cref{rq:1}}
It's 42, obviously!
\end{summary}

Expand Down
2 changes: 2 additions & 0 deletions se2packages.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,8 @@
\AddToHook { begindocument/before }
{
\RequirePackage[capitalise]{cleveref}
\Crefname{resq}{Research Question}{Research Questions}
\Crefname{hyp}{Hypothesis}{Hypotheses}
}
}
% \end{macrocode}
Expand Down

0 comments on commit a9bb331

Please sign in to comment.