คำสั่งอ้างอิงใหม่กลืนเครื่องหมายวรรคตอน

Aug 17 2020

ฉันกำหนดคำสั่งอ้างอิงใหม่เพื่อแสดงshorttitleแทนauthor- yearcombination ปัญหาคือมันกลืนเครื่องหมายวรรคตอนตามหลัง

ฉันพยายามใช้\DeclareCitePunctuationPositionแต่ไม่มีประโยชน์

ฉันจะแก้ไขปัญหานี้ได้อย่างไร?

\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}

คำตอบ

5 moewe Aug 17 2020 at 12:08

biblatex มีระบบที่ซับซ้อนมากเพื่อหลีกเลี่ยงการใช้เครื่องหมายวรรคตอนคู่หรือเครื่องหมายวรรคตอนที่ไม่พึงปรารถนา

โดยเฉพาะอย่างยิ่งbiblatexจะระงับเครื่องหมายวรรคตอนใด ๆ หลังจากช่วงเวลาสิ้นสุดประโยค (หยุดเต็ม) ดังนั้น '.;' กลายเป็นแค่ '.' 'ปัญหา' คือคุณไม่ต้องการกดเครื่องหมายจุลภาคหรืออัฒภาคหลังจากจุดที่แสดงถึงตัวย่อดังนั้น 'sv;' สมบูรณ์ดีและไม่จำเป็นต้องลดลงเป็น 'sv' ตั้งแต่ "." มีหลักสองฟังก์ชั่นที่คุณจะต้องช่วยเหลือตลอดและบอกว่าสิ่งที่คุณหมายถึงเมื่อคุณพิมพ์biblatex .โดยค่าเริ่มต้นbiblatexถือว่า a .คือช่วงเวลา หากคุณต้องการที่จะเข้าสู่ตัวย่อจุดที่คุณสามารถพูดหรือเพียงแค่\adddot.\isdot

ดังนั้นการแสดงผลต่อไปนี้ 'sv;' ดี.

\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}


หากทุกสิ่ง.ที่ลงท้าย Postnotes ของคุณเป็นจุดย่อคุณสามารถดำเนินการนี้โดยอัตโนมัติโดยการแก้ไขpostnoteรูปแบบฟิลด์ (สามารถดูคำจำกัดความดั้งเดิมได้ใน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}}%

จากนั้นคุณจะไม่ต้องเขียน\isdotทุกครั้งที่ใช้s.v.ใน Postnote แต่แน่นอนว่านั่นหมายความว่า a .ที่ควรจะเป็นช่วงเวลาสิ้นสุดประโยคในตอนท้ายของ Postnote จะไม่ได้รับการยอมรับเช่นนี้


หากคุณกำลังใช้บ่อยมากคุณอาจต้องการที่จะกำหนดคำสั่งที่มีประโยชน์สำหรับมันที่หลีกเลี่ยงความจำเป็นในการs.v.\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}