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

[Feature] Improve CJK support #349

Closed
Mikachu2333 opened this issue Jul 31, 2024 · 2 comments
Closed

[Feature] Improve CJK support #349

Mikachu2333 opened this issue Jul 31, 2024 · 2 comments

Comments

@Mikachu2333
Copy link

As the following pic shows, it seems that /href command doesn't support Chinese correctly.

20240731_21-30-46
% !TeX encoding = UTF-8
% !TEX TS-program = xelatex
\documentclass[a4paper,oneside,onecolumn,12pt]{ctexrep}
\usepackage{ulem}
\usepackage[colorlinks=false,allbordercolors={0 0 0},pdfborderstyle={/S/U/W 1}]{hyperref}
\begin{document}
This is a line aims to test the support of href when linebreaking. \href{https://github.com/latex3/hyperref}{Test English linebreak.}

这是一行文字,目的是测试hyperref在CJK文字换行时的表现。\href{https://github.com/latex3/hyperref}{测试测试测试测试测试测试测试测试测试。}

\end{document}
@u-fischer
Copy link
Member

You mean the line going through the text? That is more a xetex/xdvipdfmx problem than a hyperref problem. xdvipdfmx has its own ideas how to calculate the link area, with lualatex you would see something different.

You can try something like this to enlarge the area:

\documentclass[a4paper,oneside,onecolumn,12pt,fontset=fandol]{ctexrep} %fontset is needed for me on windows
\usepackage{ulem}
\usepackage[colorlinks=false,allbordercolors={0 0 0},pdfborderstyle={/S/U/W 1}]{hyperref}
\begin{document}
This is a line aims to test the support of href when linebreaking. \href{https://github.com/latex3/hyperref}{Test English linebreak.}

这是一行文字,目的是测试hyperref在CJK文字换行时的表现。\href{https://github.com/latex3/hyperref}{\special{pdf:xann width 0pt height 9pt depth 5pt}测试测试测试测试测试测\special{pdf:xann width 0pt height 9pt depth 5pt}试测试测试测试。}

\end{document}

image

@Mikachu2333
Copy link
Author

Thank you very much for your prompt response! My doubts have finally been resolved!

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