0

I am creating a new command in order to reference to a list of building codes I'm using. I don't want to include these in my standard bibliography, as I'm using natbib and it doesn't seem to be possible to include two different bibliographies (if this actually is possible, please say so; that would solve the problem as well and probably make it even easier).

Therefore, I created a new command. However, now when I'm using this command (\normref), it references with regular numbers (1, 2, 3, ...) and instead I would like it to reference it with the labels I'm using in the list (i.e. Roman capital letters). See this MWE:

\documentclass{report}
\usepackage[utf8]{inputenc}

\newcommand{\normref}[1]{%
    {[\ref{#1}]}}

\begin{document}

\chapter{Main text}

\begin{itemize}
    \item NEN-EN 1990 \normref{NEN1990}
    \item NEN-EN 1991-2 \normref{NEN1991_2}
\end{itemize}

\chapter*{Building Codes}

\begin{enumerate}
\renewcommand{\labelenumi}{[\Roman{enumi}]}
    \item \label{NEN1990} NEN-EN 1990+A1+A1/C2:2019: Eurocode: Grondslagen voor het constructief ontwerp
    \item \label{NEN1991_2} NEN-EN 1991-2+C1:2015: Eurocode 1: Belastingen op constructies – Deel 2: Verkeersbelasting op bruggen
\end{enumerate}

\end{document}

I'm pretty sure it should be easy to change the labeling of \normref into Roman letters, however my experience with creating new commands is nil, so hopefully someone can help me solving this issue.

1

You can create multiple bibliographies with biblatex. Apart from this: You should redefine \theenumi as this is the command used to store the value:

\documentclass{report}
\usepackage[utf8]{inputenc} %no longer needed in a current latex

\newcommand{\normref}[1]{%
    {[\ref{#1}]}}

\begin{document}

\chapter{Main text}

\begin{itemize}
    \item NEN-EN 1990 \normref{NEN1990}
    \item NEN-EN 1991-2 \normref{NEN1991_2}
\end{itemize}

\chapter*{Building Codes}

\begin{enumerate}
\renewcommand{\theenumi}{\Roman{enumi}}\renewcommand\labelenumi{[\theenumi]}
    \item \label{NEN1990} NEN-EN 1990+A1+A1/C2:2019: Eurocode: Grondslagen voor het constructief ontwerp
    \item \label{NEN1991_2} NEN-EN 1991-2+C1:2015: Eurocode 1: Belastingen op constructies – Deel 2: Verkeersbelasting op bruggen
\end{enumerate}

\end{document}

enter image description here

5
  • Thank you for your amazingly quick response. As I said, I'm not an expert at all, but I'm getting there with your help! – J.W. Boersma Apr 22 '20 at 14:54
  • However, now I have a follow up question still. If I want to include a second level of referencing (i.e. I.I, I.II, I.III, and subsequently II.I, II.II, II.III), how do I make sure these labels are also changed accordingly when I'm referencing to them in my main text? – J.W. Boersma Apr 22 '20 at 15:07
  • better ask a new question with an example, I have no idea how you want to create the second level. – Ulrike Fischer Apr 22 '20 at 15:09
  • Never mind, I managed to solve it in a different way – J.W. Boersma Apr 22 '20 at 15:32
  • @J.W.Boersma Probably \renewcommand{\theenumii}{\the\enumi.\Roman{enumii}}\renewcommand\labelenumii{[\theenumii]} and \renewcommand{\theenumiii}{\the\enumii.\Roman{enumiii}}\renewcommand\labelenumiii{[\theenumiii]} and \renewcommand{\theenumiv}{\the\enumiii.\Roman{enumiv}}\renewcommand\labelenumiv{[\theenumiv]}. – Ulrich Diez Apr 23 '20 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.