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

hyperref影响了ulem使得下划线引用文字缩进异常 #329

Closed
1 task done
Mikachu2333 opened this issue Aug 20, 2024 · 3 comments
Closed
1 task done

hyperref影响了ulem使得下划线引用文字缩进异常 #329

Mikachu2333 opened this issue Aug 20, 2024 · 3 comments

Comments

@Mikachu2333
Copy link

检查清单

  • 我已在 issues 中进行搜索(包括已关闭的问题)

操作系统

Linux (Debian GNU/Linux 12, KDE)

TeX 发行版

texlive2024

描述问题

使用latexmk调用luatex编译

如下图所示,看起来ref命令使文字略微向前移动了一些……
ksnip_20240820-212431

未能找到相关解决方案

最小工作示例(MWE)

% !TeX encoding = UTF-8
% !TEX TS-program = lualatex
\documentclass[a4paper,12pt,UTF8]{ctexrep}
\usepackage{ulem,hyperref}

\newcommand{\uref}[1]{%
    \uline{\ref{#1}}%
}

\begin{document}
\section{aaa}
\label{free_bus}
aaa
\section{bbb}
这是一段引用\uref{free_bus}测试文字。

This is English uref \uref{free_bus} test.

这是二段引用\ref{free_bus}测试文字。

This is English ref \ref{free_bus} test.
\end{document}

luatexmkrc文件仅用于调用luatex,无其他作用,故不列出

用 LuaLaTeX 编译后,日志文件输出:

Rc files read:
  latexmkrc
Latexmk: This is Latexmk, John Collins, 7 Apr. 2024. Version 4.85.
No existing .aux file, so I'll make a simple one, and require run of *latex.
Latexmk: applying rule 'lualatex'...
Rule 'lualatex':  Reasons for rerun
Category 'other':
  Rerun of 'lualatex' forced or previously required:
    Reason or flag: 'Initial setup'

------------
Run number 1 of rule 'lualatex'
------------
------------
Running 'lualatex  -synctex=1 -interaction=nonstopmode -shell-escape -halt-on-error -file-line-error -recorder  "/home/linkchu/文档/test_tex/main.tex"'
------------
This is LuaHBTeX, Version 1.18.0 (TeX Live 2024) 
 system commands enabled.
(/home/linkchu/文档/test_tex/main.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-07-20>
tput: No value for $TERM and no -T specified
 (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/ctexrep.cls (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg) (/usr/local/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-luatex.def))
Document Class: ctexrep 2022/07/14 v2.5.10 Chinese adapter for class report (CTEX)
(/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/ctexhook.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/ctexpatch.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/fix-cm.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/base/ts1enc.def)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctexopts.cfg) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/report.cls
Document Class: report 2024/02/08 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size12.clo)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/luatexja.sty (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/luatexja-core.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/infwarerr/infwarerr.sty) (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexbase/luatexbase.sty (/usr/local/texlive/2024/texmf-dist/tex/luatex/ctablestack/ctablestack.sty)) (/usr/local/texlive/2024/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/iftex/iftex.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/local/texlive/2024/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/local/texlive/2024/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/local/texlive/2024/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/everyhook/everyhook.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/svn-prov/svn-prov.sty)) (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/ltj-base.sty)) (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/luatexja-compat.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xparse/xparse.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/base/fontenc.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/tuenc.def)
(/usr/local/texlive/2024/texmf-dist/tex/luatex/chinese-jfm/jfm-zh_CN.lua)) (/usr/local/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctex.cfg) (/usr/local/texlive/2024/texmf-dist/tex/generic/ulem/ulem.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/pdfescape/pdfescape.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hycolor/hycolor.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/refcount/refcount.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/kvoptions/kvoptions.sty))) (/usr/local/texlive/2024/texmf-dist/tex/generic/stringenc/stringenc.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/local/texlive/2024/texmf-dist/tex/generic/intcalc/intcalc.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/puenc.def) (/usr/local/texlive/2024/texmf-dist/tex/latex/url/url.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/bitset/bitset.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/atbegshi-ltx.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/hluatex.def (/usr/local/texlive/2024/texmf-dist/tex/latex/base/atveryend-ltx.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty))) (./main.aux)

