hushidong / biblatex-gb7714-2015

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

反馈一些使用过程中存在的问题 #50

Closed YLXDXX closed 5 years ago

YLXDXX commented 5 years ago

1,在文献的引用上,引用名里面如果有英文的括号“()”就会报错。 例子: @Misc{Euclidean_geometry(hi), howpublished = {\url{https://en.wikipedia.org/wiki/Euclidean_geometry}}, title = {Euclidean geometry}, }

2,在文献的引用中,url包含中文的转义后出错,且必须删除编译的文件才能解决 例子: @Misc{Euclidean_geometry, howpublished = {\url{https://zh.wikipedia.org/wiki/%E6%AC%A7%E5%87%A0%E9%87%8C%E5%BE%97%E5%87%A0%E4%BD%95}}, title = {Euclidean geometry}, }

3,在文献的引用中,url包含中文,在参考文献里不能显示 例子: @Misc{Euclidean_geometry, howpublished = {\url{https://zh.wikipedia.org/wiki/欧几里德几何}}, title = {Euclidean geometry}, }

4,使用脚注,\footfullcite{Euclidean_geometry} 在参考文献里面会将脚注参考内容列出来,还有此时的脚注没有像文章介绍的那样有圆圈,只有数字,且不能跳转。

5,在figure的caption里面使用脚注 \footfullcite{Euclidean_geometry} ,不能够正常显示。

hushidong commented 5 years ago

首先感谢这么详细的反馈,一会我会逐个测试,然后给出解释或解决方法。

hushidong commented 5 years ago

的确当引用关键词中存在英文的()符号时,biber会出错。而替换成中文的括号时则没有问题,也就是说biber在解析bib文件时,对于引用关键词这一行有要求,不能使用英文的()。我估计与biber设计时使用的计数有关,可能出现()的概率实在是小,所以biber作者没有考虑这种情况的存在,而可能直接使用正则表达式及()来提取引用关键词,可能导致冲突。当然这是我的猜测。

但我用python的正则并没有什么问题,比如:

import re

a=r'@misc{Euclidean_geometry,'

m=re.search(r'@(.*){(.*),',a)

print('entrytype:',m.group(1))
print('entrykey:',m.group(2))

a='@misc{Euclidean_geometry(hi),'

m=re.search(r'@(.*){(.*),',a)

print('entrytype:',m.group(1))
print('entrykey:',m.group(2))

结果为:

entrytype: misc
entrykey: Euclidean_geometry
entrytype: misc
entrykey: Euclidean_geometry(hi)

显然是不会冲突的,我没有研究biber的代码,所以也不太清楚为什么会导致这种情况,biblatex.PDF也没有关于entrykey的限制说明。

所以这个问题我也需要去问问biblatex维护人员,如果你有时间,你也可以去biber或biblatex仓库上提个issue去问一下,到底是怎么回事?

目前的解决方法是,不使用这一()。

  1. 由于%符号在tex中用于注释,因此当它出现在bib文件的域值中时会出现问题,因为tex系统读到%该行就结束了,所以必须要进行转义,即在%前面加\。 该问题对于那些特殊字符是一样的。

解决的方法是手动加,或者利用文本编辑器替换,或者利用正则表达式替换。 或者利用biblatex的动态数据修改进行替换,或者利用jabref等软件进行替换。

  1. 这是由于url包不支持中文导致的,你可以试一下在正文中输入:
    \url{https://zh.wikipedia.org/wiki/欧几里德几何}

    它也是不显示中文的,根据url宏包的说法,它是使用了一种math模式。 但又不同于一般的数学模式,因此使用\mbox\text来加入中文也是不行的。 比如:

\url{myself%node@gateway.net\text{中文}}

\url{myself%node@gateway.net\mbox{中文}}

\begin{equation}
  x=y*3+2  \quad \text{中文}
\end{equation}

\[
  x=y*3+2  \quad \text{中文}
\]

$  x=y*3+2  \quad \text{中文}$

其中两个url会出问题,而正常的公式没有问题。

解决方法是不使用\url而使用\href命令。比如:

@misc{Euclidean_geometry,
howpublished = {\href{https://zh.wikipedia.org/wiki/欧几里德几何}{https://zh.wikipedia.org/wiki/欧几里德几何}},
title = {Euclidean geometry},
}

或者不直接使用它而是在域格式中定义:

\DeclareFieldFormat{howpublished}{\href{#1}{#1}}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}

@misc{Euclidean_geometry,
howpublished = {https://zh.wikipedia.org/wiki/欧几里德几何},
title = {Euclidean geometry},
}

\end{filecontents}
  1. 默认情况下脚注文献表按照biblatex默认的方式进行处理,当要使用国标样式时,则应 加gbfootbib=true选项,比如:
    
    \documentclass[twoside]{article}
    \usepackage{ctex}
    \usepackage{xcolor}
    \usepackage{hyperref}
    \usepackage[top=10pt,bottom=10pt,left=1cm,right=1cm]{geometry}

\usepackage[backend=biber,style=gb7714-2015,gbfootbib=true]{biblatex} %\usepackage[backend=biber,style=numeric]{biblatex}

\DeclareFieldFormat{howpublished}{\href{#1}{#1}}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}

@misc{Euclidean_geometry, howpublished = {https://zh.wikipedia.org/wiki/欧几里德几何}, title = {Euclidean geometry}, }

\end{filecontents} \addbibresource{\jobname.bib} % \begin{document} \section{set title}

脚注\footnote{脚注abc}
文献\footfullcite{Euclidean_geometry}

\printbibliography

\end{document} 

至于超链接,在未使用上述选项时,脚注超链接是没有问题的,但使用了该选项后,的确没有了超链接,这个问题我还没来得及完善,下一步处理吧。

5. 由于caption和脚注的特殊性,在caption中使用脚注本身好像就有点问题,因此通常的方法是利用`\footnotemark`和`\footnotetext`
来实现,对于文献表也是类似的,因此也不能简单使用footfullcite命令,而是要使用`\footnotemark`和`\footnotetext`以及fullcite命令配合,比如:

\documentclass[twoside]{article} \usepackage{ctex} \usepackage{xcolor} \usepackage{hyperref} \usepackage[top=10pt,bottom=10pt,left=1cm,right=1cm]{geometry}

\usepackage[backend=biber,style=gb7714-2015,gbfootbib=true]{biblatex} %\usepackage[backend=biber,style=numeric]{biblatex}

\DeclareFieldFormat{howpublished}{\href{#1}{#1}}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}

@misc{Euclidean_geometry, howpublished = {https://zh.wikipedia.org/wiki/欧几里德几何}, title = {Euclidean geometry}, }

\end{filecontents} \addbibresource{\jobname.bib} % \begin{document} \section{set title}

\footnote{foot in text}

\begin{figure}[h] \centering \fbox{abc} \caption{示意图\protect\footnotemark} \end{figure}

\footnotetext{foot in caption}

\begin{figure}[h] \centering \fbox{abc} \caption{示意图见文献\protect\footnotemark} \end{figure}

\footnotetext{\fullcite{Euclidean_geometry}}

\footfullcite{Euclidean_geometry}

\printbibliography

\end{document} 
YLXDXX commented 5 years ago

感谢详尽的回复

hushidong commented 5 years ago

@YLXDXX 找biblatex作者问了么?没问的话我去问一下英文括号的问题。

hushidong commented 5 years ago

关于条目的引用关键词不能出现()的问题,是biber自身的原因,我写了个问题本来准备提问,一放进去发现已经有了,详见:

https://github.com/plk/biblatex/issues/165

YLXDXX commented 5 years ago

还有一个习惯的问题,在引用英文条目的时候,喜欢将文章的标题作为key,例如 @Misc{how are you, howpublished = {\url{www.baidu.com}}, title = {how are you}, } 在文章中会自动填写\cite{howareyou},将空格给去掉了,不仅不好看,并且编译出错,若填写\cite{how are you}编译也会出错,对于这个问题不知能否解决?

hushidong commented 5 years ago
  1. 脚注的超链接问题已经解决了,见最新的更新。这个问题还是比较复杂的,之前使用了footmisc来实现悬挂对齐,所以超链接存在问题。现在采用新的思路来解决,则可以了。顺便细致研究了一下latex中的脚注问题,见latex中脚注及其超链接实现的原理解析

  2. 关于条目引用关键词中的空格问题,类似于前面说的(),也是biber所使用的btparse的锅。目前的解决方式,可以不用空格而用-或者_来代替空格,这时也能够直观的看到文献的意义。

关于条目引用关键词,可以用使用jabref这样的软件进行管理,定制生成模板之后还是非常方便的。

hushidong commented 5 years ago

关于条目关键词中的空格和圆括号,目前没有办法解决,所以只好改bib文件了。 详见 https://github.com/ambs/Text-BibTeX/issues/30

YLXDXX commented 5 years ago

不过......我更新了 .bbx .cbx 的文件,点击脚注依然没法跳转

hushidong commented 5 years ago

测试一下这个文件,用最新的bbx https://github.com/hushidong/biblatex-gb7714-2015/blob/master/example/opt-gbfootbib.tex

另外你的tex发行版是哪个,什么版本?

hushidong commented 5 years ago

图表标题中的脚注好像本身就不支持超链接,hyperref好像是这么说的,你可以看一下他的文档。

YLXDXX commented 5 years ago

https://github.com/hushidong/biblatex-gb7714-2015/blob/master/example/opt-gbfootbib.tex 这个测试没问题,应该是我使用的模板的问题,可能里面什么有什么包冲突了

hushidong commented 5 years ago

你用的上交模板么?他里头加了footmisc宏包,会把hyperref做的超链接破坏掉。

hushidong commented 5 years ago

如果不是要使用他的一些特殊功能,可以把他注释掉。每页重新计数,bbx里面已经做了处理。

YLXDXX commented 5 years ago

魔改模板,里面没有使用footmisc包,找到原因了,setspace 这个包的冲突

hushidong commented 5 years ago

行距设置,现在有 zhlineskip ctexorg新出的你可以试试看会否冲突

宏包名不知记错没,你看下ctex-org那。

YLXDXX commented 5 years ago

谢谢,解决了

YLXDXX commented 5 years ago

这个issue还没关,再反馈一个使用严重的问题,脚注的计数器的设置应该有问题,当我使用了一个定义的环境过后,同一页脚注的计数器会被重置,定义环境为 \newtheorem{definition}{定义}[counter1] ,counter1是我自己设置的一个计数器

hushidong commented 5 years ago

我先看看

hushidong commented 5 years ago

的确有点问题,但不是你的定义导致的,是我做的处理有bug。之前我已经把脚注与页码关联起来了,但文献相同的判断还是以refsection为单位的,没有以页为单位。

我再更新一下,就应该好了。

hushidong commented 5 years ago

已更新,见 https://github.com/hushidong/biblatex-gb7714-2015/commit/289b0be89d53d072b11b70b3c9676e59038e51a2

hushidong commented 5 years ago

测试,见

\documentclass[twoside]{article}
    \usepackage{ctex}
    \usepackage{xcolor}
    \usepackage{toolbox}
    \usepackage{hyperref}
    \usepackage{lipsum}
    \usepackage[paperwidth=12cm,paperheight=10cm,top=10pt,bottom=10pt,left=1cm,right=1cm]{geometry}

\usepackage[backend=biber,style=gb7714-2015,gbalign=center,gbfootbib=true]{biblatex}

\newcounter{DefiCounter}
\newtheorem{definition}{定义}[section]

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@ARTICLE{丁文祥2000--,
  AUTHOR = {丁文祥},
  DATE = {2000-11-20},
  JOURNALTITLE = {中国青年报},
  KEYWORDS = {丁文祥2000--,news},
  NOTE = {news},
  NUMBER = {15},
  TITLE = {数字革命与竞争国际化},
  language = {chinese}
}

    @Article{abx2007-500-503,
      Title                    = {超声速短化喷管的设计和试验研究},
      Author                   = {张敏莉 and 易仕和 and 赵玉新 and 李明},
      Journal                  = {空气动力学报},
      Year                     = {2007},
      Number                   = {4},
      Pages                    = {500-503},
      Volume                   = {25},
      language                 = {chinese}
    }

    @ARTICLE{zhang2009china,
  AUTHOR = {Zhang, Wenlang},
  PUBLISHER = {Elsevier},
  DATE = {2009},
  JOURNALTITLE = {Journal of Macroeconomics},
  KEYWORDS = {zhang2009china},
  NUMBER = {3},
  PAGES = {473--484},
  TITLE = {China’s monetary policy: Quantity versus price rules},
  VOLUME = {31},
}
\end{filecontents}
    \addbibresource{\jobname.bib}
    %

    \begin{document}

    \section{sec A}

    文献\footfullcite{zhang2009china}\cite{abx2007-500-503}
    \footfullcite{丁文祥2000--}
    \footfullcite[60]{zhang2009china}

    \begin{definition}
    一个定理环境:A
    \end{definition}

    \begin{definition}
    一个定理环境:B
    \end{definition}

    \newpage
    \section{sec B}
    文献\footfullcite{zhang2009china}\cite{abx2007-500-503}
    \footfullcite{丁文祥2000--}
    \footfullcite[60]{zhang2009china}

    \begin{definition}
    一个定理环境:C
    \end{definition}

    \newpage
    \section{sec C}
    文献\footfullcite{zhang2009china}\cite{abx2007-500-503}
    \footfullcite{丁文祥2000--}
    \footfullcite[60]{zhang2009china}

    \begin{definition}
    一个定理环境:D
    \end{definition}

    \begin{definition}
    一个定理环境:E
    \end{definition}

    \newpage
    \section{biblio}
    \printbibliography

    \end{document} 
YLXDXX commented 5 years ago

不好意思,我这边试了一下,问题依旧(更新了bbx和cbx文件)。。。

hushidong commented 5 years ago

你给个错误的mwe看看吧,上面的这个mwe你试了么?

YLXDXX commented 5 years ago

你给的例子运行没有问题,但是在我的论文里面确出问题了,附上我的cls和一个测试的例子,麻烦看一下

YLXDXX commented 5 years ago

测试.zip

hushidong commented 5 years ago

看了一下,问题在于,内部实际分页与pdf的分页不一致。

这问题本质是你前面全是section没有合适分页的内容,所以tex算法在计算分页的时候,与章节标题格式的实际设置不一致。

虽然pdf显示在一页内,但打出page计数器其实是两个了。

解决方法有

1.在最后一个section前加 newpage

2.或加clearpage

3.或加一段文字

这样就可以让分页和page计数器一致起来。

YLXDXX commented 5 years ago

谢谢,再请问一下有没有更好的方法?(newpage或者clearpage对论文来说新起一页不太协调,而我实际写作中每一个标题下面都有文字,但是仍然会出现此问题)

hushidong commented 5 years ago

有文字,那么一般不会出现问题,出现问题就是小概率了事件,完全可以手动调整。

脚注因为page计数器的问题出现分页上的问题,对于页面第一段是可能的,因为分页后页码未更新,要等到下一段更新。

解决方法是

  1. 让脚注不与页码挂钩,而采用全局页脚,这也是合理的,正常情况下,文档的页脚不会太多。

  2. 或者继续启用与页码关联,但手动调整。

jhzgjhzg commented 1 year ago

在bib文件中使用\herf会导致pdf中无法显示url,这是为什么

hushidong commented 1 year ago

@jhzgjhzg 给个小例子看看,为什么这么用呢?可能需要把命令保护一下。

jhzgjhzg commented 1 year ago

@jhzgjhzg 给个小例子看看,为什么这么用呢?可能需要把命令保护一下。

截屏2023-04-04 15 57 54

这是我在bib文件里写的引用,使用\url无法显示中文,改为\herf后整个链接都没了

sikouhjw commented 1 year ago
截屏2023-04-04 15 57 54

这是我在bib文件里写的引用,使用\url无法显示中文,改为\herf后整个链接都没了

你的写法有非常大的问题,正确写法是:

@online{baidubaike2023svd,
  author       = {百度百科},
  title        = {奇异值分解},
  urldate      = {2023-04-04},
  url          = {https://baike.baidu.com/item/%E5%A5%87%E5%BC%82%E5%80%BC%E5%88%86%E8%A7%A3},
}
jhzgjhzg commented 1 year ago
截屏2023-04-04 15 57 54

这是我在bib文件里写的引用,使用\url无法显示中文,改为\herf后整个链接都没了

你的写法有非常大的问题,正确写法是:

@online{baidubaike2023svd,
  author       = {百度百科},
  title        = {奇异值分解},
  urldate      = {2023-04-04},
  url          = {https://baike.baidu.com/item/%E5%A5%87%E5%BC%82%E5%80%BC%E5%88%86%E8%A7%A3},
}

非常感谢,我刚接触latex,还在学习中

marvel084 commented 1 month ago

求问url字段含中文的问题。

如果url字段网址包含中文,biblatex则会转义

@online{Euclidean_geometry,
  url = {https://zh.wikipedia.org/wiki/欧几里德几何},
  title = {Euclidean geometry},
}

如果写成bibtex样式,在howpublished字段填入网址,则会生成带汉字的超链接

@misc{Euclidean_geometry2,
  howpublished = {\href{https://zh.wikipedia.org/wiki/欧几里德几何}},
  title = {Euclidean geometry2},
}

PDF显示

可否让url字段不转义,生成的超链接显示中文呢?

附hyperref包配置:

\usepackage[unicode,
            pdfstartview=FitH,
            bookmarksnumbered=true,
            bookmarksopen=true,
            citecolor=cyan,
            linkcolor=red,
            anchorcolor=green,
            urlcolor=BlueGreen,
            breaklinks=true
            ]{hyperref}
hushidong commented 1 month ago

用其中的两句命令试试。

我上不去github,只能用邮箱回,你看看能不能看到。如果不行就留个邮箱。我直接发你邮箱。

获取Outlook for Androidhttps://aka.ms/AAb9ysg


From: Yiming Zhang @.> Sent: Friday, August 2, 2024 7:09:03 AM To: hushidong/biblatex-gb7714-2015 @.> Cc: hzzmail @.>; State change @.> Subject: Re: [hushidong/biblatex-gb7714-2015] 反馈一些使用过程中存在的问题 (#50)

求问url字段含中文的问题。

如果url字段网址包含中文,biblatex则会转义

@online{Euclidean_geometry, url = {https://zh.wikipedia.org/wiki/欧几里德几何}, title = {Euclidean geometry}, }

如果写成bibtex样式,在howpublished字段填入网址,则会生成带汉字的超链接

@misc{Euclidean_geometry2, howpublished = {\href{https://zh.wikipedia.org/wiki/欧几里德几何}}, title = {Euclidean geometry2}, }

2024-08-02.070213.png (view on web)https://github.com/user-attachments/assets/9de153f6-9ab2-46ac-99d0-16a8a96e1392

可否让url字段不转义,生成的超链接显示中文呢?

附hyperref包配置:

\usepackage[unicode, pdfstartview=FitH, bookmarksnumbered=true, bookmarksopen=true, citecolor=cyan, linkcolor=red, anchorcolor=green, urlcolor=BlueGreen, breaklinks=true ]{hyperref}

― Reply to this email directly, view it on GitHubhttps://github.com/hushidong/biblatex-gb7714-2015/issues/50#issuecomment-2264177239, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE3ZZI2GQ5OMZ7WWK47VAA3ZPK5Y7AVCNFSM6AAAAABL3PGAN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRUGE3TOMRTHE. You are receiving this because you modified the open/close state.Message ID: @.***>

marvel084 commented 1 month ago

可能您这条显示不全,我邮箱 moonhikari084@gmail.com

我看生成的 .blb 会有转义:

\entry{Euclidean_geometry}{online}{}{}
      \list{language}{1}{%
        {english}%
      }
      \field{sortinit}{5}
      \field{sortinithash}{20e9b4b0b173788c5dace24730f47d8c}
      \field{labeltitlesource}{title}
      \field{langid}{english}
      \field{languageid}{english}
      \field{lansortorder}{4}
      \field{title}{Euclidean geometry}
      \field{usera}{EB}
      \field{userd}{english}
      \verb{urlraw}
      \verb https://zh.wikipedia.org/wiki/欧几里德几何
      \endverb
      \verb{url}
      \verb https://zh.wikipedia.org/wiki/%E6%AC%A7%E5%87%A0%E9%87%8C%E5%BE%B7%E5%87%A0%E4%BD%95
      \endverb
      \keyw{Euclidean_geometry}
    \endentry

用xelatex能编译成功且PDF呈现转义完的url,用lualatex会编译失败,在转义的网址 \verb{url} 处提示

Use of \blx@bbl@verbadd@i doesn't match its definition.

用其中的两句命令试试。 我上不去github,只能用邮箱回,你看看能不能看到。如果不行就留个邮箱。我直接发你邮箱。 获取Outlook for Androidhttps://aka.ms/AAb9ysg ____ From: Yiming Zhang @.> Sent: Friday, August 2, 2024 7:09:03 AM To: hushidong/biblatex-gb7714-2015 @.> Cc: hzzmail @.>; State change @.> Subject: Re: [hushidong/biblatex-gb7714-2015] 反馈一些使用过程中存在的问题 (#50) 求问url字段含中文的问题。 如果url字段网址包含中文,biblatex则会转义 @online{Euclidean_geometry, url = {https://zh.wikipedia.org/wiki/欧几里德几何}, title = {Euclidean geometry}, } 如果写成bibtex样式,在howpublished字段填入网址,则会生成带汉字的超链接 @misc{Euclidean_geometry2, howpublished = {\href{https://zh.wikipedia.org/wiki/欧几里德几何}}, title = {Euclidean geometry2}, } 2024-08-02.070213.png (view on web)https://github.com/user-attachments/assets/9de153f6-9ab2-46ac-99d0-16a8a96e1392 可否让url字段不转义,生成的超链接显示中文呢? 附hyperref包配置: \usepackage[unicode, pdfstartview=FitH, bookmarksnumbered=true, bookmarksopen=true, citecolor=cyan, linkcolor=red, anchorcolor=green, urlcolor=BlueGreen, breaklinks=true ]{hyperref} ― Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE3ZZI2GQ5OMZ7WWK47VAA3ZPK5Y7AVCNFSM6AAAAABL3PGAN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRUGE3TOMRTHE. You are receiving this because you modified the open/close state.Message ID: @.***>

marvel084 commented 1 month ago

代作者发一下解答:

需求:要求参考文献中的url包含中文的不自动转义,按原文显示,且url能正确换行。

中文url会自动转义,生成的.bbl文件中如此显示:

\verb{urlraw}
\verb https://zh.wikipedia.org/wiki/通惠河通惠河通惠河通惠河通惠河通惠河通惠河通惠河通惠河通惠河通惠河通惠河
\endverb
\verb{url}
\verb https://zh.wikipedia.org/wiki/%E9%80%9A%E6%83%A0%E6%B2%B3%E9%80%9A%E6%83%A0%E6%B2%B3%E9%80%9A%E6%83%A0%E6%B2%B3%E9%80%9A%E6%83%A0%E6%B2%B3%E9%80%9A%E6%83%A0%E6%B2%B3%E9%80%9A%E6%83%A0%E6%B2%B3%E9%80%9A%E6%83%A0%E6%B2%B3%E9%80%9A%E6%83%A0%E6%B2%B3%E9%80%9A%E6%83%A0%E6%B2%B3%E9%80%9A%E6%83%A0%E6%B2%B3%E9%80%9A%E6%83%A0%E6%B2%B3%E9%80%9A%E6%83%A0%E6%B2%B3
\endverb

正是因为biblatex提供urlraw和url,所以我们可以用urlraw来输出需要的中文。比如:

\DeclareFieldFormat{urlraw}{\href{#1}{\UrlFont#1}}
\renewbibmacro*{url}{\printfield{urlraw}}

替换成\href是因为\url不支持中文。但全用href会导致url无法在英文处正确换行:

屏幕截图 2024-08-03 220810

如果有哪个包提供url命令,能支持中文那么就不用这样了。试一下xurl宏包看看?如果还用现在这种方式,那么可以让参考文献强制不溢出来实现换行。

还有一种方式是,对url内容做判断,有中文用\href,没有就用\url

另外词内换行可以手动加入hypen来实现。当然我们更希望是自动化的方式,所以可以采用如下的方式:

由于.tex文件中%后即为注释,为保留url原文,此处拆分展示

test.tex

\documentclass{article}
\usepackage{ctex}
\usepackage{hyperref}

\usepackage[backend=biber,style=gb7714-2015]{biblatex}

\usepackage{seqsplit}
\DeclareFieldFormat{urlraw}{\href{#1}{\UrlFont\seqsplit{#1}}}
\renewbibmacro*{url}{%
\iffieldsequal{url}{urlraw}{\printfield{url}}{\printfield{urlraw}}%
}

\addbibresource{test.bib}

\begin{document}
\nocite{*}
\printbibliography[heading=bibliography]
\end{document} 

test.bib

@article{wu2018da,
title = {Assessing River Water Quality Using Water Quality Index in {{Lake Taihu Basin}}, {{China}}},
author = {Wu, Zhaoshi and Wang, Xiaolong and Chen, Yuwei and Cai, Yongjiu and Deng, Jiancai},
date = {2018-01},
journaltitle = {Science of The Total Environment},
shortjournal = {Science of The Total Environment},
volume = {612},
pages = {914--922},
issn = {00489697},
doi = {10.1016/j.scitotenv.2017.08.293},
urldate = {2023-07-19},
url={10.1016/j.scitotenv/欧几里得几何欧几里得几何欧几里得几何欧几里得几何欧几里得几何欧几里得几何欧几里得几何欧几里得几何欧几里得几何},
langid = {english},
extradate={1}
}

@Inproceedings{FOURNEY1971-17-38,
 Title = {Advances in Holographic Photoelasticity},
 Author = {M E FOURNEY},
 Booktitle = {Symposium on Applications of Holography in Mechanics, August 23-25, 1971, University of Southern California, Los Angeles, California},
 year = {c1971},
 Pages = {17-38},
 Publisher = {ASME},
 Location = {New York}
}

@online{_2024_通惠河,
 title = {通惠河原url为汉字},
 date = {2024-07-24T07:47:23Z},
 url = {https://zh.wikipedia.org/wiki/通惠河通惠河通惠河通惠河通惠河通惠河通惠河通惠河通惠河通惠河通惠河通惠河},
 urldate = {2024-07-28},
 langid = {chinese},
 annotation = {Page Version ID: 83532008},
 organization = {维基百科,自由的百科全书}
}

@misc{_2024_通惠河2,
  title = {通惠河原url即为转义},
  date = {2024-07-24T07:47:23Z},
  url = {https://zh.wikipedia.org/wiki/%E9%80%9A%E6%83%A0%E6%B2%B3},
  urldate = {2024-07-28},
  langid = {chinese},
  annotation = {Page Version ID: 83532008},
  organization = {维基百科,自由的百科全书}
}

@online{ThomasAllom__Militarystationcity,
 title = {Military Station near the City of {{Chokien}}},
 author = {{Thomas Allom}},
 url = {https://commons.wikimedia.org/wiki/File:Military_station_near_the_city_of_Chokien.jpg?uselang=zh-hans},
 urldate = {2024-07-17},
 organization = {Wikimedia Commons}
}

@online{ThomasAllom__Militarystationcity2,
 title = {Military Station near the City of {{Chokien}}},
 author = {{Thomas Allom}},
 url = {https://commons.wikimedia.通惠河通惠河通惠河通惠河通惠河通惠河通惠河通惠河org/wiki/File:Military_station_near_the_city_of_Chokien.jpg?uselang=zh-hans},
 urldate = {2024-07-17},
 organization = {Wikimedia Commons}
}

显示为:

屏幕截图 2024-08-03 215515

效果是含中文的url不转义,按原文urlraw显示,能自动换行;无需转义或者原url已经转义过的,按原文显示,也能自动换行。

再次感谢作者的解答!