CTeX-org / ctex-kit

Macro Packages and Scripts for Chinese TeX users
980 stars 124 forks source link

ctex文档类, 想用changes包来跟踪修改, changes包里面的命令对中文不换行(英文没问题) #662

Closed xiaqian369 closed 1 year ago

xiaqian369 commented 1 year ago

如题, 想用\usepackage{changes}来跟踪修改, 但是changes包里面的命令对中文不换行(英文没问题)

原latex文件为:

\documentclass[a4paper, UTF8, scheme=chinese, openany, titlepage, heading=true]{ctexart}
\ctexset{
    %以下4行, 在使用了\usepackage{babel}的时候, 会不生效, 有冲突
    bibname= 参考文献, %参考文献的大标题显示中文"参考文献"
    contentsname = 目录, %目录的大标题显示中文"目录"
    abstractname = 摘要, %摘要的大标题显示中文"摘要"
    figurename = 图, %图题显示中文"图"
    chapter/number = \arabic{chapter}, % 章节编号用阿拉伯数字
    chapter/beforeskip = 0pt, %章节标题与页面顶端的边距
    chapter/aftername=\hspace{10pt}, %章节名和title之间的距离
    section/format += \raggedright, %1级标题左对齐
    subsection/format += \raggedright, %2级标题左对齐
    subsubsection/format += \raggedright, %3级标题左对齐
    appendix/numbering = false %附录不要继续编号
}

\usepackage[dvipsnames,svgnames,x11names]{xcolor} %颜色定义宏包
\usepackage{geometry} %% 负责版面设计的宏包
\geometry{left=1cm,right=5.5cm,top=1cm,bottom=1.5cm} %让生成的PDF在右侧有足够的批注框进行显示
\usepackage[markup=underlined,commentmarkup=todo]{changes}
\definechangesauthor[name={Ma}, color=BrickRed]{Ma} %定义马老师批注颜色
\definechangesauthor[name={Xie},color=NavyBlue]{Xie} %定义解老师批注颜色

% Useful packages
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}

\title{Your Paper}
\author{You}

\begin{document}
\maketitle

\section{Introduction}

\added[id=Ma,comment="推动中澳关系持续健康稳定发展。双方可在此过程当中,通过建设性磋商平衡解决各自在经贸问题上的关切,共同造福两国人民。澳媒称"]{“澳大利亚贸易部长四年来首次访华,寻求贸易全面解冻”,据澳媒报道,应中国商务部邀请,澳大利亚贸易部长法瑞尔11日抵达北京,开始为期三天的访华行程,其间将与中国商务部部长王文涛举行会晤,并共同主持召开第16届中澳部长级经济联委会。中国外交部发言人汪文斌11日表示,中方愿同澳方一道落实好两国领导人达成的重要共识,增进互信、深化合作、妥处分歧,推动中澳关系持续健康稳定发展。双方可在此过程当中,通过建设性磋商平衡解决各自在经贸问题上的关切,共同造福两国人民。澳媒称,这是中澳两国最高贸易官员2019年以来的首次面对面会晤,也是堪培拉与最大贸易伙伴关系升温的又一迹象。澳大利亚中国工商业委员会主席戴维·奥尔森表示,与中国有业务往来的澳企“都希望看到两国关系恢复稳定”。与此同时,据澳媒报道,美国方面私下警告澳大利亚对华外交要谨慎,有学者提醒称,在政治上紧紧跟随美国,这会给未来的中澳经贸合作带来潜在的风险。}

\added[id=Ma,comment="推动中澳关系持续健康稳定发展。双方可在此过程当中,通过建设性磋商平衡解决各自在经贸问题上的关切,共同造福两国人民。澳媒称"]{China urged the European Union to value the overall state of mutual trust and cooperation between them, said the Ministry of Commerce.
Shu Jueting, the ministry's spokeswoman, made the remarks on Thursday in response to media reports that the European Union has proposed sanctions on seven Chinese companies that are accused of selling microelectronics and other products to Russia.
Shu said that China and Russia have engaged in normal economic and trade cooperation on the basis of mutual respect, mutual benefit and win-win outcomes.
The Chinese authorities have repeatedly clarified China's position on the Ukraine issue, stating that China will not add fuel to the fire or take advantage of the situation for its own benefit, Sht said.}

\bibliographystyle{alpha}
\bibliography{sample}

\end{document}

结果为: image

Sophanatprime commented 1 year ago

使用 XeLaTeX 时,加载 xeCJKfntef 宏包即可;使用 pdfLaTeX 时,加载 CJKfntef

muzimuzhi commented 1 year ago

使用 XeLaTeX 时,加载 xeCJKfntef 宏包即可;使用 pdfLaTeX 时,加载 CJKfntef

补个例子,有简化

% !TeX TS-program = xelatex
\documentclass{ctexart}
\usepackage{xeCJKfntef}
\usepackage{xcolor} %颜色定义宏包

\usepackage{geometry} %% 负责版面设计的宏包
\geometry{right=5cm, marginparwidth=3cm} %让生成的PDF在右侧有足够的批注框进行显示

\usepackage[markup=underlined,commentmarkup=todo]{changes}
\definechangesauthor[name={Ma}, color=red!70!black!80]{Ma} %定义马老师批注颜色

\begin{document}

\section{Introduction}

\added[id=Ma,comment=批注内容]{“澳大利亚贸易部长四年来首次访华,寻求贸易全面解冻”。
据澳媒报道,应中国商务部邀请,澳大利亚贸易部长法瑞尔11日抵达北京,开始为期三天的访华行程。}

\added[id=Ma,comment=批注内容]{China urged the European Union to value the
overall state of mutual trust and cooperation between them, said the Ministry
of Commerce.}

\end{document}

image

PS: 原始例子里,