LaTeX Warning: Reference `free_bus' on page 1 undefined on input line 15.


LaTeX Warning: Reference `free_bus' on page 1 undefined on input line 17.


LaTeX Warning: Reference `free_bus' on page 1 undefined on input line 19.


LaTeX Warning: Reference `free_bus' on page 1 undefined on input line 21.


 [1{/usr/local/texlive/2024/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./main.aux)

LaTeX Warning: There were undefined references.


LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.


Package rerunfilecheck Warning: File `main.out' has changed.
(rerunfilecheck)                Rerun to get outlines right
(rerunfilecheck)                or use package `bookmark'.

)
 589 words of node memory still in use:
   4 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 57 attribute, 54 glue_spec, 11 attribute_list, 1 write, 6 user_defined nodes
   avail lists: 1:3,2:2888,3:81,4:80,5:48,6:21,7:547,9:183,11:6
</usr/local/texlive/2024/texmf-dist/fonts/opentype/public/fandol/FandolSong-Regular.otf></usr/local/texlive/2024/texmf-dist/fonts/opentype/public/lm/lmroman12-bold.otf></usr/local/texlive/2024/texmf-dist/fonts/opentype/public/lm/lmroman12-regular.otf>
Output written on main.pdf (1 page, 11543 bytes).
SyncTeX written on main.synctex.gz.
Transcript written on main.log.
Latexmk: Getting log file 'main.log'
Latexmk: Examining 'main.fls'
Latexmk: Examining 'main.log'
Latexmk: References changed.
Latexmk: References changed.
Latexmk: Log file says output to 'main.pdf'
Latexmk: applying rule 'lualatex'...
Rule 'lualatex':  Reasons for rerun
Changed files or newly in use/created:
  main.aux

------------
Run number 2 of rule 'lualatex'
------------
------------
Running 'lualatex  -synctex=1 -interaction=nonstopmode -shell-escape -halt-on-error -file-line-error -recorder  "/home/linkchu/文档/test_tex/main.tex"'
------------
This is LuaHBTeX, Version 1.18.0 (TeX Live 2024) 
 system commands enabled.
(/home/linkchu/文档/test_tex/main.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-07-20>
tput: No value for $TERM and no -T specified
 (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/ctexrep.cls (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg) (/usr/local/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-luatex.def))
Document Class: ctexrep 2022/07/14 v2.5.10 Chinese adapter for class report (CTEX)
(/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/ctexhook.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/ctexpatch.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/fix-cm.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/base/ts1enc.def)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctexopts.cfg) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/report.cls
Document Class: report 2024/02/08 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size12.clo)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/luatexja.sty (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/luatexja-core.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/infwarerr/infwarerr.sty) (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexbase/luatexbase.sty (/usr/local/texlive/2024/texmf-dist/tex/luatex/ctablestack/ctablestack.sty)) (/usr/local/texlive/2024/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/iftex/iftex.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/local/texlive/2024/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/local/texlive/2024/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/local/texlive/2024/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/everyhook/everyhook.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/svn-prov/svn-prov.sty)) (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/ltj-base.sty)) (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/luatexja-compat.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xparse/xparse.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/base/fontenc.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/tuenc.def)
(/usr/local/texlive/2024/texmf-dist/tex/luatex/chinese-jfm/jfm-zh_CN.lua)) (/usr/local/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctex.cfg) (/usr/local/texlive/2024/texmf-dist/tex/generic/ulem/ulem.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/pdfescape/pdfescape.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hycolor/hycolor.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/refcount/refcount.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/kvoptions/kvoptions.sty))) (/usr/local/texlive/2024/texmf-dist/tex/generic/stringenc/stringenc.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/local/texlive/2024/texmf-dist/tex/generic/intcalc/intcalc.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/puenc.def) (/usr/local/texlive/2024/texmf-dist/tex/latex/url/url.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/bitset/bitset.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/atbegshi-ltx.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/hluatex.def (/usr/local/texlive/2024/texmf-dist/tex/latex/base/atveryend-ltx.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty))) (./main.aux) (./main.out) (./main.out)
 [1{/usr/local/texlive/2024/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./main.aux))
 589 words of node memory still in use:
   4 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 57 attribute, 54 glue_spec, 11 attribute_list, 1 write, 6 user_defined nodes
   avail lists: 1:3,2:3020,3:97,4:68,5:48,6:25,7:574,9:189,11:6
</usr/local/texlive/2024/texmf-dist/fonts/opentype/public/fandol/FandolSong-Regular.otf></usr/local/texlive/2024/texmf-dist/fonts/opentype/public/lm/lmroman12-bold.otf></usr/local/texlive/2024/texmf-dist/fonts/opentype/public/lm/lmroman12-regular.otf>
Output written on main.pdf (1 page, 11798 bytes).
SyncTeX written on main.synctex.gz.
Transcript written on main.log.
Latexmk: Getting log file 'main.log'
Latexmk: Examining 'main.fls'
Latexmk: Examining 'main.log'
Latexmk: Log file says output to 'main.pdf'
Latexmk: applying rule 'lualatex'...
Rule 'lualatex':  Reasons for rerun
Changed files or newly in use/created:
  main.out

------------
Run number 3 of rule 'lualatex'
------------
------------
Running 'lualatex  -synctex=1 -interaction=nonstopmode -shell-escape -halt-on-error -file-line-error -recorder  "/home/linkchu/文档/test_tex/main.tex"'
------------
This is LuaHBTeX, Version 1.18.0 (TeX Live 2024) 
 system commands enabled.
(/home/linkchu/文档/test_tex/main.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-07-20>
tput: No value for $TERM and no -T specified
 (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/ctexrep.cls (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg) (/usr/local/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-luatex.def))
Document Class: ctexrep 2022/07/14 v2.5.10 Chinese adapter for class report (CTEX)
(/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/ctexhook.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/ctexpatch.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/fix-cm.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/base/ts1enc.def)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctexopts.cfg) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/report.cls
Document Class: report 2024/02/08 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size12.clo)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/luatexja.sty (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/luatexja-core.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/infwarerr/infwarerr.sty) (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexbase/luatexbase.sty (/usr/local/texlive/2024/texmf-dist/tex/luatex/ctablestack/ctablestack.sty)) (/usr/local/texlive/2024/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/iftex/iftex.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/local/texlive/2024/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/local/texlive/2024/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/local/texlive/2024/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/everyhook/everyhook.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/svn-prov/svn-prov.sty)) (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/ltj-base.sty)) (/usr/local/texlive/2024/texmf-dist/tex/luatex/luatexja/luatexja-compat.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xparse/xparse.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/base/fontenc.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/tuenc.def)
(/usr/local/texlive/2024/texmf-dist/tex/luatex/chinese-jfm/jfm-zh_CN.lua)) (/usr/local/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def)) (/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/config/ctex.cfg) (/usr/local/texlive/2024/texmf-dist/tex/generic/ulem/ulem.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/pdfescape/pdfescape.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hycolor/hycolor.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/refcount/refcount.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty (/usr/local/texlive/2024/texmf-dist/tex/latex/kvoptions/kvoptions.sty))) (/usr/local/texlive/2024/texmf-dist/tex/generic/stringenc/stringenc.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/local/texlive/2024/texmf-dist/tex/generic/intcalc/intcalc.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/puenc.def) (/usr/local/texlive/2024/texmf-dist/tex/latex/url/url.sty) (/usr/local/texlive/2024/texmf-dist/tex/generic/bitset/bitset.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/base/atbegshi-ltx.sty)) (/usr/local/texlive/2024/texmf-dist/tex/latex/hyperref/hluatex.def (/usr/local/texlive/2024/texmf-dist/tex/latex/base/atveryend-ltx.sty) (/usr/local/texlive/2024/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty (/usr/local/texlive/2024/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty))) (./main.aux) (./main.out) (./main.out)
 [1{/usr/local/texlive/2024/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./main.aux))
 589 words of node memory still in use:
   4 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 57 attribute, 54 glue_spec, 11 attribute_list, 1 write, 6 user_defined nodes
   avail lists: 1:3,2:3020,3:97,4:68,5:48,6:25,7:574,9:189,11:6
