
Estoy usando biblatex y biber para hacer referencia a trabajos que se muestran en una lección de historia. Datación en siglos (siglo XII o12e sigloen francés) son bastante comunes. Solía escribir esas fechas en el campo "Año" y funcionó desde la última actualización:
Siguiendo las compilaciones de MWE con 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}
…pero ya no con TexLive 2016, donde aparece un error: ! Use of /sortlist doesn't match its definition
.
Supongo que Biblatex 3.5 es menos permisivo con el campo "Año". He buscado en la documentación sin éxito y estoy abierto a todas las sugerencias.
Respuesta1
Con las nuevas funciones de fecha ISO 8601 de biblatex
3.10 y superiores, puede ingresar un siglo como
date = {19XX}
Desafortunadamente, los formatos de fecha estándar no abordan esto de manera inmediata al mostrar "siglo XX" o una salida similar; simplemente escribirían "1900-1999", pero podemos habilitar el manejo de siglos de la siguiente manera
\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}
Cuando \iffieldequalstr{dateunspecified}{yearincentury}
se verifica un siglo, el formato datecentury
controla la salida del siglo y la cadena bib century
se puede utilizar para localizar aún más la salida.
Consulte también a96-dates.tex
así como §2.3.8Especificaciones de fecha y hora, §4.2.4.1Campos genéricosdela biblatex
documentación.
Respuesta2
Simplemente cambie la forma en que define \siecle
:
\newrobustcmd{\siecle}[1]{%
\textsc{\romannumeral #1}\textsuperscript{e}~siècle
}
De esta manera la macro no se ampliará prematuramente. Por supuesto, la advertencia
WARN - year field '{\siecle{15}}' in entry 'exemple_image' is not an integer - this will probably not sort properly.
se mostrará de todos modos.
Respuesta3
Otra forma es confiar en Biber para asignar el year
campo a otro campo. (Este ejemplo utiliza addendum
.) No queda claro en el ejemplo si desea o necesita limitar el mapeo de origen a un subconjunto específico de entradas, pero hay varias formas de hacerlo. (Este ejemplo se limita al .bib
archivo específico y al tipo de entrada thesis
, solo como ejemplo).
Biber terminará sin advertencias ni errores.
\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}