Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0x 的 \parencite 与右侧中文间距太小 #91

Closed
zepinglee opened this issue Apr 12, 2021 · 12 comments
Closed

v1.0x 的 \parencite 与右侧中文间距太小 #91

zepinglee opened this issue Apr 12, 2021 · 12 comments

Comments

@zepinglee
Copy link
Contributor

 (/usr/local/texlive/2021/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx
File: gb7714-2015.cbx 2021/04/03 v1.0xbiblatex citation style

20b5a48 去掉了上标式引用与右侧中文的空格(tuna/thuthesis#624),这对上标式引用没问题,但是导致 \parencite 与右侧中文没有空隙,显得左右两侧不对称。我认为对于 inline 式引用还是保留中文与西文方括号的空隙更好。

\documentclass{ctexart}

\begin{filecontents}{refs.bib}
@book{foo,
  author     = {Foo, Bar},
  title      = {Foo},
  year       = {2021},
}
\end{filecontents}

\usepackage[
  backend   = biber,
  style     = gb7714-2015,
]{biblatex}
\addbibresource{refs.bib}

\begin{document}

引用\cite{foo}测试\par
引用\cite[42]{foo}测试\par
引用\cite[见][]{foo}测试\par
引用\cite[见][42]{foo}测试\par

Citation \cite{foo} test\par
Citation \cite[42]{foo} test\par
Citation \cite[see][]{foo} test\par
Citation \cite[see][42]{foo} test\par

引用\parencite{foo}测试\par
引用\parencite[42]{foo}测试\par
引用\parencite[见][]{foo}测试\par
引用\parencite[见][42]{foo}测试\par

Citation \parencite{foo} test\par
Citation \parencite[42]{foo} test\par
Citation \parencite[see][]{foo} test\par
Citation \parencite[see][42]{foo} test\par

\printbibliography

\end{document}

Screen Shot 2021-04-12 at 13 30 51

@hushidong
Copy link
Owner

好的,我看一下,一会改过来。

@hushidong
Copy link
Owner

修改后这样:

\documentclass{article}
\usepackage[backend=biber,style=gb7714-2015]{biblatex}%citexref=true
\usepackage{ctex}
\usepackage[top=1cm,bottom=1cm]{geometry}
\usepackage{multicol}

%\apptocmd{\cite}{\makebox{\rule{1em}{1pt}}}{}{}


\begin{filecontents}{\jobname.bib}
@book{sally_history_1985,
location = {Monterey, California},
title = {History of Algebraic Geometry},
isbn = {978-0-534-03723-9},
series = {Wadsworth Mathematics Series},
pagetotal = {xii+186},
publisher = {Wadsworth International Group, Belmont, {CA}},
author = {Dieudonné, Jean},
translator = {Sally, Judith D.},
date = {1985},
mrnumber = {780183},
}

@book{foo,
  author     = {Foo, Bar},
  title      = {Foo},
  year       = {2021},
}

@book{foc,
  author     = {Foc, Bar},
  title      = {Foo},
  year       = {2021},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}

\begin{multicols}{2}

abcd\cite{sally_history_1985}abcd

中文字符\cite{sally_history_1985}中文字符

中文字符\cite{sally_history_1985}a\rule{1em}{1pt}中文字符

中文字符\cite{sally_history_1985}\mbox{}中文字符

中文字符\cite{sally_history_1985}\hbox{}中文字符

中文字符\cite{sally_history_1985}\makebox{}中文字符%

中文字符\cite{sally_history_1985}\hspace{0pt}中文字符%

引用\cite{foo}测试\par
引用\cite[42]{foo}测试\par
引用\cite[见][]{foo}测试\par
引用\cite[见][42]{foo}测试\par

Citation \cite{foo} test\par
Citation \cite[42]{foo} test\par
Citation \cite[see][]{foo} test\par
Citation \cite[see][42]{foo} test\par

引用\parencite{foo}测试\par
引用\parencite[42]{foo}测试\par
引用\parencite[见][]{foo}测试\par
引用\parencite[见][42]{foo}测试\par

Citation \parencite{foo} test\par
Citation \parencite[42]{foo} test\par
Citation \parencite[see][]{foo} test\par
Citation \parencite[see][42]{foo} test\par

引用\textcite{foo}测试\par
引用\textcite[42]{foo}测试\par
引用\textcite[见][]{foo}测试\par
引用\textcite[见][42]{foo}测试\par

Citation \textcite{foo} test\par
Citation \textcite[42]{foo} test\par
Citation \textcite[see][]{foo} test\par
Citation \textcite[see][42]{foo} test\par

引用\citet{foo}测试\par
引用\citet[42]{foo}测试\par
引用\citet[见][]{foo}测试\par
引用\citet[见][42]{foo}测试\par

Citation \citet{foo} test\par
Citation \citet[42]{foo} test\par
Citation \citet[see][]{foo} test\par
Citation \citet[see][42]{foo} test\par


引用\citep{foo}测试\par
引用\citep[42]{foo}测试\par
引用\citep[见][]{foo}测试\par
引用\citep[见][42]{foo}测试\par

Citation \citep{foo} test\par
Citation \citep[42]{foo} test\par
Citation \citep[see][]{foo} test\par
Citation \citep[see][42]{foo} test\par


引用\authornumcite{foo}测试\par
引用\authornumcite[42]{foo}测试\par
引用\authornumcite[见][]{foo}测试\par
引用\authornumcite[见][42]{foo}测试\par

Citation \authornumcite{foo} test\par
Citation \authornumcite[42]{foo} test\par
Citation \authornumcite[see][]{foo} test\par
Citation \authornumcite[see][42]{foo} test\par

引用\citec{foo}测试\par
引用\citec[42]{foo}测试\par
引用\citec[见][]{foo}测试\par
引用\citec[见][42]{foo}测试\par

Citation \citec{foo} test\par
Citation \citec[42]{foo} test\par
Citation \citec[see][]{foo} test\par
Citation \citec[see][42]{foo} test\par

引用\cite{sally_history_1985,foo}测试\par
Citation \cite{sally_history_1985,foo} test\par
引用\parencite{sally_history_1985,foo}测试\par
Citation \parencite{sally_history_1985,foo} test\par
引用\citet{sally_history_1985,foo}测试\par
Citation \citet{sally_history_1985,foo} test\par
引用\citep{sally_history_1985,foo}测试\par
Citation \citep{sally_history_1985,foo} test\par
引用\textcite{sally_history_1985,foo}测试\par
Citation \textcite{sally_history_1985,foo} test\par
引用\citec{sally_history_1985,foc,foo}测试\par
Citation \citec{sally_history_1985,foo} test\par

\end{multicols}

\printbibliography
\end{document} 

结果为:
图片

@zepinglee
Copy link
Contributor Author

看起来没啥问题

@mengchaoheng
Copy link

请问\parencite产生的[]的前后空格,国标有要求吗?我注意到

date of update: 2021-05-06 to version v1.0y
(1) 修改顺序编码制 parencite 命令使保留引用标签后面空格。(20210412)

为了美观,我需要在\parencite命令前也输入空格,这样前后都有。我们学校的论文规范虽然没有提及,但他给的样式里前后都没空格的。所以我若要取消[]后的空格,应该如何设置?@zepinglee

@mengchaoheng
Copy link

mengchaoheng commented Dec 10, 2024

如下代码编译后:

引用前没有加空格\parencite{_c,_g}的第六章,引用后面有空格。

引用前手动加空格 \parencite{_c,_g}的第六章,引用后面有空格。

手写方括号 [6]。引用后面没空格。

生成方括号 \parencite{_k}。引用后面没空格。

效果:
截屏2024-12-10 16 14 24

空格也不是全部都有。对此有点困惑,希望得到帮助。

@mengchaoheng
Copy link

@hushidong 老师您好,华南理工大学硕/博士学位论文LaTeX模板也是用的您的包。目前主要由我在维护。

@hushidong
Copy link
Owner

@mengchaoheng

国标中好像没有行内的标注的示例。所以上述形式只是习惯而已。

前面加空格一般在写的时候添加空格就好。

后面的空格默认也是没有的,只是没有采用手段去除空格而已。

所以要在前后加空格,都需要手动加。默认后面有空格实际上是由ctex/xecjk加的,加的中英文之间的默认空格。

比如:



\documentclass[twoside]{article}
\usepackage{ctex}
\usepackage[backend=biber,style=gb7714-2015]{biblatex}

\usepackage[colorlinks]{hyperref}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Article{duhamel,
Author = {Umarov, S. R. and Sa\u{\i}damatov, E. M.},
Title = {A generalization of Duhamel’s principle for differential equations of fractional order},
Journal = {Doklady Mathematics},
Volume = {75},
Number = {1},
Pages = {94-96},
DOI = {10.1134/S1064562407010267},
Year = {2007},
}

@ARTICLE{DUBAR2013--,
  author       = {DUBAR, K L.  AND MITCHELL, D A.},
  title        = {Revealing nature's synthetic potential through the study of ribosomal natural product biosynthesis},
  Journaltitle = {ACS chemical biology},
  DATE         = {2013},
  VOLUME       = {8},
  pages        = {473-487},
  url          = {http://pubs.acs.org/doi/pdfplus/10.1021/cb3005325},
  urldate      = {2013-10-16}
}

@ARTICLE{DUBAR2008--,
  author       = {DUBAR, K L.  AND MITCHELL, D A.},
  title        = {A study on online pharmaceutical operating situation and supervision mechanism},
  Journaltitle = {Shanghai food and drug information research},
  DATE         = {2008},
  number       = {1},
  pages        = {8-11},
}

@ARTICLE{关立哲2014--,
  author       = {关立哲 and 韩纪富 and 张晨延},
  title        = {科技期刊编辑审读中要注重比较思维的科学运用},
  Journaltitle = {编辑学报},
  DATE         = {2014},
  VOLUME       = {26},
  number       = {2},
  pages        = {144-146}
}

@ARTICLE{关立哲2005--,
  author       = {韩纪富 and 张晨延},
  title        = {从交易费用的角度谈如何构建药品流通的良性机制},
  Journaltitle = {中国物价},
  DATE         = {2005},
  number       = {8},
  pages        = {42-45},
}

\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}


正文\parencite{关立哲2005--,关立哲2014--}正文

正文\parencite{关立哲2005--,关立哲2014--}。

正文 \parencite{关立哲2005--,关立哲2014--} 正文

正文 \parencite{关立哲2005--,关立哲2014--} 。

\printbibliography
\end{document} 

结果为:

图片

@hushidong
Copy link
Owner

@mengchaoheng 你可以pr修改readme文件。

@mengchaoheng
Copy link

mengchaoheng commented Dec 10, 2024

谢谢老师回复,我问了几个博士,他们说文后遇到句号确实是没有空格的,所以这个没问题。所以若需要空格,手动在命令前面也加空格即可。现在只是希望可以控制取消[]后空格,有一些用户可能需要。

@zepinglee
Copy link
Contributor Author

为了美观,我需要在\parencite命令前也输入空格,这样前后都有。我们学校的论文规范虽然没有提及,但他给的样式里前后都没空格的。所以我若要取消[]后的空格,应该如何设置?@zepinglee

这里的方括号是西文半角符号,按照习惯插入 1/6 em~1/4 em 的空白是正常的。下面是使用默认 numeric 样式的效果,在我看来是预期的效果。

\documentclass{ctexart}
\usepackage[style=numeric]{biblatex}
% \usepackage[style=gb7714-2015]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
正文\parencite{westfahl:space}正文\par
正文 \parencite{westfahl:space} 正文\par
正文\parencite{westfahl:space}。\par
正文 \parencite{westfahl:space} 。\par
\end{document}
Screenshot 2024-12-10 at 18 46 54

@mengchaoheng
Copy link

再麻烦一下您,若希望正文\parencite{westfahl:space}正文出来的效果是[]前后与正文都没有空格,该如何设置?@zepinglee

@hushidong
Copy link
Owner

临时处理,则导言区添加

\makeatletter
\newtoggle{gbNoAfPcSpace}%gb-no-after-parencite-space
\toggletrue{gbNoAfPcSpace}
\renewrobustcmd{\mkbibsuperscriptusp}[1]{%
  \unspace\allowhyphens\textsuperscript{%
    \begingroup%
    \protected\long\def\mkbibsuperscriptusp##1{%
      \blx@warning{Nested superscript}%
      \mkbibleftborder{##1}\mkbibrightborder}%
    #1\endgroup}\iftoggle{gbNoAfPcSpace}{\kern\z@}{}}
\makeatother

后面我会修改cbx,到时直接使用\toggletrue{gbNoAfPcSpace}或\togglefalse{gbNoAfPcSpace}来控制即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants