% \iffalse meta-comment
%
% Copyright 2023-2026 Tristan Miller
% -----------------------------------
%
% This work 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
%   https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008 or later.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{heria.dtx}
%</driver>
%<*class>
%% Copyright 2023-2026 Tristan Miller
%% Copyright 2016 John Kormylo
%%
%% This work 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
%%   https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008 or later.
%%
%</class>
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{heria}
%<*class>
[2026-08-16 v5.1.1.0 Class for Horizon Europe (R)IA proposals]
%</class>
%
%<*driver>
\documentclass{ltxdoc}
\DisableCrossrefs
\CodelineIndex
\RecordChanges
\addtolength\marginparwidth{5ex}
\addtolength\oddsidemargin{6ex}
\addtolength\evensidemargin{6ex}
\begin{document}
\DocInput{heria.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{1633}
%
% \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         \~}
%
%
% \GetFileInfo{heria.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
%
% \title{\textsf{heria}: A \LaTeX\ class for\\ Horizon Europe RIA and
% IA grant proposals\thanks{This document corresponds to
% \textsf{heria}~\fileversion, dated \filedate. See §\ref{sec:version}
% for an explanation of the versioning scheme.}}
%
% \author{Tristan Miller\\
% Department of Computer Science\\
% University of Manitoba\\
% \texttt{Tristan.Miller@umanitoba.ca}}
%
% \maketitle
% \tableofcontents
%
% \section{Introduction}\label{sec:introduction}
%
% This document describes the usage of \textsf{heria}, a \LaTeX\ class
% that facilitates the preparation of Research and Innovation Action
% (RIA) and Innovation Action (IA) single-stage funding proposals for
% the European Commission's~(EC) Horizon Europe program.  The
% Commission prescribes a detailed, structured format for the
% technical description (``Part~B'') of these proposals, but provides
% templates only in Rich Text Format (RTF), a format that does not
% lend itself well to collaborative authorship and
% \mbox{(cross-)}reference management.  The \textsf{heria} class is a
% conversion of the official Part~B template into \LaTeX; it preserves
% the formatting and most of the instructions of the original version,
% and has the additional feature that tables (listing the
% participants, work packages, deliverables, etc.)\ are
% programmatically generated according to data supplied by the user.
% The advantage of this becomes clear when one considers that much of
% the data is reused across multiple tables.
%
% The \textsf{heria} package can be used to write proposals using
% any of the following versions of the official Part~B template:
% \begin{itemize}
% \item 3.2 (2022-11-15)
% \item 3.3 (2023-09-27)
% \item 3.4 (2024-04-04)
% \item 4.0 (2024-12-16)
% \item 5.1 (2026-01-22)
% \end{itemize}
%
% \bigskip
%
% \noindent Besides this technical manual, there is a journal article
% that describes the motivation for and development of \textsf{heria}:
%
% \begin{quote}
%   Tristan
%   Miller. \href{https://dx.doi.org/10.47397/tb/45-1/tb139miller-horizon}{Preparing
%   Horizon Europe proposals in \LaTeX\ with
%   \textsf{heria}}. \emph{TUGboat: The Communications of the \TeX\
%   Users Group}, 45(1):\allowbreak 59–64, 2024. ISSN 0896-3207. DOI:
%   \href{https://dx.doi.org/10.47397/tb/45-1/tb139miller-horizon}{10.47397/tb/45-1/tb139miller-horizon}.
% \end{quote}
%
% \noindent Please cite this journal article if you want to refer to
% \textsf{heria} in a publication.
%
% \section{Usage}
%
% The EC's official template is structured in such a way that form and
% content cannot be entirely separated. The best way of starting a new
% proposal is therefore to make a copy of
% \texttt{heria-proposal-5.1.tex}, the skeleton proposal distributed
% with this package, and then adapt it to your project.  As suggested
% by the filename, this skeleton proposal uses version 5.1 of the
% official Part~B template.  (\textsf{heria} includes skeleton
% proposals for earlier versions of the Part~B template in the files
% \texttt{heria-proposal-4.0.tex}, \texttt{heria-proposal-3.4.tex},
% etc.).
% 
% The following subsections describe the various macros and
% environments provided by \textsf{heria}, roughly in the same order
% presented in the skeleton proposal.
%
% \subsection{Preamble}
%
% Your proposal document should begin with the following line if you
% want the template instructions to be included in the output:
% \begin{quote}\verb|\documentclass[showinstructions]{heria}|\end{quote}
% Otherwise you can omit the \verb|showinstructions| option:
% \begin{quote}\verb|\documentclass{heria}|\end{quote}
% 
% The \verb|heria| class is based on the default \LaTeX\
% \verb|article| class, and so all of the macros and environments from
% the latter are available for you to use.  The class automatically
% sets the font, margins, etc.\ mandated by the official instructions,
% and redefines some of the \verb|article| macros as described later
% in this document.
%
% \medskip
%
% \noindent Following \cs{documentclass} you should tell
% \textsf{heria} which version of the official Part~B template you
% want to use:
%
% \DescribeMacro{\templateversion} This macro sets the version of the
% official Part~B template the proposal should use.  It takes a single
% argument; valid values are \verb|3.2|, \verb|3.3|, \verb|3.4|,
% \verb|4.0|, and \verb|5.1|.  If you omit this macro, \textsf{heria}
% will default to using the latest version of the template.
%
% \medskip
%
% \noindent You should then provide the proposal metadata using the
% following macros:
%
% \DescribeMacro{\title} This macro takes the title of the proposal as
% its sole argument.  This title will be printed by the \cs{maketitle}
% macro (see below) and used for the PDF metadata.
%
% \DescribeMacro{\callname} This macro takes as its sole argument the
% official natural-language description of the call to which the
% proposal is being submitted.  It will be printed in the page header.
%
% \DescribeMacro{\callidentifier} This macro takes as its sole
% argument the identifier of the call to which the proposal is being
% submitted, which will be printed in the page header.  Call
% identifiers normally have the format
% \texttt{HORIZON-XX0-0000-XXXXX-00-XXXXX}.
%
% \DescribeMacro{\calltopic} This macro takes as its sole argument the
% identifier of the specific topic within the call to which the
% proposal is being submitted.  Such identifiers normally have the
% format \texttt{HORIZON-XX0-0000-XXXXX-00-00}.  The official template
% does not require proposals to mention the call topic, so you are
% free to omit the \cs{calltopic} macro.  If you do use it, it will be
% printed by \cs{maketitle} below the proposal title.
%
% \subsection{Title}
%
% \DescribeMacro{\maketitle} This is generally the first macro that
% should be called in the main body of the document.  As with the
% standard \verb|article| class, it typesets the title.
%
% \subsection{Section headings, tags, and instructions}
%
% \DescribeMacro{\heinstructions}\DescribeMacro{\heinstruction*}
% When the \verb|showinstructions| options is passed to the document
% class, the \cs{heinstructions} macro prints instructions from the
% official EC template.  These instructions are contained in files
% distributed with the \textsf{heria} class; the macro's sole
% mandatory argument is used to construct the name of one of these
% files.  The macro sets the instructions in a blue-tinted box with a
% blue border; the starred variant \cs{heinstructions*} omits the box.
%
% To suppress printing of individual instructions, you can simply
% remove or comment out the corresponding \cs{heinstructions}\slash
% \cs{heinstructions*} macro.
%
% \DescribeMacro{\opentag}\DescribeMacro{\closetag} Versions of the
% official Part~B template up to and including 4.0 include a number of
% ``tags'' that are used for the EC's ``internal processing of
% information, mostly for statistical gathering.''  The \cs{opentag}
% and \cs{closetag} macros are used to emit the tags at the
% appropriate places in the proposal, and so should be left in their
% original positions in the skeleton proposal.  The EC asks that
% proposal authors ``not move, delete, re-order, or alter tags in any
% way''.
%
% \DescribeMacro{\section}\DescribeMacro{\subsection}\DescribeMacro{\subsubsection}
% These three macros take a mandatory argument specifying the title of
% the corresponding section, subsection, or subsubsection,
% respectively.  These document subdivisions are fixed by the official
% template and so generally should not be renamed or reordered, though
% it is probably safe to add additional ones where it does not disrupt
% the numbering of the existing ones.  In versions of the official
% Part~B template up to and including 4.0, many sections and
% subsections \emph{must} be preceded or followed by certain tags,
% which are specified in the first and second optional arguments,
% respectively.  The third optional argument contains the recommended
% page limit, when specified by the official template.  The page limit
% will be printed only when the \verb|showinstructions| option is
% passed to the document class.
%
% \subsection{Participants}
%
% \DescribeMacro{\participant} Participants should be listed in the
% same order as in Part~A of the proposal, which is completed using an
% online form.  Use one invocation of \cs{participant} for each
% participant, with the following three mandatory arguments, in order:
% the participant's full name, the participant's short name, and the
% participant's two-letter country code.  The first participant will
% be marked in the participant table as the project coordinator.  Note
% that while the short name is typeset in the proposal, it is also
% used internally by the \verb|heria| class as part of a \LaTeX\
% counter name, and so should generally consist only of ASCII letters.
%
% \DescribeMacro{\makeparticipantstable} This macro emits the table of
% participants using the data from the \cs{participant} macro.
% Participants are automatically numbered according to the order of
% the \cs{participant} macros.
%
% \subsection{Summary tableau}
%
% \DescribeEnv{summarycanvas}\DescribeEnv{summarybox} Proposals must
% include a summary tableau of six boxes that briefly describe the
% project's specific needs; expected results; dissemination,
% exploitation, and communication measures; target groups; outcomes;
% and impacts.  The \verb|summarycanvas| and \verb|summarybox|
% environments are provided for this purpose.  Each \verb|summarybox|
% environment typesets a shaded box headed by its mandatory argument.
% Three such boxes can be grouped side by side into a single
% \verb|summarycanvas| environment.
% 
% \DescribeEnv{SidewaysFigure} The official Part~B template uses
% landscape orientation to set the summary tableau.  The
% \verb|SidewaysFigure| environment can be used to replicate this
% formatting in your proposal.  If both your \verb|summarycanvas|
% environments fit on a single page, then you can wrap them in a
% single \verb|SidewaysFigure| environment.  Otherwise, you can wrap
% each \verb|summarycanvas| in its own \verb|SidewaysFigure|
% environment to put them on separate pages.
%
% \verb|SidewaysFigure| puts its contents in a floating figure, which
% avoids wasting space when the material preceding the summary tableau
% doesn't end at the bottom of a page.  The skeleton proposal
% demonstrates how such a floating summary tableau can be referenced
% in the relevant subsection of the Impact section.  It also
% demonstrates how, using the \cs{ContinuedFloat} command of the
% \textsf{caption} package, the summary tableau can be assigned a
% single figure number even when it is split across two
% \verb|SidewaysFigure| environments.
%
% \subsection{Work packages and deliverables}
%
% \DescribeMacro{\makeworkpackagestable} This macro emits the table of
% work packages, using the data from the \cs{workpackage} macros. Work
% packages are automatically numbered according to the order of the
% \cs{workpackage} macros.
%
% \DescribeMacro{\workpackage} This macro declares a work package, and
% takes five mandatory arguments: a unique identifier (used only
% internally by \verb|heria| for cross-referencing purposes), the work
% package title, the short name of the lead participant (as specified
% in the corresponding \cs{participant} macro), the numeric starting
% month (measured from the start of the project), and the numeric
% ending month.  Since the unique identifier is used as part of a
% \LaTeX\ counter name, you should generally use only ASCII letters.
% Work packages are automatically numbered.  You should use one
% \cs{workpackage} macro for each work package in your project.
%
% \DescribeEnv{objectives} This environment typesets a box containing
% an enumerated list of objectives for the most recently declared work
% package.  Use the \cs{item} macro to begin each objective.
%
% \DescribeEnv{descriptionofwork} This environment typesets a box
% where you can describe the work program of the most recently
% declared work package.  You can enter this information in free-form
% and\slash or use the \cs{task} macro to enumerate individual tasks.
%
% \DescribeMacro{\task} This macro typesets basic information about a
% work package task. The format used by this macro is not strictly
% mandated by the official template, but you may nonetheless find it
% useful.  The macro takes three mandatory arguments: the task name,
% the short name of the lead participant (as specified in the
% corresponding \cs{participant} macro), a list of other participants
% (as free-form text, but advisedly using short names of participants
% where appropriate), and the starting and ending months for the task
% (as free-form text). You should use one \cs{task} macro for each
% task in your work package.  You can, if you wish, follow each
% \cs{task} macro with a free-form description of the task.
%
% \DescribeMacro{\deliverable} This macro declares a deliverable for
% the most recently declared work package.  There are six mandatory
% arguments: the deliverable name, a short description of the
% deliverable, the short name of the lead participant (as specified in
% the corresponding \cs{participant} macro), the deliverable type, the
% dissemination level, and the numeric delivery month (in months from
% the beginning of the project).  The type and dissemination level
% arguments must be selected from the identifiers given in the
% template instructions.
%
% \DescribeMacro{\makedeliverablestable} This macro emits the table of
% deliverables, using the data from the \cs{deliverable}
% macros. Deliverables are automatically numbered according to the
% order of the \cs{deliverable} macros.
%
% \subsection{Milestones}
%
% \DescribeMacro{\milestone} This macro declares a project milestone.
% It takes four mandatory arguments: the milestone name, a free-form
% list of related work packages, the due date (in number of months
% from the start of the project), and a free-form means of
% verification. You should use one \cs{milestone} macro for each
% milestone in your project.
%
% \DescribeMacro{\makemilestonestable} This macro emits the table of
% milestones, using the data from the \cs{milestone}
% macros. Milestones are automatically numbered according to the order
% of the \cs{milestone} macros.
%
% \subsection{Critical risks}
%
% \DescribeMacro{\criticalrisk} This macro declares a critical risk
% for the project.  It takes five mandatory arguments: a free-form
% description of the risk, the likelihood of the risk, the severity of
% the risk, and a free-form description of proposed mitigation
% measures. The likelihood and severity arguments must be selected
% from the identifiers given in the template instructions.  You should
% use one \cs{criticalrisk} macro for each critical risk in your
% project.
%
% \DescribeMacro{\makecriticalriskstable} This macro emits the table
% of critical risks, using the data from the \cs{criticalrisk}
% macros. Critical risks are output in the order of the
% \cs{criticalrisk} macros.
%
% \subsection{Summary of staff effort}
%
% \DescribeMacro{\staffeffort} This macro declares the number of
% person-months a given project participant will spend on a given work
% package.  It takes three mandatory arguments: the short name of the
% participant (as specified in the corresponding \cs{participant}
% macro), the short name of the work package (as specified in the
% corresponding \cs{workpackage} macro), and the number of months.
% You must provide one and only one \cs{staffeffort} macro for every
% possible combination of participant and work package in your project.
% 
% \DescribeMacro{\makestaffefforttable} This macro emits the summary
% of staff effort table, using the data from the \cs{staffeffort}
% macros. The table rows and columns are automatically ordered
% according to the order of the \cs{participant} and \cs{workpackage}
% macros, respectively, and the total person-months per participant
% and total person-months per work package are automatically
% calculated.
%
% \subsection{Costs}
%
% \DescribeMacro{\subcontractingcost} This macro declares a
% subcontracting cost. It takes three mandatory arguments: the short
% name of a participant (as specified in the corresponding
% \cs{participant} macro), the amount of the subcontracting cost in
% euros, and a free-form description of the tasks and justification
% for the subcontracting cost.  You should use one
% \cs{subcontractingcost} macro for each subcontracting cost in your
% project.
%
% \DescribeMacro{\makesubcontractingcoststable} This macro emits the
% tables of subcontracting costs, using the data from the
% \cs{subcontractingcost} macros.  Subcontracting costs are
% automatically grouped by participant and then output according to
% the order of the \cs{participant} and \cs{subcontractingcost}
% macros.
%
% \medskip
%
% \noindent The following macros are relevant only for those proposals
% that use versions of the official Part~B template from 5.1 onward:
%
% \DescribeMacro{\equipmentcost} This macro declares an equipment cost
% (for the ``Purchase costs'' tables). It takes three mandatory
% arguments: the short name of a participant (as specified in the
% corresponding \cs{participant} macro), the amount of the equipment
% cost in euros, and a free-form description of the need for the
% equipment cost.  You should use one \cs{equipmentcost} macro for
% each equipment cost in your project.
%
% \DescribeMacro{\makeequipmentcoststable} This macro emits the tables
% of equipment (i.e.,\ purchase) costs, using the data from the
% \cs{equipmentcost} macros.  Equipment costs are automatically
% grouped by participant and then output according to the order of the
% \cs{participant} and \cs{equipmentcost} macros.
%
% \medskip
%
% \noindent The following macros are relevant only for those proposals
% that use versions of the official Part~B template up to and
% including 4.0:
%
% \DescribeMacro{\purchasecost} This macro declares the purchase costs
% for a participant.  It takes eight mandatory arguments:
% \begin{quote}\cs{purchasecost}\marg{participant}\verb|%|\\
% \hspace*{5ex}\marg{goodscost}\marg{justification}\verb|%|\\
% \hspace*{5ex}\marg{travelcost}\marg{justification}\verb|%|\\
% \hspace*{5ex}\marg{equipmentcost}\marg{justification}\verb|%|\\
% \hspace*{5ex}\marg{remainingcosts}\end{quote}
% Here \meta{participant} is the short name of a participant (as
% specified in the corresponding \cs{participant} macro);
% \meta{goodscost}, \meta{travelcost}, \meta{equipmentcost}, and
% \meta{remainingcost} are the amount of the ``other goods, works and
% services'', ``travel and subsistence'', ``equipment'', and
% ``remaining purchase costs'', respectively, in euros; and the
% \meta{justification} arguments are free-form justifications for the
% immediately preceding cost.  (According to the official template,
% the remaining purchase costs do not require a justification.)  You
% should use one \cs{purchasecost} macro for each participant with
% purchase costs in your project.
%
% \DescribeMacro{\makepurchasecoststable} This macro emits the tables
% of purchase costs, using the data from the \cs{purchasecost} macros.
% Purchase costs are output according to the order of the
% \cs{participant} macros, and then in reverse order of the largest
% costs, with the ``remaining purchase costs'' output last.
%
% \DescribeMacro{\othercost} This macro declares an ``other'' cost
% (i.e.,\ in the ``other costs'' category). It takes three mandatory
% arguments: the short name of a participant (as specified in the
% corresponding \cs{participant} macro), the amount of the ``other''
% cost in euros, and a free-form justification for the cost.  You
% should use one \cs{othercost} macro for each ``other'' cost in your
% project.
%
% \DescribeMacro{\makeothercoststable} This macro emits the tables of
% ``other'' costs, using the data from the \cs{othercost} macros.
% ``Other'' costs are automatically grouped by participant and then
% output according to the order of the \cs{participant} and
% \cs{othercost} macros.
%
% \DescribeMacro{\inkindcontribution} This macro declares an in-kind
% contribution. It takes five mandatory arguments: the short name of a
% participant (as specified in the corresponding \cs{participant}
% macro), the third party name, the category of the contribution
% (selected from \texttt{Seconded personnel}, \texttt{Travel and
% subsistence}, \texttt{Equipment}, \texttt{Other goods, works and
% services}, and \texttt{Internally invoiced goods and services}), the
% amount of the cost in euros, and a free-form justification for the
% in-kind contribution.  You should use one \cs{inkindcontribution}
% macro for each in-kind contribution in your project.
%
% \DescribeMacro{\makeinkindcontributionstable} This macro emits the
% tables of in-kind contributions, using the data from the
% \cs{inkindcontribution} macros.  In-kind contributions are
% automatically grouped by participant and then output according to
% the order of the \cs{participant} and \cs{inkindcontribution}
% macros.
%
% \section{Hints and tips}
%
% \paragraph{Part~A.} Some proposal data---in particular, the list of
% participants and the costs---must be entered not just in Part~B of
% the proposal, but also in the online Part~A form.  It is your
% responsibility to ensure that this data is consistent across the two
% parts of the proposal.
%
% \paragraph{File structure.} Rather than putting all the work package
% data into your main proposal document, you may find it convenient to
% put the \cs{workpackage} macro, the \verb|objectives| environment,
% the \verb|descriptionofwork| environment, and the \cs{deliverable}
% macros corresponding to a single work package into a dedicated file,
% which you can then include in your main proposal document with the
% \cs{input} macro.  This will make it easier for you to shuffle the
% order of work packages as you write your proposal.  (You may wish to
% split off other sections of the proposal into their own files,
% though the official template gives considerably less freedom to
% reorder them.)
% 
% \paragraph{Vertical spacing.} The \textsf{heria} class applies the
% same vertical spacing as the \textsf{article} class; this is
% particularly generous around section headings.  If you find yourself
% running up against the page limit, you may wish to add some
% \cs{vspace} commands, with a negative length as the argument, to
% tighten up the spaces before section headings, and perhaps also the
% tables.
%
% \section{Limitations and caveats}
%
% \paragraph{Table 3.1h.} The instructions in versions of the official
% template up to and including 4.0 are ambiguous about the
% construction of the tables for purchase costs.  In particular, it's
% not clear whether each individual cost exceeding 15\% of the
% personnel costs must be listed in a separate row, or whether all
% costs in each category (``travel and subsistence'', ``equipment'',
% etc.)\ should be combined into a single row.  The \textsf{heria}
% class takes the latter interpretation; this may or may not be the
% same interpretation adopted by the funding agency and its reviewers.
%
% This ambiguity is not so troubling in versions of the official
% template after 4.0, since their purchase tables list only one
% category of costs (equipment).
%
% \paragraph{Error handling.} The class currently does very little
% error checking on its input.  Usually invalid input (e.g., mistyping
% the short name of a participant or work package in a macro argument,
% or neglecting to provide a macro necessary to generate a table)
% \emph{will} result in an error that prevents the document from
% compiling, though the diagnostic message emitted by \LaTeX\ may be
% somewhat cryptic.
%
% \paragraph{Coverage of instructions.}  The class reproduces most,
% but not all, of the instructions from the official template.  In
% particular, it omits all the instructions occurring before the title
% of the proposal, including three pages of introductory material and
% definitions.  You should not rely solely on the instructions emitted
% by the class, which are provided only as a convenience; be sure to
% also read the instructions in the official template (and in the text
% of the call to which you are applying).
%
% \section{Package development}
%
% \subsection{Source repository and bug tracker}
%
% For now, the package's source code is hosted on GitHub at
% \url{https://github.com/logological/heria}.  There you will also
% find an issue tracker for reporting bugs and feature requests.
%
% \subsection{Versioning scheme}\label{sec:version}
%
% Each release of the \textsf{heria} class carries a version number in
% the format \textit{omaj.\allowbreak omin.\allowbreak maj.\allowbreak
% min}. Here \textit{omaj.omin} is the highest version number of the
% official Horizon Europe RIA template that the class implements, and
% \textit{maj} and \textit{min} represent, respectively, major and
% minor revisions to the class (including any ancillary files, such as
% the skeleton proposal and documentation).  A major revision is one
% that includes potentially breaking changes or significant new
% features; minor revisions are for all other changes.  While efforts
% will be made to preserve compatibility with earlier versions of the
% official template (via the \cs{templateversion} macro), any change
% to \textit{omaj.omin} could unavoidably introduce breaking changes
% to the class interface.  Any such changes will be noted in the
% package documentation.
%
% \subsection{Version history}
%
% \begin{description}
% \item[v5.1.1.0 (2026-08-16)] Added support for version 5.1 of
%   the official Part~B template.
%
%   Removed licence notice from skeleton proposals.
%
%   Added example texts to the summary tableau.
%
%   Added documentation for the \verb|SidewaysFigure| environment.
%
%   Provided skeleton proposals for each supported version of the
%   official Part~B template.
%
% \item[v4.0.1.0 (2025-08-16)] Added support for version 4.0 of the
%   official Part~B template.
% \item[v3.4.1.3 (2024-09-03)] Fixed a bug where the person-months in
%   Table 3.1a were doubled.
% \item[v3.4.1.2 (2024-09-03)] Fixed a bug where the column totals in
%   Table 3.1f were doubled.
% \item[v3.4.1.1 (2024-08-14)] Updated documentation with a reference
%   to the \emph{TUGboat} paper on \textsf{heria}.
% \item[v3.4.1.0 (2024-07-14)] Added support for version 3.4 of the
%   official Part~B template and the \cs{templateversion} macro for
%   backward compatibility with earlier versions.
% \item[v3.2.1.0 (2023-12-04)] Initial release.
% \end{description}
%
% \section{Disclaimer}
%
% The \textsf{heria} package is distributed in the hope that it will
% be useful, but WITHOUT ANY WARRANTY; without even the implied
% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
% PURPOSE. (See the \LaTeX\ Project Public License for further
% details.)  In particular, users should understand that the
% \textsf{heria} proposal template is wholly unofficial, and its
% author(s) accept no responsibility for any omissions, errors, or
% discrepancies with respect to the requirements set forth in the
% official Horizon Europe templates and associated documentation.  If
% you produce a proposal with this template, then you alone are
% responsible for ensuring that it matches all the official
% requirements before submitting it to the funding body.
%
% \appendix
%
% \section{Implementation}
%
% \StopEventually{}
%
% \subsection*{Basic setup}
%
% Import the \verb|article| class and set up some basic features
% (margins, hyperlinks, etc.)
%
%\iffalse
%<*class>
%\fi
%    \begin{macrocode}
\LoadClass[11pt,a4paper]{article}
\RequirePackage[T1]{fontenc} % T1 font encoding
\RequirePackage[left=15mm,
                top=15mm,
                bottom=15mm,
                right=15mm,
                includehead,
                includefoot,
                headheight=10pt,
                headsep=5mm,
                footskip=18pt,
               ]{geometry}
\RequirePackage[pdftex]{graphicx} % For graphics

\RequirePackage[pdftex,pdfusetitle]{hyperref} % Hyperlinks
\hypersetup{%
    colorlinks=true,
    breaklinks=true,
    urlcolor=black,
    linkcolor=black,
    citecolor=black,
    pdfsubject={},
    pdfkeywords={},
}

\RequirePackage{xfp} % Floating point numbers

%    \end{macrocode}
%
% A helper function to display variables
%
%    \begin{macrocode}
\newcommand{\disptoken}[1]{%
  \csname#1\endcsname
}
%    \end{macrocode}
%
% \subsection*{Tables and framed boxes}
%
%    \begin{macrocode}
\RequirePackage{colortbl} % for shaded table rows
\RequirePackage{xltabular} % for breakable tables with var-width columns
\RequirePackage[table]{xcolor} % for colours and shaded table cells
\RequirePackage[breakable,raster]{tcolorbox} % for framed boxes
%    \end{macrocode}
%
% \subsection*{Colours}
%
%    \begin{macrocode}
\definecolor{taggrey}{HTML}{B5B5B5}
\definecolor{footergrey}{HTML}{D8D8D8}
\definecolor{tablegrey}{HTML}{F2F2F2}
\definecolor{summaryblue}{HTML}{00B0F0}
%    \end{macrocode}
%
% \subsection*{Set official Horizon Europe template version}
%
%    \begin{macrocode}
\gdef\@templateversion{5.1} % Default version
\def\@supportedtemplateversions{3.2,3.3,3.4,4.0,5.1} % Supported versions
\ExplSyntaxOn
\NewDocumentCommand{\templateversion}{m}{%
 \clist_if_in:NnTF {\@supportedtemplateversions} {#1}
   {\gdef\@templateversion{#1}}
   {\PackageError{heria}%
     {unsupported~template~version}%
     {Use~one~of~\@supportedtemplateversions}
   }%
}
\ExplSyntaxOff
%    \end{macrocode}
% \subsection*{Basic proposal variables}
%
%    \begin{macrocode}
\newcommand{\callname}[1]{\gdef\@callname{#1}}%
\newcommand{\callidentifier}[1]{\gdef\@callidentifier{#1}}%
\newcommand{\calltopic}[1]{\gdef\@calltopic{#1}}%
%    \end{macrocode}
%
% \subsection*{Participants}
%
%    \begin{macrocode}
\newcounter{@pcount} % Participant counter
\newcommand{\participant}[3]{%
  \stepcounter{@pcount}%
  \newcounter{@p#2num}% 
  \setcounter{@p#2num}{\value{@pcount}}%
  \expandafter\xdef\csname @pFullName\arabic{@p#2num}\endcsname{#1}%
  \expandafter\xdef\csname @pShortName\arabic{@p#2num}\endcsname{#2}%
  \expandafter\xdef\csname @pCountry\arabic{@p#2num}\endcsname{#3}%
  \newcounter{@pSubcontractingCosts\arabic{@p#2num}}%
  \newcounter{@pEquipmentCosts\arabic{@p#2num}}%
  \newcounter{@pPurchaseCosts\arabic{@p#2num}}%
  \newcounter{@pOtherCosts\arabic{@p#2num}}%
  \newcounter{@pInkindContributions\arabic{@p#2num}}%
}
%    \end{macrocode}
%
% Get participant number from short name
%
%    \begin{macrocode}
\newcommand{\getPnum}[1]{%
  \@ifundefined{c@@p#1num}{}{\arabic{@p#1num}}%
}
%    \end{macrocode}
%
% Participants table row
%
%    \begin{macrocode}
\newcommand{\ptablerow}[1]{%
  \stepcounter{#1}
  \the\value{#1}
  \ifthenelse{\value{#1}=1}{ (Coordinator) &}{&}%
  \disptoken{@pFullName\arabic{#1}} (\disptoken{@pShortName\arabic{#1}}) & 
  \disptoken{@pCountry\arabic{#1}} \\
  \hline%
}
%    \end{macrocode}
%
% Participants table
%
%    \begin{macrocode}
\newcommand{\makeparticipantstable}{%
  \newcounter{@ptable}
  \begin{center}
    \begin{xltabular}{0.9\textwidth}{|l|X|l|}
      \hline
      \textbf{Participant No.} & 
      \textbf{Participant organisation name} &
      \textbf{Country} \\ 
      \hline
      \whiledo%
        {\value{@ptable}<\numexpr\value{@pcount}-1}%
        {\ptablerow{@ptable}}%
      \ptablerow{@ptable}
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% \subsection*{Work packages}
%
%    \begin{macrocode}
\RequirePackage{atveryend}
\newcounter{@wpcount} % Work package counter
\newcommand{\workpackage}[5]{%
  \stepcounter{@wpcount}%
  \newcounter{@wp\arabic{@wpcount}deliverable}%
  \newcounter{@wp\arabic{@wpcount}task}%
  \newcounter{@wp#1num}% 
  \setcounter{@wp#1num}{\value{@wpcount}}%
  \expandafter\xdef\csname %
    @wpPersonMonths\arabic{@wp#1num}\endcsname{0}%
  \expandafter\xdef\csname @wpShortName\arabic{@wp#1num}\endcsname{#1}%
  \expandafter\xdef\csname @wpTitle\arabic{@wp#1num}\endcsname{#2}%
  \expandafter\xdef\csname %
    @wpLeadParticipantShortName\arabic{@wp#1num}\endcsname{#3}%
  \expandafter\xdef\csname @wpStartMonth\arabic{@wp#1num}\endcsname{#4}%
  \expandafter\xdef\csname @wpEndMonth\arabic{@wp#1num}\endcsname{#5}%
  \@bsphack
  \protected@write\@auxout{}%
    {\string\makeworkpackagestable@data{\arabic{@wp#1num}
    & #2 & \getPnum{#3} & #3 & %
    \@ifundefined{@wpTotalPersonMonths\arabic{@wp#1num}}%
    {\textbf{??}}%
    {\fpeval{\disptoken{@wpTotalPersonMonths\arabic{@wp#1num}}/2}}%
    & #4 & #5}}%
  \@esphack
  \ifthenelse{\arabic{@wp#1num}=1}{}{\bigskip}
  \noindent\begin{tabularx}%
    {1.0\linewidth}{|>{\columncolor{tablegrey}}l|X|}
    \hline
    \bfseries Work package number & \arabic{@wp#1num} \\
    \hline
    \bfseries Work package title & #2 \\
      \hline
  \end{tabularx}
}
\newcommand{\makeworkpackagestable@data}[1]{%
  \g@addto@macro\makeworkpackagestable@body{#1 \\ \hline}%
}
\def\makeworkpackagestable@body{}% initialize
\AtBeginDocument{\global\let\makeworkpackagestable@body@startup%
  \makeworkpackagestable@body}
\AtEndDocument{%
  \global\let\makeworkpackagestable@body@end\@empty
  \def\makeworkpackagestable@data#1%
    {\g@addto@macro\makeworkpackagestable@body@end{#1 \\ \hline}}%
}
\AtVeryEndDocument{%
  \ifx\makeworkpackagestable@body@startup%
    \makeworkpackagestable@body@end\else
    \@latex@warning{Rerun for \string\makeworkpackagestable}%
  \fi
}
%    \end{macrocode}
% 
% Work packages table
%
%    \begin{macrocode}
\RequirePackage{makecell}
\newcommand{\makeworkpackagestable}{%
  \begin{center}
    \renewcommand\theadfont{\normalsize\bfseries}
    \begin{xltabular}{1.0\textwidth}{|c|X|c|c|c|c|c|}
      \hline
      \rowcolor{tablegrey}%
      \thead{Work\\ package\\ No.} &
      \thead{Work package title} &
      \thead{Lead\\ participant\\ No.} &
      \thead{Lead\\ participant\\ short name} &
      \thead{Person-\\months} &
      \thead{Start\\ month} &
      \thead{End\\ month} \\
      \hline
      \makeworkpackagestable@body
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% Get work package number from short name
%
%    \begin{macrocode}
\newcommand{\getWPnum}[1]{%
  \@ifundefined{c@@wp#1num}{}{\arabic{@wp#1num}}%
}
%    \end{macrocode}
%
% Work package objectives
%
%    \begin{macrocode}
\newenvironment{objectives}{%
  \begin{tcolorbox}[colback=white,
                    parbox=false,
                    boxrule=0.75pt,
                    boxsep=0mm,
                    breakable
  ]%
  \textsf{\textbf{Objectives}~~~}%
  \begin{enumerate*}[nolistsep,noitemsep,itemjoin={~---~},%
    label=\textbf{O\arabic{@wpcount}.\arabic*}]%
  }{%
  \end{enumerate*}%
  \end{tcolorbox}%
  }
%    \end{macrocode}
%
% Work package description
%
%    \begin{macrocode}
\newenvironment{descriptionofwork}{%
  \begin{tcolorbox}[colback=white,
                    parbox=false,
                    boxrule=0.75pt,
                    boxsep=0mm,
                    breakable
  ]%
  \textsf{\textbf{Description of work}~~~}
  }{%
  \end{tcolorbox}%
  }
%    \end{macrocode}
%
% Tasks
%
%    \begin{macrocode}
\NewDocumentCommand{\task}{mmmm}{%
  \stepcounter{@wp\arabic{@wpcount}task}
  \par\medskip\noindent\textbf{Task %
  \arabic{@wpcount}.\arabic{@wp\arabic{@wpcount}task}: #1}
  \textit{(Lead: #2; Participants: #3; Month: #4)}\hspace{1em}%
}
%    \end{macrocode}
%
% \subsection*{Deliverables}
%
%    \begin{macrocode}
\newcounter{@dcount} % Deliverable counter
\newcommand{\deliverable}[6]{%
  \stepcounter{@wp\arabic{@wpcount}deliverable}%
  \stepcounter{@dcount}%
  \expandafter\xdef\csname @dNumber\arabic{@dcount}\endcsname%
    {\arabic{@wpcount}.\arabic{@wp\arabic{@wpcount}deliverable}}%
  \expandafter\xdef\csname %
    @dWorkPackage\arabic{@dcount}\endcsname{\arabic{@wpcount}}%
  \expandafter\xdef\csname @dName\arabic{@dcount}\endcsname{#1}%
  \expandafter\gdef\csname @dDescription\arabic{@dcount}\endcsname{#2}%
  \expandafter\xdef\csname @dLead\arabic{@dcount}\endcsname{#3}%
  \expandafter\xdef\csname @dType\arabic{@dcount}\endcsname{#4}%
  \expandafter\xdef\csname %
    @dDisseminationLevel\arabic{@dcount}\endcsname{#5}%
  \expandafter\xdef\csname @dDeliveryDate\arabic{@dcount}\endcsname{#6}%
}
%    \end{macrocode}
%
% Deliverables table row
%
%    \begin{macrocode}
\newcommand{\dtablerow}[1]{%
  \stepcounter{#1}
  \disptoken{@dNumber\arabic{#1}} &
  \disptoken{@dName\arabic{#1}} &
  \disptoken{@dDescription\arabic{#1}} &
  \disptoken{@dWorkPackage\arabic{#1}} &
  \disptoken{@dLead\arabic{#1}} &
  \disptoken{@dType\arabic{#1}} &
  \disptoken{@dDisseminationLevel\arabic{#1}} &
  \disptoken{@dDeliveryDate\arabic{#1}} \\
  \hline%
}
%    \end{macrocode}
%
% Deliverables table
%
%    \begin{macrocode}
\newcommand{\makedeliverablestable}{%
  \newcounter{@dtable}
  \begin{center}
    \renewcommand\theadfont{\normalsize\bfseries}
    \begin{xltabular}{1.0\textwidth}%
      {|c|>{\raggedright\hsize=.667\hsize\linewidth=\hsize}X%
      |>{\hsize=1.333\hsize\linewidth=\hsize}X|c|c|c|c|p{15mm}|}
      \hline
      \rowcolor{tablegrey}%
      \thead{\#} &
      \thead{Name} &
      \thead{Short description} &
      \thead{WP\\ \#} &
      \thead{Lead\\ participant} &
      \thead{Type} &
      \thead{Dissem.\\ level} &
      \thead{Delivery\\ month} \\
      \hline
      \whiledo%
        {\value{@dtable}<\numexpr\value{@dcount}-1}%
        {\dtablerow{@dtable}}%
      \dtablerow{@dtable}
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% \subsection*{Milestones}
%
%    \begin{macrocode}
\newcounter{@mcount} % Milestone counter
\newcommand{\milestone}[4]{%
  \stepcounter{@mcount}%
  \expandafter\gdef\csname @mName\arabic{@mcount}\endcsname{#1}%
  \expandafter\xdef\csname @mWorkPackages\arabic{@mcount}\endcsname{#2}%
  \expandafter\xdef\csname @mDueDate\arabic{@mcount}\endcsname{#3}%
  \expandafter\xdef\csname %
    @mMeansOfVerification\arabic{@mcount}\endcsname{#4}%
}
%    \end{macrocode}
%
% Milestones table row
%
%    \begin{macrocode}
\newcommand{\mtablerow}[1]{%
  \stepcounter{#1}
  \arabic{#1} &
  \disptoken{@mName\arabic{#1}} &
  \disptoken{@mWorkPackages\arabic{#1}} &
  \disptoken{@mDueDate\arabic{#1}} &
  \disptoken{@mMeansOfVerification\arabic{#1}} \\
  \hline%
}
%    \end{macrocode}
%
% Milestones table
%
%    \begin{macrocode}
\newcommand{\makemilestonestable}{%
  \newcounter{@mtable}
  \begin{center}
    \renewcommand\theadfont{\normalsize\bfseries}
    \begin{xltabular}{1.0\textwidth}{|c|X|p{26mm}|c|p{26mm}|}
      \hline
      \rowcolor{tablegrey}%
      \thead{\#} &
      \thead{Milestone\\ name} &
      \thead{Related\\ WP(s)} &
      \thead{Month\\ due} &
      \thead{Means of\\ verification} \\
      \hline
      \whiledo%
        {\value{@mtable}<\numexpr\value{@mcount}-1}%
        {\mtablerow{@mtable}}%
      \mtablerow{@mtable}
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% \subsection*{Critical risks}
%
%    \begin{macrocode}
\newtcbox{\risktag}[1][black]{%
  fontupper=\scriptsize\sffamily\bfseries,%
  on line,%
  arc=3pt,%
  colupper=white,%
  colback=#1!50!black,%
  colframe=#1!50!black,%
  before upper={\rule[-3pt]{0pt}{10pt}},%
  boxrule=1pt,%
  boxsep=0pt,%
  left=2pt,%
  right=2pt,%
  top=1pt,%
  bottom=.5pt%
}
\newcounter{@crcount} % Critical risk counter
\newcommand{\criticalrisk}[5]{%
  \stepcounter{@crcount}%
  \expandafter\gdef\csname %
    @crDescription\arabic{@crcount}\endcsname{#1}%
  \expandafter\xdef\csname @crLikelihood\arabic{@crcount}\endcsname{#2}%
  \expandafter\xdef\csname @crSeverity\arabic{@crcount}\endcsname{#3}%
  \expandafter\xdef\csname %
    @crWorkPackages\arabic{@crcount}\endcsname{#4}%
  \expandafter\gdef\csname @crMitigation\arabic{@crcount}\endcsname{#5}%
}
%    \end{macrocode}
%
% Critical risk table row
%
%    \begin{macrocode}
\newcommand{\crtablerow}[1]{%
  \stepcounter{#1}%
  \disptoken{@crDescription\arabic{#1}}\newline 
    \risktag[blue]{Likelihood: \disptoken{@crLikelihood\arabic{#1}}} 
    \risktag[red]{Severity: \disptoken{@crSeverity\arabic{#1}}} &
  \disptoken{@crWorkPackages\arabic{#1}} &
  \disptoken{@crMitigation\arabic{#1}} \\
  \hline%
}
%    \end{macrocode}
%
% Critical risks table
%
%    \begin{macrocode}
\newcommand{\makecriticalriskstable}{%
  \newcounter{@crtable}
  \begin{center}
    \renewcommand\theadfont{\normalsize\bfseries}
    \begin{xltabular}{1.0\textwidth}{|p{60mm}|c|X|}
      \hline
      \rowcolor{tablegrey}%
      \thead{Description of risk (indicate level of\\ %
        (i) likelihood, and (ii) severity:\\ %
        Low\slash Medium\slash High)} &
      \thead{WP(s)\\ involved} &
      \thead{Proposed risk-mitigation measures} \\
      \hline
      \whiledo%
        {\value{@crtable}<\numexpr\value{@crcount}-1}%
        {\crtablerow{@crtable}}%
      \crtablerow{@crtable}
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% \subsection*{Staff effort}
%
%    \begin{macrocode}
\newcommand{\staffeffort}[3]{%
  \expandafter\xdef\csname @se#1.#2\endcsname{#3}%
}
%    \end{macrocode}
%
% Summary of staff effort table row
%
%    \begin{macrocode}
\newcommand{\setablerow}[1]{%
  \def\serowtotal{0}%
  \setcounter{@secolumn}{0}%
  \bfseries\the\value{#1} \disptoken{@pShortName\arabic{#1}}%
  \edef\serowtemp{}%
  \whiledo{\value{@secolumn}<\value{@wpcount}}{%
    \stepcounter{@secolumn}%
    \edef\sewpname{\disptoken{@wpShortName\the\value{@secolumn}}}%
    \edef\sewpcell%
      {\disptoken{@se\disptoken{@pShortName\the\value{#1}}.\sewpname}}%
    \edef\serowtotal%
      {\fpeval{\serowtotal + \sewpcell}}% Total PMs per participant
    \xdef\setotalpm{\fpeval{\setotalpm + \sewpcell}}% Total PMs
    \expandafter\xdef\csname %
      @wpPersonMonths\arabic{@secolumn}\endcsname{\fpeval{%
      \sewpcell+\csname %
      @wpPersonMonths\arabic{@secolumn}\endcsname}}% Total PMs per WP
    \IfEq% If...
    {\disptoken{@pShortName\the\value{#1}}}% ...the current PI
    {\disptoken{@wpLeadParticipantShortName%
      \the\value{@secolumn}}}% ...is the WP lead
    {\protected@edef\seformat{\bfseries}}% ...then apply boldface
    {\edef\seformat{}}% ...otherwise don't.
    \protected@edef\serowtemp%
      {\serowtemp&\seformat \sewpcell}% Print PI's PMs for this WP
  }%
  \protected@edef\serowtemp{\serowtemp&\fpeval{round(\serowtotal,0)}}%
  \serowtemp%
  \stepcounter{#1}%
}
%    \end{macrocode}
%
% Summary of staff effort table
%
%    \begin{macrocode}
\newcommand{\makestaffefforttable}{%
  \newcounter{@setable}
  \stepcounter{@setable}
  \newcounter{@secolumn}
  \xdef\setotalpm{0}
  \edef\serowtemp{}
  \begin{center}
    \renewcommand\theadfont{\normalsize\bfseries}
    \begin{xltabular}{1.0\textwidth}%
      {|>{\columncolor{tablegrey}}l|*{\value{@wpcount}}{r|}%
      >{\columncolor{tablegrey}}r|}
      \hline
      % Table header
      \rowcolor{tablegrey}%
      \whiledo{\value{@secolumn}<\value{@wpcount}}{%
        \stepcounter{@secolumn}%
        \protected@edef\serowtemp%
          {\serowtemp&\protect\thead{WP\the\value{@secolumn}}}%
      }
      \serowtemp & \thead{Total PMs\\ per Participant} \\
      \hline
      % Participant rows
      \whiledo%
        {\value{@setable}<\numexpr\value{@pcount}}%
        {\setablerow{@setable}\\ \hline}%
      \setablerow{@setable} \\ \hline%
      % Total
      \rowcolor{tablegrey}%
      \setcounter{@secolumn}{0}
      \bfseries Total PMs
      \whiledo{\value{@secolumn}<\value{@wpcount}}{%
        \stepcounter{@secolumn}%
        \edef\serowtemp{\serowtemp&\fpeval{round(\csname %
          @wpPersonMonths\arabic{@secolumn}\endcsname/2,0)}}%
        \@bsphack
        \protected@write\@auxout{}%
        {\string\expandafter\string\expandafter\string\expandafter%
        \string\gdef\string\disptoken{@wpTotalPersonMonths%
        \arabic{@secolumn}}{\fpeval{round(\disptoken{@wpPersonMonths%
        \arabic{@secolumn}},0)}}}%
        \@esphack
      }
      \serowtemp & \fpeval{round(\setotalpm/2,0)} \\
      \hline
    \end{xltabular}
  \end{center}
}
%    \end{macrocode}
%
% \subsection*{Subcontracting costs}
%
%    \begin{macrocode}
\newcommand{\subcontractingcost}[3]{%
  \stepcounter{@pSubcontractingCosts\getPnum{#1}}
  \expandafter\xdef\csname %
    @scCost\getPnum{#1}.\arabic{@pSubcontractingCosts\getPnum{#1}}%
    \endcsname{#2}%
  \expandafter\xdef\csname %
    @scJustification\getPnum{#1}.\arabic{@pSubcontractingCosts\getPnum%
      {#1}}\endcsname{#3}%
}
%    \end{macrocode}
%
% Subcontracting costs table
%
%    \begin{macrocode}
\newcommand{\makesubcontractingcoststable}{%
  \newcounter{@scparticipant}
  \begin{center}
    % For each participant
    \whiledo{\value{@scparticipant}<\value{@pcount}}{%
      \stepcounter{@scparticipant}%
      \ifthenelse%
        {\value{@pSubcontractingCosts\arabic%
        {@scparticipant}}>0}% If they have subcontracting costs
      {\sctablesection%
        {@scparticipant}}% Print their subcontracting costs table
      {}% Otherwise, do nothing
    }%
  \end{center}
}
%    \end{macrocode}
%
% Subcontracting costs table section
%
%    \begin{macrocode}
\newcommand{\sctablesection}[1]{%
  \newcounter{@sccost\arabic{#1}}
  \edef\scrowtemp{}
  \renewcommand\theadfont{\normalsize\bfseries}
  \begin{xltabular}{\textwidth}{|>{\columncolor{tablegrey}}l|r|X|}
    \hline
    \rowcolor{tablegrey}
    \multicolumn{3}{|l|}{\bfseries\the\value{#1} %
      \disptoken{@pShortName\arabic{#1}}} \\
    \hline
    \rowcolor{tablegrey}
    & \thead{Cost (€)}
    & \thead{Description of tasks and justification} \\
    \hline
    % For each subcontracting cost
    \whiledo%
      {\value{@sccost\arabic{#1}}<\numexpr\value%
      {@pSubcontractingCosts\arabic{#1}}-1}{%
    \stepcounter{@sccost\arabic{#1}}%
    \sctablerow{#1}{@sccost\arabic{#1}}%
    }%
    \stepcounter{@sccost\arabic{#1}}%
    \sctablerow{#1}{@sccost\arabic{#1}}%
  \end{xltabular}
}
%    \end{macrocode}
%
% Subcontracting costs table row
%
%    \begin{macrocode}
\newcommand{\sctablerow}[2]{%
  \thead{Subcontracting} &
  \disptoken{@scCost\arabic{#1}.\arabic{#2}} &
  \disptoken{@scJustification\arabic{#1}.\arabic{#2}}
  \\ \hline
}
%    \end{macrocode}
%
% \subsection*{Equipment costs}
%
%    \begin{macrocode}
\newcommand{\equipmentcost}[3]{%
  \stepcounter{@pEquipmentCosts\getPnum{#1}}
  \expandafter\xdef\csname %
    @eqCost\getPnum{#1}.\arabic{@pEquipmentCosts\getPnum{#1}}%
    \endcsname{#2}%
  \expandafter\xdef\csname %
    @eqJustification\getPnum{#1}.\arabic{@pEquipmentCosts\getPnum%
      {#1}}\endcsname{#3}%
}
%    \end{macrocode}
%
% Equipment costs table
%
%    \begin{macrocode}
\newcommand{\makeequipmentcoststable}{%
  \newcounter{@eqparticipant}
  \begin{center}
    % For each participant
    \whiledo{\value{@eqparticipant}<\value{@pcount}}{%
      \stepcounter{@eqparticipant}%
      \ifthenelse%
        {\value{@pEquipmentCosts\arabic%
        {@eqparticipant}}>0}% If they have equipment costs
      {\eqtablesection%
        {@eqparticipant}}% Print their equipment costs table
      {}% Otherwise, do nothing
    }%
  \end{center}
}
%    \end{macrocode}
%
% Equipment costs table section
%
%    \begin{macrocode}
\newcommand{\eqtablesection}[1]{%
  \newcounter{@eqcost\arabic{#1}}
  \edef\eqrowtemp{}
  \renewcommand\theadfont{\normalsize\bfseries}
  \begin{xltabular}{\textwidth}{|>{\columncolor{tablegrey}}l|r|X|}
    \hline
    \rowcolor{tablegrey}
    \multicolumn{3}{|l|}{\bfseries\the\value{#1} %
      \disptoken{@pShortName\arabic{#1}}} \\
    \hline
    \rowcolor{tablegrey}
    & \thead{Cost (€)}
    & \thead{Description of tasks and justification} \\
    \hline
    % For each equipment cost
    \whiledo%
      {\value{@eqcost\arabic{#1}}<\numexpr\value%
      {@pEquipmentCosts\arabic{#1}}-1}{%
    \stepcounter{@eqcost\arabic{#1}}%
    \eqtablerow{#1}{@eqcost\arabic{#1}}%
    }%
    \stepcounter{@eqcost\arabic{#1}}%
    \eqtablerow{#1}{@eqcost\arabic{#1}}%
  \end{xltabular}
}
%    \end{macrocode}
%
% Equipment costs table row
%
%    \begin{macrocode}
\newcommand{\eqtablerow}[2]{%
  \thead{Equipment} &
  \disptoken{@eqCost\arabic{#1}.\arabic{#2}} &
  \disptoken{@eqJustification\arabic{#1}.\arabic{#2}}
  \\ \hline
}
%    \end{macrocode}
%
% \subsection*{Other costs}
%
%    \begin{macrocode}
\newcommand{\othercost}[3]{%
  \stepcounter{@pOtherCosts\getPnum{#1}}
  \expandafter\xdef\csname %
    @ocCost\getPnum{#1}.\arabic{@pOtherCosts\getPnum{#1}}\endcsname{#2}%
  \expandafter\xdef\csname %
    @ocJustification\getPnum{#1}.\arabic%
    {@pOtherCosts\getPnum{#1}}\endcsname{#3}%
}
%    \end{macrocode}
%
% Other costs table
%
%    \begin{macrocode}
\newcommand{\makeothercoststable}{%
  \newcounter{@ocparticipant}
  \begin{center}
    % For each participant
    \whiledo{\value{@ocparticipant}<\value{@pcount}}{%
      \stepcounter{@ocparticipant}%
      \ifthenelse%
        {\value{@pOtherCosts\arabic%
        {@ocparticipant}}>0}% If they have other costs
      {\octablesection{@ocparticipant}}% Print their other costs table
      {}% Otherwise, do nothing
    }%
  \end{center}
}
%    \end{macrocode}
%
% Other costs table section
%
%    \begin{macrocode}
\newcommand{\octablesection}[1]{%
  \newcounter{@occost\arabic{#1}}
  \edef\ocrowtemp{}
  \renewcommand\theadfont{\normalsize\bfseries}
  \begin{xltabular}{\textwidth}{|>{\columncolor{tablegrey}}l|r|X|}
    \hline
    \rowcolor{tablegrey}
    \multicolumn{3}{|l|}{\bfseries\the\value{#1} %
      \disptoken{@pShortName\arabic{#1}}} \\
    \hline
    \rowcolor{tablegrey}
    & \thead{Cost (€)} & \thead{Justification} \\
    \hline
    % For each other cost
    \whiledo%
      {\value{@occost\arabic{#1}}<\numexpr\value%
      {@pOtherCosts\arabic{#1}}-1}{%
    \stepcounter{@occost\arabic{#1}}%
    \octablerow{#1}{@occost\arabic{#1}}%
    }%
    \stepcounter{@occost\arabic{#1}}%
    \octablerow{#1}{@occost\arabic{#1}}%
  \end{xltabular}
}
%    \end{macrocode}
%
% Other costs table row
%
%    \begin{macrocode}
\newcommand{\octablerow}[2]{%
  \thead{Internally invoiced\\ goods and services} &
  \disptoken{@ocCost\arabic{#1}.\arabic{#2}} &
  \disptoken{@ocJustification\arabic{#1}.\arabic{#2}}
  \\ \hline
}
%    \end{macrocode}
%
% \subsection*{Purchase costs}
%
%    \begin{macrocode}
\newcommand{\purchasecost}[8]{%
  \stepcounter{@pPurchaseCosts\getPnum{#1}}
  \expandafter\xdef\csname @pcTravelCost\getPnum{#1}\endcsname{#2}%
  \expandafter\xdef\csname %
    @pcTravelJustification\getPnum{#1}\endcsname{#3}%
  \expandafter\xdef\csname @pcEquipmentCost\getPnum{#1}\endcsname{#4}%
  \expandafter\xdef\csname %
    @pcEquipmentJustification\getPnum{#1}\endcsname{#5}%
  \expandafter\xdef\csname @pcOtherCost\getPnum{#1}\endcsname{#6}%
  \expandafter\xdef\csname %
    @pcOtherJustification\getPnum{#1}\endcsname{#7}%
  \expandafter\xdef\csname @pcRemainingCost\getPnum{#1}\endcsname{#8}%
  \expandafter\xdef\csname %
    @pcTotalCost\getPnum{#1}\endcsname%
    {\the\numexpr #2+#4+#6+#8 \relax}% TO DO
  %  \expandafter\xdef\csname @pcTotalCost\getPnum{#1}\endcsname{100}%
}
%    \end{macrocode}
%
% Purchase costs table
%
%    \begin{macrocode}
\newcommand{\makepurchasecoststable}{%
  \newcounter{@pcparticipant}
  \begin{center}
    % For each participant
    \whiledo{\value{@pcparticipant}<\value{@pcount}}{%
      \stepcounter{@pcparticipant}%
      \ifthenelse%
        {\value{@pPurchaseCosts\arabic%
        {@pcparticipant}}>0}% If they have purchase costs
      {\pctablesection%
      {@pcparticipant}}% Print their purchase costs table
      {}% Otherwise, do nothing
    }%
  \end{center}
}
%    \end{macrocode}
%
% Purchase costs table section
%
%    \begin{macrocode}
\newcommand\swap[2]{
  \let\pcTemp#1
  \let#1#2
  \let#2\pcTemp
}
\newcommand{\pctablesection}[1]{%
  \newcounter{@pccost\arabic{#1}}
  % Define table rows
  \def\pcRowA{%
     \thead{Travel and subsistence} &
     \disptoken{@pcTravelCost\arabic{#1}} &
     \disptoken{@pcTravelJustification\arabic{#1}}
  }%
  \edef\pcCostA{\disptoken{@pcTravelCost\arabic{#1}}}%
  \def\pcRowB{%
     \thead{Equipment} &
     \disptoken{@pcEquipmentCost\arabic{#1}} &
     \disptoken{@pcEquipmentJustification\arabic{#1}}
  }%
  \edef\pcCostB{\disptoken{@pcEquipmentCost\arabic{#1}}}%
  \def\pcRowC{%
     \thead{Other goods, works\\ and services} &
     \disptoken{@pcOtherCost\arabic{#1}} &
     \disptoken{@pcOtherJustification\arabic{#1}}
  }%
  \edef\pcCostC{\disptoken{@pcOtherCost\arabic{#1}}}%
  % Sort table rows
  \ifthenelse{\pcCostA<\pcCostC}{%
    \swap{\pcRowA}{\pcRowC}
    \swap{\pcCostA}{\pcCostC}
    }{}
  \ifthenelse{\pcCostA<\pcCostB}{%
    \swap{\pcRowA}{\pcRowB}
    \swap{\pcCostA}{\pcCostB}
    }{}
  \ifthenelse{\pcCostB<\pcCostC}{%
    \swap{\pcRowC}{\pcRowB}
    \swap{\pcCostC}{\pcCostB}
    }{}

  \renewcommand\theadfont{\normalsize\bfseries}
  \begin{xltabular}{\textwidth}{|>{\columncolor{tablegrey}}p{43mm}|r|X|}
    \hline
    \rowcolor{tablegrey}
    \multicolumn{3}{|l|}{\bfseries\the\value{#1} %
      \disptoken{@pShortName\arabic{#1}}} \\
    \hline
    \rowcolor{tablegrey}
    & \thead{Cost (€)} & \thead{Justification} \\
    \hline
    % Output purchase costs in sorted order
    \pcRowA \\ \hline
    \pcRowB \\ \hline
    \pcRowC \\ \hline
    % Output remaining and total costs
    \thead{Remaining purchase\\ costs (<15\% of pers.\\ costs)}
      & \disptoken{@pcRemainingCost\arabic{#1}} \\
    \cline{1-2}
    \thead{Total} & \disptoken{@pcTotalCost\arabic{#1}} \\
    \cline{1-2}
  \end{xltabular}
}
%    \end{macrocode}
%
% \subsection*{In-kind contributions}
%
%    \begin{macrocode}
\newcommand{\inkindcontribution}[5]{%
  \stepcounter{@pInkindContributions\getPnum{#1}}
  \expandafter\xdef\csname %
    @ikcThirdPartyName\getPnum{#1}.\arabic%
    {@pInkindContributions\getPnum{#1}}\endcsname{#2}%
  \expandafter\xdef\csname %
    @ikcCategory\getPnum{#1}.\arabic%
    {@pInkindContributions\getPnum{#1}}\endcsname{#3}%
  \expandafter\xdef\csname %
    @ikcCost\getPnum{#1}.\arabic%
    {@pInkindContributions\getPnum{#1}}\endcsname{#4}%
  \expandafter\xdef\csname %
    @ikcJustification\getPnum{#1}.\arabic%
    {@pInkindContributions\getPnum{#1}}\endcsname{#5}%
}
%    \end{macrocode}
%
% In-kind contributions table
%
%    \begin{macrocode}
\newcommand{\makeinkindcontributionstable}{%
  \newcounter{@ikcparticipant}
  \begin{center}
    % For each participant
    \whiledo{\value{@ikcparticipant}<\value{@pcount}}{%
      \stepcounter{@ikcparticipant}%
      \ifthenelse%
        {\value{@pInkindContributions\arabic%
        {@ikcparticipant}}>0}% If they have in-kind contributions
      {\ikctablesection%
        {@ikcparticipant}}% Print their in-kind contributions table
      {}% Otherwise, do nothing
    }%
  \end{center}
}
%    \end{macrocode}
%
% In-kind contributions table section
%
%    \begin{macrocode}
\newcommand{\ikctablesection}[1]{%
  \newcounter{@ikccost\arabic{#1}}
  \edef\ikcrowtemp{}
  \renewcommand\theadfont{\normalsize\bfseries}
  \begin{xltabular}{\textwidth}%
    {|>{\raggedright}p{40mm}|>{\raggedright}p{35mm}|r|X|}
    \hline
    \rowcolor{tablegrey}
    \multicolumn{4}{|l|}{\bfseries\the\value{#1} %
      \disptoken{@pShortName\arabic{#1}}} \\
    \hline
    \rowcolor{tablegrey}
    \thead{Third party name} & \thead{Category} &
    \thead{Cost (€)} & \thead{Justification} \\
    \hline
    % For each in-kind contribution
    \whiledo%
      {\value{@ikccost\arabic{#1}}<\numexpr\value%
      {@pInkindContributions\arabic{#1}}-1}{%
    \stepcounter{@ikccost\arabic{#1}}%
    \ikctablerow{#1}{@ikccost\arabic{#1}}%
    }%
    \stepcounter{@ikccost\arabic{#1}}%
    \ikctablerow{#1}{@ikccost\arabic{#1}}%
  \end{xltabular}
}
%    \end{macrocode}
%
% In-kind contributions table row
%
%    \begin{macrocode}
\newcommand{\ikctablerow}[2]{%
  \disptoken{@ikcThirdPartyName\arabic{#1}.\arabic{#2}} &
  \disptoken{@ikcCategory\arabic{#1}.\arabic{#2}} &
  \disptoken{@ikcCost\arabic{#1}.\arabic{#2}} &
  \disptoken{@ikcJustification\arabic{#1}.\arabic{#2}}
  \\ \hline
}
%    \end{macrocode}
%
% \subsection*{Summary canvas}
%
%    \begin{macrocode}
\RequirePackage{pdflscape} % PDF landscape for Summary canvas
\newenvironment{summarycanvas}{%
  \begin{tcbraster}[%
    raster columns=3,
    raster equal height
    ]%
}{%
  \end{tcbraster}%
}
\newenvironment{summarybox}[1]{%
  \begin{tcolorbox}[%
    colframe=summaryblue,
    colbacktitle=summaryblue,
    fonttitle=\bfseries\sffamily,
    halign title=center,
    title={#1}
    ]
}{%
  \end{tcolorbox}%
}
%    \end{macrocode}
%
% Code for sideways figures, adapted from
% \url{https://tex.stackexchange.com/a/307142/22603}.
% Copyright 2016 John Kormylo and licensed under the Creative Commons
% Attribution-ShareAlike 4.0 license (CC~BY-SA~4.0), per personal
% communication with Tristan Miller on 2023-12-02.
% 
%    \begin{macrocode}
\RequirePackage{environ}
\newcounter{abspage}% \thepage not reliab
\newcommand{\newSFPage}[1]% #1 = \theabspage
  {\global\expandafter\let\csname SFPage@#1\endcsname\null}
\NewEnviron{SidewaysFigure}{\begin{figure}[p]
\protected@write\@auxout%
  {\let\theabspage=\relax}% delays expansion until shipout
  {\string\newSFPage{\theabspage}}%
\ifdim\textwidth=\textheight
  \rotatebox{90}{\parbox[c][\textwidth][c]{\linewidth}{\BODY}}%
\else
  \rotatebox{90}{\parbox[c][\textwidth][c]{\textheight}{\BODY}}%
\fi
\end{figure}}
\AddToHook{shipout/background}{% check if sideways figure on this page
  \put(1in,-1in){%
    \ifdim\textwidth=\textheight
      \stepcounter{abspage}% already in landscape
    \else
      \@ifundefined{SFPage@\theabspage}{}{\global\pdfpageattr{/Rotate 0}}%
      \stepcounter{abspage}%
      \@ifundefined{SFPage@\theabspage}{}%
        {\global\pdfpageattr{/Rotate 90}}%
    \fi}%
    }
%    \end{macrocode}
%
% \subsection*{Font setup}
%
%    \begin{macrocode}
\RequirePackage{newtxtext} % Use Times for main text
\RequirePackage{newtxmath} % Use Times for math
\renewcommand*\ttdefault{lmvtt} % Latin Modern Typewriter Proportional
%    \end{macrocode}
%
% \subsection*{Page header and footer}
%
%    \begin{macrocode}
\RequirePackage{lastpage}
\RequirePackage{fancyhdr}
\newcommand{\Paragraph}[1]{\vspace*{-.45em}\paragraph{#1.}}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt} % Remove line at top
\lhead{\sffamily\scriptsize Call: \@callidentifier\ --- \@callname}
\rhead{}
\chead{}
\cfoot{\raisebox{\dimexpr(-\height+\ht\strutbox-\dp\strutbox)/2}{%
    \begin{tcolorbox}[nobeforeafter,
                      fontupper=\scriptsize\sffamily,
                      colback=footergrey,
                      boxrule=0.75pt,
                      halign=center,
                      boxsep=0mm,
                     ]%
      \strut Part~B -- Page \thepage\ of \pageref*{LastPage}%
    \end{tcolorbox}%
  }%
}
%    \end{macrocode}
%
% \subsection*{Titles and section headings}
%
% Document title
%
%    \begin{macrocode}
\def\@maketitle{%
  \newpage%
  \noindent%
  \large%
  \framebox[\textwidth]%
    {\null\hfill\textsf{\textbf{\textsc{\@title}}}\hfill\null}%
  \par
  \vskip 1.5em\thispagestyle{fancy}%
  \ifdefined\@calltopic
  \vspace{-5mm}
  \begin{center}
    Topic: \@calltopic
  \end{center}
  \fi
}
%    \end{macrocode}
%
% Format comments and page limits used by the Horizon Europe
% template's section headings
%
%    \begin{macrocode}
\ExplSyntaxOn
\cs_generate_variant:Nn \str_if_in:nnTF { neTF }
\NewDocumentCommand{\showpagelimit}{m}
{
   \ifheria@showinstructions
     \str_if_in:neTF { 0123456789 } { \tl_head:n { #1 } }
     {\normalfont\sffamily\itshape [e.g.\ #1]}
     {#1}
   \fi
}
%    \end{macrocode}
%
% Format ``tags'' used by the Horizon Europe template
%
%    \begin{macrocode}
\NewDocumentCommand{\hetag}{mm}
 {%
   \textcolor{taggrey}{\normalfont\sffamily\footnotesize%
   \clist_map_inline:nn { #2 } { \# #1 ##1 #1 \# ~}%
   }%
 }
\ExplSyntaxOff
\NewDocumentCommand{\opentag}{m}{%
  \makeatletter%
  \ifdim\@templateversion pt<5.1pt%
    \hetag{@}{#1}%
  \fi%
  \makeatother%
}
\NewDocumentCommand{\closetag}{m}{
  \makeatletter%
  \ifdim\@templateversion pt<5.1pt%
  \noindent\hetag{§}{#1}%
  \fi%
  \makeatother%
}
%    \end{macrocode}
%
% Format section titles, with optional opening and closing tags
%
%    \begin{macrocode}
\RequirePackage[explicit]{titlesec}
\titleformat{\section}
  {\normalfont\normalsize\bfseries\sffamily}%
  {\thesection}{1em}{#1 \sectiontag\sectionpagelimit}
\titleformat{\subsection}
  {\normalfont\normalsize\bfseries\sffamily}%
  {\thesubsection}{1em}{#1 \sectiontag\sectionpagelimit}
\titleformat{\subsubsection}
  {\normalfont\normalsize\bfseries\sffamily}%
  {\thesubsubsection}{1em}{#1 \sectiontag\sectionpagelimit}
\NewDocumentCommand{\extendedsection}{sO{#3}mooo}{%
  \IfValueTF{#4}%
    {\renewcommand{\sectiontag}{\opentag{#4}}}%
    {\renewcommand{\sectiontag}{}}%
  \IfValueTF{#6}%
    {\renewcommand{\sectionpagelimit}{\showpagelimit{#6}}}%
    {\renewcommand{\sectionpagelimit}{}}%
  \IfValueT{#5}{%
    \closetag{#5}%
  }%
  \IfBooleanTF{#1}{%
    \latexsection*{#3}%
  }{%
    \latexsection[#2]{#3}%
  }%
}
\NewDocumentCommand{\extendedsubsection}{sO{#3}mooo}{%
  \IfValueTF{#4}%
    {\renewcommand{\sectiontag}{\opentag{#4}}}%
    {\renewcommand{\sectiontag}{}}%
  \IfValueTF{#6}%
    {\renewcommand{\sectionpagelimit}{\showpagelimit{#6}}}%
    {\renewcommand{\sectionpagelimit}{}}%
  \IfValueT{#5}{%
    \closetag{#5}%
  }%
  \IfBooleanTF{#1}{%
    \latexsubsection*{#3}%
  }{%
    \latexsubsection[#2]{#3}%
  }%
}
\NewDocumentCommand{\extendedsubsubsection}{sO{#3}mooo}{%
  \IfValueTF{#4}%
    {\renewcommand{\sectiontag}{\opentag{#4}}}%
    {\renewcommand{\sectiontag}{}}%
  \IfValueTF{#6}%
    {\renewcommand{\sectionpagelimit}{\showpagelimit{#6}}}%
    {\renewcommand{\sectionpagelimit}{}}%
  \IfValueT{#5}{%
    \closetag{#5}%
  }%
  \IfBooleanTF{#1}{%
    \latexsubsubsection*{#3}%
  }{%
    \latexsubsubsection[#2]{#3}%
  }%
}
\newcommand{\sectiontag}{}
\newcommand{\sectionpagelimit}{}
\AtBeginDocument{%
  \NewCommandCopy{\latexsection}{\section}%
  \RenewCommandCopy{\section}{\extendedsection}%
  \NewCommandCopy{\latexsubsection}{\subsection}%
  \RenewCommandCopy{\subsection}{\extendedsubsection}%
  \NewCommandCopy{\latexsubsubsection}{\subsubsection}%
  \RenewCommandCopy{\subsubsection}{\extendedsubsubsection}%
}
%    \end{macrocode}
%
% \subsection*{Official Horizon Europe template instructions}
%
%    \begin{macrocode}
\RequirePackage[inline]{enumitem} % For custom bullets
\RequirePackage[normalem]{ulem} % For underlined text
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
  family=heria,
  prefix=heria@
}
\DeclareBoolOption{showinstructions}
\ProcessKeyvalOptions*

\RequirePackage{twemojis}
\RequirePackage{xspace}
\newcommand{\twarn}{\twemoji{warning}\xspace}
\RequirePackage{verbatim}
\newenvironment{instructions}{%
  \begin{tcolorbox}[fontupper=\sffamily,
                    fonttitle=\sffamily\bfseries,
                    colback=blue!5!white,
                    colframe=blue!75!black,
                    parbox=false,
                    breakable
  ]%
  }{%
  \end{tcolorbox}%
  }

\NewDocumentCommand{\heinstructions}{sm}{%
  \ifheria@showinstructions%
    \IfBooleanTF{#1}%
    {%
      \sffamily%
      \input{hi-#2}%
    }%
    {%
      \begin{instructions}%
        \urlstyle{sf}%
        \def\do@url@hyp{\do\-}%
        \input{hi-#2}%
      \end{instructions}%
    }%
  \fi%
}
%    \end{macrocode}
%\iffalse
%</class>
%<*hi-annexes>
\textbf{ANNEXES TO PROPOSAL PART~B}

Some calls may ask to upload annexes to proposal part~B. The annexes
must be uploaded as separate documents in the submission system. The
most common annexes to be uploaded in Horizon Europe are (standard
templates are published in the Funding \& Tenders portal):

\begin{itemize}
\item
  \textbf{CLINICAL TRIALS:} Annex with information on clinical trials
\item
  \textbf{FINANCIAL SUPPORT TO THIRD PARTIES:} Annex with information on
  financial support to third parties.
\item
  \textbf{CALLS FLAGGED AS SECURITY SENSITIVE:} Annex with information
  on security aspects.
\item
  \textbf{ETHICS:} ethics self-assessment should be included in proposal
  part~A. However, in calls where several serious ethics issues are
  expected, the character limited in this section of proposal part~A may
  not be sufficient for participants to give all necessary information.
  In those cases, participants may include additional information in an
  annex to proposal part~B.
\end{itemize}
%</hi-annexes>
%<*hi-capacity>
\twarn \emph{The individual participants of the consortium are
  described in a separate section under Part~A. There is no need to
  repeat that information here.}

\begin{itemize}
\item
  Describe the consortium. How does it match the project's objectives,
  and bring together the necessary disciplinary and inter-disciplinary
  knowledge? Show how this includes expertise in social sciences and
  humanities, open science practices, and gender aspects of R\&I, as
  appropriate. Include in the description affiliated entities and
  associated partners, if any.
\item
  Show how the partners will have access to critical infrastructure
  needed to carry out the project activities.
\item
  Describe how the members complement one another (and cover the value
  chain, where appropriate)
\item
  In what way does each of them contribute to the project? Show that
  each has a valid role, and adequate resources in the project to fulfil
  that role.
\item
  If applicable, describe the industrial\slash commercial involvement in the
  project to ensure exploitation of the results and explain why this is
  consistent with and will help to achieve the specific measures which
  are proposed for exploitation of the results of the project (see
  section~\ref{sec:measures}).
\item
  \textbf{Other countries and international organisations}: If one or
  more of the participants requesting EU funding is based in a country
  or is an international organisation that is not automatically eligible
  for such funding (entities from Member States of the EU, from
  Associated Countries and from one of the countries in the exhaustive
  list included in the Work Programme General Annexes B are
  automatically eligible for EU funding), explain why the participation
  of the entity in question is essential to successfully carry out the
  project.
\end{itemize}
%</hi-capacity>
%<*hi-criticalrisks>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
\textbf{Definition critical risk:}

A critical risk is a plausible event or issue that could have a high
adverse impact on the ability of the project to achieve its objectives.

\textbf{Level of likelihood to occur: Low\slash medium\slash high}

The likelihood is the estimated probability that the risk will
materialise even after taking account of the mitigating measures put in
place.

\textbf{Level of severity: Low\slash medium\slash high}

The relative seriousness of the risk and the significance of its effect.
\end{tcolorbox}
%</hi-criticalrisks>
%<*hi-deliverables-key>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
\textbf{KEY}

Deliverable numbers in order of delivery dates. Please use the numbering
convention \textless WP number\textgreater.\textless number of
deliverable within that WP\textgreater.

For example, deliverable 4.2 would be the second deliverable from work
package 4.

\textbf{Type:}

Use one of the following codes:

\begin{quote}
R: Document, report (excluding the periodic and final reports)

DEM: Demonstrator, pilot, prototype, plan designs

DEC: Websites, patents filing, press \& media actions, videos, etc.

DATA: Data sets, microdata, etc.

DMP: Data management plan

ETHICS: Deliverables related to ethics issues.

SECURITY: Deliverables related to security issues

OTHER: Software, technical diagram, algorithms, models, etc.
\end{quote}

\textbf{Dissemination level:}

Use one of the following codes:

\begin{quote}
PU -- Public, fully open, e.g.\ web (Deliverables flagged as public will
be automatically published in CORDIS project's page)

SEN -- Sensitive, limited under the conditions of the Grant Agreement

Classified R-UE/EU-R -- EU RESTRICTED under the Commission Decision
No2015/444

Classified C-UE/EU-C -- EU CONFIDENTIAL under the Commission Decision
No2015/444

Classified S-UE/EU-S -- EU SECRET under the Commission Decision
No2015/444
\end{quote}

\textbf{Delivery date}

Measured in months from the project start date (month 1)
\end{tcolorbox}
%</hi-deliverables-key>
%<*hi-deliverables>
Only include deliverables that you consider essential for effective
project monitoring.\footnote{You must include a data
  management plan (DMP) and a `plan for dissemination and exploitation
  including communication activities as distinct deliverables within the
  first 6 months of the project. The DMP will evolve during the lifetime
  of the project in order to present the status of the
  project\textquotesingle s reflections on data management. A template
  for such a plan is available in the
  \href{https://ec.europa.eu/info/funding-tenders/opportunities/docs/2021-2027/common/guidance/om_en.pdf}{Online
  Manual} on the Funding \& Tenders Portal.}
%</hi-deliverables>
%<*hi-excellence>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
  \textbf{Excellence – aspects to be taken into account.}
  \begin{itemize}
  \item Clarity and pertinence of the project’s objectives, and the
    extent to which the proposed work is ambitious, and goes beyond
    the state of the art.
  \item Soundness of the proposed methodology, including the
    underlying concepts, models, assumptions, interdisciplinary
    approaches, appropriate consideration of the gender dimension in
    research and innovation content, and the quality of open science
    practices, including sharing and management of research outputs
    and engagement of citizens, civil society and end users where
    appropriate.
  \end{itemize}
  \end{tcolorbox}
  \noindent \twarn The following aspects will be taken into account
  only to the extent that the proposed work is within the scope of the
  work programme topic.
%</hi-excellence>
%<*hi-impact>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
\emph{\textbf{Impact -- aspects to be taken into account.}}

\begin{itemize}
\item
\makeatletter
\ifdim\@templateversion pt<5.1pt
  Credibility of the pathways to achieve the expected outcomes and
  impacts specified in the work programme, and the likely scale and
  significance of the contributions due to the project.
\else
  Credibility of the pathways to achieve the expected outcomes and
  impacts specified in the work programme.
\fi
\makeatother
\item
  Suitability and quality of the measures to maximise expected outcomes
  and impacts, as set out in the dissemination and exploitation plan,
  including communication activities.
\end{itemize}
    \end{tcolorbox}

\noindent\emph{The results of your project should make a contribution to the
expected outcomes set out for the work programme topic over the medium
term, and to the wider expected impacts set out in the `destination'
over the longer term.}

\makeatletter
\ifdim\@templateversion pt<5.1pt
\emph{In this section you should show how your project could contribute
to the outcomes and impacts described in the work programme, the likely
scale and significance of this contribution, and the measures to
maximise these impacts.}
\else
\emph{In this section you should show how your project could
contribute to the outcomes and impacts described in the work
programme, and the measures to maximise these impacts.}
\fi
\makeatother
%</hi-impact>
%<*hi-inkind>
\makeatletter
\ifdim\@templateversion pt<5.1pt
Please complete the table below for each participant that will make use
of in-kind contributions (non-financial resources made available free of
charge by third parties). In kind contributions provided by third
parties free of charge are declared by the participants as eligible
direct costs in the corresponding cost category (e.g.\ personnel costs or
purchase costs for equipment).
\fi
\makeatother
%</hi-inkind>
%<*hi-measures>
\begin{itemize}
\item
  Describe the planned measures to maximise the impact of your project
  by providing a first version of your `\uline{plan for the
  dissemination and exploitation including communication activities'}.
  Describe the dissemination, exploitation and communication measures
  that are planned, and the target group(s) addressed (e.g.\ scientific
  community, end users, financial actors, public at large).

\begin{itemize}[label=\twarn]
\item
  \emph{Please remember that this plan is an admissibility condition,
  unless the work programme topic explicitly states otherwise. In case
  your proposal is selected for funding, a more detailed `plan for
  dissemination and exploitation including communication activities'
  will need to be provided as a mandatory project deliverable within 6
  months after signature date. This plan shall be periodically updated
  in alignment with the project's progress.}
\item
  \emph{\uline{Communication}}\footnote{For further guidance on
    communicating EU research and innovation for project participants,
    please refer to the
    \href{https://ec.europa.eu/info/funding-tenders/opportunities/docs/2021-2027/common/guidance/om_en.pdf}{Online
    Manual} on the Funding \& Tenders Portal} \emph{measures should
  promote the project throughout the full lifespan of the project. The
  aim is to inform and reach out to society and show the activities
  performed, and the use and the benefits the project will have for
  citizens. Activities must be strategically planned, with clear
  objectives, start at the outset and continue through the lifetime of
  the project. The description of the communication activities needs to
  state the main messages as well as the tools and channels that will be
  used to reach out to each of the chosen target groups.}
\item
  \emph{All measures should be proportionate to the scale of the
  project, and should contain concrete actions to be implemented both
  during and after the end of the project, e.g.\ standardisation
  activities. Your plan should give due consideration to the possible
  follow-up of your project, once it is finished. In the justification,
  explain why each measure chosen is best suited to reach the target
  group addressed. Where relevant, and for innovation actions, in
  particular, describe the measures for a plausible path to
  commercialise the innovations.}
\item
  \emph{If exploitation is expected primarily in non-associated third
  countries, justify by explaining how that exploitation is still in the
  Union's interest.}
\item
  \emph{Describe possible feedback to policy measures generated by the
  project that will contribute to designing, monitoring, reviewing and
  rectifying (if necessary) existing policy and programmatic measures or
  shaping and supporting the implementation of new policy initiatives
  and decisions.}
\end{itemize}

\item
  Outline your strategy for the management of intellectual property,
  foreseen protection measures, such as patents, design rights,
  copyright, trade secrets, etc., and how these would be used to support
  exploitation.

\begin{itemize}[label=\twarn]
\item
  \emph{If your project is selected, you will need an appropriate
  consortium agreement to manage (amongst other things) the ownership
  and access to key knowledge (IPR, research data etc.). Where relevant,
  these will allow you, collectively and individually, to pursue market
  opportunities arising from the project.}
\item
  \emph{If your project is selected, you must indicate the owner(s) of
  the results (results ownership list) in the final periodic report.}
\end{itemize}
\end{itemize}
%</hi-measures>
%<*hi-methodology>
\begin{itemize}
\item
  Describe and explain the overall methodology, including the concepts,
  models and assumptions that underpin your work. Explain how this will
  enable you to deliver your project's objectives. Refer to any
  important challenges you may have identified in the chosen methodology
  and how you intend to overcome them. \emph{[e.g.\ 10 pages]}

\begin{itemize}[label=\twarn]
\item
  \emph{This section should be presented as a narrative. The detailed
  tasks and work packages are described below under `Implementation'.}
\makeatletter
\ifdim\@templateversion pt<4.0pt
\item
  \emph{Where relevant, include how the project methodology complies
  with the `do no significant harm' principle as per Article 17 of
  \href{https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=celex:32020R0852}{Regulation
  (EU) No 2020/852} on the establishment of a framework to facilitate
  sustainable investment (i.e.\ the so-called \textquotesingle EU
  Taxonomy Regulation\textquotesingle). This means that the methodology
  is designed in a way it is not significantly harming any of the six
  environmental objectives of the EU Taxonomy Regulation.}
\item
  \emph{If you plan to use, develop and\slash or deploy artificial
  intelligence (AI) based systems and\slash or techniques you must
  demonstrate their technical robustness. AI-based systems or techniques
  should be, or be developed to become:}

  \begin{itemize}
  \item
    \emph{technically robust, accurate and reproducible, and able to
    deal with and inform about possible failures, inaccuracies and
    errors, proportionate to the assessed risk they pose}
  \item
    \emph{socially robust, in that they duly consider the context and
    environment in which they operate}
  \item
    \emph{reliable and function as intended, minimizing unintentional
    and unexpected harm, preventing unacceptable harm and safeguarding
    the physical and mental integrity of humans}
  \item
    \emph{able to provide a suitable explanation of their
    decision-making processes, whenever they can have a significant
    impact on people's lives.}
  \end{itemize}
\fi
\makeatother
\end{itemize}

\item
  Describe any national or international research and innovation
  activities whose results will feed into the project, and how that link
  will be established; \emph{[e.g.\ 1 page]}
\item
  Explain how expertise and methods from different disciplines will be
  brought together and integrated in pursuit of your objectives. If you
  consider that an inter-disciplinary approach is unnecessary in the
  context of the proposed work, please provide a justification.
  \emph{[e.g.\ 1/2 page]}
\item
  For topics where the work programme indicates the need for the
  integration of social sciences and humanities, show the role of these
  disciplines in the project or provide a justification if you consider
  that these disciplines are not relevant to your proposed project.
  \emph{[e.g.\ 1/2 page]}
\item
  Describe how the gender dimension (i.e.\ sex and\slash or gender analysis) is
  taken into account in the project's research and innovation content
  \emph{[e.g.\ 1 page].} If you do not consider such a gender
  dimension to be relevant in your project, please provide a
  justification.

\begin{itemize}[label=\twarn]
\item
  \emph{Note: This section is mandatory except for topics which have
  been identified in the work programme as not requiring the integration
  of the gender dimension into R\&I content.}
\item
  \emph{Remember that that this question relates to the \uline{content}
  of the planned research and innovation activities, and not to gender
  balance in the teams in charge of carrying out the project.}
\item
  \emph{Sex and gender analysis refers to biological characteristics and
  social\slash cultural factors respectively. For guidance on methods of sex\slash
  gender analysis and the issues to be taken into account, please refer
  to}
\makeatletter
\ifdim\@templateversion pt<4.0pt
  \emph{\url{https://ec.europa.eu/info/news/gendered-innovations-2-2020-nov-24_en}}
\else
  \emph{\url{https://op.europa.eu/en/publication-detail/-/publication/33b4c99f-2e66-11eb-b27b-01aa75ed71a1/language-en}}
\fi
\makeatother
\end{itemize}

\item
  Describe how appropriate open science practices are implemented as an
  integral part of the proposed methodology. Show how the choice of
  practices and their implementation are adapted to the nature of your
  work, in a way that will increase the chances of the project
  delivering on its objectives \emph{[e.g.\ 1 page]}. If you believe
  that none of these practices are appropriate for your project, please
  provide a justification here.

\begin{itemize}[label=\twarn]
\item
  \emph{Open science is an approach based on open cooperative work and
  systematic sharing of knowledge and tools as early and widely as
  possible in the process. Open science practices include early and open
  sharing of research (for example through preregistration, registered
  reports, pre-prints, or crowd-sourcing); research output management;
  measures to ensure reproducibility of research outputs; providing open
  access to research outputs (such as publications, data, software,
  models, algorithms, and workflows); participation in open peer-review;
  and involving all relevant knowledge actors including citizens, civil
  society and end users in the co-creation of R\&I agendas and contents
  (such as citizen science).}
\item
  \emph{Please note that this question does not refer to outreach
  actions that may be planned as part of communication, dissemination
  and exploitation activities. These aspects should instead be described
  below under `Impact'.}
\end{itemize}

\makeatletter
\ifdim\@templateversion pt<4.0pt
\item
  Research \textbf{data management and management of other research
  outputs:} Applicants generating\slash collecting data and\slash or other research
  outputs (except for publications) during the project must provide
  maximum 1 page on how the data\slash research outputs will be managed in
  line with the FAIR principles (Findable, Accessible, Interoperable,
  Reusable), addressing the following (the description should be
  specific to your project): \emph{[1 page]}

\begin{quote}
\textbf{Types of data\slash research outputs} (e.g.\ experimental,
observational, images, text, numerical) and their estimated size; if
applicable, combination with, and provenance of, existing data.

\textbf{Findability of data\slash research outputs:} Types of persistent and
unique identifiers (e.g.\ digital object identifiers) and trusted
repositories that will be used.

\textbf{Accessibility of data\slash research outputs:} IPR considerations and
timeline for open access (if open access not provided, explain why);
provisions for access to restricted data for verification purposes.

\textbf{Interoperability of data\slash research outputs:} Standards, formats
and vocabularies for data and metadata.

\textbf{Reusability of data\slash research outputs}: Licenses for data
sharing and re-use (e.g.\ Creative Commons, Open Data
Commons); availability of tools\slash software\slash models for data generation and
validation\slash interpretation\slash re-use.

\textbf{Curation and storage\slash preservation costs}; person\slash team
responsible for data management and quality assurance.
\end{quote}
\fi
\makeatother

\begin{itemize}[label=\twarn]
\item
  \emph{Proposals selected for funding under Horizon Europe will need to
  develop a detailed data management plan (DMP) for making their
  data\slash research outputs findable, accessible, interoperable and reusable
  (FAIR) as a deliverable by month 6 and revised towards the end of a
  project's lifetime.}
\makeatletter
\ifdim\@templateversion pt>3.4pt
  \emph{The DMP should describe how research outputs
  (especially research data) generated and\slash or collected during the
  project will be managed so as to ensure that they are findable,
  accessible, interoperable and reusable.}
\fi
\makeatother
\item
  \emph{For guidance on open science practices and research data
  management, please refer to the relevant section of the
  \href{https://ec.europa.eu/info/funding-tenders/opportunities/docs/2021-2027/horizon/guidance/programme-guide_horizon_en.pdf}{HE
  Programme Guide} on the Funding \& Tenders Portal.}
\end{itemize}
\end{itemize}
%</hi-methodology>
%<*hi-milestones>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
\textbf{KEY}

\textbf{Due date}

Measured in months from the project start date (month 1)

\textbf{Means of verification}

Show how you will confirm that the milestone has been attained. Refer to
indicators if appropriate. For example: a laboratory prototype that is
`up and running'; software released and validated by a user group; field
survey complete and data quality validated.
\end{tcolorbox}
%</hi-milestones>
%<*hi-objectives>
\begin{itemize}
\item
  Briefly describe the objectives of your proposed work. Why are they
  pertinent to the work programme topic? Are they measurable and
  verifiable? Are they realistically achievable?
\item
  Describe how your project goes beyond the state-of-the-art, and the
  extent the proposed work is ambitious. Indicate any exceptional
  ground-breaking R\&I, novel concepts and approaches, new products,
  services or business and organisational models. Where relevant,
  illustrate the advance by referring to products and services already
  available on the market. Refer to any patent or publication search
  carried out.
\item
  Describe where the proposed work is positioned in terms of R\&I
  maturity (i.e.\ where it is situated in the spectrum from `idea to
  application', or from `lab to market'). Where applicable, provide an
  indication of the Technology Readiness Level, if possible
  distinguishing the start and by the end of the project.

  \begin{itemize}[label=\twarn]
  \item \emph{Please bear in mind that advances beyond the state of
      the art must be interpreted in the light of the positioning of
      the project.  Expectations will not be the same for RIAs at
      lower TRL, compared with Innovation Actions at high TRLs.}
  \end{itemize}
\end{itemize}
%</hi-objectives>
%<*hi-othercosts>
\makeatletter
\ifdim\@templateversion pt<5.1pt
Please complete the table below for each participant that would like to
declare costs under other costs categories (e.g.\ internally invoiced
goods and services), irrespective of the percentage of personnel costs.
\fi
\makeatother
%</hi-othercosts>
%<*hi-participant-numbering>
Please use the same participant numbering and name as that used in the
administrative proposal forms.
%</hi-participant-numbering>
%<*hi-participants>
\twarn The consortium members are listed in part~A of the proposal
(application forms). A summary list should also be provided in the
table below.
%</hi-participants>
%<*hi-pathways>
\begin{itemize}
\item
  \begin{quote}
    Provide a \textbf{narrative} explaining how the project's results
    are expected to make a difference in terms of impact, beyond the
    immediate scope and duration of the project. The narrative should
    include the components below, tailored to your project.
  \end{quote}

\begin{enumerate}
\def\labelenumi{(\alph{enumi})}
\item
  Describe the unique contribution your project results would make
  towards (1)~the \textbf{outcomes} specified in this topic, and (2)~the
  \textbf{wider impacts}, in the longer term, specified in the
  respective destinations in the work programme.
\makeatletter
\ifdim\@templateversion pt>4.0pt
  Provide quantified estimates where possible and meaningful.
\fi
\makeatother
\begin{itemize}[label=\twarn]
\item
  \emph{Be specific, referring to the effects of your project, and not
  R\&I in general in this field.}
\item
  \emph{State the target groups that would benefit. Even if target
  groups are mentioned in general terms in the work programme, you
  should be specific here, breaking target groups into particular
  interest groups or segments of society relevant to this project.}
\makeatletter
\ifdim\@templateversion pt<5.1pt
\item
  \emph{The outcomes and impacts of your project may:}

  \begin{itemize}
  \item
    \emph{Scientific, e.g.\ contributing to specific scientific advances,
    across and within disciplines, creating new knowledge, reinforcing
    scientific equipment and instruments, computing systems (i.e.
    research infrastructures);}
  \item
    \emph{Economic\slash technological, e.g.\ bringing new products, services,
    business processes to the market, increasing efficiency, decreasing
    costs, increasing profits, contributing to standards' setting, etc.}
  \item
    \emph{Societal, e.g.\ decreasing CO\textsubscript{2} emissions,
    decreasing avoidable mortality, improving policies and decision
    making, raising consumer awareness.}
  \end{itemize}

\emph{Only include such outcomes and impacts where your project would
make a significant and direct contribution. Avoid describing very
tenuous links to wider impacts. However, include any potential
negative environmental outcome or impact of the project including when
expected results are brought at scale (such as at commercial level).
Where relevant, explain how the potential harm can be managed.}
\end{itemize}

\item
  Give an indication of the scale and significance of the project's
  contribution to the expected outcomes and impacts, should the project
  be successful. Provide quantified estimates where possible and
  meaningful.

\begin{itemize}[label=\twarn]
\item
  `\emph{\uline{Scale'} refers to how widespread the outcomes and
  impacts are likely to be. For example, in terms of the size of the
  target group, or the proportion of that group, that should benefit
  over time; \uline{`Significance'} refers to the importance, or value,
  of those benefits. For example, number of additional healthy life
  years; efficiency savings in energy supply.}

\item
  \emph{Explain your baselines, benchmarks and assumptions used for
  those estimates. Wherever possible, quantify your estimation of the
  effects that you expect from your project. Explain assumptions that
  you make, referring for example to any relevant studies or statistics.
  Where appropriate, try to use only one methodology for calculating
  your estimates: not different methodologies for each partner, region
  or country (the extrapolation should preferably be prepared by one
  partner).}

\item
  \emph{Your estimate must relate to this project only~- the effect of
  other initiatives should not be taken into account.}
\fi
\makeatother
\end{itemize}

\item
  Describe any requirements and potential barriers~- arising from
  factors beyond the scope and duration of the project~- that may
  determine whether the desired outcomes and impacts are achieved. These
  may include, for example, other R\&I work within and beyond Horizon
  Europe; regulatory environment; targeted markets; user behaviour.
  Indicate if these factors might evolve over time. Describe any
  mitigating measures you propose, within or beyond your project, that
  could be needed should your assumptions prove to be wrong, or to
  address identified barriers.

\begin{itemize}[label=\twarn]
\item
  \emph{Note that this does not include the critical risks inherent to
  the management of the project itself , which should be described below
  under `Implementation'.}
\end{itemize}
\end{enumerate}
\end{itemize}
%</hi-pathways>
%<*hi-purchasecosts>
\makeatletter
\ifdim\@templateversion pt<5.1pt
Please complete the table below for each participant if the purchase
costs (i.e.\ the sum of the costs for 'travel and subsistence',
`equipment', and `other goods, works and services') exceeds 15\% of the
personnel costs for that participant (according to the budget table in
proposal part~A). The record must list cost items in order of costs and
starting with the largest cost item, up to the level that the remaining
costs are below 15\% of personnel costs.
\else
Please provide details on the need for equipment costs if they
exceed 15\% of the personnel costs for that participant (according
to the budget table in proposal part~A).
\fi
\makeatother
%</hi-purchasecosts>
%<*hi-quality>
\begin{tcolorbox}[standard jigsaw,opacityback=0]
  \emph{\textbf{Quality and efficiency of the implementation -- aspects to
be taken into account}}

\begin{itemize}
\item
  \emph{Quality and effectiveness of the work plan, assessment of risks,
  and appropriateness of the effort assigned to work packages, and the
  resources overall}
\item
  \emph{Capacity and role of each participant, and extent to which the
  consortium as a whole brings together the necessary expertise.}
\end{itemize}
  \end{tcolorbox}
%</hi-quality>
%<*hi-staffeffort>
\emph{Please indicate the number of person\slash months over the whole
duration of the planned work, for each work package, for each
participant. Identify the work-package leader for each WP by showing the
relevant person-month figure in bold.}
%</hi-staffeffort>
%<*hi-subcontractingcosts>
For each participant describe and justify the tasks to be subcontracted
(please note that core tasks of the project should not be
sub-contracted).
%</hi-subcontractingcosts>
%<*hi-summary>
  Provide a summary of this section by presenting in the canvas below the
key elements of your project impact pathway and of the measures to
maximise its impact.
%</hi-summary>
%<*hi-summary-specificneeds>
\textcolor{summaryblue}{\emph{What are the specific needs that
    triggered this project?}}\\

\textcolor{summaryblue}{Example 1}\\
Most airports use process flow-oriented models based on static
mathematical values limiting the optimal management of passenger flow
and hampering the accurate use of the available resources to
the actual demand of passengers.\\

\textcolor{summaryblue}{Example 2}\\
Electronic components need to get smaller and lighter to match the
expectations of the end-users. At the same time there is a problem of
sourcing of raw materials that has an environmental impact.
%</hi-summary-specificneeds>
%<*hi-summary-expectedresults>
\textcolor{summaryblue}{\emph{What do you expect to generate by the
    end of the project?}}\\

\textcolor{summaryblue}{Example 1}\\
\textbf{Successful large-scale demonstrator}: Trial with 3 airports of
an advanced forecasting system for proactive airport passenger flow
management.\\

\textbf{Algorithmic model}:\\
Novel algorithmic model for proactive airport passenger flow
management.\\

\textcolor{summaryblue}{Example 2}\\
Publication of a \textbf{scientific discovery on transparent
  electronics}.\\

\textbf{New product}: More sustainable electronic circuits.\\

\textbf{Three PhD students trained}.
%</hi-summary-expectedresults>
%<*hi-summary-decmeasures>
\textcolor{summaryblue}{\emph{What dissemination, exploitation and
    communication measures will you apply to the results?}}\\

\textcolor{summaryblue}{Example 1}\\
\textbf{Exploitation}: Patenting the algorithmic model.\\

\textbf{Dissemination towards the scientific community and airports}:
Scientific publication with the results of the large-scale
demonstration.\\

\textbf{Communication towards citizens}: An event in a shopping mall
to show how the outcomes of the action are relevant to our
everyday lives.\\

\textcolor{summaryblue}{Example 2}\\
\textbf{Exploitation of the new product}: Patenting the new product;
Licencing to major electronic companies.\\

\textbf{Dissemination towards the scientific community and industry}:
Participating at conferences; Developing a platform of material
compositions for industry; Participation at EC project portfolios to
disseminate the results as part of a group and maximise the visibility
vis-à-vis companies.
%</hi-summary-decmeasures>
%<*hi-summary-targetgroups>
\textcolor{summaryblue}{Who will use or further up-take the results of
  the project? Who will benefit from the results of the
  project?}\\

\textcolor{summaryblue}{Example 1}\\
9 European airports: Schiphol, Brussels airport, etc.\\

\textbf{The European Union aviation safety agency}.\\

\textbf{Air passengers (indirect)}.\\

\textcolor{summaryblue}{Example 2}\\
\textbf{End-users}: consumers of electronic devices.\\

\textbf{Major electronic companies}: Samsung, Apple, etc.\\

\textbf{Scientific community} (field of transparent electronics).
%</hi-summary-targetgroups>
%<*hi-summary-outcomes>
\textcolor{summaryblue}{\emph{What change do you expect to see after
    successful dissemination and exploitation of project results
    to the target group(s)?}}\\

\textcolor{summaryblue}{Example 1}\\
\textbf{Up-take by airports}: 9 European airports adopt the advanced
forecasting system demonstrated during the project.\\

\textcolor{summaryblue}{Example 2}\\
\textbf{High use of the scientific discovery published} (measured with
the relative rate of citation index of project publications).\\

A \textbf{major electronic company} (Samsung or Apple)
\textbf{exploits\slash uses the new product} in their manufacturing.
%</hi-summary-outcomes>
%<*hi-summary-impacts>
\textcolor{summaryblue}{\emph{What are the expected wider scientific,
    economic and societal effects of the project contributing to the
    expected impacts outlined in the
    respective destination in the work programme?}}\\

\textcolor{summaryblue}{Example 1}\\
\textbf{Scientific}: New breakthrough scientific discovery on
passenger
forecast modelling.\\

\textbf{Economic}: Increased airport efficiency Size: 15\% increase of
maximum passenger capacity in European
airports, leading to a 28\% reduction in infrastructure expansion costs.\\

\textcolor{summaryblue}{Example 2}\\
\textbf{Scientific}: New breakthrough scientific discovery on
transparent electronics.\\

\textbf{Economic/Technological}: A new market for touch enabled
electronic devices.\\

\textbf{Societal}: Lower climate impact of electronics manufacturing
(including through material sourcing and waste management).
%</hi-summary-impacts>
%<*hi-tables>
\twarn \emph{Use plain text for the tables in section~\ref{sec:workplan}. If the proposal is
invited to start Grant Agreement preparation, these tables will have to
be encoded in the grant management IT tool, where no graphics or special
formats are supported.}
%</hi-tables>
%<*hi-workplan>
Please provide the following:

\begin{itemize}
\item
  
  brief presentation of the overall structure of the work plan;
\item
  
  timing of the different work packages and their components (Gantt
  chart or similar);
\item
  
  graphical presentation of the components showing how they inter-relate
  (Pert chart or similar).
\item
  
  detailed work description, i.e.:

  \begin{itemize}
  \item
    
    a list of work packages (table~3.1a);
  \item
    
    a description of each work package (table~3.1b);
  \item
    
    a list of deliverables (table~3.1c);
\begin{itemize}[label=\twarn]
\item
  \emph{Give full details. Base your account on the logical structure of
  the project and the stages in which it is to be carried out.}
\makeatletter
\ifdim\@templateversion pt<3.4pt
  \emph{The number of work packages should be proportionate to the scale
  and complexity of the project.}
\item
  \emph{You should give enough detail in each work package to justify
  the proposed resources to be allocated and also quantified information
  so that progress can be monitored, including by the Commission}
\else
  \emph{Each work package should be a substantial part of the work
    plan, and the number of work packages should be proportionate to
    the scale and complexity of the project.}
\item \emph{Structure each work package by breaking it down into
    tasks. If tasks are not appropriate, work packages can be
    organised according to other criteria (e.g., according to the type
    of work or thematically). For each task or element of the work
    package, describe all activities to be carried out and quantify
    them (e.g., number of protocols, tests, measurements,
    combinations, study subjects, conferences, publications,
    etc.). Provide enough detail to clarify who will do this work and
    why it is needed for the project, (e.g., the level of
    qualification and number of person-months for personnel, as well
    as the requested equipment, consumables, meetings, etc.), to
    justify the proposed resources and so that progress can be
    monitored, including by the Commission.}
\fi
\makeatother
\item
  \emph{Resources assigned to work packages should be in line with their
  objectives and deliverables. You are advised to include a distinct
  work package on `project management', and to give due visibility in
  the work plan to `data management' `dissemination and exploitation'
  and `communication activities', either with distinct tasks or distinct
  work packages.}
\item
  \emph{You will be required to update the `plan for the dissemination
  and exploitation of results including communication activities', and a
  `data management plan', (this does not apply to topics where a plan
  was not required.) This should include a record of activities related
  to dissemination and exploitation that have been undertaken and those
  still planned.}
\item
  \emph{Please make sure the information in this section matches the
  costs as stated in the budget table in section~\ref{sec:quality} of the application
  forms, and the number of person months, shown in the detailed work
  package descriptions.}
\end{itemize}
\end{itemize}

\item
  a list of milestones (table~3.1d);
  
\item
  a list of critical risks, relating to project implementation, that the
  stated project\textquotesingle s objectives may not be achieved.
  Detail any risk mitigation measures. You will be able to update the
  list of critical risks and mitigation measures as the project
  progresses (table~3.1e);
  
\item
  a table showing number of person months required (table~3.1f);
  
\item
  a table showing description and justification of subcontracting costs
  for each participant (table~3.1g);

\item
  a table showing justifications for `purchase costs' (table~3.1h) for
  participants where those costs exceed 15\% of the personnel costs
  (according to the budget table in proposal part~A); % [sic]
  
\makeatletter
\ifdim\@templateversion pt<5.1pt
\item
  if applicable, a table showing justifications for `other costs
  categories' (table~3.1i);
  
\item
  if applicable, a table showing in-kind contributions from third
  parties (table~3.1j)
\fi
\makeatother
\end{itemize}
%</hi-workplan>
%<*hi-wp-description>
\makeatletter
\ifdim\@templateversion pt<3.4pt
(where appropriate, broken down into tasks), lead partner and role of
participants. Deliverables linked to each WP are listed in table~3.1c
(no need to repeat the information here).
\else
(where appropriate, broken down into tasks), lead partner and role of participants. For each task, quantify the amount of work. Provide enough detail to justify the resources requested and clarify why the work is needed and who will do it. Deliverables linked to each WP are listed in table~3.1c (no need to repeat the information here).
\fi
\makeatother
%</hi-wp-description>
%<*hi-wp-objectives>
\twarn \emph{Participants involved in each WP and their efforts are
  shown in table~3.1f. Lead participant and starting and end date of
  each WP are shown in table~3.1a.)}
%</hi-wp-objectives>
%<*heria-proposal>
\documentclass[showinstructions]{heria}

%<3.2>\templateversion{3.2}
%<3.3>\templateversion{3.3}
%<3.4>\templateversion{3.4}
%<4.0>\templateversion{4.0}
%<5.1>\templateversion{5.1}

\usepackage{caption}

\title{Skeleton Horizon Europe Proposal}
\callname{insert call name}
\callidentifier{HORIZON-XX0-0000-XXXXX-00-XXXXX}
\calltopic{HORIZON-XX0-0000-XXXXX-00-00}

\begin{document}
\maketitle

\heinstructions{participants}

%<3.2|3.3|3.4|4.0>\noindent\opentag{APP-FORM-HERIAIA}%
\section*{List of participants}[][][1 page]\label{sec:listofparticipants}

\participant
  {University of Upper Freedonia} % Participant organisation name
  {UUF} % Participant short name
  {AT} % Country

\participant
  {Molvania State University} % Participant organisation name
  {MSU} % Participant short name
  {DE} % Country

\participant
  {Institute for Underwater Basket Weaving} % Participant organisation name
  {IUBW} % Participant short name
  {UK} % Country

\makeparticipantstable

\heinstructions{participant-numbering}

%<3.2|3.3|3.4|4.0>\section{Excellence}[REL-EVA-RE]\label{sec:excellence}
%<5.1>\section{Excellence}\label{sec:excellence}

\heinstructions{excellence}

%<3.2|3.3|3.4|4.0>\subsection{Objectives and ambition}[PRJ-OBJ-PO][][4 pages]\label{sec:objectives}
%<5.1>\subsection{Objectives and ambition}[][][4 pages]\label{sec:objectives}

\heinstructions{objectives}

%<3.2|3.3|3.4|4.0>\subsection{Methodology}[CON-MET-CM,COM-PLE-CP][PRJ-OBJ-PO][14 pages]\label{sec:methodology}
%<5.1>\subsection{Methodology}[][][14 pages]\label{sec:methodology}

\heinstructions{methodology}

\subsubsection{Overall methodology}[][][10 pages]\label{sec:overallmethodology}

\subsubsection{Connections to other research activities}[][][1 page]\label{sec:connections}

\subsubsection{Interdisciplinarity}[][][1/2 page]\label{sec:interdisciplinarity}

%<3.2|3.3|3.4|4.0>\subsubsection{Gender dimension}[][][1/2 page]\label{sec:gender} 
%<5.1>\subsubsection{Gender dimension}[][][1 page]\label{sec:gender} 

\subsubsection{Open science}[][][1 page]\label{sec:openscience}

%<3.2|3.3|3.4>\subsubsection{Research data management}[][][1 page]\label{sec:rdm}

%<3.2|3.3|3.4|4.0>\section{Impact}[IMP-ACT-IA][CON-MET-CM,COM-PLE-CP,REL-EVA-RE]\label{sec:impact}
%<5.1>\section{Impact}\label{sec:impact}

\heinstructions{impact}

%<3.2|3.3|3.4|4.0>\subsection{Project's pathways towards impact}[][][4 pages]\label{sec:pathways}
%<5.1>\subsection{Project's pathways towards impact}[][][3 pages]\label{sec:pathways}

\heinstructions{pathways}

%<3.2|3.3|3.4|4.0>\subsection{Measures to maximise impact: Dissemination, exploitation and communication}[COM-DIS-VIS-CDV][][5 pages, including section~\ref{sec:summary}]\label{sec:measures}
%<5.1>\subsection{Measures to maximise impact: Dissemination, exploitation and communication}[][][3 pages, excluding section~\IfLabelExistsTF{sec:summary}{\ref{sec:summary}}{2.3}]\label{sec:measures}

\heinstructions{measures}

%<3.2|3.3|3.4|4.0>\closetag{COM-DIS-VIS-CDV}

%<3.2|3.3|3.4|4.0>\subsection{Summary}\label{sec:summary}
%<5.1>\subsection{Summary}[][][(OPTIONAL~-- Please remove this section if not used)]\label{sec:summary}

\heinstructions{summary}

\noindent Figure~\ref{fig:impact} on
pages~\pageref{fig:impact}--\pageref{fig:impact2} presents a tableau
summarising the project's impact.

\begin{SidewaysFigure}
\begin{summarycanvas}%
  \begin{summarybox}{SPECIFIC NEEDS}
    \heinstructions*{summary-specificneeds}
  \end{summarybox}%
  \begin{summarybox}{EXPECTED RESULTS}
    \heinstructions*{summary-expectedresults}
  \end{summarybox}%
  \begin{summarybox}{D \& E \& C MEASURES}
    \heinstructions*{summary-decmeasures}
  \end{summarybox}%
\end{summarycanvas}%
\caption{Impact summary tableau}\label{fig:impact}
\end{SidewaysFigure}

\begin{SidewaysFigure}
\begin{summarycanvas}%
  \begin{summarybox}{TARGET GROUPS}
    \heinstructions*{summary-targetgroups}
  \end{summarybox}%
  \begin{summarybox}{OUTCOMES}
    \heinstructions*{summary-outcomes}
  \end{summarybox}%
  \begin{summarybox}{IMPACTS}
    \heinstructions*{summary-impacts}
  \end{summarybox}%
\end{summarycanvas}%
\ContinuedFloat%
\caption{Impact summary tableau (continued)}\label{fig:impact2}
\end{SidewaysFigure}

%<3.2|3.3|3.4|4.0>\section{Quality and efficiency of the implementation}[QUA-LIT-QL,WRK-PLA-WP][IMP-ACT-IA]\label{sec:quality}
%<5.1>\section{Quality and efficiency of the implementation}\label{sec:quality}

\heinstructions{quality}

%<3.2|3.3|3.4|4.0>\subsection{Work plan and resources}[][][14 pages (19 pages for topics using lump sum funding)~-- including tables]\label{sec:workplan}
%<5.1>\subsection{Work plan and resources}[][][12 pages (17 pages for topics using lump sum funding)~-- including tables]\label{sec:workplan}

\heinstructions{workplan}

\subsubsection*{Table 3.1a: List of work packages}

\heinstructions{tables}

\makeworkpackagestable

\subsubsection*{Table 3.1b: Work package description}

\workpackage
  {ra} % unique ID (used only for cross-referencing deliverables, etc. in LaTeX)
  {Requirements analysis} % work package title
  {UUF}% Lead participant (using short name)
  {1}% Start month
  {6}% End month

\heinstructions{wp-objectives}
\begin{objectives}
\item First objective
\item Second objective
\item \dots
\end{objectives}

\begin{descriptionofwork}
\heinstructions{wp-description}
\task
  {Literature survey} % task name
  {UUF} % short name of lead participant
  {MSU} % other participants (or "all participants", etc.)
  {1--6} % month(s)
  In this task, we will read a lot of books, and\dots
\end{descriptionofwork}

\deliverable
  {dmp} % deliverable name
  {Data management plan} % short description
  {MSU} % short name of lead participant
  {DMP}% type; see Table 3.1c instructions for valid values
  {PU}% dissemination level; see Table 3.1c instructions for valid values
  {6}% delivery date (in months from beginning of project)

\workpackage%
  {integration}% Unique ID (used only for cross-referencing deliverables, etc. in LaTeX)
  {System integration}% Title
  {UUF}% Lead partner (using short name ID)
  {1}% Start month
  {20}% End month

\heinstructions{wp-objectives}
\begin{objectives}
\item First objective
\item Second objective
\item \dots
\end{objectives}

\begin{descriptionofwork}
\heinstructions{wp-description}
\task
  {Develop prototype} % task name
  {UUF} % short name of lead participant
  {MSU} % other participants (or "all participants", etc.)
  {1--10} % month(s)
  In this task, we will do lots of coding, and\dots
\end{descriptionofwork}

\deliverable
  {demo} % deliverable name
  {Working demo system} % short description
  {IUBW} % short name of lead participant
  {DEM}% type; see Table 3.1c instructions for valid values
  {SEN}% dissemination level; see Table 3.1c instructions for valid values
  {10}% delivery date (in months from beginning of project)

\workpackage%
  {dissemination}% Unique ID (used only for cross-referencing deliverables, etc. in LaTeX)
  {Dissemination and exploitation}% Title
  {UUF}% Lead partner (using short name ID)
  {7}% Start month
  {20}% End month

\heinstructions{wp-objectives}
\begin{objectives}
\item First objective
\item Second objective
\item \dots
\end{objectives}

\begin{descriptionofwork}
\heinstructions{wp-description}
\task
  {Organise public workshop} % task name
  {MSU} % short name of lead participant
  {all participants} % other participants (or "all participants", etc.)
  {7--10} % month(s)
  In this task, we will unite the greatest minds\dots
\end{descriptionofwork}

\deliverable
  {proceedings} % deliverable name
  {Workshop proceedings} % short description
  {MSU} % short name of lead participant
  {R}% type; see Table 3.1c instructions for valid values
  {PU}% dissemination level; see Table 3.1c instructions for valid values
  {11}% delivery date (in months from beginning of project)

\subsubsection*{Table 3.1c: List of deliverables}

\heinstructions{deliverables}

\makedeliverablestable

\heinstructions{deliverables-key}

\subsubsection*{Table 3.1d: List of milestones}

\milestone
  {Define use cases} % milestone name
  {WP1} % related work package(s)
  {12} % month due
  {expert review} % means of verification

\milestone
  {Minimum viable product (MVP)} % milestone name
  {WP2} % related work package(s)
  {20} % month due
  {expert review} % means of verification

\heinstructions{milestones}
\makemilestonestable

%<3.2|3.3|3.4|4.0>\subsubsection*{Table 3.1e: Critical risks for implementation}[RSK-MGT-RM]
%<5.1>\subsubsection*{Table 3.1e: Critical risks for implementation}

\criticalrisk
  {Datasets are not available} % description of risk
  {Low} % Likelihood
  {High} % Severity
  {WP1, WP2} % Work package(s) involved
  {We'll find new ones} % Proposed risk-mitigation measures

\heinstructions{criticalrisks}
\makecriticalriskstable

%<3.2|3.3|3.4|4.0>\subsubsection*{Table 3.1f: Summary of staff effort}[][RSK-MGT-RM]
%<5.1>\subsubsection*{Table 3.1f: Summary of staff effort}

\staffeffort
  {UUF} % short name of participant
  {ra} % name of work package
  {23} % number of person-months
\staffeffort{UUF}{integration}{6}
\staffeffort{UUF}{dissemination}{11}
\staffeffort{MSU}{ra}{18}
\staffeffort{MSU}{integration}{17}
\staffeffort{MSU}{dissemination}{1}
\staffeffort{IUBW}{ra}{21}
\staffeffort{IUBW}{integration}{14}
\staffeffort{IUBW}{dissemination}{5}

\heinstructions{staffeffort}
\makestaffefforttable

\subsubsection*{Table 3.1g: `Subcontracting costs' items}

\heinstructions{subcontractingcosts}

\subcontractingcost
  {UUF} % short name of participant
  {25000} % cost in euros
  {Design project website} % description of tasks and justification

\makesubcontractingcoststable

%<*5.1>
\subsubsection*{Table 3.1h: `Purchase costs' items (major equipment costs)}

\heinstructions{purchasecosts}

\equipmentcost
  {IUBW} % short name of participant
  {2120} % cost in euros
  {Computing cluster} % details on need for equipment

\makeequipmentcoststable

%</5.1>
%<*3.2|3.3|3.4|4.0>
\subsubsection*{Table 3.1h: `Purchase costs' items (travel and subsistence, equipment and other goods, works and services)}

\heinstructions{purchasecosts}

\purchasecost
  {IUBW} % short name of participant
  {6125} % travel cost in euros
  {Attendance at two conferences} % justification
  {2120} % equipment cost in euros
  {Computing cluster} % justification
  {4775} % other costs in euros
  {Crowdsourcing study} % justification
  {1000} % remaining costs

\makepurchasecoststable

\subsubsection*{Table 3.1i: `Other costs categories' items (e.g., internally invoiced goods and services)}

\heinstructions{othercosts}

\othercost
  {UUF} % short name of participant
  {500} % cost in euros
  {Cookies for bribing reviewers} % justification
\othercost
  {MSU} % short name of participant
  {15000} % cost in euros
  {Legal fees for defending bribery charges} % justification

\makeothercoststable

\subsubsection*{Table 3.1j: `In-kind contributions' provided by third parties}

\inkindcontribution
  {UUF} % short name of participant
  {Freedonian Ministry of Education} % third party name
  {Travel and subsistence} % category (see template instructions for list)
  {300} % cost in euros
  {Use of minister's private jet} % justification

\heinstructions{inkind}
\makeinkindcontributionstable

%</3.2|3.3|3.4|4.0>
%<3.2|3.3|3.4|4.0>\subsection{Capacity of participants and consortium as a whole}[CON-SOR-CS,PRJ-MGT-PM][][3 pages]\label{sec:capacity}
%<5.1>\subsection{Capacity of participants and consortium as a whole}[][][3 pages]\label{sec:capacity}

\heinstructions{capacity}

%<3.2|3.3|3.4|4.0>\closetag{CON-SOR-CS,PRJ-MGT-PM}

%<3.2|3.3|3.4|4.0>\closetag{QUA-LIT-QL,WRK-PLA-WP}

\heinstructions{annexes}
\end{document}
%</heria-proposal>
% \fi
% \Finale
