biblatex-gb7714-2015 icon indicating copy to clipboard operation
biblatex-gb7714-2015 copied to clipboard

`biblatex-gb7714-2015` 宏包对于 `\cite[...]{...}` 的处理与默认不同.

Open syvshc opened this issue 2 years ago • 10 comments

下面是 mwe:

\documentclass{ctexart}
% \usepackage[style=gb7714-2015]{biblatex}
\usepackage{biblatex}
\begin{filecontents}{\jobname.bib}
  @book{feynman2011feynman,
  title={The Feynman lectures on physics, Vol. I: The new millennium edition: mainly mechanics, radiation, and heat},
  author={Feynman, Richard P and Leighton, Robert B and Sands, Matthew},
  volume={1},
  year={2011},
  publisher={Basic books}
}
\end{filecontents}
\addbibresource[]{\jobname.bib}
\begin{document}
  text\cite[Thm. 3]{feynman2011feynman}
\printbibliography
\end{document}

不加载 gb7714-2015 的时候的输出为

image

加载 gb7714-2015 的输出为

image

请问这样做是由于国标的某项要求吗? 我刚翻了一下《GB/T 7714-2015》没发现对于引用的要求.

另外, 如果想恢复成上面默认形式的 \cite[..]{..} 应该如何处理呢?

syvshc avatar Mar 08 '22 15:03 syvshc

国标要求引用标注的页码在括号外。\cite[]{} 的输入方式无法区分“Thm. 3”和页码,所以也放在了括号外。

Screen Shot 2022-03-09 at 11 03 30

gb7714-2015.bbx 2022/03/07 v1.1e 不会产生额外的逗号,可能你需要升级宏包的版本。

Screen Shot 2022-03-09 at 11 11 31

zepinglee avatar Mar 09 '22 03:03 zepinglee

gb7714-2015.bbx 2022/03/07 v1.1e 不会产生额外的逗号,可能你需要升级宏包的版本。

我刚刚更新了宏包版本,不会产生额外的逗号了。

因为学校的规定和国标不太一致。需要什么改动可以达到和默认样式相同的效果吗

syvshc avatar Mar 09 '22 03:03 syvshc

你的示例是行内命令是吧,做如下修改即可,放到导言区里。

\DeclareCiteCommand{\parencite}%[\mkbibbrackets]
  {\mkbibleftborder\usebibmacro{cite:init}%
   \usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}\addcomma\addspace\printfield{postnote}\mkbibrightborder}

hushidong avatar Mar 09 '22 05:03 hushidong

比如:

\documentclass{ctexart}
\usepackage[style=gb7714-2015]{biblatex}
%\usepackage{biblatex}
\begin{filecontents}{\jobname.bib}
  @book{feynman2011feynman,
  title={The Feynman lectures on physics, Vol. I: The new millennium edition: mainly mechanics, radiation, and heat},
  author={Feynman, Richard P and Leighton, Robert B and Sands, Matthew},
  volume={1},
  year={2011},
  publisher={Basic books}
}
\end{filecontents}
\addbibresource[]{\jobname.bib}

\DeclareCiteCommand{\parencite}%[\mkbibbrackets]
  {\mkbibleftborder\usebibmacro{cite:init}%
   \usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}\addcomma\addspace\printfield{postnote}\mkbibrightborder}

\begin{document}
  text\parencite[Thm. 3]{feynman2011feynman}
\printbibliography
\end{document} 

结果为:

图片

hushidong avatar Mar 09 '22 05:03 hushidong

你的示例是行内命令是吧,做如下修改即可,放到导言区里。

\DeclareCiteCommand{\parencite}%[\mkbibbrackets]
  {\mkbibleftborder\usebibmacro{cite:init}%
   \usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}\addcomma\addspace\printfield{postnote}\mkbibrightborder}

请问如果是上标的\cite应该怎么改呢

xkwxdyy avatar Mar 09 '22 05:03 xkwxdyy

\DeclareCiteCommand{\cite}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号 
  {\mkbibleftborder\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}\addcomma\addspace%
   \printfield{postnote}\mkbibrightborder}

hushidong avatar Mar 09 '22 06:03 hushidong

\DeclareCiteCommand{\cite}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号 
  {\mkbibleftborder\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}\addcomma\addspace%
   \printfield{postnote}\mkbibrightborder}

感谢

xkwxdyy avatar Mar 09 '22 06:03 xkwxdyy

感谢, 我的问题已经得到了解决.

syvshc avatar Mar 09 '22 11:03 syvshc

@hushidong 我测试了一下,按照上面的代码的话,不加[] 的时候, 仍然存在

\documentclass{ctexart}
\usepackage[style=gb7714-2015]{biblatex}
%\usepackage{biblatex}
\begin{filecontents}{\jobname.bib}
  @book{feynman2011feynman,
    title={The Feynman lectures on physics, Vol. I: The new millennium edition: mainly mechanics, radiation, and heat},
    author={Feynman, Richard P and Leighton, Robert B and Sands, Matthew},
    volume={1},
    year={2011},
    publisher={Basic books}
  }
\end{filecontents}
\addbibresource[]{\jobname.bib}

\DeclareCiteCommand{\parencite}%[\mkbibbrackets]
  {\mkbibleftborder\usebibmacro{cite:init}%
   \usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}\addcomma\addspace\printfield{postnote}\mkbibrightborder}

\begin{document}
  text\parencite[Thm. 3]{feynman2011feynman}

  text\parencite{feynman2011feynman}
\printbibliography
\end{document} 

image

xkwxdyy avatar Mar 10 '22 07:03 xkwxdyy

\DeclareCiteCommand{\parencite}%[\mkbibbrackets]
  {\mkbibleftborder\usebibmacro{cite:init}%
   \usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}\setunit{\addcomma\addspace}\printfield{postnote}\mkbibrightborder}


\DeclareCiteCommand{\cite}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号
  {\mkbibleftborder\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}\setunit{\addcomma\addspace}%
   \printfield{postnote}\mkbibrightborder}

hushidong avatar Mar 10 '22 07:03 hushidong