1

So I want to reference to several sections in the eurocode without a massive bibliography. Today I'm creating a new @standard for every section in a standary that I need to reference which of course generates i.e 15 references in the bibliography.

Example

As described in [1] and [2] the choise of parametes in [3]...

BIBLIOGRAPHY

[1] SS-EN 1992-1-1 eurocode section 4.5.6.7

[2] SS-EN 1992-1-1 eurocode section 4.5.6.8

[3] SS-EN 1992-1-1 eurocode section 4.5.6.9

This is what I would like to achieve:

Example

As described in [1a] and [1b] the chose of parametes in [1c]...

BIBLIOGRAPHY

[1] SS-EN 1992-1-1 eurocode

    (a) section 4.5.6.7

    (b) section 4.5.6.8

    (c) section 4.5.6.9

Is there a nice way?

moewe
  • 175,683
  • Maybe this https://tex.stackexchange.com/a/463919/118739 may help... – AndiW Feb 22 '19 at 14:00
  • I guess usually one would just cite the entire thing and would add the specific section/pinpoint in the cite command: \cite[§4.5.6.7]{en1992} and \cite[§4.5.6.9]{en1992}. – moewe Feb 24 '19 at 13:22

1 Answers1

2

Welcome to TeX.SE!

Facing a very similar problem some time ago i modified the @set handling of biblatex with the highly appreciated assistance of moewe to get the following result:

enter image description here

Adapting the answer mentioned in my previous comment using the the solution of this question and the main part of this answer to your needs you can use the following:

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber,style=numeric-comp,mcite,subentry,sorting=nty,sortsets=true]{biblatex}
\usepackage{enumitem}

\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{default}{family-given}
\DeclareFieldFormat{entrysetcount}{\mknumalph{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}

\makeatletter
\DeclareEntryOption[string]{multivolumehead}{\def\xs@mv@head{#1}}
\define@key{xs@multivolume}{multivolumehead}{\def\xs@mv@head{#1}}

\DeclareBibliographyDriver{multivolumechild}{%
    \ifboolexpr{
      test {\ifnamesequal{author}{savedauthor}}
      or
      test {\ifnameundef{author}}
    }
      {\nopunct}
      {\printnames{author}%
       \newunit\newblock}%
    \iffieldundef{volume}
      {}
      {\printfield{volume}%
       \printfield{part}%
       \newunit\newblock}%
    \usebibmacro{title}%
    \newunit\newblock
    \ifboolexpr{
      test {\ifnamesequal{editor}{savededitor}}
      or
      test {\ifnameundef{editor}}
     }{}
      {\usebibmacro{byeditor+others}%
       \newunit\newblock}%
    \ifboolexpr{
      test {\iflistsequal{location}{savedlocation}}
      or
      test {\iflistundef{location}}
     }{}
      {\printlist{location}}%<- typo
    \ifboolexpr{
      test {\iflistsequal{publisher}{savedpublisher}}
      or
      test {\iflistundef{publisher}}
    } {\setunit*{\addcomma\space}}%
      {\setunit*{\addcolon\space}%
       \printlist{publisher}%
       \setunit*{\addcomma\space}}%
    \newunit\newblock%
    \ifboolexpr{
      test {\iffieldsequal{year}{savedyear}}
      or
      test {\iffieldundef{year}}
     }{}
      {\printdate%
       \newunit\newblock}%
    \ifboolexpr{
      test {\iffieldsequal{isbn}{savedisbn}}
      or
      not togl {bbx:isbn}
     }{}
      {\printfield{isbn}}%
    \newunit\newblock%
    \usebibmacro{chapter+pages}%
  }

\DeclareBibliographyDriver{set}{%
  \edef\xs@mv@set{\abx@field@entrykey}%
  \ifboolexpr{
    test {\ifundef{\xs@mv@head}}
    or
    test {\ifblank{\xs@mv@head}}
    }
    {\entryset{}{}%
     \newunit\newblock
     \usebibmacro{setpageref}%
     \finentry}
    {\entrydata*{\xs@mv@head}{\usedriver{}{\abx@field@entrytype}\finentrypunct%
       % reload the set so we can access the header via saved
       \entrydata*{\xs@mv@set}{
         % don't issue \leavevmode inside here
         \let\blx@leavevmode\relax
         \setitemize{noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt}%
         \begin{itemize}[label={\printfield{entrysetcount})},labelindent=0.5\labelnumberwidth,labelsep=1ex,itemindent=0pt,leftmargin=*]
         \entryset{\item \ifcsdef{blx@bbx@multivolume\abx@field@savedentrytype}
           {\edef\abx@field@entrytype{multivolume\abx@field@savedentrytype}}
           {\message{^^Jxs Warning: BibliographyDriver blx@bbx@multivolume@\abx@field@entrytype\space undefined
                     ^^J** Using fallback driver multivolumechild
                     ^^J** If you get unexpected entries in the bibliography consider to create a new BibliographyDriver multivolume@\abx@field@savedentrytype.}%
            \def\abx@field@entrytype{multivolumechild}}}{}%
         \finentrypunct\end{itemize}\nopunct}}%
     \newunit\newblock
     \usebibmacro{setpageref}%
     \finentry}}

\newcounter{cbx@tempcntc}% no. of entrysetcounts we skipped
\newcounter{cbx@tempcntd}% 'predicted' entrysetcount
\renewbibmacro*{cite:init}{%
  \global\boolfalse{cbx:parens}%
  \global\undef\cbx@lasthash
  \global\undef\cbx@lastnumber
  \global\undef\cbx@lastprefix
  \global\undef\cbx@lastcount
  \setcounter{cbx@tempcnta}{0}%
  \setcounter{cbx@tempcntb}{-2}%
  \setcounter{cbx@tempcntc}{0}%
  \setcounter{cbx@tempcntd}{-1}}

\newcommand*{\cbx@iflabelnumberequalslast}{%
  \iffieldequals{labelnumber}{\cbx@lastnumber}}

\newcommand*{\cbx@iflabelprefixequalslast}{%
  \ifundef\cbx@lastprefix
    {\iffieldundef{labelprefix}
       {\@firstoftwo}
       {\@secondoftwo}}
    {\iffieldequals{labelprefix}{\cbx@lastprefix}
       {\@firstoftwo}
       {\@secondoftwo}}}

\newcommand*{\cbx@iflabelequalslast}{%
  \iffieldequals{labelnumber}{\cbx@lastnumber}
    {\cbx@iflabelprefixequalslast
       {\@firstoftwo}
       {\@secondoftwo}}
    {\@secondoftwo}}

\renewbibmacro*{cite:comp:inset}{%
  \stepcounter{cbx@tempcntd}%
  \cbx@iflabelequalslast
    {}
    {\usebibmacro{cite:dump}%
     \ifnumgreater{\value{cbx@tempcntb}}{-1}
       {\multicitedelim}
       {}}%
  \printtext[bibhyperref]{%
    \cbx@iflabelequalslast
      {}
      {\setcounter{cbx@tempcntd}{-1}%
       \printfield{labelprefix}%
       \printfield{labelnumber}%
       \savefield{labelprefix}{\cbx@lastprefix}%
       \savefield{labelnumber}{\cbx@lastnumber}}%
    \ifnumequal{\thefield{entrysetcount}}{\value{cbx@tempcntd}}
      {\savefield{entrykey}{\cbx@lastkey}%
       \savefield{entrysetcount}{\cbx@lastcount}%
       \stepcounter{cbx@tempcntc}}
      {\usebibmacro{cite:dump}%
       \ifnumgreater{\value{cbx@tempcntd}}{0}
         {\multicitedelim}
         {}%
       \printfield{entrysetcount}}}%
    \setcounter{cbx@tempcntd}{\thefield{entrysetcount}}%
    \setcounter{cbx@tempcntb}{-1}}

\renewbibmacro*{cite:dump}{%
  \ifnumgreater{\value{cbx@tempcntc}}{0}
    {\ifnumgreater{\value{cbx@tempcntc}}{1}
       {\bibrangedash}
       {\multicitedelim}%
     \bibhyperref[\cbx@lastkey]{%
       \printtext[entrysetcount]{\cbx@lastcount}}}
    {}%
  \setcounter{cbx@tempcntc}{0}%
  \ifnumgreater{\value{cbx@tempcnta}}{0}
    {\ifnumgreater{\value{cbx@tempcnta}}{1}
       {\bibrangedash}
       {\multicitedelim}%
     \bibhyperref[\cbx@lastkey]{%
       \ifdef\cbx@lastprefix
         {\printtext[labelprefix]{\cbx@lastprefix}}
         {}%
       \printtext[labelnumber]{\cbx@lastnumber}}%
     \global\undef\cbx@lastprefix}
    {}%
  \setcounter{cbx@tempcnta}{0}}
\makeatother

\renewcommand{\entrysetpunct}{\finentrypunct}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Reference{ISO:a,
  crossref = {ISO:base},
  title    = {section 4.5.6.7},
  options  = {dataonly},
}
@Reference{ISO:b,
  crossref = {ISO:base},
  title    = {section 4.5.6.8},
  options  = {dataonly},
}
@Reference{ISO:c,
  crossref = {ISO:base},
  title    = {section 4.5.6.9},
  options  = {dataonly},
}
@Reference{ISO:base,
  title    = {SS-EN 1992-1-1 eurocode},
  options  = {dataonly},
}
@Set{ISO,
  entryset = {ISO:a,ISO:b,ISO:c},
  options  = {multivolumehead=ISO:base},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
As described in \cite{ISO:a} and \cite{ISO:b} the chose of parametes in \cite{ISO:c}, all those are part of \cite{ISO}.

Furthermore multiple cites in one \verb+\cite+ command like \verb+\cite{ISO:a,ISO:c,ISO:b}+ are compressed to \cite{ISO:a,ISO:c,ISO:b}.

\printbibliography
\end{document}

Note that if you do not use \cite{ISO} you have to add \nocite{} or it will fail.

AndiW
  • 786