Lệnh trích dẫn mới nuốt chửng dấu chấm câu
Tôi đã xác định một lệnh cite mới để hiển thị shorttitlethay vì author- yearkết hợp. Vấn đề là nó nuốt dấu chấm câu theo sau nó.
Tôi đã thử sử dụng \DeclareCitePunctuationPosition, nhưng vô ích.
Làm thế nào tôi có thể sửa lỗi này?
\documentclass{article}
\usepackage{biblatex-chicago}
\DeclareCiteCommand{\citeabbr}
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\printtext[bibhyperref]{\textit{\printfield{shorttitle}}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCitePunctuationPosition{\citeabbr}{r} % doesn't work
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Howlett1975,
title = {Dictionary of Medieval Latin from British Sources},
shorttitle = {DMLBS},
editor = {Howlett, D.R.},
date = {1975/2013},
publisher = {Oxford University Press},
location = {Oxford},
addendum = {DMLBS},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\usepackage{hyperref}
\begin{document}
\citeabbr[s.v.]{Howlett1975}; this cite command has swallowed my semicolon.
\end{document}
Trả lời
biblatex có một hệ thống rất tinh vi để tránh các dấu câu kép hoặc xung đột dấu câu không mong muốn.
Đặc biệt biblatexsẽ chặn bất kỳ dấu câu nào sau dấu chấm kết thúc câu (dấu chấm hết). Vì thế '.;' trở thành chỉ '.'. 'Vấn đề' là bạn không muốn bỏ dấu phẩy hoặc dấu chấm phẩy sau dấu chấm biểu thị chữ viết tắt, vì vậy 'sv;' là hoàn toàn ổn và không cần phải giảm xuống 'sv'. Kể từ dấu '.' về cơ bản có hai chức năng, bạn sẽ phải trợ giúp biblatexvà cho nó biết ý của bạn khi bạn nhập .. Theo mặc định, biblatexgiả sử a .là một khoảng thời gian. Nếu bạn muốn nhập dấu chấm viết tắt, bạn có thể nói \adddothoặc chỉ .\isdot.
Do đó, phần sau hiển thị 'sv;' bình thường.
\documentclass{article}
\usepackage{biblatex-chicago}
\DeclareCiteCommand{\citeabbr}
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\printtext[bibhyperref]{\printfield[emph]{shorttitle}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\begin{filecontents}{\jobname.bib}
@book{Howlett1975,
title = {Dictionary of Medieval Latin from British Sources},
shorttitle = {DMLBS},
editor = {Howlett, D.R.},
date = {1975/2013},
publisher = {Oxford University Press},
location = {Oxford},
addendum = {DMLBS},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\usepackage{hyperref}
\begin{document}
\citeabbr[s.v.\isdot]{Howlett1975}; this cite command has swallowed my semicolon.
\end{document}
Nếu tất cả .các dấu chấm cuối bài đăng của bạn là dấu chấm viết tắt, bạn có thể tự động hóa điều này bằng cách sửa đổi postnoteđịnh dạng trường (bạn có thể tìm thấy định nghĩa gốc trong chicago-notes.cbx)
\DeclareFieldFormat{postnote}{% Changed for page compression option
\ifboolexpr{%
togl {cms@comprange}%
and
test {\ifpages{#1}}%
}%
{\iffieldundef{pagination}%
{\mkcomprange{#1}}%
{\mkcomprange[{\mkpageprefix[pagination]}]{#1}}}%
{\iffieldundef{pagination}%
{#1}%
{\mkpageprefix[pagination]{#1}}%
\isdot}}%
Sau đó, bạn có thể tránh phải viết \isdotmỗi khi bạn sử dụng s.v.trong một bài chú thích. Nhưng tất nhiên điều đó có nghĩa là một dấu .chấm được cho là kết thúc câu ở cuối bài chú thích sẽ không được công nhận như vậy.
Nếu bạn đang sử dụng s.v.rất thường xuyên, bạn có thể muốn xác định một lệnh hữu ích cho nó mà tránh sự cần thiết \isdot.
\documentclass{article}
\usepackage{biblatex-chicago}
\DeclareCiteCommand{\citeabbr}
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\printtext[bibhyperref]{\printfield[emph]{shorttitle}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\NewBibliographyString{sv}
\DefineBibliographyStrings{english}{
sv = {s\adddot v\adddot},
}
\newcommand*{\sv}{\bibstring{sv}}
\begin{filecontents}{\jobname.bib}
@book{Howlett1975,
title = {Dictionary of Medieval Latin from British Sources},
shorttitle = {DMLBS},
editor = {Howlett, D.R.},
date = {1975/2013},
publisher = {Oxford University Press},
location = {Oxford},
addendum = {DMLBS},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\usepackage{hyperref}
\begin{document}
\citeabbr[\sv]{Howlett1975}; this cite command has swallowed my semicolon.
\end{document}