Data fora do padrão Biblatex

Data fora do padrão Biblatex

Estou usando biblatex e biber para referenciar trabalhos mostrados em uma aula de história. Dados em séculos (século XII ouSéculo XIIem francês) são bastante comuns. Eu costumava escrever essas datas no campo "Ano" e funcionou desde a última atualização:

A seguir o MWE compila com o TexLive 2015…

\documentclass{article}
\usepackage{biblatex}
\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}
\addbibresource{\jobname.bib}

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

\nocite{*}

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

referência impressa corretamente

…mas não mais com o TexLive 2016, onde recebi um erro: ! Use of /sortlist doesn't match its definition.

Acho que o Biblatex 3.5 é menos permissivo com o campo "Ano". Procurei na documentação sem sucesso e estou aberto a todas as sugestões.

Responder1

Com os novos recursos de data ISO 8601 de biblatex3.10 e superiores, você pode inserir um século como

date = {19XX}

Infelizmente, os formatos de data padrão não lidam com isso imediatamente, mostrando 'século 20' ou resultados semelhantes, eles apenas escreveriam '1900-1999', mas podemos permitir o tratamento de séculos da seguinte forma

\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}

Onde \iffieldequalstr{dateunspecified}{yearincentury}verifica um século, o formato datecenturycontrola a saída do século e a string bib centurypode ser usada para localizar ainda mais a saída.

saída de exemplo

Consulte também96-dates.texbem como §2.3.8Especificações de data e hora, §4.2.4.1Campos genéricosdea biblatexdocumentação.

Responder2

Basta mudar a maneira como você define \siecle:

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

Desta forma a macro não é expandida prematuramente. Claro, o aviso

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

vai aparecer mesmo assim.

insira a descrição da imagem aqui

Responder3

Outra forma é contar com Biber para mapear o yearcampo para outro campo. (Este exemplo usa addendum.) Não está claro no exemplo se você deseja ou precisa limitar o mapeamento de origem a um subconjunto específico de entradas, mas há diversas maneiras de fazer isso. (Este exemplo limita-se ao .bibarquivo específico e ao entrytype thesis, apenas como exemplo.)

Biber terminará sem avisos ou erros.

\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}

informação relacionada