</usr/local/texlive/2024/texmf-dist/fonts/opentype/public/fandol/FandolSong-Regular.otf></usr/local/texlive/2024/texmf-dist/fonts/opentype/public/lm/lmroman12-bold.otf></usr/local/texlive/2024/texmf-dist/fonts/opentype/public/lm/lmroman12-regular.otf>
Output written on main.pdf (1 page, 11798 bytes).
SyncTeX written on main.synctex.gz.
Transcript written on main.log.
Latexmk: Getting log file 'main.log'
Latexmk: Examining 'main.fls'
Latexmk: Examining 'main.log'
Latexmk: Log file says output to 'main.pdf'
Latexmk: All targets (main.pdf) are up-to-date

链接

除了一个NoHyper环境以外,确实未能找到相关资料

https://ask.latexstudio.net/ask/question/8205.html

其他信息

没明白原理也没找到资料……

附件

No response

@Mikachu2333
Copy link
Author

Updated:
图片

% !TeX encoding = UTF-8
% !TEX TS-program = lualatex
\documentclass[a4paper,12pt,UTF8]{ctexrep}
\usepackage{ulem,hyperref}

\newcommand{\uref}[1]{%
    \uline{\ref{#1}}%
}

\begin{document}
\section{aaa}
\label{free_bus}
aaa
\section{bbb}
这是一段引用\uref{free_bus}测试文字。

This is English uref \uref{free_bus} test.

这是二段引用\ref{free_bus}测试文字。

This is English ref \ref{free_bus} test.
\end{document}

此外,关联 #327

@wangweixuan
Copy link

跟 hyperref 没有关系,是下划线造成的。示例:

\documentclass{article}
\usepackage{ctex}
\usepackage{ulem}

\begin{document}

中\uline{abc}文

\showboxbreadth=100
\showboxdepth=2
\setbox0=\hbox{中\uline{abc}文}
\showbox0

\end{document}

日志输出:

> \box0=
\hbox(9.27464+3.03484)x39.81773, direction TLT
.\whatsit4=[]
.\norule(9.27464+1.26472)x0.0
.\LTJY3/FZSSK(0)/m/n/10.53937 中   <-- 这是汉字
.\penalty 0
.\rule(*+*)x0.0
.\penalty 10000
.\glue -0.24089
.\leaders 16.58594
..\rule(-2.63484+3.03484)x*        <-- 这是下划线
.\glue -0.24089
.\kern-16.10416                    <-- 后退
.\hbox(7.31432+0.11594)x16.10416, direction TLT
..\whatsit4=[]
..\kern-0.00005
..\kern0.00005
..\TU/lmr/m/n/10.53937 a           <-- “中”和“a”之间缺少间距
..\TU/lmr/m/n/10.53937 b
..\kern0.2951 (font)
..\TU/lmr/m/n/10.53937 c
.\glue 2.63484 plus 1.0 minus 1.0  <-- “c”和“文”之间间距正常
.\norule(9.27464+1.26472)x0.0
.\LTJY3/FZSSK(0)/m/n/10.53937 文

可见 \uline 展开后先引入下划线 \rule,然后后退到下划线之前,再引入西文“abc”。按照设计,汉字和 \rule 之间不需要间距,导致这里缺少间距。

在 LuaLaTeX 上可以用 Lua-UL 宏包替代 ulem 来解决。

@Mikachu2333
Copy link
Author

解决了,谢谢大佬!

另附关于双下划线的疑问(均已解决)与链接

zauguin/luaul#23

https://tex.stackexchange.com/questions/724804/how-to-use-lua-ul-to-make-double-underline-same-as-uuline-in-ulem

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