hushidong / biblatex-gb7714-2015

A biblatex implementation of the GB/T7714-2015 bibliography style || GB/T 7714-2015 参考文献著录和标注的biblatex样式包
742 stars 83 forks source link

[样式请求] 顺序编码制 + `\parencite` 输出的页码是非上标 #191

Closed sikouhjw closed 3 months ago

sikouhjw commented 3 months ago

宏包的效果: 图片 想要的效果:

[2, pages]

目前的尝试是将 \mkbibsuperscriptusp 重定义,取消「上标」:

\renewrobustcmd{\mkbibsuperscriptusp}[1]{%
\unspace\allowhyphens{%
  \begingroup%
  \protected\long\def\mkbibsuperscriptusp##1{%
    \blx@warning{Nested superscript}%
    \mkbibleftborder{##1}\mkbibrightborder}%
  #1\endgroup}}

但是页码会出现在方括号外面 [2] pages,希望能得到帮助,谢谢!

MWE:

\begin{filecontents}[force,noheader]{\jobname.bib}

@article{kanamori1998shaking,
  author       = {Kanamori, H},
  title        = {Shaking without Quaking},
  journal      = {Science},
  year         = {1998},
  volume       = {279},
  number       = {5359},
  pages        = {2063},
}

\end{filecontents}

\documentclass{article}
\usepackage[backend=biber,style=gb7714-2015]{biblatex}
\addbibresource[location=local]{\jobname.bib}
\begin{document}

\makeatletter
\renewrobustcmd{\mkbibsuperscriptusp}[1]{%
\unspace\allowhyphens{%
  \begingroup%
  \protected\long\def\mkbibsuperscriptusp##1{%
    \blx@warning{Nested superscript}%
    \mkbibleftborder{##1}\mkbibrightborder}%
  #1\endgroup}}
\makeatother

\parencite[50]{kanamori1998shaking}
\printbibliography
\end{document}
hushidong commented 3 months ago

这个要重定义parencite了。比如:

\begin{filecontents}[force,noheader]{\jobname.bib}

@article{kanamori1998shaking,
  author       = {Kanamori, H},
  title        = {Shaking without Quaking},
  journal      = {Science},
  year         = {1998},
  volume       = {279},
  number       = {5359},
  pages        = {2063},
}

\end{filecontents}

\documentclass{article}
\usepackage[backend=biber,style=gb7714-2015]{biblatex}
\addbibresource[location=local]{\jobname.bib}

\DeclareCiteCommand{\parencite}%
  {\mkbibleftborder\usebibmacro{cite:init}%
   \usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \usebibmacro{postnote}\mkbibrightborder}

\begin{document}

\parencite[50]{kanamori1998shaking}
\printbibliography
\end{document} 

结果:

图片

sikouhjw commented 3 months ago

谢谢,问题已解决!