GithubHelp home page GithubHelp logo

ctex-org / ctex-kit Goto Github PK

View Code? Open in Web Editor NEW
970.0 55.0 124.0 27.89 MB

Macro Packages and Scripts for Chinese TeX users

TeX 54.78% Makefile 0.08% C 8.20% Lua 36.59% Shell 0.02% Batchfile 0.07% Prolog 0.23% Perl 0.02%
latex ctex

ctex-kit's Introduction

CTeX-kit

CTeX-kit is a collection of TeX/LaTeX/ConTeXt macro packages, related scripts, and resource files made specifically for Chinese TeX users, especially Mandarin users.

This project aims to bring together many existing efforts including ctex, xeCJK, zhspacing, LuaTeX related Chinese support, etc.

It is maintained by CTeX community.

Our packages/collections on CTAN

Package/collection Version
CJKpunct CTAN
CTeX Collection CTAN
xCJK2uni CTAN
xeCJK CTAN
xpinyin CTAN
zhlineskip CTAN
zhmCJK CTAN
zhmetrics CTAN
zhmetrics-uptex CTAN
zhnumber CTAN
zhspacing CTAN

Build status

CTeX-kit uses Github Actions as a hosted continuous integration service. For each commit, CTeX-kit is tested using the current release of TeX Live on Ubuntu Linux, macOS and Windows.

Current build status
ctex-kit test

Copyright (C) 2003–2024 CTeX community.

ctex-kit's People

Contributors

aminophen avatar artoria2e5 avatar atxy-blip avatar dependabot[bot] avatar dieken avatar jjgod avatar jlhwung avatar josephwright avatar leo-liu avatar liam0205 avatar liyanrui avatar muzimuzhi avatar qinglee avatar ruixizhang42 avatar stone-zeng avatar tanukihee avatar zepinglee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ctex-kit's Issues

ctex 宏包(r224) 的 \CTEXsetup 对 chapter 有问题

Original issue 31 created by LeoLiu.PKU on 2010-05-12T05:09:04.000Z:

测试代码:
\documentclass{ctexbook}
\CTEXsetup[nameformat={\normalsize}]{chapter}
\CTEXsetup[numberformat={\normalsize}]{chapter}
\CTEXsetup[format={\normalsize}]{chapter}
\begin{document}
\chapter{foo}
\end{document}

章节名 foo 没有变化。

用于更新了一些宏包,CTeX无法正常工作

Original issue 20 created by JiangDZH on 2009-12-09T18:01:04.000Z:

更新了一些宏包,结果发现CTeX宏包无法正常工作,下面是出错信息片段:

... ...

