Si cambio una taquigrafía en el .bib
archivo desde XYZ
a \textbf{X}YZ
el orden en la bibliografía cambia.
¿Cómo puedo tener taquigrafías en las que algunas de las taquigrafías comienzan con a \textbf
(para poner en negrita ciertas letras) sin distorsionar el orden de clasificación?
MWE
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[backend=biber,
style=alphabetic,
natbib=true,
sorting=ynt,
]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{xei2016asdf,
Author = {Xei, A and A, B and B, C and C, D},
Title = {asdf is asdf},
Year = {2016},
}
@article{xei2017bob,
Author = {Xei, A and A, B and B, C and C, D},
Title = {bob is bob},
Year = {2017},
}
@article{xei2017bob2,
Author = {Xei, A and A, B and B, C and C, D},
Title = {bob is bob 2},
Year = {2017},
shorthand = {\textbf{X}ei+17},
sortshorthand = {Xei+17},
}
@article{xei2017alice,
Author = {Xei, A and A, B and B, C},
Title = {alice is alice},
Year = {2017},
}
@article{xei2018alice2,
Author = {Xei, A and A, B and B, C},
Title = {alice is alice 2},
Year = {2018},
shorthand = {\textbf{X}AB18},
sortshorthand = {XAB18},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\newrefcontext[sorting=anyvt]
\cite{xei2016asdf,xei2017bob,xei2017bob2,xei2017alice,xei2018alice2}
\printbibliography
\end{document}
Resultados en la bibliografía:
Pero todavía me gustaría la siguiente clasificación:
Hay una curiosidad sobre la solución propuesta. Si se considera:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[backend=biber,
style=alphabetic,
]{biblatex}
\DeclareSortingScheme{anyt}{
\sort{
\field{presort}
}
\sort{
\field{sortshorthand}
\field{labelalpha}
}
\sort[final]{
\field{sortkey}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{year}
}
\sort{
\field{sorttitle}
\field{title}
}
\sort{
\field{volume}
\literal{0}
}
}
\DeclareSortingScheme{anyvt}{
\sort{
\field{presort}
}
\sort{
\field{sortshorthand}
\field{labelalpha}
}
\sort[final]{
\field{sortkey}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{year}
}
\sort{
\field{volume}
\literal{0}
}
\sort{
\field{sorttitle}
\field{title}
}
}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{xei2016asdf,
Author = {Xei, A and A, B and B, C and C, D},
Title = {asdf is asdf},
Year = {2016},
}
@article{xei2018bob,
Author = {Xei, A and A, B and B, C and C, D},
Title = {bob is bob},
Year = {2018},
}
@article{xei2017bob2,
Author = {Xei, A and A, B and B, C and C, D},
Title = {bbob is bob 2},
Year = {2017},
shorthand = {\textbf{X}ei+17},
sortshorthand = {Xei+17},
}
@article{xei2017alice,
Author = {Xei, A and A, B and B, C},
Title = {alice is alice},
Year = {2017},
}
@article{xei2018alice2,
Author = {Xei, A and A, B and B, C},
Title = {alice is alice 2},
Year = {2018},
shorthand = {\textbf{X}AB18},
sortshorthand = {XAB18},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{xei2016asdf,xei2018bob,xei2017bob2,xei2017alice,xei2018alice2}
\printbibliography
\end{document}
Respuesta1
biblatex
conoce el campo sortshorthand
. Elbiblatex
documentaciónexplica (§2.2.3Campos especiales, pag. 30):
[
sortshorthand
] Similar asortkey
pero usado en la lista de taquigrafías. Si está presente,biblatex
utiliza este campo en lugar deshorthand
al ordenar la lista de taquigrafías. Esto es útil si el campo abreviado contiene abreviaturas con comandos de formato como\emph
o\textbf
.
Para los alphabetic
esquemas de clasificación anyt
y anyvt
biblatex
no se utiliza sortshorthand
(ya que eso básicamente significaría realizar un seguimiento de a labelalpha
y a sortlabelalpha
que se construirían de acuerdo con las mismas reglas, pero da prioridad a sort...
los campos).
Con la configuración estándar (que se establece labelalpha
en shorthand
si esta última existe), basta con agregar \field{sortshorthand}
antes \field{labelalpha}
en los esquemas de clasificación.
El MWE redefine ambos esquemas de clasificación, pero si solo usa uno de los dos, puede eliminar el otro.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[backend=biber,
style=alphabetic,
]{biblatex}
\DeclareSortingTemplate{anyt}{
\sort{
\field{presort}
}
\sort{
\field{sortshorthand}
\field{labelalpha}
}
\sort[final]{
\field{sortkey}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{year}
}
\sort{
\field{sorttitle}
\field{title}
}
\sort{
\field{volume}
\literal{0}
}
}
\DeclareSortingTemplate{anyvt}{
\sort{
\field{presort}
}
\sort{
\field{sortshorthand}
\field{labelalpha}
}
\sort[final]{
\field{sortkey}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{year}
}
\sort{
\field{volume}
\literal{0}
}
\sort{
\field{sorttitle}
\field{title}
}
}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{xei2016asdf,
Author = {Xei, A and A, B and B, C and C, D},
Title = {asdf is asdf},
Year = {2016},
}
@article{xei2017bob,
Author = {Xei, A and A, B and B, C and C, D},
Title = {bob is bob},
Year = {2017},
}
@article{xei2017bob2,
Author = {Xei, A and A, B and B, C and C, D},
Title = {bob is bob 2},
Year = {2017},
shorthand = {\textbf{X}ei+17},
sortshorthand = {Xei+17},
}
@article{xei2017alice,
Author = {Xei, A and A, B and B, C},
Title = {alice is alice},
Year = {2017},
}
@article{xei2018alice2,
Author = {Xei, A and A, B and B, C},
Title = {alice is alice 2},
Year = {2018},
shorthand = {\textbf{X}AB18},
sortshorthand = {XAB18},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{xei2016asdf,xei2017bob,xei2017bob2,xei2017alice,xei2018alice2}
\printbibliography
\end{document}