% \iffalse meta-comment
%
% Copyright (C) 2019-2025 by Jan Hajer
% -----------------------------------
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
% http://www.latex-project.org/lppl.txt
%
% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% \fi
%
% \iffalse

%<package|class|bibliography>\NeedsTeXFormat{LaTeX2e}[2021-11-15]
%<package>\ProvidesPackage{hep-cv}[2026/11/13 v1.6 Curricula vitae, cover letters and publication lists]
%<bibliography>\ProvidesPackage{hep-cv-bibliography}[2026/11/13 v1.6 Publication lists for curricula vitae]
%<class>\ProvidesClass{hep-cv}[2026/11/13 v1.6 Curricula vitae, cover letters and publication lists]
%<documentation>\ProvidesFile{hep-cv-documentation.tex}[2026/11/13 v1.6 HEP-CV documentation]
%<test-sty>\ProvidesFile{hep-cv-test-sty.tex}[2026/11/13 v1.6 HEP-CV package test]
%<test-cls>\ProvidesFile{hep-cv-test-cls.tex}[2026/11/13 v1.6 HEP-CV class test]
%
%<*documentation>
%
\RequirePackage[l2tabu, orthodox]{nag}
\documentclass{ltxdoc}

\renewcommand*\theCodelineNo{\rmfamily\tstyle\footnotesize\arabic{CodelineNo}}
\AtBeginEnvironment{macrocode}{\renewcommand*{\ttdefault}{clmt}}
\renewcommand*{\MacroFont}{\codestyle}
\AtBeginDocument{\DeleteShortVerb{\|}}
\AtBeginDocument{\MakeShortVerb{\"}}
\EnableCrossrefs
\CodelineIndex
\RecordChanges

\usepackage{hologo}

\usepackage[parskip,oldstyle,font=10pt]{hep-paper}
\bibliography{bibliography}

\acronym{CV}{curriculum vitae}[curricula vitarum]
\acronym{TOC}{table of contents}
%</documentation>

%<*driver>
\expandafter\newif\csname ifshort\endcsname
\shortfalse
\begin{document}
\DocInput{hep-cv-implementation.dtx}
\end{document}
%</driver>
%
% \fi
%
% \CheckSum{1129}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \changes{v1.2}{2020/01/02}{Added to the hep-paper repository with release v2.1: CV layout with a left column, CV entries, standalone loading, paper, font, language, and list options, title, photo, contact, and bibliography helpers, and cover letters.}
% \changes{v1.3}{2024/11/01}{Added the hep-cv class and the hep-cv-bibliography package, month helpers, title pages, page styles, \cs{cvpart}, and \cs{insubfile}.}
% \changes{v1.4}{2025/09/01}{Applied starred command definitions.}
% \changes{v1.5}{2026/08/01}{Raised the LaTeX format requirement and expanded the documentation, README, and examples.}
% \changes{v1.6}{2026/11/13}{First release on CTAN. Fixed spurious spaces, made the month macros robust with PDF-string fallbacks and measured their width at use time, documented the date option correctly, and fixed the class \cs{HUGE}, PDF title, \cs{cvpart} PDF update, letter defaults and starred sections without \software{hyperref}, and made \cs{insubfile} test for the \software{subfiles} class, so that it also works in the body of subfiles. Renamed the internal \cs{printindex} of the bibliography to \cs{printcvindex}, which clashed with the index packages.}
%
% \ifshort
%<*documentation>
% \fi
%
\GetFileInfo{hep-cv.sty}

\title{The \software{hep-cv} package\thanks{This document corresponds to \software{hep-cv}~\fileversion.}}
\subtitle{Curricula vitae, cover letters and publication lists}
\author{Jan Hajer \email{jan.hajer@tecnico.ulisboa.pt}}
\date{\filedate}

% \ifshort
\begin{document}
% \fi

\newgeometry{vscale=.8, vmarginratio=3:4, includeheadfoot, left=11em, marginparwidth=4.6cm, marginparsep=3mm, right=7em}

\maketitle

\begin{abstract}
The \software{hep-cv} package and class provide a compact $\CV$ layout for academic applications.
The package defines the left-column $\CV$ line and entry layout, list styling, month helpers, and bibliography support, while the class adds article-based $\CV$ defaults, contact and photo title pages, cover-letter helpers, section and page styles, and subfile support.
\end{abstract}

\newgeometry{vscale=.8, vmarginratio=3:4, includeheadfoot, left=11em, marginparwidth=4.6cm, marginparsep=3mm, right=7em}

\section{Introduction}

The \software{hep-cv} package enables the user to write an appealing \CV.
The style is heavily influenced by the \software{moderncv} package \cite{moderncv}.
In order to use the package layout macros the user has to load only the \software{hep-cv} package in addition to the "article" class.
\begin{verbatim}
\documentclass{article}
\usepackage{hep-cv}
\end{verbatim}
The source also provides a "hep-cv" class for complete \CV documents and a "hep-cv-bibliography" module for \CV bibliography layouts.

\subsection{Options}

\DescribeMacro{date}
\DescribeMacro{list}
The "date" option switches to a compact \CV date scheme: it defines the month macros described in \cref{sec:months} and makes the bibliography module print months with these macros and years in the short form "'25".
Without it, the usual date scheme is kept.
The "list=false" option prevents the package from adjusting the standard list environments.

\section{Macros}

\DescribeMacro{\setleftwidth}
\DescribeMacro{\setseperatorwidth}
The layout can be tuned by setting the "\setleftwidth" and "\setseperatorwidth" macros.

\DescribeMacro{\cvline}
The "\cvline"\oarg{left}\marg{main} adds an unformatted line to the \CV.

\begin{verbatim}
\cvline[left]{cvline example}
\end{verbatim}

\DescribeMacro{\cventry}
The "\cventry"\oarg{left}\marg{main 1}\oarg{main 2}\meta{*}\oarg{\dots} macro adds a boldface entry to the \CV.
The contents passed to the following arguments alternate between upright and italic text.
Starred optional arguments begin on a new line.
For example:

\begin{verbatim}
\cventry[left]{cventry example}[one][two]*[starred three][four]
\cventry[left]{cventry example}[one]
\cventry[left]{cventry example}
\end{verbatim}

\subsection{Lists}

\DescribeEnv{itemize}
The "itemize" environment is adjusted using the "enumitem" package \cite{enumitem}.
\DescribeEnv{enumerate}
The "enumerate" environment is adjusted.
\DescribeEnv{description}
The "description" environment is adjusted.
\DescribeEnv{enumdescript}
The "enumdescript" environment of the "hep-text" package \cite{hep-text} is adjusted.

\subsection{Months} \label{sec:months}

\DescribeMacro{\Jan}
\DescribeMacro{\Feb}
\DescribeMacro{\Mar}
\DescribeMacro{\Apr}
\DescribeMacro{\May}
\DescribeMacro{\Jun}
\DescribeMacro{\Jul}
\DescribeMacro{\Aug}
\DescribeMacro{\Sep}
\DescribeMacro{\Oct}
\DescribeMacro{\Nov}
\DescribeMacro{\Dec}
With the "date" option, the month macros spread a short month name evenly across the width of \enquote{May} in the current font and are intended for compact date columns.
They are robust and print the plain month name in PDF strings such as bookmarks.

\section{Class additions}

The "hep-cv" class is based on "article" and loads the package layout with full-page \CV defaults.

\DescribeMacro{font}
\DescribeMacro{serif}
\DescribeMacro{hyperref}
The class accepts a "font="\meta{size} option (the standard size options "10pt", "11pt" and "12pt" are shortcuts for it), the "serif" option, and a "hyperref" switch that controls whether \software{hep-reference} is loaded for PDF metadata and links.

\DescribeMacro{\address}
\DescribeMacro{\addressfont}
\DescribeMacro{\addcontactline}
The "\address"\marg{text} macro stores contact information, "\addressfont" controls its font, and "\addcontactline"\marg{text} appends additional contact material.

\DescribeMacro{\opening}
\DescribeMacro{\closing}
\DescribeMacro{\makelettertitle}
\DescribeMacro{\makeletterclosing}
\DescribeEnv{letter}
The cover-letter helpers store opening and closing text, typeset a letter title and closing, and provide a "letter" environment that wraps one letter page.

\DescribeMacro{\titlefont}
\DescribeMacro{\infofont}
\DescribeMacro{\addtitleline}
\DescribeMacro{\photo}
\DescribeMacro{\maketitle}
The class title page uses "\author" for the name, optional "\photo"\marg{file} material, "\addtitleline"\marg{label}\marg{text} for title metadata, and "\addcontactline" for contact metadata.
The "\titlefont" and "\infofont" macros control the title and metadata fonts.

\DescribeEnv{abstract}
The class renames the abstract to \enquote{Summary} and formats it in the \CV left-column layout.

\DescribeMacro{\cvpart}
\DescribeMacro{\insubfile}
The "\cvpart"\marg{name} macro stores the current \CV part for headers and PDF metadata, and "\insubfile"\marg{code} emits \meta{code} only when a subfile is compiled on its own with the \software{subfiles} class, \eg "\insubfile{\cvpart{Education}}" in the preamble of a subfile.
When the subfile is included in the main \CV with "\subfile", the code is ignored.

\section{Bibliography}

The bibliography module mirrors the standalone \software{hep-cv-bibliography} package.
It defines \CV date sorting, section-level bibliography headings, left-column date and index helpers, and "unnumbered", "numbered", and "starrednumbered" bibliography environments for publication lists.
The "date" option described above can also be given to the bibliography module, "\usepackage[date]{hep-cv-bibliography}", which passes it on to \software{hep-cv}, also if the "hep-cv" class has already loaded it.

% \ifshort
\printbibliography

\end{document}
%
%</documentation>
% \fi
%
% \StopEventually{
% \printbibliography
% \PrintChanges
% }
%
% \clearpage\appendix
%
% \section{Package Implementation}
%
%<*package>
%
% \subsection{Options}
%
% Load the \software{kvoptions} package \cite{kvoptions} and define a "hepcv" namespace.
%    \begin{macrocode}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
  family=hepcv,
  prefix=hepcv@
}
%    \end{macrocode}
%
% \begin{macro}{date}
% Provide the option "date" switching to the compact \CV date scheme with the month macros.
%    \begin{macrocode}
\DeclareBoolOption[false]{date}
\DeclareBoolOption[true]{list}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\ProcessKeyvalOptions*
%    \end{macrocode}
%
% \subsection{Widths}
%
% \begin{macro}{\hep@left@width}
% \begin{macro}{\hep@seperator@width}
% \begin{macro}{\hep@main@width}
% Define document widths.
%    \begin{macrocode}
\newlength{\hep@left@width}
\newlength{\hep@seperator@width}
\newlength{\hep@main@width}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\hep@set@main@width}
% Define private macro for setting the main widths using the \software{calc} package \cite{calc}.
% The main width fills the current line width.
% It is recomputed whenever a \CV line is typeset, so that later changes of the text width, \eg by the \software{geometry} package \cite{geometry}, are taken into account.
%    \begin{macrocode}
\RequirePackage{calc}
\newcommand*{\hep@set@main@width}{%
  \setlength{\hep@main@width}{%
    \linewidth-\hep@left@width-\hep@seperator@width%
  }%
}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\setleftwidth}
% \begin{macro}{\setseperatorwidth}
% Define macros for setting the document widths.
%    \begin{macrocode}
\newcommand*{\setleftwidth}[1]{%
  \setlength{\hep@left@width}{#1}%
  \hep@set@main@width
}
\newcommand*{\setseperatorwidth}[1]{%
  \setlength{\hep@seperator@width}{#1}%
  \hep@set@main@width
}
\setleftwidth{2.8cm}
\setseperatorwidth{4mm}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Macros}
%
% \begin{macro}{\hep@begin}
% \begin{macro}{\hep@end}
% Define private \CV macros using the \software{array} and \software{hep-font} packages \cite{array,hep-font}.
%    \begin{macrocode}
\RequirePackage{array}
\RequirePackage{hep-font}
\newcommand*{\hep@begin}{\hep@set@main@width\noindent\begin{tabular}{%
  @{}>{\raggedleft\arraybackslash}p{\hep@left@width}%
  @{\hspace{\hep@seperator@width}}p{\hep@main@width}@{}%
}\tstyle}
\newcommand*{\hep@end}{\end{tabular}\hfill\par}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\cvline}
% Define the "\cvline" macro.
%    \begin{macrocode}
\newcommand*{\cvline}[2][]{\hep@begin#1&#2\hep@end}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hep@check@for@optional@args}
% \begin{macro}{\hep@next@optional@arg}
% Define private recursive macros for the "\cventry" macro.
%    \begin{macrocode}
\newcommand*{\hep@next@optional@arg}[1][]{%
  \em{\em{#1}}\hep@check@for@optional@args%
}
\newcommand*{\hep@check@for@optional@args}{%
  \@ifnextchar*{%
    ,\newline\@firstoftwo\hep@next@optional@arg%
  }{%
    \@ifnextchar[{, \hep@next@optional@arg}{.\hep@end}%
  }%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\cventry}
% Define the "\cventry" macro.
%    \begin{macrocode}
\newcommand*{\cventry}[2][]{%
  \vspace{.5ex plus .2ex minus .2ex}%
  \hep@begin#1&\textbf{#2}\hep@check@for@optional@args%
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Dates}
%
% \begin{macro}{\hep@date@setup}
% The month macros are defined by "\hep@date@setup".
% It is called below with the "date" option and by \software{hep-cv-bibliography} if that package receives the "date" option after \software{hep-cv} has been loaded without it.
%    \begin{macrocode}
\RequirePackage{etoolbox}
\newcommand*{\hep@date@setup}{%
%    \end{macrocode}
%
% \begin{macro}{\hep@longest@month}
% \begin{macro}{\hep@spread@even}
% \begin{macro}{\hep@month}
% Define macros of equally distributed month names.
% The width of the longest month name is measured each time in the current font.
%    \begin{macrocode}
\newlength{\hep@longest@month}%
\newcommand*{\hep@spread@even}[1]{\@tfor\next:=##1\do{\hfil\next}}%
\newcommand*{\hep@month}[1]{%
  \settowidth{\hep@longest@month}{May}%
  \makebox[\hep@longest@month][c]{\hep@spread@even{##1}}%
}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\Jan}
% \begin{macro}{\Feb}
% \begin{macro}{\Mar}
% \begin{macro}{\Apr}
% \begin{macro}{\May}
% \begin{macro}{\Jun}
% \begin{macro}{\Jul}
% \begin{macro}{\Aug}
% \begin{macro}{\Sep}
% \begin{macro}{\Oct}
% \begin{macro}{\Nov}
% \begin{macro}{\Dec}
% Apply macros of equally distributed month names.
% They are robust and print the plain month name in PDF strings such as bookmarks.
%    \begin{macrocode}
\newrobustcmd*{\Jan}{\hep@month{Jan}}%
\newrobustcmd*{\Feb}{\hep@month{Feb}}%
\newrobustcmd*{\Mar}{\hep@month{Mar}}%
\newrobustcmd*{\Apr}{\hep@month{Apr}}%
\newrobustcmd*{\May}{\hep@month{May}}%
\newrobustcmd*{\Jun}{\hep@month{Jun}}%
\newrobustcmd*{\Jul}{\hep@month{Jul}}%
\newrobustcmd*{\Aug}{\hep@month{Aug}}%
\newrobustcmd*{\Sep}{\hep@month{Sep}}%
\newrobustcmd*{\Oct}{\hep@month{Oct}}%
\newrobustcmd*{\Nov}{\hep@month{Nov}}%
\newrobustcmd*{\Dec}{\hep@month{Dec}}%
\AtBeginDocument{%
  \ifdefined\pdfstringdefDisableCommands
    \pdfstringdefDisableCommands{%
      \def\Jan{Jan}\def\Feb{Feb}\def\Mar{Mar}\def\Apr{Apr}%
      \def\May{May}\def\Jun{Jun}\def\Jul{Jul}\def\Aug{Aug}%
      \def\Sep{Sep}\def\Oct{Oct}\def\Nov{Nov}\def\Dec{Dec}%
    }%
  \fi
}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% End of "\hep@date@setup".
%    \begin{macrocode}
}
%    \end{macrocode}
% \end{macro}
%
% Define the month macros with the "date" option.
%    \begin{macrocode}
\ifhepcv@date
  \hep@date@setup
\fi
%    \end{macrocode}
%
% \subsubsection{Lists}
%
% Begin of list conditionals and load the \software{hep-text} \cite{hep-text} package.
%    \begin{macrocode}
\ifhepcv@list
\RequirePackage{hep-text}
%    \end{macrocode}
%
% \begin{macro}{itemize}
% Adjust lists to the \CV format.
%    \begin{macrocode}
\setlist[1]{
  leftmargin=\hep@left@width+\hep@seperator@width,
  labelwidth=\hep@left@width,
  labelsep=\hep@seperator@width,
}
\setlist{
  nosep,
  topsep=.5ex,
  listparindent=0pt,
  itemindent=0pt,
  align=right
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{enumerate}
% Adjust the "enumerate" list to the \CV format.
%    \begin{macrocode}
\setlist[enumerate]{label=\arabic*}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{description}
% Adjust the "description" list to the \CV format.
%    \begin{macrocode}
\setlist[description]{font=\normalfont}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{enumdescript}
% Adjust the "enumdescript" list to the \CV format.
%    \begin{macrocode}
\setlist[enumdesc]{label=\arabic*}
%    \end{macrocode}
% \end{macro}
%
% End of lsit conditional.
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
%</package>
%
% \section{Class implementation}
%
%<*class>
%
% Base the \CV on the article class.
%    \begin{macrocode}
\PassOptionsToClass{a4paper}{article}
\LoadClass{article}
%    \end{macrocode}
%
% \subsection{Options}
%
% Load the \software{kvoptions} package \cite{kvoptions} and define a "hepcv" namespace.
%    \begin{macrocode}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
  family=hepcv,
  prefix=hepcv@
}
%    \end{macrocode}
%
% \begin{macro}{font}
% \begin{macro}{10pt}
% \begin{macro}{11pt}
% \begin{macro}{12pt}
% Define a "font="\meta{size} option.
% Make \unit[11]{pt} the default font size.
% The standard size options "10pt", "11pt" and "12pt" are shortcuts for it, so that they are not overridden by the size of \software{hep-font}.
%    \begin{macrocode}
\DeclareStringOption[11pt]{font}
\DeclareVoidOption{10pt}{\def\hepcv@font{10pt}}
\DeclareVoidOption{11pt}{\def\hepcv@font{11pt}}
\DeclareVoidOption{12pt}{\def\hepcv@font{12pt}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{sansserif}
% Define the option pair "serif" and "sansserif" controling the font shape of the whole document.
%    \begin{macrocode}
\DeclareBoolOption[false]{serif}
\DeclareComplementaryOption{sansserif}{serif}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{hyperref}
% Provide the option "standalone" in order to use the \CV macros in other packages.
%    \begin{macrocode}
\DeclareBoolOption[true]{hyperref}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\ProcessKeyvalOptions*
%    \end{macrocode}
%
% \subsection{Packages}
%
% Load the \software{hep-cv} and \software{fullpage} packages \cite{fullpage} and the \software{calc} \cite{calc} packages.
%    \begin{macrocode}
\PassOptionsToPackage{
  size=\hepcv@font,
  sans=\ifhepcv@serif false\else true\fi,
  oldstyle
}{hep-font}
\RequirePackage{hep-cv}
% \RequirePackage{fullpage}
\setleftwidth{2.8cm}
\setseperatorwidth{4mm}
%    \end{macrocode}
%
% \subsection{Address field}
%
% Load the \software{phonenumbers} package \cite{phonenumbers}.
%    \begin{macrocode}
\PassOptionsToPackage{foreign}{phonenumbers}
\RequirePackage{phonenumbers}
%    \end{macrocode}
% \begin{macro}{\address}
% \begin{macro}{\addressfont}
% Define contact information macros.
%    \begin{macrocode}
\newcommand*\address[1]{\long\gdef\hep@address{#1}}
\newcommand*{\addressfont}{\itshape\small}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\hep@address@field}
% Define "\hep@address@field" macro.
%    \begin{macrocode}
\newcommand*{\hep@address@field}{
  \ifdef{\hep@address}{\hep@address\\}{}\strut
}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Cover letter}
%
% \begin{macro}{\opening}
% \begin{macro}{\makelettertitle}
% Define "\lettertitle" macros.
% The opening is empty unless it is set.
%    \begin{macrocode}
\newcommand*\opening[1]{\long\gdef\hep@opening{#1}}
\opening{}
\newcommand*\makelettertitle{{%
    \raggedleft\addressfont
    \textbf{\@author}\\
    \hep@address@field
  }\\\raggedright\bigskip\hep@opening\par
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\closing}
% \begin{macro}{\makeletterclosing}
% Define macros for the letter closing.
% The closing is empty unless it is set.
%    \begin{macrocode}
\newcommand*\closing[1]{\long\gdef\hep@closing{#1}}
\closing{}
\newcommand*\makeletterclosing{%
  \par\bigskip\hep@closing\par\textbf{\@author}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{letter}
% Define "letter" environment.
%    \begin{macrocode}
\newenvironment{letter}{%
  \thispagestyle{plain}\makelettertitle%
}{%
  \makeletterclosing\clearpage%
}
%    \end{macrocode}
% \end{macro}

% \subsection{Title}
%
% \begin{macro}{\HUGE}
% \begin{macro}{\titlefont}
% Define the "\HUGE" fontsize for the title using the "anyfontsize" package \cite{anyfontsize}.
% It replaces the "\HUGE" of the \software{fontsize} package loaded by \software{hep-font}.
%    \begin{macrocode}
\RequirePackage{anyfontsize}
\DeclareRobustCommand*\HUGE{\@setfontsize\HUGE{38}{47}}
\newcommand*{\titlefont}{\HUGE}
\newcommand*{\infofont}{\small}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\addtitleline}
% Define macros for further identity informations.
%    \begin{macrocode}
\newcommand*{\hep@title@lines}{}
\newcommand*{\addtitleline}[2]{%
  \let\@hep@title@lines\hep@title@lines
  \expandafter\renewcommand\expandafter*\expandafter\hep@title@lines\expandafter{%
    \@hep@title@lines\cvline[#1]{#2}%
  }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hep@contact@lines}
% \begin{macro}{\hep@contact@line}
% \begin{macro}{\addcontactline}
% Define the "\hep@contact@line" macro.
%    \begin{macrocode}
\newcommand*{\hep@contact@lines}{}
\newcommand{\addcontactline}[1]{%
  \ifx\hep@contact@lines\@empty
    \gappto\hep@contact@lines{#1}%
  \else
    \gappto\hep@contact@lines{\\#1}%
  \fi
}
\newcommand*{\hep@contact@line}{%
  \ifdef{\hep@address}{%
    \hep@address\\[-1.5ex]\strut
    \ifx\hep@contact@lines\@empty
    \else
      \\%
    \fi
  }{}%
  \hep@contact@lines
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\hep@head}
% \begin{macro}{\hep@tail}
% Define head and tail macros.
%    \begin{macrocode}
\newcommand*\hep@head[1]{%
  \expandafter\@hep@head\expandafter\expandafter#1 \@nil%
}%
\newcommand*\@hep@head{}%
\def\@hep@head#1 #2\@nil{#1\unskip}%
%
\newcommand*\hep@tail[1]{%
  \expandafter\@hep@tail\expandafter\expandafter#1 \@nil%
}%
\newcommand*\@hep@tail{}%
\def\@hep@tail#1 #2\@nil{#2\unskip}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\hep@top@include@graphics}
% Include graphics top aligned using the \software{graphicx} package \cite{graphicx}.
%    \begin{macrocode}
\RequirePackage{graphicx}
\newcommand*{\hep@top@include@graphics}[2][]{%
  \raisebox{%
    \dimexpr-\height+\ht\strutbox\relax%
  }{%
    \includegraphics[#1]{#2}%
  }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\photo}
% Store photo path.
%    \begin{macrocode}
\newcommand*\photo[1]{\long\gdef\hep@photo{#1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\maketitle}
% Redefine the "\maketitle" macro using the "textpos" package \cite{textpos}.
%    \begin{macrocode}
\RequirePackage{textpos}
\DeclareDocumentCommand{\maketitle}{}{%
  \par\noindent{\titlefont%
    \@ifundefined{hep@photo}{%
      \settowidth{\dimen0}{\hep@head{\@author}}%
      \ifdim\dimen0>\hep@left@width\relax%
        \noindent\begin{tabular}{l}\@author\hep@end%
      \else%
        \cvline[\hep@head{\@author}]{\hep@tail{\@author}}%
      \fi%
      {\infofont\hep@title@lines}%
    }{%
      \hep@begin%
        \hep@top@include@graphics[width=\hep@left@width]{\hep@photo}%
      &%
        \@author\newline\newline\infofont%
        \renewcommand*{\cvline}[2][]{##1&##2\\}%
        \noindent%
        \begin{tabular}{@{}r@{: }l@{}}\hep@title@lines\end{tabular}%
      \hep@end\medskip%
    }%
    \begin{textblock*}{\linewidth}[1,0](\linewidth,-4ex)%
      \raggedleft\addressfont\hep@contact@line%
    \end{textblock*}%
  }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{environment}{abstract}
% Redfine the abstract environment.
%    \begin{macrocode}
\AtBeginDocument{\renewcommand*{\abstractname}{Summary}}
\renewenvironment{abstract}{\hep@begin\abstractname&}{\hep@end\bigskip}
%    \end{macrocode}
% \end{environment}
%
% \subsection{Hyperref}
%
% Begin of hyperref conditional.
%    \begin{macrocode}
\ifhepcv@hyperref
%    \end{macrocode}
%
% Load the \software{hep-reference} package \cite{hep-reference}.
%    \begin{macrocode}
\RequirePackage{hep-reference}
%    \end{macrocode}
%
% End of hyperref conditional.
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
% \begin{macro}{\title}
% The title of a \CV is the author followed by the current \CV part.
% It is not printed, but it is used for the PDF "title", also by hooks that set it before "\maketitle".
%    \begin{macrocode}
\title{\@author~---~\hep@part}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hep@pdf@info}
% Update the PDF "title" and "author" information at the beginning of the document if \software{hyperref} \cite{hyperref} is loaded.
%    \begin{macrocode}
\newcommand*{\hep@pdf@info}{%
  \ifdefined\hypersetup
    \hypersetup{pdftitle={\@title}, pdfauthor={\@author}}%
  \fi
}
\AtBeginDocument{\hep@pdf@info}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\phantomsection}
% Provide "\phantomsection", used by the starred sections, if \software{hyperref} is not loaded.
%    \begin{macrocode}
\AtBeginDocument{\providecommand*{\phantomsection}{}}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Sectioning}
%
% Begin of sectioning conditional.
%    \begin{macrocode}
% \ifhepcv@sectioning
%    \end{macrocode}
%
% Load the \software{titlesec} package \cite{titlesec} and deactivate section numbering.
%    \begin{macrocode}
\PassOptionsToPackage{compact}{titlesec}
\RequirePackage{titlesec}
\setcounter{secnumdepth}{0}
%    \end{macrocode}
%
% \begin{macro}{\hep@dash@length}
% \begin{macro}{\hep@dash@height}
% \begin{macro}{\hep@dash@shift}
% \begin{macro}{\hep@dash@sep}
% Load the \software{dashrule} package \cite{dashrule} and define dash properties.
%    \begin{macrocode}
\RequirePackage{dashrule}
\newcommand*{\hep@dash@length}{4pt}
\newcommand*{\hep@dash@height}{.5pt}
\newcommand*{\hep@dash@shift}{.6ex}
\newcommand*{\hep@dash@sep}{.5em}
\newlength{\hep@dash@width}
\newlength{\hep@dash@seperator}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%    \begin{macrocode}
\providecommand*{\sentence}{}
%    \end{macrocode}
%
% \begin{macro}{\section}
% Redefine "\section".
%    \begin{macrocode}
\titleformat{name=\section}{\Large}{%
  \setlength{\hep@dash@width}{%
    \hep@left@width-\widthof{\thesection}-\hep@dash@length-\hep@dash@sep%
  }%
  \hdashrule[\hep@dash@shift][x]{\hep@dash@width}{\hep@dash@height}{}%
  \hspace{\hep@dash@length+\hep@dash@sep}\thesection%
}{\hep@seperator@width}{\sentence}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\section*}
% Redefine "\section*".
%    \begin{macrocode}
\titleformat{name=\section, numberless}{\Large}{%
  \phantomsection%
  \setlength{\hep@dash@width}{\hep@left@width}%
  \hdashrule[\hep@dash@shift][x]{\hep@dash@width}{\hep@dash@height}{}%
}{\hep@seperator@width}{\sentence}
%    \end{macrocode}
% \end{macro}
%
% Spacing.
%    \begin{macrocode}
\titlespacing*{\section}{0pt}{*3}{*1.75}
%    \end{macrocode}

% \begin{macro}{\subsection}
% Redefine "\subsection".
%    \begin{macrocode}
\titleformat{name=\subsection}{\large}{%
  \setlength{\hep@dash@width}{%
    \hep@left@width-\widthof{\thesubsection}-\hep@dash@sep%
  }%
  \hdashrule[\hep@dash@shift][x]{\hep@dash@width}{\hep@dash@height}{1mm}%
  \hspace{\hep@dash@sep}\thesubsection%
}{\hep@seperator@width}{\sentence}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subsection*}
% Redefine "\subsection*".
%    \begin{macrocode}
\titleformat{name=\subsection, numberless}{\large}{%
  \phantomsection%
  \setlength{\hep@dash@width}{\hep@left@width+\hep@dash@length}%
  \setlength{\hep@dash@seperator}{\hep@seperator@width-\hep@dash@length}%
  \hdashrule[\hep@dash@shift][x]{\hep@dash@width}{\hep@dash@height}{%
    \hep@dash@length%
  }%
}{\hep@dash@seperator}{\sentence}
%    \end{macrocode}
% \end{macro}
%
% Spacing.
%    \begin{macrocode}
\titlespacing*{\subsection}{0pt}{*2}{*1.5}
%    \end{macrocode}

% \begin{macro}{\subsubsection}
% Redefine "\subsubsection".
%    \begin{macrocode}
\titleformat{name=\subsubsection}{}{%
  \setlength{\hep@dash@width}{%
    \hep@left@width-\widthof{\thesubsubsection}-\hep@dash@sep%
  }%
  \hdashrule[\hep@dash@shift][x]{\hep@dash@width}{\hep@dash@height}{%
    .7pt \hep@dash@length%
  }%
  \hspace{\hep@dash@sep}\thesubsubsection%
}{\hep@seperator@width}{\sentence}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subsubsection*}
% Redefine "\subsubsection*".
%    \begin{macrocode}
\titleformat{name=\subsubsection, numberless}{}{%
  \phantomsection%
  \setlength{\hep@dash@width}{\hep@left@width+\hep@dash@length}%
  \setlength{\hep@dash@seperator}{\hep@seperator@width-\hep@dash@length}%
  \hdashrule[\hep@dash@shift][x]{\hep@dash@width}{\hep@dash@height}{%
    .7pt \hep@dash@length%
  }%
  }{\hep@dash@seperator}{\sentence}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\paragraph}
% Redefine "\paragraph".
%    \begin{macrocode}
\titleformat{\paragraph}[runin]{\itshape}{}{}{\sentence}[:]
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subparagraph}
% Redefine "\subparagraph".
%    \begin{macrocode}
\titleformat{\subparagraph}[runin]{\itshape}{}{%
  }{\hspace{1em}\sentence%
}[:]
%    \end{macrocode}
% \end{macro}

% \subsection{Table of contents}
%
% Use the \software{titeltoc} package \cite{titlesec} and set the \TOC depths to 2.
%    \begin{macrocode}
\RequirePackage{titletoc}
\setcounter{tocdepth}{2}
\newlength{\label@width}
%    \end{macrocode}
%
% \begin{macro}{section}
% Sections in \TOC.
%    \begin{macrocode}
\titlecontents{section}[\hep@left@width+\hep@seperator@width]{%
  \setlength{\label@width}{%
    \widthof{\large\tstyle\thecontentslabel}+\hep@seperator@width%
  }%
  \vspace{1.5ex}%
}{%
  \contentslabel[\large\tstyle\thecontentslabel]{\label@width}\large%
}{%
  \large%
}{%
  \hfill\contentspage[\large\tstyle\thecontentspage]%
}[\vspace{.5ex}]
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{subsection}
% Subsection in \TOC.
%    \begin{macrocode}
\titlecontents{subsection}[\hep@left@width+\hep@seperator@width]{%
  \setlength{\label@width}{%
    \widthof{\tstyle\thecontentslabel}+\hep@seperator@width+.8em%
  }%
}{%
  \hspace{.8em}\contentslabel[\tstyle\thecontentslabel]{\label@width}%
}{%
  \hdashrule[\hep@dash@shift][x]{.8em}{\hep@dash@height}{\hep@dash@length}%
}{%
  \titlerule*[1pc]{.}\contentspage[\tstyle\thecontentspage]%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{subsubsection}
% Subsubsection in \TOC.
%    \begin{macrocode}
\titlecontents{subsubsection}[\hep@left@width+\hep@seperator@width]{%
  \setlength{\label@width}{%
    \widthof{\thecontentslabel}+\hep@seperator@width+1.5em%
  }%
}{%
  \hspace{1.5em}\contentslabel[\tstyle\thecontentslabel]{\label@width}%
}{%
  \hdashrule[\hep@dash@shift][x]{1.5em}{\hep@dash@height}{%
    .7pt \hep@dash@length%
  }%
}{%
  \titlerule*[1pc]{.}\contentspage[\tstyle\thecontentspage]%
}
%    \end{macrocode}
% \end{macro}
%
% End of check for sectioning option.
%    \begin{macrocode}
% \fi
%    \end{macrocode}
%
% \subsection{Header and Footer}
%
% Use the \software{fancyhdr} package \cite{fancyhdr}.
%    \begin{macrocode}
\RequirePackage{fancyhdr}
\renewcommand*{\headrulewidth}{0pt}
%    \end{macrocode}
%
% \begin{macro}{\cvpart}
% Define the "\cvpart" macro.
% In the document body it also updates the PDF information.
%    \begin{macrocode}
\newcommand*\cvpart[1]{\long\gdef\hep@part{#1}\hep@cvpart@hook}
\let\hep@cvpart@hook\relax
\AtBeginDocument{\global\let\hep@cvpart@hook\hep@pdf@info}
\cvpart{Curriculum Vitæ}
%    \end{macrocode}
%  \end{macro}
%
% Redefine the pagenumber using the \software{lastpage} package \cite{lastpage}.
%    \begin{macrocode}
\RequirePackage{lastpage}
\cfoot{\addressfont Page \thepage\ of \pageref{LastPage}}
%    \end{macrocode}
%
% \begin{macro}{plain}
% Redefine the "plain" page style.
%    \begin{macrocode}
\fancypagestyle{plain}{%
  \rhead{}
  \lhead{}
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{name}
% Define the "name" page style.
%    \begin{macrocode}
\fancypagestyle{name}{%
  \rhead{\addressfont{\@author}}
  \lhead{}
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{both}
% Define the "both" page style.
%    \begin{macrocode}
\fancypagestyle{both}{%
  \rhead{\addressfont{\@author}}
  \lhead{\addressfont{\hep@part}}
}
%    \end{macrocode}
% \end{macro}

% \subsection{Subfiles}
%
% \begin{macro}{\insubfile}
% Provide subfile features using the \software{subfiles} package \cite{subfiles}.
% Its "\ifSubfilesClassLoaded" is true when a subfile is compiled on its own, both in the preamble and in the body.
%    \begin{macrocode}
\RequirePackage{subfiles}
\newcommand*{\insubfile}[1]{\ifSubfilesClassLoaded{#1}{}}
%    \end{macrocode}
% \end{macro}
%
%</class>
%
% \section{Bibliography implementation}
%
%<*bibliography>
%
% \subsection{Options}
%
% Load the \software{kvoptions} package \cite{kvoptions} and define a "hepcv" namespace.
%    \begin{macrocode}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
  family=hepcv,
  prefix=hepcv@
}
%    \end{macrocode}
%
% \begin{macro}{bibliography}
% Provide the option "bibliography" for passing a "style" string to the "biblatex" package \cite{biblatex} or disabling the automatic loading of "biblatex".
%    \begin{macrocode}
\DeclareStringOption[numeric-comp]{bibliography}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{date}
% Provide the option "date" switching to the compact \CV date scheme.
% It is passed on to \software{hep-cv}, whose "\ifhepcv@date" switch is used below.
% The scheme is also used if \software{hep-cv} has been loaded with the "date" option before.
%    \begin{macrocode}
\newif\ifhep@cv@bib@date
\define@key{hepcv}{date}[true]{\csname hep@cv@bib@date#1\endcsname}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\ProcessKeyvalOptions*
%    \end{macrocode}
%
% Load the \software{hep-cv} package and pass the "date" option on.
% If \software{hep-cv} has already been loaded without it, switch the date scheme on and define the month macros now.
%    \begin{macrocode}
\@ifpackageloaded{hep-cv}{}{%
  \ifhep@cv@bib@date\PassOptionsToPackage{date}{hep-cv}\fi
}
\RequirePackage{hep-cv}
\ifhep@cv@bib@date
  \hepcv@datetrue
  \@ifundefined{hep@month}{\hep@date@setup}{}%
\fi
%    \end{macrocode}
%
% \subsection{Biblatex}
%
% Load the \software{biblatex} \cite{biblatex} package and execute bibliography options.
%    \begin{macrocode}
\PassOptionsToPackage{style=\hepcv@bibliography}{biblatex}
\RequirePackage{biblatex}
\ExecuteBibliographyOptions{
  maxnames=99,
  uniquename=init,
  abbreviate=false,
  useeditor=false,
}
\ExecuteBibliographyOptions{sorting=ymdnt, defernumbers}
%    \end{macrocode}
%
% \subsubsection{Authoryear}
%
% Adjust the "authoryear" style. The sorting template is defined in \cref{sec:sorting}
%    \begin{macrocode}
\ifnum\pdf@strcmp{\hepcv@bibliography}{authoryear}=0
  \ExecuteBibliographyOptions{
    dashed=false,
    sorting=ymdnt
  }
%    \end{macrocode}
% \begin{macro}{begentry}
% \begin{macro}{finentry}
% Ensure that the "date" is printed in the left column of the \CV.
% Each entry is a two-column tabular, which starts at the left margin and fills the line.
% It is opened in "begentry" and closed in "finentry".
%    \begin{macrocode}
  \renewbibmacro{begentry}{%
    \hep@set@main@width
    \addtolength{\hep@main@width}{-\itemindent}%
    \begin{tabular}{%
      @{}>{\raggedleft\arraybackslash}p{\hep@left@width}%
      @{\hspace{\hep@seperator@width}}p{\hep@main@width}@{}%
    }%
    \ifhepcv@date
      \iffieldundef{month}{}{\printfield{month}\space}%
      \iffieldundef{year}{}{\printfield{year}}%
      \iffieldundef{endyear}{}{%
        --\iffieldundef{endmonth}{}{\printfield{endmonth}\space}%
        \printfield{endyear}%
      }%
    \else
      \printdate%
    \fi &%
  }
  \renewbibmacro{finentry}{\finentry\end{tabular}}
\fi
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Dates}
%
% Begin of date conditionals.
%    \begin{macrocode}
\ifhepcv@date
%    \end{macrocode}
%
% Define short names for month without dots.
%    \begin{macrocode}
\DefineBibliographyStrings{english}{%
  january = \Jan,
  february = \Feb,
  march = \Mar,
  april = \Apr,
  may = \May,
  june = \Jun,
  july = \Jul,
  august = \Aug,
  september = \Sep,
  october = \Oct,
  november = \Nov,
  december = \Dec
}
%    \end{macrocode}
%
% \begin{macro}{\mkbibshortyear}
% Define shortyear with apostrophe.
% An empty year, such as the end year of the open-ended range "2022-07/", prints nothing.
%    \begin{macrocode}
\DeclareFieldFormat{shortyear}{\ifblank{#1}{}{'\mkbibshortyear{#1}}}
\newcommand*{\mkbibshortyear}[1]{%
  \hep@short@year#1\@empty\@empty\@empty\@empty\@nil%
}
\def\hep@short@year#1#2#3#4#5\@nil{#3#4}
%    \end{macrocode}
% \end{macro}
%
% Use shortyear
%    \begin{macrocode}
\DeclareFieldAlias{year}{shortyear}
\DeclareFieldAlias{endyear}{shortyear}
%    \end{macrocode}
%
% Use superscript ordinals
%    \begin{macrocode}
\DefineBibliographyExtras{british}{%
  \protected\def\mkbibordinal#1{\begingroup%
    \@tempcnta0#1\relax\number\@tempcnta
    \@whilenum\@tempcnta>100\do{\advance\@tempcnta-100\relax}%
    \ifnum\@tempcnta>20
      \@whilenum\@tempcnta>9\do{\advance\@tempcnta-10\relax}%
    \fi
    \textsuperscript{%
      \ifcase\@tempcnta th\or st\or nd\or rd\else th\fi%
    }%
  \endgroup}
}
%    \end{macrocode}
%
% Otherwise abbreviate all months to three letters and a dot, also June, July and September, which the English strings of \software{biblatex} abbreviate differently.
% The definitions apply to the long and the short form of the strings, but the dates of the \CV\ use the short forms anyway.
%    \begin{macrocode}
\else
\DefineBibliographyStrings{english}{%
  june = {Jun\adddot},
  july = {Jul\adddot},
  september = {Sep\adddot}
}
%    \end{macrocode}
%
% End of date conditional.
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
% Format the end month like the month.
%    \begin{macrocode}
\DeclareFieldAlias{endmonth}{month}
%    \end{macrocode}
%
% \subsection{Sorting Templates} \label{sec:sorting}
%
% Ensure that also the first author is written as "given-name family-name"
%    \begin{macrocode}
\DeclareNameAlias{sortname}{given-family}
%    \end{macrocode}

% \begin{macro}{ymnt}
% Define the year-month-name-title sorting scheme
%    \begin{macrocode}
\DeclareSortingTemplate{ymnt}{
  \sort{\field{presort}}
  \sort[final]{\field{sortkey}}
  \sort{\field{sortyear}\field{year}\literal{9999}}
  \sort{%
    \field[padside=left, padwidth=2, padchar=0]{month}%
    \literal{9999}%
  }
  \sort{%
    \field[padside=left, padwidth=2, padchar=0]{day}%
    \literal{00}%
  }
  \sort{%
    \field{sortname}\field{author}\field{editor}%
    \field{translator}\field{sorttitle}\field{title}
  }
  \sort{\field{sorttitle}\field{title}}
}
%    \end{macrocode}
% \end{macro}

% \begin{macro}{ymdnt}
% Define the year-month-descending-name-title sorting scheme
%    \begin{macrocode}
\DeclareSortingTemplate{ymdnt}{
  \sort{\field{presort}}
  \sort[final]{\field{sortkey}}
  \sort[direction=descending]{%
    \field[strside=left, strwidth=4]{sortyear}%
    \field[strside=left, strwidth=4]{year}\literal{9999}
  }
  \sort[direction=descending]{%
    \field[padside=left, padwidth=2, padchar=0]{month}\literal{00}%
  }
  \sort[direction=descending]{%
    \field[padside=left, padwidth=2, padchar=0]{day}\literal{00}%
  }
  \sort{%
    \field{sortname}\field{author}\field{editor}%
    \field{translator}\field{sorttitle}\field{title}%
  }
  \sort{\field{sorttitle}\field{title}}
}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Bibliography headings}
%
% \begin{macro}{bibliography}
% \begin{macro}{section}
% \begin{macro}{subsection}
% \begin{macro}{subsubsection}
% Redefine the usual bibliography heading from "section" to "subsection".
% Define a "section" bibliography heading.
% Define a "subsection" bibliography heading.
% Define a "subsubsection" bibliography heading.
%    \begin{macrocode}
\defbibheading{bibliography}[\bibname]{\subsection{#1}}
\defbibheading{section}[\bibname]{\section{#1}}
\defbibheading{subsection}[\bibname]{\subsection{#1}}
\defbibheading{subsubsection}[\bibname]{\subsubsection{#1}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Macros}
%
% \begin{macro}{related:default}
% Related bibliography entries.
%    \begin{macrocode}
\renewbibmacro*{related:default}[1]{%
  \renewcommand*{\newunitpunct}{\addcomma\space}%
  \entrydata{#1}{\usebibmacro{doi+eprint+url}}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{titlefirst}
% A macro that can be used to places the title at the beginning.
%    \begin{macrocode}
\newbibmacro*{titlefirst}{%
  \ifboolexpr{
    test {\iffieldundef{title}}
    and
    test {\iffieldundef{subtitle}}
  }{%
  }{\printtext[title]{%
      \printfield[titlecase]{title}%
      \setunit{\subtitlepunct}%
      \printfield[titlecase]{subtitle}%
    }\newunit%
  }\printfield{titleaddon}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\setlengths}
% Set bibliography length.
%    \begin{macrocode}
\newcommand*{\setlengths}{%
  \setlength{\labelnumberwidth}{\hep@left@width-\hep@seperator@width}%
  \setlength{\labelwidth}{\labelnumberwidth}%
  \setlength{\leftmargin}{\labelwidth}%
  \setlength{\labelsep}{\biblabelsep}%
  \addtolength{\leftmargin}{\labelsep}%
  \setlength{\itemsep}{\bibitemsep}%
  \setlength{\parsep}{\bibparsep}%
  \addtolength{\leftmargin}{\hep@seperator@width}%
  \addtolength{\labelwidth}{\hep@seperator@width}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\printcvdate}
% Print date in the left column.
%    \begin{macrocode}
\newcommand*{\printcvdate}{%
  \printtext{\hfill}%
  \ifkeyword{ongoing}{\printtext{Since} }{}%
  \iffieldundef{day}{}{\printfield{day}\printtext{.\space}}%
  \smash{\vphantom{\printfield{day}}}% Why do I need this?
  \iffieldundef{month}{}{\printfield{month}\space}%
  \tstyle\iffieldundef{year}{}{\printfield{year}}%
  \iffieldundef{endyear}{}{%
    --\iffieldundef{endday}{}{\printfield{endday}. }%
    \iffieldundef{endmonth}{}{\printfield{endmonth}\space}%
    \printfield{endyear}%
  }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\printcvindex}
% Print index label in the left column.
% The name differs from "\printindex", which prints the index with \software{makeidx} or \software{imakeidx}.
%    \begin{macrocode}
\newcommand*{\printcvindex}{%
  \printtext[labelnumberwidth]{%
    \printfield{labelprefix}\tstyle\printfield{labelnumber}%
  }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{given-family-bold}
% Bold names.
%    \begin{macrocode}
\DeclareNameFormat{given-family-bold}{%
  \mkbibbold{%
    \ifgiveninits{%
      \usebibmacro{name:given-family}{\namepartfamily}%
      {\namepartgiveni}{\namepartprefix}{\namepartsuffix}%
    }{%
      \usebibmacro{name:given-family}{\namepartfamily}%
      {\namepartgiven}{\namepartprefix}{\namepartsuffix}%
    }%
  \usebibmacro{name:andothers}
  }%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\printissuedate}
% Print issue and date.
%    \begin{macrocode}
\newcommand*{\printissuedate}{%
  % \ifhepcv@date
  \printtext{\hfill}%
  \ifkeyword{ongoing}{\printtext{Since}}{}
  \iffieldundef{issue}{}{\printfield{issue}\space}%
  \tstyle\iffieldundef{year}{}{\printfield{year}}%
  \iffieldundef{endyear}{}{%
    --\iffieldundef{endmonth}{}{\printfield{endmonth}\space}%
    \printfield{endyear}%
  }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\adjustOrgLocDat}
% Adjust organisation, location, and Date.
%    \begin{macrocode}
\newcommand*{\adjustOrgLocDat}{%
  \renewbibmacro*{organization+location+date}{%
    \printlist{organization}\setunit*{\addcomma\space}%
    \printlist{location}\setunit*{\addcomma\space}\newunit%
  }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\cleardate}
% Clear the date from the entry body, since it is printed in the left column.
% Besides "issue+date", the date is printed by the "date" macro, which is used by "organization+location+date" (\eg "@misc"), "publisher+location+date", "institution+location+date" and "location+date".
%    \begin{macrocode}
\newcommand*{\cleardate}{%
  \renewbibmacro*{issue+date}{%
    \printfield{issue}%
    \setunit*{\addspace}\newunit
  }%
  \renewbibmacro*{date}{}%
}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Bibliography environments}
%
% \begin{environment}{unnumbered}
% Unnumbered bibliography environment.
%    \begin{macrocode}
\defbibenvironment{unnumbered}{%
  \toggletrue{blx@skiplab}%
  \cleardate
  \list{\printcvdate}{\setlengths}%
  \renewcommand*{\makelabel}[1]{\hss##1}%
}{\endlist}{\item}
%    \end{macrocode}
%\end{environment}
%
% \environment{numbered}{Numbered bibliography environment.}
%    \begin{macrocode}
\defbibenvironment{numbered}{%
  \cleardate
  \list{\printcvindex\printcvdate}{\setlengths}%
  \renewcommand*{\makelabel}[1]{\hss##1}%
}{\endlist}{\item}
%    \end{macrocode}
%
% \begin{environment}{starrednumbered}
% Starrred and numbered bibliography environment.
%    \begin{macrocode}
\defbibenvironment{starrednumbered}{%
  \cleardate
  \list{%
    \printcvindex%
    \ifkeyword{main5}{\hfill\textborn}{}%
    \printcvdate%
  }{\setlengths}%
  \renewcommand*{\makelabel}[1]{\hss##1}%
}{\endlist}{\item}
%    \end{macrocode}
%\end{environment}
%
%</bibliography>
%
% \section{Tests}
%
% \subsection{Package}
%
%<*test-sty>
%
%    \begin{macrocode}
\documentclass{article}

\usepackage{hep-cv}

\author{First Last}
\title{Test}
\date{}

\begin{document}

\maketitle

\tableofcontents

\section{Macros and environments}

\subsection{Macros}

\cvline[left]{cvline example}

\cventry[left]{cvetry example}[one][two]*[starred three][four]
\cventry[left]{cvetry example}[one]
\cventry[left]{cvetry example}

\subsection{Environments}

\subsubsection{Itemize}

\begin{itemize}
\item first
\item second
\end{itemize}

\subsubsection{Enumerate}

\begin{enumerate}
\item first
\item second
\end{enumerate}

\subsubsection{Description}

\begin{description}
\item[first] one
\item[second] two
\end{description}

\subsubsection{Enumdescript}

\begin{enumdescript}
\item{first} one
\item{second} two
\end{enumdescript}

\end{document}
\end{macro}
%    \end{macrocode}
%</test-sty>
%
% \subsection{Class}
%
%<*test-cls>
%    \begin{macrocode}
\documentclass{hep-cv}

\usepackage{blindtext}

\author{First Last}
\address{Address}
\addtitleline{Additional}{Info}
\addcontactline{Contact info}

\setcounter{secnumdepth}{2}
\opening{To whom it may concern,}
\closing{With kind regards,}
\begin{document}

\begin{letter}
Letter content
\end{letter}

\tableofcontents

\clearpage

\section{Title}

\subsection{Short name}

\author{First Last}
\maketitle

\subsection{Long name}

\author{{First-name Last-name}}
\maketitle

\subsection{Photo}

\author{First Last}
\photo{picture}
\maketitle

\begin{abstract}
\blindtext
\end{abstract}

\blinddocument

\end{document}
\end{macro}
%    \end{macrocode}
%</test-cls>
%
% \subsection{Bibliography}
%
%<*test-bib>
%    \begin{macrocode}
\documentclass{article}

\usepackage{hep-cv-bibliography}

\addbibresource{hep-bibliography-test.bib}

\nocite{*}

\begin{document}
\printbibliography[env=numbered, heading=section, title=Publications]
\end{document}
%    \end{macrocode}
%</test-bib>
%
% \section{Readme}
%
%<*readme>
%
%    \begin{macrocode}
# The `hep-cv` package

Curricula vitae, cover letters and publication lists

## Introduction

The `hep-cv` package and class provide a compact CV layout for HEP
applications. The package defines the left-column CV line and entry
layout, list styling, month helpers, and bibliography support. The class
adds article-based CV defaults, contact and photo title pages,
cover-letter helpers, section and page styles, and subfile support.

For package-only use:

    \documentclass{article}
    \usepackage{hep-cv}

For complete CV documents use the `hep-cv` class.

## Author

Jan Hajer

## License

This file may be distributed and/or modified under the conditions of the
`LaTeX` Project Public License, either version 1.3c of this license or
(at your option) any later version. The latest version of this license is
in `http://www.latex-project.org/lppl.txt` and version 1.3c or later is
part of all distributions of LaTeX version 2005/12/01 or later.
%    \end{macrocode}
%
%</readme>
%
% \Finale
%
\endinput