("E:\MiKTeX\MiKTeX 2.8\tex\latex\ctex\engine\ctex-cjk-common.def")
("E:\MiKTeX\MiKTeX 2.8\tex\latex\ctex\fontset\ctex-xecjk-
winfonts.def"Running miktex-makemf.exe...
miktex-makemf: The ICU source file could not be found.

Running hbf2gf.exe...

hbf2gf (CJK ver. 4.8.0)

Couldn't find `I.cfg'

miktex-maketfm: No creation rule for font ICU.

! Font @tempfontb=[simkai.ttf]/ICU at 10.0pt not loadable: Metric (TFM)
file o
r installed font not found.
\zf@make@font@shapes ...f@suffix " at \f@size pt
\edef @tempb {\fontname
...
l.5 {SimSun}

?

出问题的CTeX版本是 2009/10/20 v0.95,XeTeX, 版本 3.1415926-2.2-0.9995.1
(MiKTeX 2.8),Windows系统

用于测试的文件很简单,如下
\documentclass[12pt]{ctexart}
\begin{document}
中文宏包测试
\end{document}

另外,如果采用直接使用xecjk的方式却可以编译成功,测试文件如下
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont[BoldFont=SimHei,ItalicFont=SimHei]{SimSun}
\begin{document}
中文测试
\end{document}

谢谢!

建议按照TDS来组织svn中每个项目的结构

Original issue 12 created by yuleopen on 2009-07-09T16:30:32.000Z:

而不要通过makefile来实现. 这样方便开发和维护.
(当然, 项目和项目的TDS是分开维护, 自成一体的, 我指的是单独的项目维持TDS的结构)
这样需要提交某个包, 只要check下来右键添加为压缩档, 就能够直接交给ctan了.
对用户和开发者来说, 由于是tds的, 复制粘贴到texmf树就能测试和使用, 也方便.

合并ctex-kit和ctex-doc

Original issue 13 created by yuleopen on 2009-07-09T16:40:28.000Z:

既然目前又允许把pdf等二进制文件重新回归svn管理, 我个人认为当初jjgod再搞出个ctex-doc意义不大, 也不
利于用户的搜索. 我个人建议统一把它放在一个svn管理. ctan上好说, 已提交的包裹到时候肯定会重复提交, 届
时我们改readme就好.

至于jjgod当初说会导致svn目录树太大的问题, 我觉得多虑了, 整个目录树大是好事, 说明我们的成果多, 用户可
以分目录来checkout的, 反正每个包都是独立的.

xeCJK r230 的 CJKchecksingle 选项失效

Original issue 37 created by LeoLiu.PKU on 2010-10-30T17:42:35.000Z:

CJKchecksingle 失效。原因不明。
最小测试代码:
[code]\documentclass{minimal}
\usepackage[CJKchecksingle]{xeCJK}
\setCJKmainfont{SimSun}
\begin{document}
\hsize=30em
\parindent=0pt
一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一
\end{document}[/code]

环境:TL2010,fontspec 2.1b,xeCJK 2.3.15

参看:
http://bbs.ctex.org/viewthread.php?tid=40232&page=67&fromuid=56635#pid392460

beamer + ctex 宏包用 CJK 方式的支持

Original issue 38 created by LeoLiu.PKU on 2010-11-03T18:09:45.000Z:

不加 CJK 选项可以使用汉字。但 GBK 编码不能在导言区使用汉字。
测试代码:
% !TeX encoding = System
\documentclass{beamer}
\usepackage[GBK,noindent]{ctex}
\ifxetex
\XeTeXinputencoding "GBK"
\fi
\title{测试}
\author{某某}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{测试}
测试测试测试
\end{frame}
\end{document}
xelatex 编译无误,pdflatex 会报错。把 \title 等移支 document 环境内可解决。

另外,CJK 方式下,ctex 使用 \begin{CJK*}{GBK/UTF8}{rm} 设置初始字体。但 beamer 中一般默认使用无衬线体,对应于黑体或圆体。或许 ctex 宏包也应该增加一个选项,默认使用 sffamily?

ctex xelatex conflict

Original issue 34 created by charley792 on 2010-07-24T11:07:25.000Z:

I am using texlive 2009 in Fedora, and I have just installed ctex by svn.


\documentclass[winfonts,UTF8,cs4size,a4paper,fancyhdr,fntef]{ctexart}
\usepackage[xetex]{hyperref}
\begin{document}
......
\end{document}


! LaTeX Error: Unknown option normalindentfirst' for packagefontspec'.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.

r215: zhspacing 的 plain TeX 部分坏掉了

Original issue 25 created by LeoLiu.PKU on 2010-02-01T16:03:04.000Z:

事实上是 r132,自此 zhspacing 就没有变化过。

这个版本,包括进入 TeX Live 2009 的版本,支持 LaTeX 格式没有问题,但使用
Plain TeX 格式会出错。具体原因还不清楚。回归 yindian 的原始版本,则 Plain
TeX 可正常编译。

从 yindian 的原始版本(http://code.google.com/p/zhspacing/)到 ctex-kit
中,主要的修改是加了 ConTeXt 支持,不过这部分内容是实验性质的,后来似乎也就
忽略了。结果遗留了问题。

自 xeCJK 比较完善以后,现在这个宏包好像是整个被忽略了。目前来看 zhspacing
更适宜作为一个 Plain TeX 的宏包,因而这个 BUG 也就比较重要了。

让 xeCJK 可以修改默认字体族,并修改定义字体族的方式

Original issue 50 created by LeoLiu.PKU on 2011-05-19T15:44:36.000Z:

为 xeCJK 增加 \familydefault、\rmdefault、\sfdefault、\ttdefault 的对应物:
\CJKfamilydefault、\CJKrmdefault、\CJKsfdefault、\CJKttdefault

这样可以通过重定义:
\renewcommand\CJKfamilydefault{\CJKsfdefault}
完成 \normalfont 意义的转变。

现状:

使用 rm、sf、tt 作为三个特殊 CJK 字体族名,对应于三种字体。缺少改变 \normalfont 意义的能力。

\CJKfamily 兼容 CJK 时代的语法,但与 fontspec 的语法不同。后者使用的是 \newfontfamily\song{SimSun} 这样的语法,而 \f@family 即字体族名则是自动命名的,为 SimSun(0) 之类。

历史:

传统 NFSS 使用 \fontfamily{...}\selectfont 选择字体族。并定义 \rmfaily 为 \fontfamily{\rmdefault}\selectfont 等等,从而重定义 \rmdefault (如改为 ptm)就可以改变正文字体。

CJK 使用传统 NFSS 机制,\CJKfamily{...} 对应于 \fontfamily{...}\selectfont。而字体族、字形定义等工作则与传统 NFSS 大体一致。但 CJK 也缺少对 \rmfamily 等命令的修正。修改字体依赖直接 \CJKfamily 或 CJK 环境。

fontspec 更新了 NFSS 机制。字体族定义在 \newfontfamily、\setmainfont 等命令时完成,字体族名是由定义时 fontconfig 的族名去掉空格加上编号自动生成的,同时对 \rmdefault 等命令重定义。但此时手工修改 \rmdefault 之类的命令意义已不明显。

方案及问题:

一、
增加 \CJKfamilydefault,可以将其重定义为 \CJKrmdefault、\CJKsfdefault、\CJKttdefault 或自定义的 CJK family 来完成。
增加 \CJKrmfamily、\CJKsffamily、\CJKttfamily 并缺省为 rm、sf、tt。
不改变 \setCJKfamilyfont 的机制。不在字体定义时自动生成 CJK 字体族名。

此方案行为与 fontspec 不同。好处是可以使重定义 \CJKrmdefault 等命令有实际意义,而 fontspec 中由于字体族名不透明,难以重定义 \rmdefault。

二、
全面照搬 fontspec 的行为模式,自动由 fontconfig 族名生成 CJK 字体族名(读取 fontspec 产生的 \f@family),并赋给 \CJKrmfamily 等。不再使用 rm、sf、tt 这样的缺省名称。
增加 \CJKnewfontfamily,与 \newfontfamily 对应。

此方案可能造成以前依赖 rm、sf、tt 名称的个别文档不兼容。实现比方案一略复杂。

目前倾向于方案一。

ctex包的问题

Original issue 19 created by [email protected] on 2009-11-29T03:18:11.000Z:

最近更新了些宏包,具体记不清了,最简单的文件就出现以下错误

(f:/MTeX/utils/xetex/tex/xelatex/euenc/eu1enc.def)
(f:/MTeX/utils/xetex/tex/xelatex/euenc/lm/eu1lmr.fd)kpathsea: Invalid
fontname `
[lmroman10-regular]', contains '['

! Font EU1/lmr/m/n/10=[lmroman10-regular]:mapping=tex-text at 10.0pt
not loadab
le: Metric (TFM) file or installed font not found.
<to be read again>
relax
l.61 \fontencoding\encodingdefault\selectfont

最简单的文件就是
\documentclass{article}
\usepackage{xeCJK}
\begin{document}abc
\end{document}

ctex+xelatex在使用enumerate出现编号错误

Original issue 49 created by srayu.ws on 2011-05-04T18:08:14.000Z:

测试代码
\documentclass[a4paper]{article}
\usepackage[UTF8]{ctex}

\begin{document}

\begin{enumerate}
\item hello
\item world
\item wtf
\end{enumerate}

\end{document}

用xelatex编译以后的结果
1 hello
world
3 wtf

简单的说,就是2的编号掉了……

xelatex的版本是
This is XeTeX, Version 3.1415926-2.2-0.9997.4 (MiKTeX 2.9)

windows系统(好吧,都miktex了是吧……)

如果将编译程序改成pdflatex 或者 不使用ctex包
都能正确的输出2……

ctex 宏包的 fd 档不准确

Original issue 24 created by LeoLiu.PKU on 2010-01-09T06:57:26.000Z:

对于 winfonts,现在的版本似乎是使用 zhmetrics 的字体定义,即 zhsong、zhhei
等等,见 ctex/fontset/ctex-cjk-winfonts.def。
但在 ctex/fd/ 中 rm、sf、tt 的定义,还使用 gbksong、unisong 等,不一致。

强烈建议去除对商业字体的应用

Original issue 30 created by ptpt52 on 2010-04-16T07:05:29.000Z:

ctex 默认引用中易的六款字体或Adobe的四款字体,对这些商业字体的引用似乎不太
合法,建议去除,或者是改成选项让用户自己选择。建议添加一组开源字体,例如名
为 unixfonts,设置可参考这样:
% ctex-xecjk-unixfonts.def: Unix 的 xeCJK 字体设置
% vim:ft=tex

\setCJKmainfont[BoldFont={WenQuanYi Zen Hei},ItalicFont={AR PL UKai CN}]
{AR PL SungtiL GB}
\setCJKsansfont{WenQuanYi Zen Hei}
\setCJKmonofont{AR PL UMing CN}

\setCJKfamilyfont{zhsong}{AR PL SungtiL GB}
\setCJKfamilyfont{zhhei}{WenQuanYi Zen Hei}
\setCJKfamilyfont{zhkai}{AR PL KaitiM GB}
\setCJKfamilyfont{zhfs}{AR PL UMing CN}
\setCJKfamilyfont{zhli}{WenQuanYi Zen Hei Mono}
\setCJKfamilyfont{zhyou}{AR PL SungtiL GB}

\setCJKfamilyfont{wqy}{WenQuanYi Zen Hei}
\setCJKfamilyfont{uming}{AR PL UMing CN}
\setCJKfamilyfont{ukai}{AR PL UKai CN}
\setCJKfamilyfont{kaitim}{AR PL KaitiM GB}
\setCJKfamilyfont{sungtil}{AR PL SungtiL GB}

\newcommand_{\wqy}{\CJKfamily{wqy}} % 文泉驿正黑
\newcommand_{\uming}{\CJKfamily{uming}} % AR PL UMing CN
\newcommand_{\ukai}{\CJKfamily{ukai}} % AR PL UKai CN
\newcommand_{\kaitim}{\CJKfamily{kaitim}} % 文鼎PL简中楷
\newcommand*{\sungtil}{\CJKfamily{sungtil}} % 文鼎PL简报宋

\newcommand_{\songti}{\CJKfamily{zhsong}} % 宋体
\newcommand_{\heiti}{\CJKfamily{zhhei}} % 黑体
\newcommand_{\kaishu}{\CJKfamily{zhkai}} % 楷书
\newcommand_{\fangsong}{\CJKfamily{zhfs}} % 仿宋
\newcommand_{\lishu}{\CJKfamily{zhli}} % 隶书
\newcommand_{\youyuan}{\CJKfamily{zhyou}} % 幼圆

\endinput

并且建议默认设置成为 nofonts
对商业字体的引用可能会导致Texlive官方将ctex包从Texlive中移除,请作者慎重考虑

报告ctex宏包的两个问题

Original issue 29 created by [email protected] on 2010-04-07T08:35:00.000Z:

第一个,不显示外国人名的间隔号
\PassOptionsToPackage{cm-default}{fontspec}
\documentclass{ctexart}
\setCJKmainfont{Adobe Song Std}
\begin{document}
比尔·盖茨
\end{document}

第二个,并列选项设置之前使用了加号,则后面的设置全部作废
\CTEXsetup[number={\arabic{subsection})},
format+={\zihao{5}},
beforeskip={1 bp},
afterskip={1bp}]{subsection}
得到的beforeskip仍然是默认的(比较大的)间距,因为之前的format使用了加号(如果不使
用,则没问题)

mactex 2009 中似乎缺少 "製作 CJKpunct.spa 文件" 之解釋

Original issue 27 created by andrew.43 on 2010-02-22T17:04:48.000Z:

各位先進大家好.

小弟在 mactex 2008 及 2009 上使用 xecjk package.
在 2009 中, xecjk 是被收錄的, 但卻對 "製作 CJKpunct.spa 文件" 著墨不多.
我的意思是, 我從 xecjk manual 的得知我需自行製作 CJKpunct.spa,
但我在 mactex 2009 中完全找不到 xecjksetpunct-main.tex 此製作 CJKpunct.spa
的檔案.

我反倒需要到此下載完整的 setpunct 相關檔案以製作 CJKpunct.spa.
而 manual 中也沒有提供完整的下載網址.

這對初次欲製作 CJKpunct.spa 的朋友可能不夠友善.

抖膽在此提出此疑問, 也不知道是 texlive 還是 mactex 的問題.
若此處不適合發表這項疑問, 請多多指教何處較為適當發表, 我會再到適當之處提出
此問題.

cjkfonts怎被去掉了?

Original issue 21 created by e1212dison on 2009-12-20T13:05:14.000Z:

“v0.95 2009/10/20 移除对CJKnumb 宏包的依赖。 去除无用的cjkfonts 选项,以
winfonts作为默认值。” from ctex 宏包说明 ctex.org∗ 版本号:v0.96 修改日
期:2009/11/24

cjkfonts无用吗?这相当有用啊,它实际上提供了一个用户自定义字体的接口,去除
cjkfonts就不能配置其他的字体了!!建议各位老大加上cjkfonts吧!

比如我使用的是方正的字体,opensuse自带的,
要使用方正字体很简单,改ctex-xecjk-cjkfonts.def
\input{ctex-xecjk-fzfonts.def}
\endinput
让其使用fzfonts,然后自己自己写一个ctex-xecjk-fzfonts.def,工作的很好。

这两天新装了一台机器,svn了ctex,没想到ctex-xecjk-cjkfonts.def没了,还以为
svn出错了,
看了更新日志才确定,cjkfonts真的没了,悲哀阿!!

无奈了,只能把adobe的字体配置文件手工改成fangzheng的了。
% ctex-xecjk-adobefonts.def: Adobe 的 xeCJK 字体设置,为 Adobe 的四套字体
% vim:ft=tex

%\setCJKmainfont[BoldFont=Adobe Heiti Std,ItalicFont=Adobe Kaiti Std]
% {Adobe Song Std}
%\setCJKsansfont{Adobe Heiti Std}
%\setCJKmonofont{Adobe Fangsong Std}

%\setCJKfamilyfont{zhsong}{Adobe Song Std}
%\setCJKfamilyfont{zhhei}{Adobe Heiti Std}
%\setCJKfamilyfont{zhfs}{Adobe Fangsong Std}
%\setCJKfamilyfont{zhkai}{Adobe Kaiti Std}

%\newcommand_{\songti}{\CJKfamily{zhsong}} % 宋体
%\newcommand_{\heiti}{\CJKfamily{zhhei}} % 黑体
%\newcommand_{\kaishu}{\CJKfamily{zhkai}} % 楷书
%\newcommand_{\fangsong}{\CJKfamily{zhfs}} % 仿宋
%\newcommand_{\lishu}{\CJKfamily{zhli}} % 隶书
%\newcommand_{\youyuan}{\CJKfamily{zhyou}} % 幼圆
%\endinput
% ctex-xecjk-fzfonts.def: 方正 的 xeCJK 字体设置,为 方正 的四套字体
% vim:ft=tex

\setCJKmainfont[BoldFont=FZHeiTi,ItalicFont=FZKaiTi]
{FZSongTi}
\setCJKsansfont{FZHeiTi}
\setCJKmonofont{FZFangSong}

\setCJKfamilyfont{zhsong}{FZSongTi}
\setCJKfamilyfont{zhhei}{FZHeiTi}
\setCJKfamilyfont{zhfs}{FZFangSong}
\setCJKfamilyfont{zhkai}{FZKaiTi}

\newcommand_{\songti}{\CJKfamily{zhsong}} % 宋体
\newcommand_{\heiti}{\CJKfamily{zhhei}} % 黑体
\newcommand_{\kaishu}{\CJKfamily{zhkai}} % 楷书
\newcommand_{\fangsong}{\CJKfamily{zhfs}} % 仿宋
\newcommand_{\lishu}{\CJKfamily{zhli}} % 隶书
\newcommand_{\youyuan}{\CJKfamily{zhyou}} % 幼圆

\endinput

xeCJK 的抄录环境汉字空格不对

Original issue 51 created by LeoLiu.PKU on 2011-05-19T17:54:29.000Z:

汉字与西文、公式之间的自动空格应该去掉。
标点压缩应取消。
字距(\CJKglue)应该取消。

此外打字机体的一个汉字最好能占英文等宽字体的两个字符宽。

基本代码已完成,待移植和文档编写。

使用 ctex 宏包的文档用 xelatex 编译时如果指定了 UTF8 选项,会导致书签乱码

Original issue 17 created by Yubao.Liu on 2009-09-10T18:11:29.000Z:

What steps will reproduce the problem?

  1. 安装 texlive 2009
  2. 下载 http://ctex-kit.googlecode.com/svn/trunk/templates/LaTeX/utf8.tex @153
  3. 准备 adobe 四款字体放入 ~/.fonts 下
  4. 使用 xelatex utf8 两遍来编译文档

What is the expected output? What do you see instead?
期望书签不乱码。但书签乱码了。

What version of the product are you using? On what operating system?
各个宏包的版本见 utf8.tex 末尾注释的说明,用今天 tlmgr update --all 更新后
问题依旧。

BTW: 如果 owner 设置不合适,请 jjgod 转交一下。

ctex 宏包 GBK 编码使用 pdflatex 或者 latex 编译失败

Original issue 18 created by Yubao.Liu on 2009-09-10T18:16:31.000Z:

What steps will reproduce the problem?

  1. 安装 texlive 2009
  2. 下载 http://ctex-kit.googlecode.com/svn/trunk/templates/LaTeX/gbk.tex @153
  3. pdflatex gbk 或者 latex gbk

What is the expected output? What do you see instead?
期望正常编译,但是编译失败:
kpathsea: Running mktexmf gbk51
! I can't find file `gbk51'.
<*> ...e:=ljfour; mag:=1; nonstopmode; input gbk51

Please type another input file name
! Emergency stop.
<*> ...e:=ljfour; mag:=1; nonstopmode; input gbk51

Transcript written on mfput.log.
grep: gbk51.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input
gbk51' failed to make gbk51.tfm.
kpathsea: Appending font creation commands to missfont.log.

! Font C19/song/m/n/15.06/51=gbk51 at 15.06pt not loadable: Metric (TFM) file n
ot found.
<to be read again>
relax
l.21 \tableofcontents

Please use labels and text to provide additional information.

使用 winfonts 而非 cjkfonts 即可编译通过。软件包信息见 gbk.tex 末尾
的注释,以及 http://www.newsmth.net/bbscon.php?bid=460&amp;id=290951

xeCJK 个别命令后接汉字会有多余的空格

Original issue 45 created by LeoLiu.PKU on 2011-02-26T16:28:25.000Z:

参看 ctex 论坛帖:http://bbs.ctex.org/viewthread.php?tid=62884

示例代码:
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{SimSun}
\begin{document}
\CJKsetecglue{}
中\textdollar 国
\end{document}

得到的结果是“中$ 国”,在“$”之后会多出一个空格。而前面的\CJKsetecglue置空无效果。如果用“中$国”,则前后都会多出空格,更不正常。
其他xunicode定义的符号命令也会受影响。如\textunderscore(和_)等。

目前的解决方案:
\normalspacedchars{$}
解决方案二:
中\mbox{\textdollar}国

问题出在 r181 中对 xeCJK 的修改,对 255 类到 1 类的状态转移,在一定情况下插入的是普通空格 @SPtoken

这部分代码未看懂。主要不明白xeCJK在此处状态转换的各种判断的意思,以及这里被改成普通空格的用意。

ctexbook 中 \backmatter 中每章的超链接失效

Original issue 36 created by LeoLiu.PKU on 2010-10-23T04:35:11.000Z:

测试代码:
\documentclass[hyperref]{ctexbook}
\begin{document}
\mainmatter
\chapter{1}
\chapter{2}
\backmatter
\chapter{A}
\chapter{B}
\end{document}

另注:book 类直接加 hyperref 无误。

可能是 ctex-book.def 中对 @chapter 的重定义造成的。在 hyperref 中也有对这个命令的重定义。

还没有细看。

每个目录Makefile的编辑

Original issue 9 created by yuleopen on 2009-05-24T09:44:07.000Z:

只要能产生文档的pdf文件,能够clean辅助文件,然后自动打成tar.gz的包即可。

\ziju 命令应该如何定义?

Original issue 1 created by gzjjgod on 2009-05-05T02:57:41.000Z:

正值 ctex 宏包要修改的时候,我把这个问题拿出来讨论。

在 ctex 0.8a 中,是这样定义的(503--506 行):

\newcommand*\ziju[1]{% 字距
\settowidth@tempdima{\CTEX@spaceChar}%
\renewcommand{\CJKglue}{\hskip # 1@tempdima}%
\CTEXsetfont}

就是把 \CJKglue 设置为若干倍的汉字宽度。

问题一:
设置的 \CJKglue 没有伸长收缩的量,只有一个固定的长度。结果就是,如果用设置了字距以后排版整段的
文字(超过一行),则会出现严重的盒子溢出之类的问题。
而事实上,对于给定的字距,怎么样大小的伸缩量是合适的,也不好确定。

问题二:
这个说是新版本的 CJKpunct 的问题。就是这个版本的 CJKpunct 把 \CJKglue 改成了 \CJKoglue,原来的
\CJKglue 被取消定义。但无论是裸 CJK 还是 xeCJK,仍使用 \CJKglue。因此这个 \ziju 命令就会在使用
CJKpunct 时出错。
这个问题我觉得比较好的办法是修改 CJKpunct 宏包。

让 xeCJK 分区管理 Ext-B、Ext-C 等区的汉字

Original issue 47 created by LeoLiu.PKU on 2011-04-18T16:53:39.000Z:

这个在 zhspacing 中已经完成,不过 xeCJK 没有实现。按现在 xeCJK 的结构可能需要许多代码,主要是新建一个 XeTeX 字符类,然后把第 1 类与其他类的 interchar tokens 复制到这一个类上,但改变其字体。zhspacing 好像是使用一个循环写的这部分代码,没仔细看过。

希望 zhmetrics 支持 tex4ht

Original issue 46 created by LeoLiu.PKU on 2011-03-17T11:47:40.000Z:

目前 TeX Live 2010 上的 tex4ht 的中文支持文件是李树钧等人做的,和现在的 zhmetrics 字体不匹配,而且似乎安装也有一些错误。

部分讨论见水木帖子:
http://www.newsmth.net/bbscon.php?bid=460&amp;id=305617

当前的问题和需要:
1、不知道为什么 c70song.fd 和 c19song.fd 使用的是 cyberb 和空 gbk 为名,而不是 gbksong 和 unisong 这样的名字?
2、为 tex4ht 编写生成 GBK 和 UTF8 编码 htf 文件的脚本。htf 文件就是一个纯文本的简单编码映射表,加上一行 css 设置,应该非常容易做(特别是 UTF-8 编码)。tex4ht 也支持 htf 文件的 alias 技术,因此文件也不是很大。

ctex宏包中使用CTEXsetup错误,bug?

Original issue 44 created by [email protected] on 2011-02-23T02:51:50.000Z:

Ubuntu 9.10
TeX Live 2010

Bug:

当使用ctex宏包时,这里说的是\usepackage{ctex}时,而不是使用\usepackage{ctex},
\CTEXoptions{}不能正常使用。例如: bug.tex


\documentclass{article}
\usepackage{ctex}

\title{ctex 功能测试}
\CTEXoptions[today=big]
\CTEXsetup[name={第,节},number={\chinese{section}},format+={\bfseries},beforeskip={-10ex plus -.1ex minus -.1ex},afterskip={1ex plus .1ex minus .1ex}]{section}

\begin{document}
\section{首先}
其实就是说一句首先
\section{其次}
其实就是说一句其次
\section{最后}
其实就是说一句最后
\end{document}


之后使用xelatex进行编译,xelatex bug.tex,出现错误:


! Package xkeyval Error: name' undefined in familiesCTEXsection'.

See the xkeyval package documentation for explanation.
Type H <return> for immediate help.
...

l.6 ...erskip={1ex plus .1ex minus .1ex}]{section}



ctex 宏包 GBK 编码的 XeTeX 支持

Original issue 39 created by LeoLiu.PKU on 2010-11-03T18:21:10.000Z:

目前是回避了的,因为造成的问题很多。
\XeTeXinputencoding 只适用于单文件;
\XeTeXdefaultencoding 可以影响所有 \input 得到的文件,但 XeTeX 写 toc、aux 时似乎仍使用 UTF8 编码,造成问题。这个是 XeTeX 的 BUG?

fontset/ctex-cjk-winfonts.def 中的 \input zhwinfonts 后应加扩展名 .sty

Original issue 22 created by tianlei.zhao on 2010-01-04T05:57:23.000Z:

问题描述:
如果使用 ctexart 文档类,用 latex 编译的时候,会报错,说找不到 zhwinfonts
文件。

一个最小的例子:
\documentclass[UTF8]{ctexart}
\begin{document}
测试文档。
\end{document}

latex 编译的时候报的错:

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
restricted \write18 enabled.
entering extended mode
(./test_ctex.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, pinyin, loaded.
(/usr/local/share/texmf/tex/latex/ctex/ctexart.cls
Document Class: ctexart 2009/11/24 v0.96 ctexart document class
...
...
(/usr/local/share/texmf/tex/latex/ctex/engine/ctex-cjk-common.def)
(/usr/local/share/texmf/tex/latex/ctex/fontset/ctex-cjk-winfonts.def
! I can't find file `zhwinfonts'.
l.5 \input zhwinfonts

(Press Enter to retry, or Control-D to exit)

解决方法:
将 fontset/ctex-cjk-winfonts.def 中的 \input zhwinfonts 后应加扩展名 .sty
之后,编译成功,排版输出亦正确。

cjkfonts 选项并不总能正确工作

Original issue 5 created by LeoLiu.PKU on 2009-05-23T10:20:35.000Z:

尤其是其中的 GBK 编码,之前只是改动了几处 fd 文件(而且改得也不对),看来并
不正确。(因为 GB 与 GBK 编码不能使用相同的 tfm)

这个不知道怎么改,我不会做字体映射……

ctex.cfg 中并不能正确修改字体设置

Original issue 6 created by LeoLiu.PKU on 2009-05-24T09:16:49.000Z:

示例文件的写法:

% ctexopts.cfg.template: set default options
% vim:ft=tex

\ExecuteOptions{winfonts}

\endinput

这样是不管用的。字体设置都是在很早就失效的,而且似乎不易在后面改掉。
可能需要更改引入 ctex.cfg 文件的时机,或者另行增加一个 cfg 文件。

关于 CJKpunct 包的三个问题。

Original issue 26 created by Jinsong.Zhao on 2010-02-19T06:45:17.000Z:

1)现在的 CJKpunct 包生成 CJKpunct.spa 时,与破折号相关的两个值均为 -1,这
样,在最后的文档中,破折号中间会断开,把它们改为 0 即可消除
(\punctstyle{plain} 除外)。

相应的 setpunct-marcos.tex 的修改如下(抄自 xeCJK 包中相关代码,呵呵……)

@@ -101,6 +101,9 @@
\fi
\cnta=-\temp@xwidth\relax
\advance\cnta 100\relax

  • \ifnum\cnta<0
  • \cnta=0\relax
  • \fi
    \edef\temp@xspace{\the\cnta}}

\long\def\getleftupdimen# 1%%BoundingBox: # 2 # 3 # 4 # 5 {

2)如果使用 \punctstyle{kaiming} 时,句号、感叹号与问号后面如果接右双引号
时,可以看到它们之间存在较大的间隙。如果把这个间隙放在右双引号后可能更好一
些。也就是说,当右双引号与表示一句话结束的句号、感叹号与问号组合在一起时,
减小它们之间的间距,而增大双引号与紧接其后的文字之间的间距。

3)我试图使用 \CJKpunctsetkern{。}{”}{0.1em} 调整句号与右双引号之间的间距
时,出现错误:

! Undefined control sequence.
\CJKpunctsetkern ...e @\CJK@enc @\CJKpunct@family
@kern\CJKpunct@pna @\CJKpu...
l.10 \CJKpunctsetkern{。}{”}{0.1em}

?

相应的源文件如下:

\documentclass{article}
\usepackage{CJK}
\usepackage{CJKpunct}
\begin{document}

\begin{CJK*}{GBK}{song}

\punctstyle{kaiming}
\CJKpunctsetkern{。}{”}{0.1em}

\verb+|+”。\verb+|+

\verb+|+。”\verb+|+

\end{CJK*}
\end{document}

ctex 宏包关于 hyperref 参数设定的问题

Original issue 40 created by LeoLiu.PKU on 2010-11-09T11:12:05.000Z:

xelatex使用的是空参数。
如下代码失败:
\documentclass[UTF8,hyperref]{ctexart}
\begin{document}
\section{汉字%}
\end{document}
产生的 .out 文件是:
\BOOKMARK [1][-]{section.1}{汉字%}{}% 1

如果没有汉字,改为 \section{%},则将产生:
\BOOKMARK [1][-]{section.1}{\045}{}% 1

如下代码成功:
\documentclass[UTF8,hyperref]{ctexart}
\begin{document}
\section{汉字%}
\end{document}
产生的 .out 文件是:
\BOOKMARK [1][-]{section.1}{\376\377\154\111\133\127\000\045}{}% 1

感觉上是 hyperref 的实现就有问题。不过似乎还是应该给 hyperref 加上 unicode 选项?

关于宏包中中文字体设置的一些考虑

Original issue 4 created by LeoLiu.PKU on 2009-05-08T10:39:27.000Z:

对于 XeTeX 引擎下的字体设置,现在是在 ctex-xetex-engine.sty 里面直接设成
Adobe 的四款,缺的圆、隶种用黑、楷补上。jjgod 的意思应该是让用户如有需要自
己修改这个文件。

这样做可能不大好。

并不是人人都有或愿意用 Adobe 的这四种字体,这样把设置直接写进宏包代码就要求
用户:要么得改宏包文件,这样比较复杂;要么就要装上这几种字体,但是不用,在
文档里面重新设置改回来,这样也得平白多读入一遍 Adobe 的字体,影响效率。

基于这个考虑,我想至少需要加一个 nozhfont 之类的选项,禁用这些字体设
置。(与 cm-default 对应)

还有一个考虑是,ctex 宏包到底应该提供多少种字体命令?

其实 ctex 宏包里面用到的,是四种字体:宋、仿宋、黑、楷——传统上这基本上也确
实是最基本的几种中文字体。而隶书和幼圆加入的原因主要是 CTeX 套装预装了这 6
种 CJK 字体。CTeX 套装这样设计大概也正是因为 Windows 有这前四种字体,Office
有后两种。

一台没有安装 Office 的 Windows 系统,是不能使用隶书和幼圆字体的;Adobe 字体
的问题也是这样,缺两种。

因此,我考虑是不是应该把我们定义的 \lishu、\youyuan 删去?CJK 用户仍然可以
使用 \CJKfamily 访问这两种字体,xeCJK 用户也完全不用面对两种假的字体。

除此而外还有一种办法是,给 xeCJK 宏包增加一个类似 \fontspec 的命令,能直接
使用字体而不声明一个 family,这样可以免去隶书、幼圆两种字体的声明,仅当使用
\lishu、\youyuan 命令的时候,才读入字体信息。

同时,我也犹豫对于 xeCJK 的字体设置,是不是应该默认使用中易的字体,而不是
Adobe 的字体——这样对于占大多数的 Windows 用户来说更不需要配置,得到的结果也
与 CJK 方式一致。

如果使用中易的字体,还有一个不得不面对的问题,就是对于 Vista、Win 7,楷体和
仿宋是 18030 编码的;而对于 XP 以下的版本,则仅是 GB2312 编码的——两种字体的
字体名不一样,似乎也很不容易无需配置地弄好。

Adobe 字体和中易字体等基本的方案,可以都做成选项,这样对用户更方便。

修改一些基于 list 的环境缩进

Original issue 3 created by LeoLiu.PKU on 2009-05-07T02:06:14.000Z:

在 list 环境中,\parindent 不起作用,起作用的是 \listparindent。

如 quotation,会把 \listparindent 设为 1.5em,不符合中文版式。此外
quotation 环境还会影响到基于它定义的 abstract 环境。

更进一步的工作可能需要对所有基于 list 的环境做相关的处理,使之符合中文版式。

(或许还应该减小默认的前后垂直间距)

已证实是 beamer 与 fontspec 相互作用的问题,与 ctex-kit 无关

Original issue 42 created by suxpert on 2010-12-17T07:28:08.000Z:

What steps will reproduce the problem?

  1. 经过接近两天的测试,得到如下最小重现方式:
    [code=LaTeX]
    \documentclass{beamer}
    \mode<presentation>{
    %%%%%% Some themes may cause lots warnings:
    \usetheme{Warsaw} % CambridgeUS, Copenhagen, Warsaw, etc.
    %%%%%% Some product less warnings:
    % \usetheme{Madrid} % Madrid, Ilmenau, Frankfurt, etc.
    %%%%%% And some do not product any warnings:
    % \usetheme{Singapore} % Singapore, default, etc.
    }
    % \usepackage{times}
    % Will change the font, solve the `OT1/cmss/m/n' warning.
    % The warnings can disappear by loading zhspacing or xeCJK. I don't know why.

\usepackage{zhspacing}
% \usepackage{xeCJK}

% \setsansfont{Arial}
% Change the Beamer default font will [partly?] solve the problem.

\title{\LaTeX{} Beamer example}
\subtitle{Use \LaTeX{} to produce slide}
\author{A \TeX er}
% \date{}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section{Section}
\subsection{Subsection}
\begin{frame}
{Frame}
Blah blah blah blah.
\end{frame}

\end{document}
[/code]
2. 将上述文件保存为utf8编码的纯文本文件,比如foo.tex;
3. 通过命令行或者任何您喜欢的方式,执行xelatex foo.tex;
4. 【可选的】将上述文件中的zhspacing换成xeCJK,执行xelatex foo;将Warsaw主题换成别的主题,执行xelatex foo;以及其他的测试。

What is the expected output? What do you see instead?
我们期望的是没有意外,也就是这样一个简单的文件(大量使用默认设置)应该可以顺利通过,并正确生成foo.pdf。然而,在执行过程中,XeTeX会输出大量警告:
** WARNING ** Annotation out of page boundary.
** WARNING ** Current page's MediaBox: [0 0 362.835 272.126]
** WARNING ** Annotation: [153.48 264.278 172.913 273.053]
** WARNING ** Maybe incorrect paper size specified.
类似上述信息,四行为一组,若干组。虽然在最终的pdf中没有明显可见的异常。

What version of the product are you using? On what operating system?
我使用的是MiKTeX Portable 2.8:
MiKTeX-XeTeX 2.8.3758 (0.9995.1 texlive svn 15079) (MiKTeX 2.8)
zhspacing、xeCJK等宏包是在使用过程中从MiKTeX源自动下载到的,zhspacing.sty中History有090720行,xeCJK.sty中有`version 2.3.15 (31-May-2010)'行。

OS: Windows XP en with SP3.

Please provide any additional information below.
在豆瓣小组上的一帖:http://www.douban.com/group/topic/16416725/
测试zhspacing时还遇到这么一个(跟这个关系不大的)问题:http://code.google.com/p/zhspacing/issues/detail?id=14
从警告信息搜索到的已知问题(关于dvipdfmx):https://bitbucket.org/rivanvx/beamer/issue/29/x-dvipdfmx-produces-annotation-out-of-page-boundary-warnings-on-beamer
http://www.tug.org/pipermail/xetex/2008-April/009254.html 以及后面的若干跟帖;

虽然这个号称是dvipdfmx Bug的问题,输出信息跟我看到的信息是一样的,而且也是从xelatex -no-pdf然后xdvipdfmx分步运行的结果是第二步出现警告,但是我总觉得跟beamer同zhspacing或者xeCJK之间是有关联的。在源文件中我已经标注了一些,下面是若干解释:

1、有些主题会出现较多警告,有些一般,有些没有。以一般的为标准,主要出现在\section等地方出现英文处,这种警告有时候也能通过在英文处单独修改字体(比如\tt之类)而消失(时间关系,还没有找到重现方法);较多警告的原因可能在于\LaTeX这种东西,去掉后警告会变少;
2、times宏包是另一个问题,可能跟这个主题无关。可以用于去掉那个字体警告,zhspacing或者xeCJK有去掉这个字体警告的副作用(所以我怀疑是否它们都修改了默认字体,初学者,没本事追踪进去);
3、在zhspacing或者xeCJK加载之后,修改默认无衬线字体能够(部分的?)解决这些警告,测试过程中这一招很有效;
4、(没找到确定的重现方式)如果section之类全都是汉字,不会出现警告;
5、(不直接相关问题)在单独使用times宏包时跟times后加载zhspacing或者xeCJK宏包得到的pdf文件中,英文字体不同。具体表现是,载入zhspacing或者xeCJK之前加载times默认字体跟直接不加载times视觉效果是一样的,当然之后加载会将字体变成罗马字体。

因此我的感觉是,极有可能因为zhspacing或者xeCJK要进行中英文字体切换时,由于某些字体的特殊、Beamer包中的infolines等部件的定义等导致的这个warning。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.