Se eu alterar uma abreviação no .bib
arquivo de XYZ
para \textbf{X}YZ
a ordem na bibliografia muda.
Como posso ter taquigrafias onde algumas taquigrafias começam com a \textbf
(para colocar certas letras em negrito) sem distorcer a ordem de classificação?
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}
Mas eu ainda gostaria da seguinte classificação:
Há uma curiosidade sobre a solução proposta. Se considerarmos:
\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}
Responder1
biblatex
conhece o campo sortshorthand
. Obiblatex
documentaçãoexplica (§2.2.3Campos Especiais, pág. 30):
[
sortshorthand
] Semelhante,sortkey
mas usado na lista de abreviações. Se presente,biblatex
usa este campo em vez deshorthand
ao classificar a lista de abreviações. Isso é útil se o campo abreviado contiver abreviações com comandos de formatação como\emph
ou\textbf
.
Para os alphabetic
esquemas de classificação anyt
and anyvt
biblatex
não usa sortshorthand
(pois isso significaria basicamente manter o controle de a labelalpha
e a sortlabelalpha
que seriam construídos de acordo com as mesmas regras, mas dá precedência aos sort...
campos).
Com as configurações padrão (definidas labelalpha
como shorthand
se esta existir), basta adicionar \field{sortshorthand}
antes \field{labelalpha}
nos esquemas de classificação.
O MWE redefine ambos os esquemas de classificação, mas se você usar apenas um dos dois, poderá descartar o outro.
\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}