%2C%20parte%20II.png)
Estaba buscando un ejemplo usando biblatex
y biber
un documento mixto latino/griego/cirílico; encontrébiblatex biber nombres UTF-8 no latinos (cirílicos)ybiblatex: Abreviar los nombres de los autores cirílicos con la opción firstinits, pero ninguno de ellos es concluyente (y están cerrados). Entonces, se me ocurrió un MWE (a continuación) que se compila pdflatex test.tex; biber test; pdflatex test.tex; pdflatex test.tex
(usando TexLive 2014) y produce esto:
En general, se ve como debería; mis preguntas son:
- ¿Es esta la forma correcta de utilizar nombres/títulos cirílicos con biblatex/biber? (es decir, con
\foreignlanguage
?) - Como en la publicación anterior, el nombre cirílico no está abreviado, mientras que el latino sí lo está. ¿Cómo podría hacer que ambos se abrevien?
EDITAR: El motivo para no abreviar se puede ver en el .bbl
archivo:
\name{author}{1}{}{%
{{hash=3bd6100cde97ee45844a484f7fc7612b}{Goethe}{G\bibinitperiod}{Johann\bibnamedelima Wolfgang}{J\bibinitperiod\bibinitdelim W\bibinitperiod}{von}{v\bibinitperiod}{}{}}%
...
\name{author}{1}{}{%
{{hash=c78e01570c60a06ba7419ac38e11ab99}{\foreignlanguage{russian}{Фёдор\bibnamedelimb Михайлович\bibnamedelimb Достоевский}}{\\bibinitperiod}{}{}{}{}{}{}}%
Aparentemente, biblatex
/ biber
es lo suficientemente inteligente como para ver a través de \foreignlanguage
insertar un \bibnamedelimb
también para el nombre cirílico, pero de alguna manera, no llena todos los campos (en particular, aquellos que contienen las abreviaturas). Si intento hackear manualmente e insertar por analogía con el nombre latino, para labelname
y author
, esto en su lugar:
{{hash=c78e01570c60a06ba7419ac38e11ab99}{\foreignlanguage{russian}{Достоевский}}{\foreignlanguage{russian}{Д\bibinitperiod}}{\foreignlanguage{russian}{Фёдор\bibnamedelima Михайлович}}{\foreignlanguage{russian}{Ф\bibinitperiod\bibinitdelim М\bibinitperiod}}{}{}{}{}}%
... luego abreviar funciona, pero claramente, no me gustaría hacer esto manualmente para cada entrada cirílica, por lo que se puede plantear la pregunta: ¿puedo de alguna manera lograr que biber
esto se produzca automáticamente, tal vez ingresando algunos comandos en el .bib
archivo?
EDITAR2: También intenté incluir cada palabra del nombre del autor en un idioma extranjero en el archivo .bib:
author={\foreignlanguage{russian}{Фёдор} \foreignlanguage{russian}{Михайлович} \foreignlanguage{russian}{Достоевский}},
... esto no funciona en absoluto (no hay abreviatura y, de hecho, algunas palabras se omiten en el resultado final).
EDITAR3: Como @egreg señaló en los comentarios (objeto único), intenté eliminar el \foreignlanguage
nombre del autor y escribir directamente en UTF-8:
author={Фёдор Михайлович Достоевский},
... y ahora esto divide el nombre de los componentes correctamente en el .bbl
archivo:
\name{author}{1}{}{%
{{hash=e3c9a72252d468ac324a38026797e091}{Достоевский}{Д\bibinitperiod}{Фёдор\bibnamedelima Михайлович}{Ф\bibinitperiod\bibinitdelim М\bibinitperiod}{}{}{}{}}%
... pero luego, cuando pdflatex
se ejecuta por segunda vez, falla con:
! LaTeX Error: Command \CYRF unavailable in encoding T1.
... aparentemente, todavía se necesita el cambio de codificación de fuente.
Aquí está el código:
\documentclass{article}
\usepackage{filecontents} % tlmgr install filecontents
\begin{filecontents*}{\jobname.bib}
@BOOK{von1841faust,
title={Faust: Eine Tragödie. Erster Theil},
author={Johann Wolfgang von Goethe},
url={http://books.google.dk/books?id=zF8-AAAAYAAJ},
year={1841},
publisher={Hermann Passarge}
}
% see: https://tex.stackexchange.com/questions/215447/using-cyrillic-with-tex-gyre-pagella-and-pdflatex
% if fonts are properly set-up, there's no need for separate \fontencoding{T2A}\selectfont, as in:
% title={\fontencoding{T2A}\selectfont \foreignlanguage{russian}{Двойник}},
% else - with or without \fontencoding{T2A}\selectfont:
% ! LaTeX Error: Command \CYRD unavailable in encoding T1.
% with \foreignlanguage and \fontencoding{T2A}:
% LaTeX Font Warning: Font shape `T2A/qpl/m/n' undefined
% (Font) using `T2A/cmr/m/n' instead on input line 48.
% kpathsea: Running mktexmf larm1000
% ! I can't find file `larm1000'.
% <*> ...ljfour; mag:=1; nonstopmode; input larm1000
% mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000' failed to make larm1000.tfm.
% ! Font T2A/cmr/m/n/10=larm1000 at 10.0pt not loadable: Metric (TFM) file not found.
@book{dostoevskij2014dvoinik,
title={\foreignlanguage{russian}{Двойник}},
author={\foreignlanguage{russian}{Фёдор Михайлович Достоевский}},
isbn={9785000640227},
url={http://books.google.dk/books?id=OR7BAQAAQBAJ},
year={2014},
publisher={Aegitas}
}
\end{filecontents*}
\usepackage[utf8]{inputenc}
\usepackage[T2A, T1]{fontenc} % before babel!
\usepackage[russian,greek,english]{babel} % tlmgr install babel-russian
\usepackage[sc]{mathpazo}
\usepackage{paratype} % tlmgr install paratype
\usepackage{tgpagella}
% T2A for cyrillic - paratype
\usepackage{substitutefont}
\substitutefont{T2A}{\rmdefault}{PTSerif-TLF}
\usepackage{siunitx}
\usepackage[%
style=ieee,
isbn=true,
url=true,
defernumbers=true,
sorting=nyt, % "Sort by name, year, title."
%sorting=none, % "Do not sort at all. All entries are processed in citation order." (order of appearance)
bibencoding=utf8,
backend=biber
]{biblatex}
\bibliography{\jobname}
\begin{document}
From \si{\mega\ohm} to \si{\micro\watt} -- consider "Faust" \cite{von1841faust}, which is in (extended) Latin script; or "\foreignlanguage{russian}{Двойник}" \cite{dostoevskij2014dvoinik}, which is in Cyrillic script.
\printbibliography
\end{document}
Respuesta1
No es necesario \foreignlanguage
en el .bib
archivo. Utilice la opción biblatex autolang=other
en su lugar. Envuelve automáticamente las entradas dorsales en el otherlanguage
entorno. Para que esto funcione, también necesita langid
campos en el .bib
archivo.
Este es su MWE corregido (eliminé la configuración de fuente, no funciona en mi máquina por alguna razón, pero supongo que es un problema diferente):
\documentclass{article}
\usepackage{filecontents} % tlmgr install filecontents
\begin{filecontents*}{\jobname.bib}
@BOOK{von1841faust,
title={Faust: Eine Tragödie. Erster Theil},
author={Johann Wolfgang von Goethe},
url={http://books.google.dk/books?id=zF8-AAAAYAAJ},
year={1841},
publisher={Hermann Passarge},
langid={german},
}
@book{dostoevskij2014dvoinik,
title={Двойник},
author={Фёдор Михайлович Достоевский},
isbn={9785000640227},
url={http://books.google.dk/books?id=OR7BAQAAQBAJ},
year={2014},
publisher={Aegitas},
langid={russian},
}
\end{filecontents*}
\usepackage[utf8]{inputenc}
\usepackage[T2A,T1]{fontenc} % before babel!
\usepackage[russian,greek,german,english]{babel} % tlmgr install babel-russian
\usepackage{siunitx}
\usepackage[%
style=ieee,
isbn=true,
url=true,
defernumbers=true,
sorting=nyt, % "Sort by name, year, title."
%sorting=none, % "Do not sort at all. All entries are processed in citation order." (order of appearance)
bibencoding=utf8,
backend=biber,
language=auto, % get main language from babel
autolang=other,
]{biblatex}
\bibliography{\jobname}
\begin{document}
From \si{\mega\ohm} to \si{\micro\watt} -- consider "Faust" \cite{von1841faust}, which is in (extended) Latin script; or "\foreignlanguage{russian}{Двойник}" \cite{dostoevskij2014dvoinik}, which is in Cyrillic script.
\printbibliography
\end{document}
Producción: