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

\citet 数字与右括号有多余空白 #152

Closed
note286 opened this issue Jan 28, 2023 · 2 comments
Closed

\citet 数字与右括号有多余空白 #152

note286 opened this issue Jan 28, 2023 · 2 comments

Comments

@note286
Copy link

note286 commented Jan 28, 2023

#151 中你的回答里的截图也是如此,我通过在Sumatra PDF Viewer中选中数字1发现前两行中的1较窄,第三行的较宽。

\documentclass{article}
\usepackage{xeCJK}
\usepackage[style=gb7714-2015]{biblatex}
\addbibresource{ref.bib}
\begin{filecontents}[force]{ref.bib}
@book{xxx,
  author       = {蒋有绪 and 郭泉水 and 马娟 and others},
  title        = {中国森林群落分类及其群落特征},
  address      = {北京},
  publisher    = {科学出版社},
  year         = {1998},
}
\end{filecontents}
\begin{document}
\citeauthor{xxx}\cite{xxx}

\authornumcite{xxx}

\citet{xxx}

\printbibliography
\end{document}

image

@hushidong
Copy link
Owner

实话说,我找半天没有发现问题所在,所以暂时只能这样处理一下了。

\documentclass{article}
%\usepackage{xeCJK}
\usepackage{ctex}
\usepackage[style=gb7714-2015]{biblatex}
\addbibresource{ref.bib}
\begin{filecontents}[force]{ref.bib}
@book{xxx,
  author       = {蒋有绪 and 郭泉水 and 马娟 and others},
  title        = {中国森林群落分类及其群落特征},
  address      = {北京},
  publisher    = {科学出版社},
  year         = {1998},
}
\end{filecontents}

\makeatletter
\renewbibmacro*{citet}{%
  \iffieldequals{namehash}{\cbx@lasthash}%
    {\usebibmacro{cite:comp}}%
    {\usebibmacro{cite:dump}%
     \ifbool{cbx:parens}%
       {\mkbibsuperscript{{\hspace{-0.075em}\bibclosebracket}}\global\boolfalse{cbx:parens}}%\printtext
       {}%
     \iffirstcitekey%
       {}%
       {\textcitedelim}%
     \usebibmacro{cite:init}%
     \ifnameundef{labelname}%
       {\printfield[citetitle]{labeltitle}}%
       {\printnames{labelname}}%
     %\setunit*{\printdelim{namelabeldelim}}%
     \mkbibsuperscript{{\bibopenbracket}\global\booltrue{cbx:parens}%\printtext
     \ifnumequal{\value{citecount}}{1}%
       {\usebibmacro{prenote}}%
       {}%
     \usebibmacro{cite:comp}%\usebibmacro{cite:comp}
     \stepcounter{textcitecount}%
     \savefield{namehash}{\cbx@lasthash}}}}

\DeclareCiteCommand{\cbx@textcite}%
  {\usebibmacro{cite:init}}%
  {\usebibmacro{citeindex}%
   \ifbool{cbx:incitet}{\usebibmacro{citet}}{\usebibmacro{textcite}}%
   }%
  {}%
  {\ifbool{cbx:incitet}%
        {\mkbibsuperscript{\usebibmacro{cite:dump}\usebibmacro{postnote}%
        \ifbool{cbx:parens}{\hspace{-0.075em}\bibclosebracket\global\boolfalse{cbx:parens}}{}%
        }%
        }%
        {\usebibmacro{cite:dump}\usebibmacro{postnote}%
        \ifbool{cbx:parens}{\bibclosebracket\global\boolfalse{cbx:parens}}{}%
        }%
   }
\makeatother




\begin{document}
\citeauthor{xxx}\cite{xxx}

\authornumcite{xxx}

\citet{xxx}

\printbibliography
\end{document} 

结果为:
图片

@note286
Copy link
Author

note286 commented Jan 29, 2023

项目复杂了,出问题难免,辛苦了。

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

2 participants