Biblatex non-standard date

Just change the way you define \siecle:

\newrobustcmd{\siecle}[1]{%
  \textsc{\romannumeral #1}\textsuperscript{e}~siècle
}

In such a way the macro is not expanded prematurely. Of course, the warning

WARN - year field '{\siecle{15}}' in entry 'exemple_image' is not an integer - this will probably not sort properly.

will show nonetheless.

enter image description here


With the new ISO 8601 date features of biblatex 3.10 and above you can input a century as

date = {19XX}

Unfortunately, the standard date formats do not deal with this out of the box by showing '20th century' or similar output, they'd just write '1900-1999', but we can enable handling of centuries as follows

\documentclass[french]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@thesis{exemple_image,
  title    = {Title of the work},
  author   = {Artist Name},
  location = {Switzerland},
  date     = {16XX},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\NewBibliographyString{century}
\DefineBibliographyStrings{french}{century = {siècle}}

\makeatletter
\renewcommand*{\RNfont}{\textsc}
\DeclareFieldFormat{datecentury}{\RN{#1}\textsuperscript{e}}
\renewrobustcmd*{\mkdaterangetrunc}[2]{%
  \begingroup
    \blx@metadateinfo{#2}%
    \iffieldundef{#2year}
      {}
      {\printtext[#2date]{%
         \datecircaprint
         % Such a season component can only come from an EDTF 5.1.5 season which replaces
         % a normal month so if it exists, we know that a normal date print is ruled out
         \iffieldequalstr{dateunspecified}{yearincentury}
           {\printtext[datecentury]{\number\numexpr\thefield{#2year}/100+1\relax}\setunit{\addnbspace}\bibstring{century}}
           {\iffieldundef{#2season}
              {\iffieldsequal{#2year}{#2endyear}
                 {\iffieldsequal{#2month}{#2endmonth}
                    {\csuse{mkbibdate#1}{}{}{#2day}}
                    {\csuse{mkbibdate#1}{}{#2month}{#2day}}}
                 {\csuse{mkbibdate#1}{#2year}{#2month}{#2day}%
                  \iffieldsequal{#2dateera}{#2enddateera}{}
                   {\dateeraprint{#2year}}}}
              {\iffieldsequal{#2year}{#2endyear}
                {\csuse{mkbibseasondate#1}{}{#2season}}
                {\csuse{mkbibseasondate#1}{#2year}{#2season}%
                 \iffieldsequal{#2dateera}{#2enddateera}{}
                   {\dateeraprint{#2year}}}}%
            \dateuncertainprint
            \iffieldundef{#2endyear}
              {}
              {\iffieldequalstr{#2endyear}{}
                 {\mbox{\bibdaterangesep}}
                 {\bibdaterangesep
                  \enddatecircaprint
                  \iffieldundef{#2season}
                    {\csuse{mkbibdate#1}{#2endyear}{#2endmonth}{#2endday}}
                    {\csuse{mkbibseasondate#1}{#2endyear}{#2endseason}}%
                  \enddateuncertainprint
                  \dateeraprint{#2endyear}}}}}}%
  \endgroup}
\makeatother

\begin{document}
\nocite{*}
\printbibliography
\end{document}

Where \iffieldequalstr{dateunspecified}{yearincentury} checks for a century, the format datecentury controls the output of the century and the bibstring century can be used to localise the output further.

example output

Refer also to 96-dates.tex as well as §2.3.8 Date and Time Specifications, §4.2.4.1 Generic Fields of the biblatex documentation.


Another way is to rely on Biber to map the year field to another field. (This example uses addendum.) It is unclear from the example as to whether you want or need to limit the sourcemapping to a specific sub-set of entries, but there are a number of ways to do this. (This example limits to the specific .bib file and the entrytype thesis, just as an example.)

Biber will finish without warnings or errors.

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

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
    @Thesis{exemple_image,
    Title                    = {Title of the work},
    Author                   = {Artist Name},
    Location                 = {Switzerland},
    Year                     = {{\siecle{15}}},
    }
\end{filecontents}
\usepackage[backend=biber]{biblatex}
\addbibresource{\jobname.bib}

\newcommand{\siecle}[1]{%
  \textsc{\romannumeral #1}\textsuperscript{e}~siècle
}

\DeclareSourcemap{
  \maps[datatype=bibtex, overwrite]{
    \map{
      \perdatasource{\jobname.bib}% <-- If you have them in a special bib file
      \pertype{thesis}%             <-- If you want to limit by type
      \step[fieldsource=year]
      \step[fieldset=addendum, origfieldval]
      \step[fieldset=year, null]
    }
  }
}

\nocite{*}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

Tags:

Biblatex