├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ └── test.yml ├── .gitignore ├── CJKpunct ├── CJKpunct.dtx ├── CJKpunct.spa ├── build.lua ├── examples │ ├── example-CJKfntef.tex │ ├── example-gb.tex │ ├── example-gbk.tex │ └── example-utf8.tex └── setpunct │ ├── README.txt │ ├── setpunct-macros.tex │ └── setpunct-main.tex ├── README.md ├── ctan.lua ├── ctex ├── build.lua ├── ctex.dtx ├── ctexpunct.spa └── test │ ├── config-cmap.lua │ ├── config-contrib.lua │ ├── support │ ├── basic-body.tex │ ├── beamer-body.tex │ ├── cleveref-body.tex │ ├── ctexopts.cfg │ ├── fontsize-body.tex │ ├── headings-skip-body.tex │ ├── linespread-body.tex │ ├── luaotfload.conf │ └── regression-test.cfg │ ├── testfiles-cmap │ ├── cmap-gbk.pvt │ ├── cmap-gbk.tpf │ ├── cmap-utf8.pvt │ └── cmap-utf8.tpf │ ├── testfiles-contrib │ ├── pkuthss.lvt │ ├── pkuthss.tlg │ ├── thuthesis.lvt │ └── thuthesis.tlg │ └── testfiles │ ├── backend.luatex.tlg │ ├── backend.lvt │ ├── backend.pdftex.tlg │ ├── backend.tlg │ ├── backend.uptex.tlg │ ├── basic01.luatex.tlg │ ├── basic01.lvt │ ├── basic01.pdftex.tlg │ ├── basic01.tlg │ ├── basic01.uptex.tlg │ ├── basic02.luatex.tlg │ ├── basic02.lvt │ ├── basic02.pdftex.tlg │ ├── basic02.tlg │ ├── basic02.uptex.tlg │ ├── basic03.luatex.tlg │ ├── basic03.lvt │ ├── basic03.pdftex.tlg │ ├── basic03.tlg │ ├── basic03.uptex.tlg │ ├── basic04.luatex.tlg │ ├── basic04.lvt │ ├── basic04.pdftex.tlg │ ├── basic04.tlg │ ├── basic04.uptex.tlg │ ├── basic05.luatex.tlg │ ├── basic05.lvt │ ├── basic05.pdftex.tlg │ ├── basic05.tlg │ ├── basic05.uptex.tlg │ ├── beamer01.luatex.tlg │ ├── beamer01.lvt │ ├── beamer01.pdftex.tlg │ ├── beamer01.tlg │ ├── beamer01.uptex.tlg │ ├── beamer02.luatex.tlg │ ├── beamer02.lvt │ ├── beamer02.pdftex.tlg │ ├── beamer02.tlg │ ├── beamer02.uptex.tlg │ ├── cleveref01.lvt │ ├── cleveref01.pdftex.tlg │ ├── cleveref01.tlg │ ├── cleveref02.lvt │ ├── cleveref02.pdftex.tlg │ ├── cleveref02.tlg │ ├── cleveref03.lvt │ ├── cleveref03.pdftex.tlg │ ├── cleveref03.tlg │ ├── ctexhook.lvt │ ├── ctexhook.tlg │ ├── ctexpatch.lvt │ ├── ctexpatch.tlg │ ├── fancyhdr01.lvt │ ├── fancyhdr01.pdftex.tlg │ ├── fancyhdr01.tlg │ ├── fancyhdr02.lvt │ ├── fancyhdr02.pdftex.tlg │ ├── fancyhdr02.tlg │ ├── fancyhdr03.lvt │ ├── fancyhdr03.pdftex.tlg │ ├── fancyhdr03.tlg │ ├── fancyhdr04.lvt │ ├── fancyhdr04.pdftex.tlg │ ├── fancyhdr04.tlg │ ├── files01.luatex.tlg │ ├── files01.lvt │ ├── files01.pdftex.tlg │ ├── files01.tlg │ ├── files01.uptex.tlg │ ├── files02.luatex.tlg │ ├── files02.lvt │ ├── files02.pdftex.tlg │ ├── files02.tlg │ ├── files02.uptex.tlg │ ├── fonts01.luatex.tlg │ ├── fonts01.lvt │ ├── fonts01.pdftex.tlg │ ├── fonts01.tlg │ ├── fonts01.uptex.tlg │ ├── fonts02.luatex.tlg │ ├── fonts02.lvt │ ├── fonts02.pdftex.tlg │ ├── fonts02.tlg │ ├── fonts02.uptex.tlg │ ├── fonts03.luatex.tlg │ ├── fonts03.lvt │ ├── fonts03.pdftex.tlg │ ├── fonts03.tlg │ ├── fonts03.uptex.tlg │ ├── fonts04.luatex.tlg │ ├── fonts04.lvt │ ├── fonts04.tlg │ ├── fontsize01.luatex.tlg │ ├── fontsize01.lvt │ ├── fontsize01.pdftex.tlg │ ├── fontsize01.tlg │ ├── fontsize01.uptex.tlg │ ├── fontsize02.luatex.tlg │ ├── fontsize02.lvt │ ├── fontsize02.pdftex.tlg │ ├── fontsize02.tlg │ ├── fontsize02.uptex.tlg │ ├── fontsize03.luatex.tlg │ ├── fontsize03.lvt │ ├── fontsize03.pdftex.tlg │ ├── fontsize03.tlg │ ├── fontsize03.uptex.tlg │ ├── fontsize04.luatex.tlg │ ├── fontsize04.lvt │ ├── fontsize04.pdftex.tlg │ ├── fontsize04.tlg │ ├── fontsize04.uptex.tlg │ ├── fontsize05.luatex.tlg │ ├── fontsize05.lvt │ ├── fontsize05.pdftex.tlg │ ├── fontsize05.tlg │ ├── fontsize05.uptex.tlg │ ├── github472-01.luatex.tlg │ ├── github472-01.lvt │ ├── github472-01.pdftex.tlg │ ├── github472-01.tlg │ ├── github472-01.uptex.tlg │ ├── github472-02.luatex.tlg │ ├── github472-02.lvt │ ├── github472-02.pdftex.tlg │ ├── github472-02.tlg │ ├── github472-02.uptex.tlg │ ├── github472-03.luatex.tlg │ ├── github472-03.lvt │ ├── github472-03.pdftex.tlg │ ├── github472-03.tlg │ ├── github472-03.uptex.tlg │ ├── github472-04.luatex.tlg │ ├── github472-04.lvt │ ├── github472-04.pdftex.tlg │ ├── github472-04.tlg │ ├── github472-04.uptex.tlg │ ├── header01.lvt │ ├── header01.pdftex.tlg │ ├── header01.tlg │ ├── header02.lvt │ ├── header02.pdftex.tlg │ ├── header02.tlg │ ├── header03.lvt │ ├── header03.pdftex.tlg │ ├── header03.tlg │ ├── header04.lvt │ ├── header04.pdftex.tlg │ ├── header04.tlg │ ├── heading01.luatex.tlg │ ├── heading01.lvt │ ├── heading01.pdftex.tlg │ ├── heading01.tlg │ ├── heading01.uptex.tlg │ ├── heading02.luatex.tlg │ ├── heading02.lvt │ ├── heading02.pdftex.tlg │ ├── heading02.tlg │ ├── heading02.uptex.tlg │ ├── heading03.luatex.tlg │ ├── heading03.lvt │ ├── heading03.pdftex.tlg │ ├── heading03.tlg │ ├── heading03.uptex.tlg │ ├── heading04.luatex.tlg │ ├── heading04.lvt │ ├── heading04.pdftex.tlg │ ├── heading04.tlg │ ├── heading04.uptex.tlg │ ├── heading05.luatex.tlg │ ├── heading05.lvt │ ├── heading05.pdftex.tlg │ ├── heading05.tlg │ ├── heading05.uptex.tlg │ ├── heading06.luatex.tlg │ ├── heading06.lvt │ ├── heading06.pdftex.tlg │ ├── heading06.tlg │ ├── heading06.uptex.tlg │ ├── heading07.luatex.tlg │ ├── heading07.lvt │ ├── heading07.pdftex.tlg │ ├── heading07.tlg │ ├── heading07.uptex.tlg │ ├── heading08.luatex.tlg │ ├── heading08.lvt │ ├── heading08.pdftex.tlg │ ├── heading08.tlg │ ├── heading08.uptex.tlg │ ├── heading09.luatex.tlg │ ├── heading09.lvt │ ├── heading09.pdftex.tlg │ ├── heading09.tlg │ ├── heading09.uptex.tlg │ ├── heading10.luatex.tlg │ ├── heading10.lvt │ ├── heading10.pdftex.tlg │ ├── heading10.tlg │ ├── heading10.uptex.tlg │ ├── heading11.luatex.tlg │ ├── heading11.lvt │ ├── heading11.pdftex.tlg │ ├── heading11.tlg │ ├── heading11.uptex.tlg │ ├── heading12.luatex.tlg │ ├── heading12.lvt │ ├── heading12.pdftex.tlg │ ├── heading12.tlg │ ├── heading12.uptex.tlg │ ├── heading13.luatex.tlg │ ├── heading13.lvt │ ├── heading13.pdftex.tlg │ ├── heading13.tlg │ ├── heading13.uptex.tlg │ ├── heading14.luatex.tlg │ ├── heading14.lvt │ ├── heading14.pdftex.tlg │ ├── heading14.tlg │ ├── heading14.uptex.tlg │ ├── hyperref-headings.lvt │ ├── hyperref-headings.tlg │ ├── hyperref-pdfstringdef01.lvt │ ├── hyperref-pdfstringdef01.tlg │ ├── hyperref-pdfstringdef01.uptex.tlg │ ├── hyperref-pdfstringdef02.lvt │ ├── hyperref-pdfstringdef02.pdftex.tlg │ ├── hyperref-pdfstringdef02.tlg │ ├── hyperref-pdfstringdef03.lvt │ ├── hyperref-pdfstringdef03.pdftex.tlg │ ├── hyperref-pdfstringdef03.tlg │ ├── indent.luatex.tlg │ ├── indent.lvt │ ├── indent.pdftex.tlg │ ├── indent.tlg │ ├── indent.uptex.tlg │ ├── koma-script.lvt │ ├── koma-script.tlg │ ├── koma-script.uptex.tlg │ ├── linespread01.luatex.tlg │ ├── linespread01.lvt │ ├── linespread01.pdftex.tlg │ ├── linespread01.tlg │ ├── linespread01.uptex.tlg │ ├── linespread02.luatex.tlg │ ├── linespread02.lvt │ ├── linespread02.pdftex.tlg │ ├── linespread02.tlg │ ├── linespread02.uptex.tlg │ ├── linespread03.luatex.tlg │ ├── linespread03.lvt │ ├── linespread03.pdftex.tlg │ ├── linespread03.tlg │ ├── linespread03.uptex.tlg │ ├── names.lvt │ ├── names.pdftex.tlg │ ├── names.tlg │ ├── punct.luatex.tlg │ ├── punct.lvt │ ├── punct.pdftex.tlg │ ├── punct.tlg │ ├── punct.uptex.tlg │ ├── space.luatex.tlg │ ├── space.lvt │ ├── space.pdftex.tlg │ ├── space.tlg │ ├── space.uptex.tlg │ ├── titlesec01.lvt │ ├── titlesec01.tlg │ ├── titlesec02.lvt │ ├── titlesec02.tlg │ ├── titlesec03.lvt │ ├── titlesec03.tlg │ ├── toc.luatex.tlg │ ├── toc.lvt │ ├── toc.pdftex.tlg │ ├── toc.tlg │ ├── toc.uptex.tlg │ ├── zhnumber.luatex.tlg │ ├── zhnumber.lvt │ ├── zhnumber.pdftex.tlg │ ├── zhnumber.tlg │ └── zhnumber.uptex.tlg ├── gbk2uni ├── Makefile ├── gbk2uni.c ├── gbk2uni.h └── gbk2uni.tex ├── gbkmac ├── c.tex ├── cjkmap.tex ├── gbkmac.tex └── readme.txt ├── jiazhu ├── build.lua └── jiazhu.dtx ├── support ├── build-config.lua ├── ctex-zhconv-index.lua ├── ctex-zhconv-make.lua ├── ctex-zhconv.lua ├── ctxdoc.cls ├── ctxdocstrip.tex └── dtxchecksum.lua ├── templates ├── ConTeXt-MkIV │ ├── t-simplefonts │ │ ├── readme.txt │ │ ├── t-simplefonts.lua │ │ ├── t-simplefonts.tex │ │ └── test.tex │ ├── t-zhfonts │ │ ├── readme.txt │ │ ├── t-zhfonts.tex │ │ └── test.tex │ ├── zhfonts-new │ │ ├── readme.txt │ │ ├── test.tex │ │ └── zhfonts.tex │ └── zhfonts │ │ ├── ch1.tex │ │ ├── ch2.tex │ │ ├── cover.tex │ │ ├── doc-env.tex │ │ ├── main.tex │ │ ├── readme.txt │ │ └── zhfonts.tex ├── LaTeX │ ├── Makefile │ ├── all.sh │ └── utf8.tex └── README ├── xCJK2uni ├── build.lua └── xCJK2uni.dtx ├── xeCJK ├── build.lua └── xeCJK.dtx ├── xpinyin ├── build.lua └── xpinyin.dtx ├── zh-luatex ├── test │ └── test.tex └── tex │ ├── scrp-zhpunc.lua │ └── zhluatex.tex ├── zhlineskip ├── CJKmetrics.pdf ├── Latinmetrics.pdf ├── README.md ├── zhlineskip-test.tex ├── zhlineskip.sty └── zhlineskip.tex ├── zhmetrics-uptex ├── README.md ├── build.lua ├── makemetrics.lua ├── upzhfandolfonts-test.tex ├── upzhfandolfonts.tex ├── upzhm-h.pl └── upzhm-v.pl ├── zhmetrics ├── CTeXFonts.lua ├── Make-zhmCJK.bat ├── README ├── build.lua ├── zhfd.lua ├── zhmCJK-addmap.pl ├── zhmCJK.dtx ├── zhmCJK.ins ├── zhmCJK.lua ├── zhmap.lua └── zhtfm.lua ├── zhnumber ├── build.lua └── zhnumber.dtx └── zhspacing ├── README.md ├── build.lua ├── t-zhspacing.tex ├── zhfont.sty ├── zhmath.sty ├── zhs-man.tex ├── zhsmyclass.sty ├── zhspacing-context-test.tex ├── zhspacing.sty ├── zhsusefulmacros.sty └── zhulem.sty /.gitattributes: -------------------------------------------------------------------------------- 1 | *.cfg linguist-language=tex 2 | *.lvt linguist-language=tex 3 | *.pvt linguist-language=tex 4 | 5 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot 2 | version: 2 3 | updates: 4 | 5 | - package-ecosystem: "github-actions" 6 | directory: "/" 7 | schedule: 8 | # Check for updates to GitHub Actions every week 9 | interval: "weekly" 10 | 11 | -------------------------------------------------------------------------------- /CJKpunct/CJKpunct.spa: -------------------------------------------------------------------------------- 1 | \relax 2 | -------------------------------------------------------------------------------- /CJKpunct/build.lua: -------------------------------------------------------------------------------- 1 | 2 | module = "cjkpunct" 3 | 4 | packtdszip = true 5 | 6 | gitverfiles = { } 7 | sourcefiles = {"CJKpunct.dtx", "CJKpunct.spa"} 8 | unpackfiles = {"CJKpunct.dtx"} 9 | installfiles = {"CJKpunct.sty", "CJKpunct.spa"} 10 | typesetfiles = {"CJKpunct.dtx"} 11 | unpackexe = "pdftex" 12 | typesetexe = "latex" 13 | 14 | dtxchecksum = dtxchecksum or { } 15 | dtxchecksum.exe = "latex" 16 | dtxchecksum.cfgfile = "ltxdoc.cfg" 17 | 18 | function doc_posthook() 19 | for _, i in pairs(typesetfiles) do 20 | local name = jobname(i) 21 | run(typesetdir, "dvipdfmx " .. name) 22 | cp(name .. ".pdf", typesetdir, currentdir) 23 | end 24 | end 25 | 26 | function copyctan_posthook() 27 | local ctandir = ctandir .. "/" .. ctanpkg 28 | local docdir = tdsdir .. "/doc/" .. moduledir 29 | cp("examples", currentdir, ctandir) 30 | cp("examples", currentdir, docdir) 31 | cp("setpunct", currentdir, ctandir) 32 | cp("setpunct", currentdir, docdir) 33 | end 34 | 35 | 36 | dofile("../support/build-config.lua") 37 | -------------------------------------------------------------------------------- /CJKpunct/examples/example-CJKfntef.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/CJKpunct/examples/example-CJKfntef.tex -------------------------------------------------------------------------------- /CJKpunct/examples/example-gb.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/CJKpunct/examples/example-gb.tex -------------------------------------------------------------------------------- /CJKpunct/examples/example-gbk.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/CJKpunct/examples/example-gbk.tex -------------------------------------------------------------------------------- /CJKpunct/examples/example-utf8.tex: -------------------------------------------------------------------------------- 1 | % -*- coding: utf-8 -*- 2 | \documentclass{article} 3 | \usepackage{CJKutf8} 4 | \usepackage{CJKpunct} 5 | 6 | 7 | \begin{document} 8 | 9 | \begin{CJK*}{UTF8}{gbsn} 10 | \parindent 2em 11 | 12 | 13 | \long\def\sometexts{ 14 | 话说宝玉来至院外,就有跟贾政的几个小厮上来拦腰抱住, 都说:“今儿亏我们, 老爷才喜欢,老太太打发人出来问了几遍,都亏我们回说喜欢,不然,若老太太叫 15 | 你进去,就不得展才了。人人都说,你才那些诗比世人的都强。今儿得了这样的彩头。 该赏我们了。”宝玉笑道:“每人一吊钱。”众人道:“谁没见那一吊钱!把这荷包赏了罢。” 说着,一个上来解荷包, 那一个就解扇囊,不容分说,将宝玉所佩之物尽行解去。 又道:“好生送上去,罢。”一个抱了起来,几个围绕,送至贾母二门前。 16 | 那时贾母已命人看了几次。 众奶娘丫鬟跟上来,见过贾母,知不曾难为着他,心中自是欢喜。 17 | 18 | 少时袭人倒了茶来,见身边佩物一件无存, 19 | 因笑道:“带的东西又是那起没脸的东西们解了去了。”林黛玉听说,走来瞧瞧, 20 | 果然一件无存,因向宝玉道:“我给的那个荷包也给他们了?你明儿再想我的东西, 21 | 可不能够了!”说毕,赌气回房,将前日宝玉所烦他作的那个香袋儿——才做了一 22 | 半——赌气拿过来就铰。 宝玉见他生气,便知不妥, 忙赶过来,早剪破了。宝玉已见过这香囊,虽尚未完,却十分精巧,费了许多工夫。 23 | 今见无故剪了, 却也可气。因忙把衣领解了,从里面红袄襟上将黛玉所给的那荷包解了下来, 递与黛玉瞧道:“你瞧瞧,这是什么!我那一回把你的东西给人了?” 24 | 林黛玉见他如此珍重,带在里面,可知是怕人拿去之意,因此又自悔莽撞, 25 | 未见皂白,就剪了香袋。因此又愧又气,低头一言不发。宝玉道:“你也不 26 | 用剪,我知道你是懒待给我东西。我连这荷包奉还,何如?”说着,掷向他怀 27 | 中便走。黛玉见如此,越发气起来,声咽气堵,又汪汪的滚下泪来,拿起荷包 28 | 来又剪。宝玉见他如此,忙回身抢住,笑道:“好妹妹,饶了他罢!” 黛玉将剪子一摔,拭泪说道:“你不用同我好一阵歹一阵的,要恼,就撂开手。 29 | 这当了什么。”说着,赌气上床,面向里倒下拭泪。禁不住宝玉上来“妹妹”长“妹妹”短赔不是。 30 | 31 | 前面贾母一片声找宝玉。众奶娘丫鬟们忙回说:“在林姑娘房里呢。”贾母听 32 | 说道:“好,好,好!让他姊妹们一处顽顽罢。才他老子拘了他这半天,让他开 33 | 心一会子罢。只别叫他们拌嘴, 不许扭了他。”众人答应着。黛玉被宝玉缠不过,只得起 34 | 来道:“你的意思不叫我安生,我就离了你。”说着往外就走。宝玉笑道:“你到 35 | 那里,我跟到那里。”一面仍拿起荷包来带上,黛玉伸手抢道:“你说不要了,这 36 | 会子又带上,我也替你怪臊的!”说着,“嗤”的一声又笑了。宝玉道:“好妹妹, 37 | 明儿另替我作个香袋儿罢。”黛玉道:“那也只瞧我高兴罢了。”一面说,一面二人出 38 | 房,到王夫人上房中去了,可巧宝钗亦在那里。 39 | 40 | \hfill 41 | ——曹雪芹《红楼梦》\unkern\unkern 42 | } 43 | 44 | 45 | \long\def\showexample#1{\par------ #1 ------\par \punctstyle{#1}\sometexts} 46 | 47 | 48 | \showexample{quanjiao} 49 | 50 | 51 | \showexample{banjiao} 52 | 53 | \showexample{hangmobanjiao} 54 | 55 | \showexample{CCT} 56 | 57 | \showexample{kaiming} 58 | 59 | \showexample{plain} 60 | 61 | 62 | 63 | 64 | \end{CJK*} 65 | 66 | 67 | \end{document} 68 | 69 | -------------------------------------------------------------------------------- /CJKpunct/setpunct/README.txt: -------------------------------------------------------------------------------- 1 | 修改 CJKpunct.spa 2 | 3 | 打开文件 setpunct\setpunct-main.tex, 4 | 5 | 1. 根据操作系统修改 \ghostscript 的定义 6 | 7 | 2. 修改 \setpunctfamilies, 添加你所使用的CJKfamily 8 | 9 | 3. 对于miktex, 运行 10 | 11 | latex --enable-write18 setpunct-main 12 | 13 | 对于texlive, 运行 14 | 15 | latex --shell-escape setpunct-main 16 | 17 | 4. 把文件 CJKpunct.spa 复制到 CJKpunct.sty 所在文件夹, 然后运行 18 | 19 | Texhash 20 | 21 | ------ 安装完成 22 | -------------------------------------------------------------------------------- /CJKpunct/setpunct/setpunct-macros.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/CJKpunct/setpunct/setpunct-macros.tex -------------------------------------------------------------------------------- /CJKpunct/setpunct/setpunct-main.tex: -------------------------------------------------------------------------------- 1 | % Linux 2 | % 3 | %\def\ghostscript{gs -dBATCH -dEPSCrop -dNOPAUSE \space 4 | % -sDEVICE=bbox rubisha.pdf 2>rubishb.tex} 5 | 6 | % windows 7 | % 8 | \def\ghostscript{"gswin32c.exe -dBATCH -dEPSCrop -dNOPAUSE \space 9 | -sDEVICE=bbox rubisha.pdf 2>rubishb.tex"} 10 | 11 | 12 | \def\setpunctfamilies{ 13 | \CJKpunctsetfamily{song} 14 | \CJKpunctsetfamily{hei} 15 | \CJKpunctsetfamily{fs} 16 | \CJKpunctsetfamily{kai} 17 | \CJKpunctsetfamily{you} 18 | \CJKpunctsetfamily{li} 19 | } 20 | 21 | 22 | \input{setpunct-macros.tex} 23 | 24 | 25 | 26 | \endinput 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CTeX-kit 2 | 3 | CTeX-kit is a collection of TeX/LaTeX/ConTeXt macro packages, related scripts, 4 | and resource files made specifically for Chinese TeX users, especially 5 | Mandarin users. 6 | 7 | This project aims to bring together many existing efforts including `ctex`, 8 | `xeCJK`, `zhspacing`, LuaTeX related Chinese support, etc. 9 | 10 | It is maintained by [CTeX][ctex] community. 11 | 12 | [ctex]: http://www.ctex.org 13 | 14 | ## Our packages/collections on CTAN 15 | 16 | Package/collection | Version 17 | --------------------------------------- | ------- 18 | [CJKpunct][CJKpunct-ctan] | [![CTAN](https://img.shields.io/ctan/v/cjkpunct.svg)](https://ctan.org/pkg/cjkpunct) 19 | [CTeX Collection][ctex-collection-ctan] | [![CTAN](https://img.shields.io/ctan/v/ctex.svg)](https://ctan.org/pkg/ctex) 20 | [xCJK2uni][xCJK2uni-ctan] | [![CTAN](https://img.shields.io/ctan/v/xcjk2uni.svg)](https://ctan.org/pkg/xcjk2uni) 21 | [xeCJK][xeCJK-ctan] | [![CTAN](https://img.shields.io/ctan/v/xecjk.svg)](https://ctan.org/pkg/xecjk) 22 | [xpinyin][xpinyin-ctan] | [![CTAN](https://img.shields.io/ctan/v/xpinyin.svg)](https://ctan.org/pkg/xpinyin) 23 | [zhlineskip][zhlineskip-ctan] | [![CTAN](https://img.shields.io/ctan/v/zhlineskip.svg)](https://ctan.org/pkg/zhlineskip) 24 | [zhmCJK][zhmCJK-ctan] | [![CTAN](https://img.shields.io/ctan/v/zhmcjk.svg)](https://ctan.org/pkg/zhmcjk) 25 | [zhmetrics][zhmetrics-ctan] | [![CTAN](https://img.shields.io/ctan/v/zhmetrics.svg)](https://ctan.org/pkg/zhmetrics) 26 | [zhmetrics-uptex][zhmetrics-uptex-ctan] | [![CTAN](https://img.shields.io/ctan/v/zhmetrics-uptex.svg)](https://ctan.org/pkg/zhmetrics-uptex) 27 | [zhnumber][zhnumber-ctan] | [![CTAN](https://img.shields.io/ctan/v/zhnumber.svg)](https://ctan.org/pkg/zhnumber) 28 | [zhspacing][zhspacing-ctan] | [![CTAN](https://img.shields.io/ctan/v/zhspacing.svg)](https://ctan.org/pkg/zhspacing) 29 | 30 | [CJKpunct-ctan]: https://ctan.org/tex-archive/language/chinese/cjkpunct 31 | [ctex-collection-ctan]: https://ctan.org/tex-archive/language/chinese/ctex 32 | [xCJK2uni-ctan]: https://ctan.org/tex-archive/macros/latex/contrib/xcjk2uni 33 | [xeCJK-ctan]: https://ctan.org/tex-archive/macros/xetex/latex/xecjk 34 | [xpinyin-ctan]: https://ctan.org/tex-archive/macros/latex/contrib/xpinyin 35 | [zhlineskip-ctan]: https://ctan.org/tex-archive/language/chinese/zhlineskip 36 | [zhmCJK-ctan]: https://ctan.org/tex-archive/language/chinese/zhmcjk 37 | [zhmetrics-ctan]: https://ctan.org/tex-archive/fonts/psfonts/zhmetrics 38 | [zhmetrics-uptex-ctan]: https://ctan.org/tex-archive/fonts/zhmetrics-uptex 39 | [zhnumber-ctan]: https://ctan.org/tex-archive/macros/latex/contrib/zhnumber 40 | [zhspacing-ctan]: https://ctan.org/tex-archive/macros/xetex/generic/zhspacing 41 | 42 | ## Build status 43 | 44 | CTeX-kit uses [Github Actions](https://github.com/features/actions) as a hosted 45 | continuous integration service. For each commit, CTeX-kit is tested using the 46 | current release of TeX Live on Ubuntu Linux, macOS and Windows. 47 | 48 | | Current build status | 49 | |:--------------------:| 50 | | [![ctex-kit test](https://github.com/CTeX-org/ctex-kit/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/CTeX-org/ctex-kit/actions/workflows/test.yml?query=branch%3Amaster) | 51 | 52 | --- 53 | 54 | Copyright (C) 2003–2024 [CTeX][ctex] community. 55 | -------------------------------------------------------------------------------- /ctan.lua: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env texlua 2 | 3 | local ctex_kit = { 4 | "CJKpunct" , 5 | "ctex" , 6 | "xCJK2uni" , 7 | "xeCJK" , 8 | "xpinyin" , 9 | "zhmetrics" , 10 | "zhmetrics-uptex" , 11 | "zhnumber" , 12 | "zhspacing" , 13 | } 14 | 15 | local ctan = #arg > 0 and arg or ctex_kit 16 | 17 | for _, pkg in ipairs(ctan) do 18 | local currdir = lfs.currentdir() 19 | lfs.chdir(pkg) 20 | os.execute("l3build ctan") 21 | lfs.chdir(currdir) 22 | end 23 | -------------------------------------------------------------------------------- /ctex/build.lua: -------------------------------------------------------------------------------- 1 | 2 | module = "ctex" 3 | 4 | packtdszip = true 5 | 6 | sourcefiles = {"ctex.dtx", "ctexpunct.spa"} 7 | unpackfiles = {"ctex.dtx"} 8 | installfiles = {"*.sty", "*.cls", "*.clo", "*.def", "*.cfg", "*.fd", "ct*.tex", "zh*.tex", "*.dict", "*.ins", "*.lua"} 9 | unpacksuppfiles = {"ctex.id", "ctxdocstrip.tex", "ctex-zhconv.lua", "ctex-zhconv-index.lua"} 10 | typesetsuppfiles = {"ctxdoc.cls"} 11 | gitverfiles = {"ctex.dtx", "ctxdoc.cls"} 12 | 13 | tdslocations = { 14 | "source/latex/ctex/*-make.lua", 15 | "source/latex/ctex/*.ins", 16 | "tex/generic/ctex/zhmap/ctex-zhmap*.tex", 17 | "tex/generic/ctex/*.tex", 18 | "tex/latex/ctex/config/*.cfg", 19 | "tex/latex/ctex/fd/*.fd", 20 | "tex/latex/ctex/engine/ctex-engine-*.def", 21 | "tex/latex/ctex/fontset/ctex-fontset-*.def", 22 | "tex/latex/ctex/heading/ctex-heading-*.def", 23 | "tex/latex/ctex/scheme/ctex-scheme-*.def", 24 | "tex/latex/ctex/dictionary/*.dict", 25 | "tex/luatex/ctex/*.lua", 26 | } 27 | 28 | function unpack_posthook() 29 | if install_files_bool then 30 | for _,i in ipairs{"ctxdoc.cls", "ctxdocstrip.tex", "ctex-zhconv*.lua"} do 31 | cp(i, supportdir, unpackdir) 32 | end 33 | end 34 | end 35 | 36 | function copyctan_posthook() 37 | local dest = ctandir .. "/" .. ctanpkg 38 | for _,file in ipairs{"ctxdocstrip.tex", "ctex-zhconv.lua", "ctex-zhconv-make.lua"} do 39 | cp(file, unpackdir, dest) 40 | end 41 | end 42 | 43 | testfiledir = "./test/testfiles" 44 | testsuppdir = "./test/support" 45 | testdir = "./build/check" 46 | checkruns = 2 47 | stdengine = "xetex" 48 | checkdeps = {"../xeCJK","../zhnumber"} 49 | checkengines = {"pdftex", "xetex", "luatex", "uptex"} 50 | specialformats = {} 51 | specialformats.latex = { 52 | pdftex = {format = "latex"}, 53 | uptex = {binary = "euptex"} 54 | } 55 | 56 | checkinit_hook = function() 57 | for _,i in ipairs(checkdeps) do 58 | local unpackdir = i .. "/" .. unpackdir 59 | for _,i in ipairs(installfiles) do 60 | cp(i, unpackdir, testdir) 61 | end 62 | end 63 | return 0 64 | end 65 | 66 | dofile("../support/build-config.lua") 67 | -------------------------------------------------------------------------------- /ctex/test/config-cmap.lua: -------------------------------------------------------------------------------- 1 | 2 | testfiledir = "./test/testfiles-cmap" 3 | checkruns = 1 4 | stdengine = "pdftex" 5 | checkdeps = { } 6 | checkengines = {"pdftex"} 7 | 8 | specialformats = { } 9 | -------------------------------------------------------------------------------- /ctex/test/config-contrib.lua: -------------------------------------------------------------------------------- 1 | 2 | testfiledir = "./test/testfiles-contrib" 3 | checkruns = 3 4 | checkengines = {"xetex"} 5 | -------------------------------------------------------------------------------- /ctex/test/support/basic-body.tex: -------------------------------------------------------------------------------- 1 | \START 2 | 3 | \AUTHOR{Xiangdong Zeng} 4 | 5 | \loggingoutput 6 | 7 | \TEST{Basic text}{ 8 | 你好,\CTeX{}! 9 | \clearpage 10 | } 11 | 12 | \TEST{Muliple paragraphs}{ 13 | \CTeX{} 宏集是面向中文排版的通用 \LaTeX{} 排版框架,为中文 \LaTeX{} 文档 14 | 提供了汉字输出支持、标点压缩、字体字号命令、标题文字汉化、中文版式调整、数字 15 | 日期转换等支持功能,可适应论文、报告、书籍、幻灯片等不同类型的中文文档。 16 | 17 | \CTeX{} 宏集支持 LaTeX、pdfLaTeX、XeLaTeX、LuaLaTeX、upLaTeX 等多种不同的编译 18 | 方式,并为它们提供了统一的界面。主要功能由宏包 ctex 和中文文档类 ctexart、 19 | ctexrep、ctexbook 和 ctexbeamer 实现。 20 | 21 | \clearpage 22 | } 23 | 24 | \TEST{Mathematical typesetting}{ 25 | 勾股定理:直角三角形斜边的平方等于两腰的平方和。 26 | 27 | 可以用符号语言表述为:设直角三角形 $ABC$,其中 $\angle C = 90^\circ$,则有 28 | \[ a^2 + b^2 = c^2. \] 29 | 30 | \clearpage 31 | } 32 | 33 | \END 34 | -------------------------------------------------------------------------------- /ctex/test/support/beamer-body.tex: -------------------------------------------------------------------------------- 1 | \START 2 | 3 | \AUTHOR{Xiangdong Zeng} 4 | 5 | \AtBeginSection[]{ 6 | \begin{frame} 7 | \usebeamerfont{title} 8 | \insertsectionhead 9 | \end{frame} 10 | } 11 | 12 | \setbeamertemplate{navigation symbols}{} 13 | 14 | \OMIT 15 | \maketitle 16 | \TIMO 17 | 18 | \loggingoutput 19 | 20 | \TEST{Title page}{ 21 | \maketitle 22 | } 23 | 24 | \TEST{Muliple paragraphs}{ 25 | \begin{frame}{\CTeX{} 宏集} 26 | \CTeX{} 宏集是面向中文排版的通用 \LaTeX{} 排版框架,为中文 \LaTeX{} 文档 27 | 提供了汉字输出支持、标点压缩、字体字号命令、标题文字汉化、中文版式调整、数字 28 | 日期转换等支持功能,可适应论文、报告、书籍、幻灯片等不同类型的中文文档。 29 | 30 | \CTeX{} 宏集支持 LaTeX、pdfLaTeX、XeLaTeX、LuaLaTeX、upLaTeX 等多种不同的编译 31 | 方式,并为它们提供了统一的界面。主要功能由宏包 ctex 和中文文档类 ctexart、 32 | ctexrep、ctexbook 和 ctexbeamer 实现。 33 | \end{frame} 34 | } 35 | 36 | \TEST{Section}{ 37 | \section{测试} 38 | } 39 | 40 | \TEST{Theorem}{ 41 | \begin{frame}{勾股定理} 42 | \begin{theorem}[勾股定理] 43 | 直角三角形斜边的平方等于两腰的平方和。 44 | 45 | 可以用符号语言表述为:设直角三角形 $ABC$,其中 $\angle C = 90^\circ$,则有 46 | \[ a^2 + b^2 = c^2. \] 47 | \end{theorem} 48 | \end{frame} 49 | } 50 | 51 | \END 52 | -------------------------------------------------------------------------------- /ctex/test/support/cleveref-body.tex: -------------------------------------------------------------------------------- 1 | \START 2 | 3 | \AUTHOR{Qing Lee, Xiangdong Zeng} 4 | 5 | \makeatletter 6 | \ExplSyntaxOn 7 | 8 | \seq_set_map_x:NNn \l_tmpa_seq \c__ctex_headings_seq 9 | { 10 | \exp_not:c {#1} {#1} 11 | \exp_not:N \TIMO 12 | \exp_not:N \TEST {#1} 13 | { 14 | \tl_log:N \exp_not:N \@currentlabel 15 | \tl_log:N \exp_not:N \cref@currentlabel 16 | } 17 | \exp_not:N \OMIT 18 | } 19 | 20 | \cs_set_protected:Npx \TESTBODY 21 | { \seq_use:Nn \l_tmpa_seq { } } 22 | 23 | \ExplSyntaxOff 24 | \makeatother 25 | 26 | \OMIT 27 | \TESTBODY 28 | \appendix 29 | \TESTBODY 30 | \TIMO 31 | 32 | \END 33 | -------------------------------------------------------------------------------- /ctex/test/support/ctexopts.cfg: -------------------------------------------------------------------------------- 1 | %% 2 | %% File ctexopts.cfg 3 | %% 4 | \ProvidesExplFile{ctexopts.cfg}{}{}{ctex option for test} 5 | \keys_set:nn { ctex / option } { fontset = fandol } 6 | -------------------------------------------------------------------------------- /ctex/test/support/fontsize-body.tex: -------------------------------------------------------------------------------- 1 | \START 2 | 3 | \AUTHOR{Xiangdong Zeng} 4 | 5 | \ExplSyntaxOn 6 | 7 | \cs_if_exist:NTF \CTeX 8 | { \tl_set:Nn \TEST_text_tl { 中文排版~ABC~abc } } 9 | { \tl_set:Nn \TEST_text_tl { Awesome~\LaTeX{} } } 10 | 11 | \cs_new_protected:Npn \TEST:Nn #1#2 12 | { 13 | \clist_map_inline:nn {#2} 14 | { 15 | \group_begin: 16 | #1 {##1} 17 | \hbox_set:Nn \l_tmpa_box { \TEST_text_tl } 18 | \dim_log:n { \box_wd:N \l_tmpa_box } 19 | \dim_log:n { \box_ht:N \l_tmpa_box } 20 | \dim_log:n { \box_dp:N \l_tmpa_box } 21 | \cs_if_exist:NT \ccwd { \dim_log:N \ccwd } 22 | \group_end: 23 | } 24 | } 25 | 26 | \TEST{LaTeX~font~size~commands}{ 27 | \TEST:Nn \use:c 28 | { tiny, scriptsize, footnotesize, small, normalsize, large, Large, LARGE, huge, Huge } 29 | } 30 | 31 | \TEST{Command~`\zihao'}{ 32 | \TEST:Nn \zihao 33 | { 8, 7, -6, 6, -5, 5, -4, 4, -3, 3, -2, 2, -1, 1, -0, 0 } 34 | } 35 | 36 | \cs_if_exist:NT \ziju 37 | { 38 | \TEST{Command~`\ziju'}{ 39 | \TEST:Nn \ziju 40 | { -2, -1, -0.5, 0, 0.5, 1, 2, 4 } 41 | } 42 | } 43 | 44 | \ExplSyntaxOff 45 | 46 | \END 47 | -------------------------------------------------------------------------------- /ctex/test/support/linespread-body.tex: -------------------------------------------------------------------------------- 1 | \setbox0=\hbox{一行} % trigger font info 2 | 3 | \START 4 | 5 | \AUTHOR{Xiangdong Zeng} 6 | 7 | \loggingoutput 8 | 9 | \TEST{Lines}{% 10 | 一行\\两行\\三行% 11 | \clearpage 12 | } 13 | 14 | \TEST{Paragraphs}{% 15 | 一段\par 两段\par 三段% 16 | \clearpage 17 | } 18 | 19 | \END 20 | -------------------------------------------------------------------------------- /ctex/test/support/luaotfload.conf: -------------------------------------------------------------------------------- 1 | [run] 2 | log-level = -1 3 | -------------------------------------------------------------------------------- /ctex/test/support/regression-test.cfg: -------------------------------------------------------------------------------- 1 | \def\AUTHOR#1{\LONGTYPEOUT{Author: #1}} 2 | \let\wlog\@gobble 3 | \InputIfFileExists{ts1cmr.fd}{}{} 4 | \ExplSyntaxOn 5 | \cs_new_protected:Npn \CTEXLogMark #1 6 | { 7 | \protected@edef \l_tmpa_tl {#1} 8 | \exp_args:No \tl_log:n { \l_tmpa_tl } 9 | } 10 | \ExplSyntaxOff 11 | -------------------------------------------------------------------------------- /ctex/test/testfiles-cmap/cmap-gbk.pvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/ctex/test/testfiles-cmap/cmap-gbk.pvt -------------------------------------------------------------------------------- /ctex/test/testfiles-cmap/cmap-gbk.tpf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/ctex/test/testfiles-cmap/cmap-gbk.tpf -------------------------------------------------------------------------------- /ctex/test/testfiles-cmap/cmap-utf8.pvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \def\CJKrmdefault{song} 4 | \def\CJKsfdefault{song} 5 | \def\CJKttdefault{song} 6 | 7 | \AddToHook{shipout/firstpage}{\pdfmapline{=cyberb@Unicode@ \c_sys_backend_str=luatex. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: \Gin@driver 10 | ============================================================ 11 | > \Gin@driver=luatex.def. 12 | ============================================================ 13 | ============================================================ 14 | TEST 3: \Hy@driver 15 | ============================================================ 16 | > \Hy@driver=hluatex. 17 | ============================================================ 18 | -------------------------------------------------------------------------------- /ctex/test/testfiles/backend.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{ctexbook} 4 | 5 | \usepackage{graphicx} 6 | \usepackage{hyperref} 7 | 8 | \START 9 | \makeatletter 10 | \ExplSyntaxOn 11 | 12 | \tl_map_inline:nn 13 | { \c_sys_backend_str \Gin@driver \Hy@driver } 14 | { \exp_args:Nx \TEST { \token_to_str:N #1 } { \tl_log:N #1 } } 15 | 16 | \ExplSyntaxOff 17 | \END 18 | -------------------------------------------------------------------------------- /ctex/test/testfiles/backend.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: \c_sys_backend_str 5 | ============================================================ 6 | > \c_sys_backend_str=dvipdfmx. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: \Gin@driver 10 | ============================================================ 11 | > \Gin@driver=dvipdfmx.def. 12 | ============================================================ 13 | ============================================================ 14 | TEST 3: \Hy@driver 15 | ============================================================ 16 | > \Hy@driver=hdvipdfm. 17 | ============================================================ 18 | -------------------------------------------------------------------------------- /ctex/test/testfiles/backend.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: \c_sys_backend_str 5 | ============================================================ 6 | > \c_sys_backend_str=xetex. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: \Gin@driver 10 | ============================================================ 11 | > \Gin@driver=xetex.def. 12 | ============================================================ 13 | ============================================================ 14 | TEST 3: \Hy@driver 15 | ============================================================ 16 | > \Hy@driver=hxetex. 17 | ============================================================ 18 | -------------------------------------------------------------------------------- /ctex/test/testfiles/backend.uptex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: \c_sys_backend_str 5 | ============================================================ 6 | > \c_sys_backend_str=dvipdfmx. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: \Gin@driver 10 | ============================================================ 11 | > \Gin@driver=dvipdfmx.def. 12 | ============================================================ 13 | ============================================================ 14 | TEST 3: \Hy@driver 15 | ============================================================ 16 | > \Hy@driver=hdvipdfm. 17 | ============================================================ 18 | -------------------------------------------------------------------------------- /ctex/test/testfiles/basic01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexart} 4 | 5 | \begin{document} 6 | \input{basic-body} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /ctex/test/testfiles/basic02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,scheme=plain]{ctexart} 4 | 5 | \begin{document} 6 | \input{basic-body} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /ctex/test/testfiles/basic03.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{minimal} 4 | \usepackage[fontset=fandol]{ctex} 5 | 6 | \begin{document} 7 | \input{basic-body} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/basic04.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{article} 4 | \usepackage[fontset=fandol]{ctex} 5 | 6 | \begin{document} 7 | \input{basic-body} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/basic05.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{article} 4 | \usepackage[fontset=fandol,scheme=chinese]{ctex} 5 | 6 | \begin{document} 7 | \input{basic-body} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/beamer01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexbeamer} 4 | 5 | \year=2021 \month=1 \day=1 6 | \title{Beamer 测试} 7 | \author{ctex.org} 8 | 9 | \begin{document} 10 | \input{beamer-body} 11 | \end{document} 12 | -------------------------------------------------------------------------------- /ctex/test/testfiles/beamer02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{beamer} 4 | \usepackage[fontset=fandol,scheme=plain]{ctex} 5 | 6 | \year=2021 \month=1 \day=1 7 | \title{Beamer 测试 (plain)} 8 | \author{ctex.org} 9 | 10 | \begin{document} 11 | \input{beamer-body} 12 | \end{document} 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/cleveref01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{ctexbook} 4 | \usepackage{cleveref} 5 | 6 | \begin{document} 7 | \input{cleveref-body} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/cleveref01.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | Author: Qing Lee, Xiangdong Zeng 4 | ============================================================ 5 | TEST 1: part 6 | ============================================================ 7 | > \@currentlabel=一. 8 | > \cref@currentlabel=[part][1][]一. 9 | ============================================================ 10 | ============================================================ 11 | TEST 2: chapter 12 | ============================================================ 13 | > \@currentlabel=一. 14 | > \cref@currentlabel=[chapter][1][]一. 15 | ============================================================ 16 | ============================================================ 17 | TEST 3: section 18 | ============================================================ 19 | > \@currentlabel=1.1. 20 | > \cref@currentlabel=[section][1][1]1.1. 21 | ============================================================ 22 | ============================================================ 23 | TEST 4: subsection 24 | ============================================================ 25 | > \@currentlabel=1.1.1. 26 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 27 | ============================================================ 28 | ============================================================ 29 | TEST 5: subsubsection 30 | ============================================================ 31 | > \@currentlabel=1.1.1. 32 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 33 | ============================================================ 34 | ============================================================ 35 | TEST 6: paragraph 36 | ============================================================ 37 | > \@currentlabel=1.1.1. 38 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 39 | ============================================================ 40 | ============================================================ 41 | TEST 7: subparagraph 42 | ============================================================ 43 | > \@currentlabel=1.1.1. 44 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 45 | ============================================================ 46 | ============================================================ 47 | TEST 8: part 48 | ============================================================ 49 | > \@currentlabel=二. 50 | > \cref@currentlabel=[part][2][2147483647]二. 51 | ============================================================ 52 | ============================================================ 53 | TEST 9: chapter 54 | ============================================================ 55 | > \@currentlabel=A. 56 | > \cref@currentlabel=[appendix][1][2147483647]A. 57 | ============================================================ 58 | ============================================================ 59 | TEST 10: section 60 | ============================================================ 61 | > \@currentlabel=A.1. 62 | > \cref@currentlabel=[subappendix][1][2147483647,1]A.1. 63 | ============================================================ 64 | ============================================================ 65 | TEST 11: subsection 66 | ============================================================ 67 | > \@currentlabel=A.1.1. 68 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 69 | ============================================================ 70 | ============================================================ 71 | TEST 12: subsubsection 72 | ============================================================ 73 | > \@currentlabel=A.1.1. 74 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 75 | ============================================================ 76 | ============================================================ 77 | TEST 13: paragraph 78 | ============================================================ 79 | > \@currentlabel=A.1.1. 80 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 81 | ============================================================ 82 | ============================================================ 83 | TEST 14: subparagraph 84 | ============================================================ 85 | > \@currentlabel=A.1.1. 86 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 87 | ============================================================ 88 | -------------------------------------------------------------------------------- /ctex/test/testfiles/cleveref02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{ctexbook} 4 | \usepackage{hyperref,cleveref} 5 | 6 | \begin{document} 7 | \input{cleveref-body} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/cleveref02.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | Author: Qing Lee, Xiangdong Zeng 4 | ============================================================ 5 | TEST 1: part 6 | ============================================================ 7 | > \@currentlabel=一. 8 | > \cref@currentlabel=[part][1][]一. 9 | ============================================================ 10 | ============================================================ 11 | TEST 2: chapter 12 | ============================================================ 13 | > \@currentlabel=一. 14 | > \cref@currentlabel=[chapter][1][]一. 15 | ============================================================ 16 | ============================================================ 17 | TEST 3: section 18 | ============================================================ 19 | > \@currentlabel=1.1. 20 | > \cref@currentlabel=[section][1][1]1.1. 21 | ============================================================ 22 | ============================================================ 23 | TEST 4: subsection 24 | ============================================================ 25 | > \@currentlabel=1.1.1. 26 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 27 | ============================================================ 28 | ============================================================ 29 | TEST 5: subsubsection 30 | ============================================================ 31 | > \@currentlabel=1.1.1. 32 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 33 | ============================================================ 34 | ============================================================ 35 | TEST 6: paragraph 36 | ============================================================ 37 | > \@currentlabel=1.1.1. 38 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 39 | ============================================================ 40 | ============================================================ 41 | TEST 7: subparagraph 42 | ============================================================ 43 | > \@currentlabel=1.1.1. 44 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 45 | ============================================================ 46 | ============================================================ 47 | TEST 8: part 48 | ============================================================ 49 | > \@currentlabel=二. 50 | > \cref@currentlabel=[part][2][2147483647]二. 51 | ============================================================ 52 | ============================================================ 53 | TEST 9: chapter 54 | ============================================================ 55 | > \@currentlabel=A. 56 | > \cref@currentlabel=[appendix][1][2147483647]A. 57 | ============================================================ 58 | ============================================================ 59 | TEST 10: section 60 | ============================================================ 61 | > \@currentlabel=A.1. 62 | > \cref@currentlabel=[subappendix][1][2147483647,1]A.1. 63 | ============================================================ 64 | ============================================================ 65 | TEST 11: subsection 66 | ============================================================ 67 | > \@currentlabel=A.1.1. 68 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 69 | ============================================================ 70 | ============================================================ 71 | TEST 12: subsubsection 72 | ============================================================ 73 | > \@currentlabel=A.1.1. 74 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 75 | ============================================================ 76 | ============================================================ 77 | TEST 13: paragraph 78 | ============================================================ 79 | > \@currentlabel=A.1.1. 80 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 81 | ============================================================ 82 | ============================================================ 83 | TEST 14: subparagraph 84 | ============================================================ 85 | > \@currentlabel=A.1.1. 86 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 87 | ============================================================ 88 | -------------------------------------------------------------------------------- /ctex/test/testfiles/cleveref03.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{ctexbook} 4 | \usepackage{varioref,hyperref,cleveref} 5 | 6 | \begin{document} 7 | \input{cleveref-body} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/cleveref03.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | Author: Qing Lee, Xiangdong Zeng 4 | ============================================================ 5 | TEST 1: part 6 | ============================================================ 7 | > \@currentlabel=一. 8 | > \cref@currentlabel=[part][1][]一. 9 | ============================================================ 10 | ============================================================ 11 | TEST 2: chapter 12 | ============================================================ 13 | > \@currentlabel=一. 14 | > \cref@currentlabel=[chapter][1][]一. 15 | ============================================================ 16 | ============================================================ 17 | TEST 3: section 18 | ============================================================ 19 | > \@currentlabel=1.1. 20 | > \cref@currentlabel=[section][1][1]1.1. 21 | ============================================================ 22 | ============================================================ 23 | TEST 4: subsection 24 | ============================================================ 25 | > \@currentlabel=1.1.1. 26 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 27 | ============================================================ 28 | ============================================================ 29 | TEST 5: subsubsection 30 | ============================================================ 31 | > \@currentlabel=1.1.1. 32 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 33 | ============================================================ 34 | ============================================================ 35 | TEST 6: paragraph 36 | ============================================================ 37 | > \@currentlabel=1.1.1. 38 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 39 | ============================================================ 40 | ============================================================ 41 | TEST 7: subparagraph 42 | ============================================================ 43 | > \@currentlabel=1.1.1. 44 | > \cref@currentlabel=[subsection][1][1,1]1.1.1. 45 | ============================================================ 46 | ============================================================ 47 | TEST 8: part 48 | ============================================================ 49 | > \@currentlabel=二. 50 | > \cref@currentlabel=[part][2][2147483647]二. 51 | ============================================================ 52 | ============================================================ 53 | TEST 9: chapter 54 | ============================================================ 55 | > \@currentlabel=A. 56 | > \cref@currentlabel=[appendix][1][2147483647]A. 57 | ============================================================ 58 | ============================================================ 59 | TEST 10: section 60 | ============================================================ 61 | > \@currentlabel=A.1. 62 | > \cref@currentlabel=[subappendix][1][2147483647,1]A.1. 63 | ============================================================ 64 | ============================================================ 65 | TEST 11: subsection 66 | ============================================================ 67 | > \@currentlabel=A.1.1. 68 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 69 | ============================================================ 70 | ============================================================ 71 | TEST 12: subsubsection 72 | ============================================================ 73 | > \@currentlabel=A.1.1. 74 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 75 | ============================================================ 76 | ============================================================ 77 | TEST 13: paragraph 78 | ============================================================ 79 | > \@currentlabel=A.1.1. 80 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 81 | ============================================================ 82 | ============================================================ 83 | TEST 14: subparagraph 84 | ============================================================ 85 | > \@currentlabel=A.1.1. 86 | > \cref@currentlabel=[subsubappendix][1][2147483647,1,1]A.1.1. 87 | ============================================================ 88 | -------------------------------------------------------------------------------- /ctex/test/testfiles/ctexhook.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \RequirePackage{ctexhook} 4 | \RequirePackage{indentfirst} 5 | 6 | \documentclass{minimal} 7 | \expandafter\def\csname @font@info\endcsname#1{} % Suppress font info 8 | 9 | \START 10 | 11 | \AUTHOR{Xiangdong Zeng} 12 | 13 | \ExplSyntaxOn 14 | 15 | \TEST { Package~hook } 16 | { 17 | % close the group opened by \BEGINTEST used in \TEST 18 | % loading packages in a group is invalid since LaTeX2e 2024-06-01 19 | \group_end: 20 | \clist_map_inline:nn 21 | { indentfirst, somedefs, hyperref } 22 | { 23 | \ctex_at_begin_package:nn {#1} { \LONGTYPEOUT { Begin~hook:~#1 } } 24 | \ctex_at_end_package:nn {#1} { \LONGTYPEOUT { End~hook:~#1 } } 25 | } 26 | \cs_set_eq:cN { protected@wlog } \use_none:n 27 | \cs_set_eq:NN \wlog \use_none:n 28 | \usepackage{somedefs} 29 | \usepackage{indentfirst} 30 | \usepackage{xr} 31 | \group_begin: 32 | } 33 | 34 | \TEST { Begin~document~hook } 35 | { 36 | \tl_map_inline:nn 37 | { 38 | \ctex_at_end_preamble:n 39 | \ctex_after_end_preamble:n 40 | \AtBeginDocument 41 | \AtEndDocument 42 | } 43 | { #1 { \TYPE { Package~hook:~\token_to_str:N #1 } } } 44 | } 45 | 46 | \ExplSyntaxOff 47 | 48 | \begin{document} 49 | 50 | \end{document} 51 | -------------------------------------------------------------------------------- /ctex/test/testfiles/ctexhook.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | Author: Xiangdong Zeng 4 | ============================================================ 5 | TEST 1: Package hook 6 | ============================================================ 7 | Package ctexhook Warning: Package `indentfirst' is loaded. 8 | (ctexhook) \ctex_at_begin_package:nn{indentfirst}{...} is invalid. 9 | End hook: indentfirst 10 | Begin hook: somedefs 11 | (../somedefs.sty) 12 | End hook: somedefs 13 | (../xr.sty) 14 | ============================================================ 15 | ============================================================ 16 | TEST 2: Begin document hook 17 | ============================================================ 18 | ============================================================ 19 | Package hook: \ctex_at_end_preamble:n 20 | (ctexhook.aux) 21 | Package hook: \AtBeginDocument 22 | Package hook: \ctex_after_end_preamble:n 23 | Package hook: \AtEndDocument 24 | (ctexhook.aux) 25 | -------------------------------------------------------------------------------- /ctex/test/testfiles/ctexpatch.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \RequirePackage{ctexpatch} 4 | \RequirePackage{etoolbox} 5 | 6 | \START 7 | 8 | \AUTHOR{Qing Lee, Xiangdong Zeng} 9 | 10 | \ExplSyntaxOn 11 | 12 | \cs_set_protected:Npn \TEST:w #1#2#3 \q_stop 13 | { 14 | \exp_args:Nx \TEST { \token_to_str:N #1 \token_to_str:N #2 #3 } 15 | { \ctex_parse_name:NN \TEST:NN #2 #2 } 16 | } 17 | \cs_set_protected:Npn \TEST:NN #1#2 18 | { 19 | \iow_term:x 20 | { 21 | [ \cs_replacement_spec:N #2 ] \iow_newline: 22 | [ \token_to_str:N #1 ] \iow_newline: 23 | [ \cs_replacement_spec:N #1 ] 24 | } 25 | } 26 | 27 | \clist_map_inline:nn 28 | { 29 | \newcommand \cmda [ 2 ] [ x ] , 30 | \DeclareRobustCommand \cmdb [ 2 ] , 31 | \DeclareRobustCommand \cmdc [ 2 ] [ x ] , 32 | \newrobustcmd \cmdd [ 2 ] [ x ] , 33 | \newcommand \1 [ 2 ] [ x ] , 34 | \DeclareRobustCommand \2 [ 2 ] , 35 | \DeclareRobustCommand \3 [ 2 ] [ x ] , 36 | \newrobustcmd \4 [ 2 ] [ x ] , 37 | } 38 | { 39 | #1 { ********************************************************** } 40 | \TEST:w #1 \q_stop 41 | } 42 | 43 | \ExplSyntaxOff 44 | 45 | \END 46 | -------------------------------------------------------------------------------- /ctex/test/testfiles/ctexpatch.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | Author: Qing Lee, Xiangdong Zeng 4 | ============================================================ 5 | TEST 1: \newcommand\cmda[2][x] 6 | ============================================================ 7 | [\@protected@testopt \cmda \\cmda {x}] 8 | [\\cmda] 9 | [**********************************************************] 10 | ============================================================ 11 | ============================================================ 12 | TEST 2: \DeclareRobustCommand\cmdb[2] 13 | ============================================================ 14 | [\protect \cmdb ] 15 | [\cmdb ] 16 | [**********************************************************] 17 | ============================================================ 18 | ============================================================ 19 | TEST 3: \DeclareRobustCommand\cmdc[2][x] 20 | ============================================================ 21 | [\protect \cmdc ] 22 | [\\cmdc ] 23 | [**********************************************************] 24 | ============================================================ 25 | ============================================================ 26 | TEST 4: \newrobustcmd\cmdd[2][x] 27 | ============================================================ 28 | [\@testopt \\cmdd {x}] 29 | [\\cmdd] 30 | [**********************************************************] 31 | ============================================================ 32 | ============================================================ 33 | TEST 5: \newcommand\1[2][x] 34 | ============================================================ 35 | [\@protected@testopt \1\\1 {x}] 36 | [\\1] 37 | [**********************************************************] 38 | ============================================================ 39 | ============================================================ 40 | TEST 6: \DeclareRobustCommand\2[2] 41 | ============================================================ 42 | [\x@protect \2\protect \2 ] 43 | [\2 ] 44 | [**********************************************************] 45 | ============================================================ 46 | ============================================================ 47 | TEST 7: \DeclareRobustCommand\3[2][x] 48 | ============================================================ 49 | [\x@protect \3\protect \3 ] 50 | [\\3 ] 51 | [**********************************************************] 52 | ============================================================ 53 | ============================================================ 54 | TEST 8: \newrobustcmd\4[2][x] 55 | ============================================================ 56 | [\@testopt \\4 {x}] 57 | [\\4] 58 | [**********************************************************] 59 | ============================================================ 60 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[twoside]{ctexart} 4 | 5 | \usepackage[headings]{fancyhdr} 6 | 7 | \ctexset{ 8 | section = { 9 | name = {第,节}, 10 | number = \chinese{section}, 11 | }, 12 | subsection = { 13 | name = {第,小节}, 14 | number = \chinese{subsection}, 15 | }, 16 | } 17 | 18 | \begin{document} 19 | 20 | \section{一级标题 Section Heading} 21 | \subsection{二级标题 Subsection Heading} 22 | \clearpage 23 | 24 | \START 25 | \ExplSyntaxOn 26 | 27 | \TEST { Left~ header } 28 | { \CTEXLogMark \leftmark } 29 | 30 | \TEST { Right~ header } 31 | { \CTEXLogMark \rightmark } 32 | 33 | \ExplSyntaxOff 34 | \OMIT 35 | 36 | \pagestyle{headings} 37 | \section{一级标题 Section Heading} 38 | \subsection{二级标题 Subsection Heading} 39 | \clearpage 40 | 41 | \TIMO 42 | \ExplSyntaxOn 43 | 44 | \TEST { Left~ header~ of~ headings } 45 | { \CTEXLogMark \leftmark } 46 | 47 | \TEST { Right~ header~ of~ headings } 48 | { \CTEXLogMark \rightmark } 49 | 50 | \ExplSyntaxOff 51 | \END 52 | 53 | \end{document} 54 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr01.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^b8^^80^^e8^^8a^^82\hskip 1em\relax ^^e4^^b8^^80^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Section Heading}. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > ^^e7^^ac^^ac^^e4^^b8^^80^^e5^^b0^^8f^^e8^^8a^^82\hskip 1em\relax ^^e4^^ba^^8c^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Subsection Heading. 12 | ============================================================ 13 | ============================================================ 14 | TEST 3: Left header of headings 15 | ============================================================ 16 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^ba^^8c^^e8^^8a^^82\hskip 1em\relax ^^e4^^b8^^80^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Section Heading}. 17 | ============================================================ 18 | ============================================================ 19 | TEST 4: Right header of headings 20 | ============================================================ 21 | > ^^e7^^ac^^ac^^e4^^b8^^80^^e5^^b0^^8f^^e8^^8a^^82\hskip 1em\relax ^^e4^^ba^^8c^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Subsection Heading. 22 | ============================================================ 23 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr01.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > \MakeUppercase []{第一节\hskip 1em\relax 一级标题 Section Heading}. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > 第一小节\hskip 1em\relax 二级标题 Subsection Heading. 12 | ============================================================ 13 | ============================================================ 14 | TEST 3: Left header of headings 15 | ============================================================ 16 | > \MakeUppercase []{第二节\hskip 1em\relax 一级标题 Section Heading}. 17 | ============================================================ 18 | ============================================================ 19 | TEST 4: Right header of headings 20 | ============================================================ 21 | > 第一小节\hskip 1em\relax 二级标题 Subsection Heading. 22 | ============================================================ 23 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[oneside]{ctexart} 4 | 5 | \usepackage[headings]{fancyhdr} 6 | 7 | \ctexset{ 8 | section = { 9 | name = {第,节}, 10 | number = \chinese{section}, 11 | }, 12 | subsection = { 13 | name = {第,小节}, 14 | number = \chinese{subsection}, 15 | }, 16 | } 17 | 18 | \begin{document} 19 | 20 | \section{一级标题 Section Heading} 21 | \subsection{二级标题 Subsection Heading} 22 | \clearpage 23 | 24 | \START 25 | \ExplSyntaxOn 26 | 27 | \TEST { Right~ header } 28 | { \CTEXLogMark \rightmark } 29 | 30 | \ExplSyntaxOff 31 | \OMIT 32 | 33 | \pagestyle{headings} 34 | \section{一级标题 Section Heading} 35 | \subsection{二级标题 Subsection Heading} 36 | \clearpage 37 | 38 | \TIMO 39 | \ExplSyntaxOn 40 | 41 | \TEST { Right~ header~ of~ headings } 42 | { \CTEXLogMark \rightmark } 43 | 44 | \ExplSyntaxOff 45 | \END 46 | 47 | \end{document} 48 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr02.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Right header 5 | ============================================================ 6 | > ^^e7^^ac^^ac^^e4^^b8^^80^^e5^^b0^^8f^^e8^^8a^^82\hskip 1em\relax ^^e4^^ba^^8c^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Subsection Heading. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header of headings 10 | ============================================================ 11 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^ba^^8c^^e8^^8a^^82\hskip 1em\relax ^^e4^^b8^^80^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Section Heading}. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr02.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Right header 5 | ============================================================ 6 | > 第一小节\hskip 1em\relax 二级标题 Subsection Heading. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header of headings 10 | ============================================================ 11 | > \MakeUppercase []{第二节\hskip 1em\relax 一级标题 Section Heading}. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr03.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[twoside]{ctexbook} 4 | 5 | \usepackage[headings]{fancyhdr} 6 | 7 | \ctexset{ 8 | chapter = { 9 | name = {第,章}, 10 | number = \chinese{chapter}, 11 | }, 12 | section = { 13 | name = {第,节}, 14 | number = \chinese{section}, 15 | }, 16 | } 17 | 18 | \begin{document} 19 | 20 | \chapter{一级标题 Chapter Heading} 21 | \section{二级标题 Section Heading} 22 | \clearpage 23 | 24 | \START 25 | \ExplSyntaxOn 26 | 27 | \TEST { Left~ header } 28 | { \CTEXLogMark \leftmark } 29 | 30 | \TEST { Right~ header } 31 | { \CTEXLogMark \rightmark } 32 | 33 | \ExplSyntaxOff 34 | \OMIT 35 | 36 | \pagestyle{headings} 37 | \chapter{一级标题 Chapter Heading} 38 | \section{二级标题 Section Heading} 39 | \clearpage 40 | 41 | \TIMO 42 | \ExplSyntaxOn 43 | 44 | \TEST { Left~ header~ of~ headings } 45 | { \CTEXLogMark \leftmark } 46 | 47 | \TEST { Right~ header~ of~ headings } 48 | { \CTEXLogMark \rightmark } 49 | 50 | \ExplSyntaxOff 51 | \END 52 | 53 | \end{document} 54 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr03.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^b8^^80^^e7^^ab^^a0\hskip 1em\relax ^^e4^^b8^^80^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Chapter Heading}. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^b8^^80^^e8^^8a^^82\hskip 1em\relax ^^e4^^ba^^8c^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Section Heading}. 12 | ============================================================ 13 | ============================================================ 14 | TEST 3: Left header of headings 15 | ============================================================ 16 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^ba^^8c^^e7^^ab^^a0\hskip 1em\relax ^^e4^^b8^^80^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Chapter Heading}. 17 | ============================================================ 18 | ============================================================ 19 | TEST 4: Right header of headings 20 | ============================================================ 21 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^b8^^80^^e8^^8a^^82\hskip 1em\relax ^^e4^^ba^^8c^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Section Heading}. 22 | ============================================================ 23 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr03.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > \MakeUppercase []{第一章\hskip 1em\relax 一级标题 Chapter Heading}. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > \MakeUppercase []{第一节\hskip 1em\relax 二级标题 Section Heading}. 12 | ============================================================ 13 | ============================================================ 14 | TEST 3: Left header of headings 15 | ============================================================ 16 | > \MakeUppercase []{第二章\hskip 1em\relax 一级标题 Chapter Heading}. 17 | ============================================================ 18 | ============================================================ 19 | TEST 4: Right header of headings 20 | ============================================================ 21 | > \MakeUppercase []{第一节\hskip 1em\relax 二级标题 Section Heading}. 22 | ============================================================ 23 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr04.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[oneside]{ctexbook} 4 | 5 | \usepackage[headings]{fancyhdr} 6 | 7 | \ctexset{ 8 | chapter = { 9 | name = {第,章}, 10 | number = \chinese{chapter}, 11 | }, 12 | section = { 13 | name = {第,节}, 14 | number = \chinese{section}, 15 | }, 16 | } 17 | 18 | \begin{document} 19 | 20 | \chapter{一级标题 Chapter Heading} 21 | \section{二级标题 Section Heading} 22 | \clearpage 23 | 24 | \START 25 | \ExplSyntaxOn 26 | 27 | \TEST { Right~ header } 28 | { \CTEXLogMark \rightmark } 29 | 30 | \ExplSyntaxOff 31 | \OMIT 32 | 33 | \pagestyle{headings} 34 | \chapter{一级标题 Chapter Heading} 35 | \section{二级标题 Section Heading} 36 | \clearpage 37 | 38 | \TIMO 39 | \ExplSyntaxOn 40 | 41 | \TEST { Right~ header~ of~ headings } 42 | { \CTEXLogMark \rightmark } 43 | 44 | \ExplSyntaxOff 45 | \END 46 | 47 | \end{document} 48 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr04.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Right header 5 | ============================================================ 6 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^b8^^80^^e8^^8a^^82\hskip 1em\relax ^^e4^^ba^^8c^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Section Heading}. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header of headings 10 | ============================================================ 11 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^ba^^8c^^e7^^ab^^a0\hskip 1em\relax ^^e4^^b8^^80^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Chapter Heading}. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fancyhdr04.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Right header 5 | ============================================================ 6 | > \MakeUppercase []{第一节\hskip 1em\relax 二级标题 Section Heading}. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header of headings 10 | ============================================================ 11 | > \MakeUppercase []{第二章\hskip 1em\relax 一级标题 Chapter Heading}. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/files01.luatex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | (files01.aux) 4 | regression-test.tex 5 | regression-test.cfg 6 | ts1cmr.fd 7 | ctexart.cls 8 | ctexbackend.cfg 9 | expl3.sty 10 | l3backend-luatex.def 11 | ctexhook.sty 12 | ctexpatch.sty 13 | fix-cm.sty 14 | ts1enc.def 15 | ctexopts.cfg 16 | article.cls 17 | size10.clo 18 | ctex-engine-luatex.def 19 | luatexja.sty 20 | luatexja-core.sty 21 | infwarerr.sty 22 | luatexbase.sty 23 | ctablestack.sty 24 | ltxcmds.sty 25 | pdftexcmds.sty 26 | iftex.sty 27 | xkeyval.sty 28 | xkeyval.tex 29 | etoolbox.sty 30 | everyhook.sty 31 | svn-prov.sty 32 | ltj-base.sty 33 | luatexja-compat.sty 34 | fontspec.sty 35 | xparse.sty 36 | fontspec-luatex.sty 37 | fontenc.sty 38 | fontspec.cfg 39 | tuenc.def 40 | zhnumber.sty 41 | zhnumber-utf8.cfg 42 | ctex-scheme-chinese-article.def 43 | ctex-name-utf8.cfg 44 | ctex-c5size.clo 45 | ctex-fontset-fandol.def 46 | ctex.cfg 47 | -------------------------------------------------------------------------------- /ctex/test/testfiles/files01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexart} 4 | 5 | \listfiles 6 | 7 | \begin{document} 8 | 9 | \makeatletter 10 | \ExplSyntaxOn 11 | 12 | \cs_set_protected:Npn \@dofilelist 13 | { \clist_map_function:NN \@filelist \iow_log:n } 14 | 15 | \ExplSyntaxOff 16 | \makeatother 17 | 18 | \START 19 | 20 | \end{document} 21 | 22 | \END 23 | -------------------------------------------------------------------------------- /ctex/test/testfiles/files01.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | (files01.aux) 4 | regression-test.tex 5 | regression-test.cfg 6 | ts1cmr.fd 7 | ctexart.cls 8 | ctexbackend.cfg 9 | expl3.sty 10 | l3backend-dvipdfmx.def 11 | ctexhook.sty 12 | ctexpatch.sty 13 | fix-cm.sty 14 | ts1enc.def 15 | ctexopts.cfg 16 | article.cls 17 | size10.clo 18 | ctex-engine-pdftex.def 19 | CJKutf8.sty 20 | ifpdf.sty 21 | iftex.sty 22 | inputenc.sty 23 | CJK.sty 24 | MULEenc.sty 25 | fontenc.sty 26 | CJKpunct.sty 27 | CJKpunct.spa 28 | CJKspace.sty 29 | UTF8.bdg 30 | ctexspa.def 31 | zhnumber.sty 32 | zhnumber-utf8.cfg 33 | ctex-scheme-chinese-article.def 34 | ctex-name-utf8.cfg 35 | ctex-c5size.clo 36 | ctex-fontset-fandol.def 37 | ctex.cfg 38 | UTF8.enc 39 | UTF8.chr 40 | -------------------------------------------------------------------------------- /ctex/test/testfiles/files01.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | (files01.aux) 4 | regression-test.tex 5 | regression-test.cfg 6 | ts1cmr.fd 7 | ctexart.cls 8 | ctexbackend.cfg 9 | expl3.sty 10 | l3backend-xetex.def 11 | ctexhook.sty 12 | ctexpatch.sty 13 | fix-cm.sty 14 | ts1enc.def 15 | ctexopts.cfg 16 | article.cls 17 | size10.clo 18 | ctex-engine-xetex.def 19 | xeCJK.sty 20 | xtemplate.sty 21 | fontspec.sty 22 | xparse.sty 23 | fontspec-xetex.sty 24 | fontenc.sty 25 | fontspec.cfg 26 | xeCJK.cfg 27 | zhnumber.sty 28 | zhnumber-utf8.cfg 29 | ctex-scheme-chinese-article.def 30 | ctex-name-utf8.cfg 31 | ctex-c5size.clo 32 | ctex-fontset-fandol.def 33 | ctex.cfg 34 | -------------------------------------------------------------------------------- /ctex/test/testfiles/files01.uptex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | (files01.aux) 4 | upldefs.ltx 5 | jy2mc.fd 6 | jy2gt.fd 7 | jt2mc.fd 8 | jt2gt.fd 9 | ukinsoku.tex 10 | regression-test.tex 11 | regression-test.cfg 12 | ts1cmr.fd 13 | ctexart.cls 14 | ctexbackend.cfg 15 | expl3.sty 16 | l3backend-dvipdfmx.def 17 | ctexhook.sty 18 | ctexpatch.sty 19 | fix-cm.sty 20 | ts1enc.def 21 | ctexopts.cfg 22 | article.cls 23 | size10.clo 24 | ctex-engine-uptex.def 25 | jt2zhrm.fd 26 | jy2zhrm.fd 27 | zhnumber.sty 28 | zhnumber-utf8.cfg 29 | ctex-scheme-chinese-article.def 30 | ctex-name-utf8.cfg 31 | ctex-c5size.clo 32 | ctex-fontset-fandol.def 33 | ctex.cfg 34 | -------------------------------------------------------------------------------- /ctex/test/testfiles/files02.luatex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | (files02.aux) 4 | regression-test.tex 5 | regression-test.cfg 6 | ts1cmr.fd 7 | book.cls 8 | bk10.clo 9 | ctex.sty 10 | expl3.sty 11 | l3backend-luatex.def 12 | ctexhook.sty 13 | ctexpatch.sty 14 | fix-cm.sty 15 | ts1enc.def 16 | ctexopts.cfg 17 | ctex-engine-luatex.def 18 | luatexja.sty 19 | luatexja-core.sty 20 | infwarerr.sty 21 | luatexbase.sty 22 | ctablestack.sty 23 | ltxcmds.sty 24 | pdftexcmds.sty 25 | iftex.sty 26 | xkeyval.sty 27 | xkeyval.tex 28 | etoolbox.sty 29 | everyhook.sty 30 | svn-prov.sty 31 | ltj-base.sty 32 | luatexja-compat.sty 33 | fontspec.sty 34 | xparse.sty 35 | fontspec-luatex.sty 36 | fontenc.sty 37 | fontspec.cfg 38 | tuenc.def 39 | zhnumber.sty 40 | zhnumber-utf8.cfg 41 | ctex-scheme-chinese.def 42 | ctex-name-utf8.cfg 43 | indentfirst.sty 44 | ctex-c5size.clo 45 | ctex-fontset-fandol.def 46 | ctex.cfg 47 | -------------------------------------------------------------------------------- /ctex/test/testfiles/files02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{book} 4 | \usepackage[fontset=fandol]{ctex} 5 | 6 | \listfiles 7 | 8 | \begin{document} 9 | 10 | \makeatletter 11 | \ExplSyntaxOn 12 | 13 | \cs_set_protected:Npn \@dofilelist 14 | { \clist_map_function:NN \@filelist \iow_log:n } 15 | 16 | \ExplSyntaxOff 17 | \makeatother 18 | 19 | \START 20 | 21 | \end{document} 22 | 23 | \END 24 | -------------------------------------------------------------------------------- /ctex/test/testfiles/files02.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | (files02.aux) 4 | regression-test.tex 5 | regression-test.cfg 6 | ts1cmr.fd 7 | book.cls 8 | bk10.clo 9 | ctex.sty 10 | expl3.sty 11 | l3backend-dvips.def 12 | ctexhook.sty 13 | ctexpatch.sty 14 | fix-cm.sty 15 | ts1enc.def 16 | ctexopts.cfg 17 | ctex-engine-pdftex.def 18 | CJKutf8.sty 19 | ifpdf.sty 20 | iftex.sty 21 | inputenc.sty 22 | CJK.sty 23 | MULEenc.sty 24 | fontenc.sty 25 | CJKpunct.sty 26 | CJKpunct.spa 27 | CJKspace.sty 28 | UTF8.bdg 29 | ctexspa.def 30 | zhnumber.sty 31 | zhnumber-utf8.cfg 32 | ctex-scheme-chinese.def 33 | ctex-name-utf8.cfg 34 | indentfirst.sty 35 | ctex-c5size.clo 36 | ctex-fontset-fandol.def 37 | ctex.cfg 38 | UTF8.enc 39 | UTF8.chr 40 | -------------------------------------------------------------------------------- /ctex/test/testfiles/files02.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | (files02.aux) 4 | regression-test.tex 5 | regression-test.cfg 6 | ts1cmr.fd 7 | book.cls 8 | bk10.clo 9 | ctex.sty 10 | expl3.sty 11 | l3backend-xetex.def 12 | ctexhook.sty 13 | ctexpatch.sty 14 | fix-cm.sty 15 | ts1enc.def 16 | ctexopts.cfg 17 | ctex-engine-xetex.def 18 | xeCJK.sty 19 | xtemplate.sty 20 | fontspec.sty 21 | xparse.sty 22 | fontspec-xetex.sty 23 | fontenc.sty 24 | fontspec.cfg 25 | xeCJK.cfg 26 | zhnumber.sty 27 | zhnumber-utf8.cfg 28 | ctex-scheme-chinese.def 29 | ctex-name-utf8.cfg 30 | indentfirst.sty 31 | ctex-c5size.clo 32 | ctex-fontset-fandol.def 33 | ctex.cfg 34 | -------------------------------------------------------------------------------- /ctex/test/testfiles/files02.uptex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | (files02.aux) 4 | upldefs.ltx 5 | jy2mc.fd 6 | jy2gt.fd 7 | jt2mc.fd 8 | jt2gt.fd 9 | ukinsoku.tex 10 | regression-test.tex 11 | regression-test.cfg 12 | ts1cmr.fd 13 | book.cls 14 | bk10.clo 15 | ctex.sty 16 | expl3.sty 17 | l3backend-dvips.def 18 | ctexhook.sty 19 | ctexpatch.sty 20 | fix-cm.sty 21 | ts1enc.def 22 | ctexopts.cfg 23 | ctex-engine-uptex.def 24 | jt2zhrm.fd 25 | jy2zhrm.fd 26 | zhnumber.sty 27 | zhnumber-utf8.cfg 28 | ctex-scheme-chinese.def 29 | ctex-name-utf8.cfg 30 | indentfirst.sty 31 | ctex-c5size.clo 32 | ctex-fontset-fandol.def 33 | ctex.cfg 34 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fonts01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexart} 4 | 5 | \begin{document} 6 | 7 | \START 8 | 9 | \AUTHOR{Xiangdong Zeng} 10 | 11 | \ExplSyntaxOn 12 | 13 | \cs_new_protected:Npn \TEST:Nnnnn #1#2#3#4#5 14 | { 15 | \group_begin: 16 | #1 17 | #2 \textbf{#3} \textit{#4} \textbf{\textit{#5}} 18 | \group_end: 19 | } 20 | 21 | \loggingoutput 22 | 23 | \TEST{LaTeX~font~commands}{ 24 | \clist_map_inline:nn 25 | { 26 | \rmfamily {天地玄黄 Aa,} {宇宙洪荒 Bb。} {日月盈昃 Cc,} {辰宿列张 Dd。} , 27 | \sffamily {寒来暑往 Aa,} {秋收冬藏 Bb。} {闰馀成岁 Cc,} {律吕调阳 Dd。} , 28 | \ttfamily {云腾致雨 Aa,} {露结为霜 Bb。} {金生丽水 Cc,} {玉出昆冈 Dd。} , 29 | } 30 | { \TEST:Nnnnn #1 } 31 | \clearpage 32 | } 33 | 34 | \TEST{CJK~font~commands}{ 35 | \clist_map_inline:nn 36 | { 37 | \songti {剑号巨阙 Ee,} {珠称夜光 Ff。} {果珍李柰 Gg,} {菜重芥姜 Hh。} , 38 | \heiti {海咸河淡 Ee,} {鳞潜羽翔 Ff。} {龙师火帝 Gg,} {鸟官人皇 Hh。} , 39 | \fangsong {始制文字 Ee,} {乃服衣裳 Ff。} {推位让国 Gg,} {有虞陶唐 Hh。} , 40 | \kaishu {吊民伐罪 Ee,} {周发殷汤 Ff。} {坐朝问道 Gg,} {垂拱平章 Hh。} , 41 | } 42 | { \TEST:Nnnnn #1 } 43 | \clearpage 44 | } 45 | 46 | \TEST{CJK~font~families}{ 47 | \clist_map_inline:nn 48 | { 49 | { \CJKfamily{zhsong} } {爱育黎首 Ii,} {臣伏戎羌 Jj。} {遐迩壹体 Kk,} {率宾归王 Ll。} , 50 | { \CJKfamily{zhhei} } {鸣凤在树 Ii,} {白驹食场 Jj。} {化被草木 Kk,} {赖及万方 Ll。} , 51 | { \CJKfamily{zhfs} } {盖此身发 Ii,} {四大五常 Jj。} {恭惟鞠养 Kk,} {岂敢毁伤 Ll。} , 52 | { \CJKfamily{zhkai} } {女慕贞洁 Ii,} {男效才良 Jj。} {知过必改 Kk,} {得能莫忘 Ll。} , 53 | } 54 | { \TEST:Nnnnn #1 } 55 | \clearpage 56 | } 57 | 58 | \ExplSyntaxOff 59 | 60 | \END 61 | 62 | \end{document} 63 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fonts02.luatex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | Author: Xiangdong Zeng 4 | ============================================================ 5 | TEST 1: Engine name 6 | ============================================================ 7 | > \c_sys_engine_str=luatex. 8 | ============================================================ 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fonts02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=none]{ctexart} 4 | 5 | \ExplSyntaxOn 6 | 7 | \sys_if_engine_xetex:T 8 | { 9 | \def\FontOptions{UprightFont=*, BoldFont=*~Bold, ItalicFont=*, BoldItalicFont=*~Bold} 10 | 11 | \setCJKmainfont{Noto~Serif~CJK~SC}[\FontOptions] 12 | \setCJKsansfont{Noto~Sans~CJK~SC}[\FontOptions] 13 | 14 | \setCJKfamilyfont{zhsong}{Noto~Serif~CJK~TC}[\FontOptions] 15 | \setCJKfamilyfont{zhhei}{Noto~Sans~CJK~TC}[\FontOptions] 16 | 17 | \NewDocumentCommand\songti{}{\CJKfamily{zhsong}} 18 | \NewDocumentCommand\heiti{}{\CJKfamily{zhhei}} 19 | } 20 | 21 | \ExplSyntaxOff 22 | 23 | \begin{document} 24 | 25 | \START 26 | 27 | \AUTHOR{Xiangdong Zeng} 28 | 29 | \ExplSyntaxOn 30 | 31 | \TEST{Engine~name}{\str_log:N \c_sys_engine_str} 32 | 33 | \sys_if_engine_xetex:T 34 | { 35 | \cs_new_protected:Npn \TEST:Nnnnn #1#2#3#4#5 36 | { 37 | \group_begin: 38 | #1 39 | #2 \textbf{#3} \textit{#4} \textbf{\textit{#5}} 40 | \group_end: 41 | } 42 | 43 | \loggingoutput 44 | 45 | \TEST{LaTeX~font~commands}{ 46 | \clist_map_inline:nn 47 | { 48 | \rmfamily {天地玄黄 Aa,} {宇宙洪荒 Bb。} {日月盈昃 Cc,} {辰宿列张 Dd。} , 49 | \sffamily {寒来暑往 Aa,} {秋收冬藏 Bb。} {闰馀成岁 Cc,} {律吕调阳 Dd。} , 50 | \ttfamily {云腾致雨 Aa,} {露结为霜 Bb。} {金生丽水 Cc,} {玉出昆冈 Dd。} , 51 | } 52 | { \TEST:Nnnnn #1 } 53 | \clearpage 54 | } 55 | 56 | \TEST{CJK~font~commands}{ 57 | \clist_map_inline:nn 58 | { 59 | \songti {剑号巨阙 Ee,} {珠称夜光 Ff。} {果珍李柰 Gg,} {菜重芥姜 Hh。} , 60 | \heiti {海咸河淡 Ee,} {鳞潜羽翔 Ff。} {龙师火帝 Gg,} {鸟官人皇 Hh。} , 61 | } 62 | { \TEST:Nnnnn #1 } 63 | \clearpage 64 | } 65 | 66 | \TEST{CJK~font~families}{ 67 | \clist_map_inline:nn 68 | { 69 | { \CJKfamily{zhsong} } {始制文字 Ii,} {乃服衣裳 Jj。} {推位让国 Kk,} {有虞陶唐 Ll。} , 70 | { \CJKfamily{zhhei} } {吊民伐罪 Ii,} {周发殷汤 Jj。} {坐朝问道 Kk,} {垂拱平章 Ll。} , 71 | } 72 | { \TEST:Nnnnn #1 } 73 | \clearpage 74 | } 75 | } 76 | 77 | \ExplSyntaxOff 78 | 79 | \END 80 | 81 | \end{document} 82 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fonts02.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | Author: Xiangdong Zeng 4 | ============================================================ 5 | TEST 1: Engine name 6 | ============================================================ 7 | > \c_sys_engine_str=pdftex. 8 | ============================================================ 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fonts02.uptex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | Author: Xiangdong Zeng 4 | ============================================================ 5 | TEST 1: Engine name 6 | ============================================================ 7 | > \c_sys_engine_str=uptex. 8 | ============================================================ 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fonts03.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=none]{ctexart} 4 | 5 | \pagestyle{empty} 6 | 7 | \ExplSyntaxOn 8 | 9 | \cs_if_exist:NF \tex_Umathcode:D 10 | { 11 | \START \str_log:N \c_sys_engine_str \END 12 | \file_input_stop: 13 | } 14 | 15 | \setCJKmainfont 16 | { FandolSong-Regular.otf } 17 | [ ItalicFont = FandolKai-Regular.otf ] 18 | 19 | \sys_if_engine_luatex:TF 20 | { 21 | \ctexset 22 | { 23 | declarecharrange = 24 | { 25 | { 1 } { `一, `三 } , 26 | { 2 } { `二 } 27 | } 28 | } 29 | \cs_new_protected:Npn \CLEAR 30 | { \ctexset { clearalternatefont } } 31 | \cs_new_protected:Npn \RESET 32 | { \ctexset { resetalternatefont } } 33 | \cs_new_eq:Nc \mdfivesum:n { pdf@mdfivesum } 34 | } 35 | { 36 | \xeCJKDeclareSubCJKBlock { 1 } { `一, `三 } 37 | \xeCJKDeclareSubCJKBlock { 2 } { `二 } 38 | \cs_new_protected:Npn \CLEAR 39 | { \xeCJKCancelSubCJKBlock { 1 , 2 } } 40 | \cs_new_protected:Npn \RESET 41 | { \xeCJKRestoreSubCJKBlock { 1 , 2 } } 42 | \cs_new_eq:NN \mdfivesum:n \tex_mdfivesum:D 43 | } 44 | 45 | \cs_new:Npn \test_color:n #1 46 | { 47 | Color = \exp_args:Ne \str_range:nnn 48 | { \mdfivesum:n {#1} } { 1 } { 6 } 49 | } 50 | 51 | \int_step_inline:nn { 2 } 52 | { 53 | \setCJKmainfont 54 | { FandolHei-Regular.otf } 55 | [ 56 | #1 , \test_color:n {#1} , 57 | ItalicFont = FandolFang-Regular.otf 58 | ] 59 | } 60 | 61 | \ExplSyntaxOff 62 | 63 | \begin{document} 64 | 65 | 一二三四 66 | 67 | \itshape 68 | 69 | 一二三四 70 | 71 | \normalfont 72 | 73 | 一二三四 74 | 75 | \CLEAR 76 | 77 | 一二三四 78 | 79 | \RESET 80 | 81 | 一二三四 82 | 83 | \itshape 84 | 85 | 一二三四 86 | 87 | \START 88 | \loggingoutput 89 | 90 | \clearpage 91 | 92 | \END 93 | 94 | \end{document} 95 | 96 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fonts03.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | > \c_sys_engine_str=pdftex. 4 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fonts03.uptex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | > \c_sys_engine_str=uptex. 4 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fonts04.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=none]{ctexart} 4 | 5 | \pagestyle{empty} 6 | 7 | \ExplSyntaxOn 8 | 9 | \sys_if_engine_luatex:F 10 | { 11 | \START \TYPE { LuaTeX ~ Only. } \END 12 | \file_input_stop: 13 | } 14 | 15 | \ExplSyntaxOff 16 | 17 | \ctexset 18 | { 19 | declarecharrange = 20 | { 21 | {Tian} {`天} , 22 | {Di} {`地} , 23 | } 24 | } 25 | 26 | \setCJKmainfont{FandolSong-Regular}[ 27 | Extension = .otf , 28 | Tian = {FandolHei-Regular} {Color=00FFFF} , 29 | Di = {} {Color=FF0000} , 30 | AlternateFont = { 31 | {`玄 , `黄} {FandolFang-Regular} , 32 | {`宇 , `宙} {FandolKai-Regular} {Color=00FF00} , 33 | {`洪 , `荒} {} {Color=0000FF} , 34 | } , 35 | ] 36 | 37 | 38 | \begin{document} 39 | 40 | 天地玄黄宇宙洪荒 41 | 42 | 日月盈昃辰宿列张 43 | 44 | \START 45 | \loggingoutput 46 | 47 | \clearpage 48 | 49 | \END 50 | 51 | \end{document} 52 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fonts04.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | LuaTeX Only. 4 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fontsize01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexart} 4 | 5 | \begin{document} 6 | \input{fontsize-body} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fontsize02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,zihao=-4]{ctexart} 4 | 5 | \begin{document} 6 | \input{fontsize-body} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fontsize03.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,12pt]{ctexart} 4 | 5 | \begin{document} 6 | \input{fontsize-body} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fontsize04.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{article} 4 | \usepackage[zihao=-4]{ctexsize} 5 | 6 | \begin{document} 7 | \input{fontsize-body} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/fontsize05.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{article} 4 | \usepackage[zihao=false]{ctexsize} 5 | 6 | \begin{document} 7 | \input{fontsize-body} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/github472-01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,openany]{ctexbook} 4 | \usepackage{titletoc} 5 | 6 | \begin{document} 7 | 8 | \START 9 | 10 | \AUTHOR{Xiangdong Zeng} 11 | 12 | \OMIT 13 | \mbox{文字ABC} 14 | \clearpage 15 | \TIMO 16 | 17 | \loggingoutput 18 | 19 | \TEST{\tableofcontents with titletoc}{ 20 | \tableofcontents 21 | \clearpage 22 | } 23 | 24 | \OMIT 25 | 26 | \chapter{测试} 27 | \chapter{测试} 28 | 29 | \end{document} 30 | -------------------------------------------------------------------------------- /ctex/test/testfiles/github472-01.uptex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | Author: Xiangdong Zeng 4 | ============================================================ 5 | TEST 1: \tableofcontents with titletoc 6 | ============================================================ 7 | (github472-01.toc) 8 | Completed box being shipped out [2] 9 | \vbox(627.36243+0.0)x434.0 10 | .\glue 22.0 11 | .\vbox(605.36243+0.0)x345.0, shifted 89.0 12 | ..\vbox(12.0+0.0)x345.0, glue set 12.0fil 13 | ...\glue 0.0 plus 1.0fil 14 | ...\hbox(0.0+0.0)x345.0 15 | ....\hbox(0.0+0.0)x345.0 16 | ..\glue 18.06749 17 | ..\glue(\lineskip) 0.0 18 | ..\vbox(550.0+0.0)x345.0, glue set 361.58957fil 19 | ...\write-{} 20 | ...\write-{} 21 | ...\glue(\topskip) 10.0 22 | ...\rule(0.0+0.0)x* 23 | ...\penalty 10000 24 | ...\glue 50.0 25 | ...\glue 0.0 26 | ...\glue(\parskip) 0.0 plus 1.0 27 | ...\glue(\parskip) 0.0 28 | ...\glue(\baselineskip) 15.01617 29 | ...\hbox(19.43259+2.64989)x345.0, glue set 150.41751fil 30 | ....\glue(\leftskip) 0.0 plus 1.0fil 31 | ....\JY2/zhrm/bx/n/22.08249 目 32 | ....\JY2/zhrm/bx/n/22.08249 录 33 | ....\penalty 10000 34 | ....\glue(\parfillskip) 0.0 35 | ....\glue(\rightskip) 0.0 plus 1.0fil 36 | ...\marks1{\__mark_id:n {1}\MakeUppercase []{目录}} 37 | ...\marks2{\__mark_id:n {2}\MakeUppercase []{目录}} 38 | ...\marks3{\__mark_id:n {3}\MakeUppercase []{目录}} 39 | ...\mark{{\MakeUppercase []{目录}}{\MakeUppercase []{目录}}} 40 | ...\penalty 10000 41 | ...\glue 40.0 42 | ...\glue 10.53938 plus 1.0 43 | ...\glue(\parskip) 0.0 plus 1.0 44 | ...\glue(\parskip) 0.0 45 | ...\glue(\baselineskip) 4.51692 46 | ...\hbox(9.27464+1.26471)x345.0, glue set 267.06131fil 47 | ....\glue(\leftskip) 15.80907 48 | ....\hbox(0.0+0.0)x0.0 49 | ....\glue -15.80907 50 | ....\hbox(9.27464+1.26471)x40.52388, glue set 5.26968fil 51 | .....\JY2/zhrm/bx/n/10.53937 第 52 | .....\JY2/zhrm/bx/n/10.53937 一 53 | .....\JY2/zhrm/bx/n/10.53937 章 54 | .....\glue 3.6361 55 | .....\glue 0.0 plus 1.0fil 56 | ....\JY2/zhrm/bx/n/10.53937 测 57 | ....\JY2/zhrm/bx/n/10.53937 试 58 | ....\penalty 10000 59 | ....\glue 0.0 plus 1.0fil 60 | ....\penalty 10000 61 | ....\hbox(6.79202+0.0)x16.33607, glue set 10.27599fil 62 | .....\glue 0.0 plus 1.0fil minus 1.0fil 63 | .....\OT1/cmr/bx/n/10.53937 3 64 | .....\kern -1.0 65 | .....\kern 1.0 66 | ....\penalty 10000 67 | ....\glue(\parfillskip) -16.33607 68 | ....\glue(\rightskip) 16.33607 69 | ...\penalty 301 70 | ...\penalty -301 71 | ...\glue 10.53938 plus 1.0 72 | ...\glue(\parskip) 0.0 plus 1.0 73 | ...\glue(\parskip) 0.0 74 | ...\glue(\baselineskip) 5.9021 75 | ...\hbox(9.27464+1.26471)x345.0, glue set 267.06131fil 76 | ....\glue(\leftskip) 15.80907 77 | ....\hbox(0.0+0.0)x0.0 78 | ....\glue -15.80907 79 | ....\hbox(9.27464+1.26471)x40.52388, glue set 5.26968fil 80 | .....\JY2/zhrm/bx/n/10.53937 第 81 | .....\JY2/zhrm/bx/n/10.53937 二 82 | .....\JY2/zhrm/bx/n/10.53937 章 83 | .....\glue 3.6361 84 | .....\glue 0.0 plus 1.0fil 85 | ....\JY2/zhrm/bx/n/10.53937 测 86 | ....\JY2/zhrm/bx/n/10.53937 试 87 | ....\penalty 10000 88 | ....\glue 0.0 plus 1.0fil 89 | ....\penalty 10000 90 | ....\hbox(6.79202+0.0)x16.33607, glue set 10.27599fil 91 | .....\glue 0.0 plus 1.0fil minus 1.0fil 92 | .....\OT1/cmr/bx/n/10.53937 4 93 | .....\kern -1.0 94 | .....\kern 1.0 95 | ....\penalty 10000 96 | ....\glue(\parfillskip) -16.33607 97 | ....\glue(\rightskip) 16.33607 98 | ...\penalty 301 99 | ...\glue -1.26471 100 | ...\glue 0.0 plus 1.0fil 101 | ...\glue 0.0 102 | ..\glue(\baselineskip) 18.50291 103 | ..\hbox(6.79202+0.0)x345.0 104 | ...\hbox(6.79202+0.0)x345.0, glue set 169.86516fil 105 | ....\glue 0.0 plus 1.0fil 106 | ....\OT1/cmr/m/n/10.53937 2 107 | ....\glue 0.0 plus 1.0fil 108 | ============================================================ 109 | -------------------------------------------------------------------------------- /ctex/test/testfiles/github472-02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,openany]{ctexbook} 4 | \usepackage{titletoc} 5 | 6 | \titlecontents{chapter} 7 | [0pt] 8 | {\addvspace{1pc}% 9 | \itshape}% 10 | {\contentsmargin{0pt}% 11 | \bfseries 12 | \makebox[0pt][r]{\huge\thecontentslabel\enspace}% 13 | \large} 14 | {\contentsmargin{0pt}% 15 | \large} 16 | {\quad\thepage} 17 | [\addvspace{.5pc}] 18 | 19 | \begin{document} 20 | 21 | \START 22 | 23 | \AUTHOR{Xiangdong Zeng} 24 | 25 | \OMIT 26 | \mbox{文字ABC} 27 | \clearpage 28 | \TIMO 29 | 30 | \loggingoutput 31 | 32 | \TEST{\tableofcontents with titletoc}{ 33 | \tableofcontents 34 | \clearpage 35 | } 36 | 37 | \OMIT 38 | 39 | \chapter{测试} 40 | \chapter{测试} 41 | 42 | \end{document} 43 | -------------------------------------------------------------------------------- /ctex/test/testfiles/github472-03.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexart} 4 | \usepackage{tocloft} 5 | 6 | \ctexset{section/name={第,小节}} 7 | 8 | \begin{document} 9 | 10 | \START 11 | 12 | \AUTHOR{Xiangdong Zeng} 13 | 14 | \OMIT 15 | \mbox{文字ABC} 16 | \clearpage 17 | \TIMO 18 | 19 | \loggingoutput 20 | 21 | \TEST{\tableofcontents with tocloft}{ 22 | \tableofcontents 23 | \clearpage 24 | } 25 | 26 | \OMIT 27 | 28 | \section{测试} 29 | \section{测试} 30 | 31 | \end{document} 32 | -------------------------------------------------------------------------------- /ctex/test/testfiles/github472-04.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexart} 4 | \usepackage{tocloft} 5 | 6 | \renewcommand{\cftsecfont}{\sffamily} 7 | \cftsetindents{sec}{2cm}{6em} 8 | \ctexset{section/name={第,小节}} 9 | 10 | \begin{document} 11 | 12 | \START 13 | 14 | \AUTHOR{Xiangdong Zeng} 15 | 16 | \OMIT 17 | \mbox{文字ABC} 18 | \clearpage 19 | \TIMO 20 | 21 | \loggingoutput 22 | 23 | \TEST{\tableofcontents with tocloft}{ 24 | \tableofcontents 25 | \clearpage 26 | } 27 | 28 | \OMIT 29 | 30 | \section{测试} 31 | \section{测试} 32 | 33 | \end{document} 34 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[twoside]{ctexart} 4 | 5 | \ctexset{ 6 | section = { 7 | name = {第,节}, 8 | number = \chinese{section}, 9 | }, 10 | subsection = { 11 | name = {第,小节}, 12 | number = \chinese{subsection}, 13 | }, 14 | } 15 | 16 | \begin{document} 17 | 18 | \pagestyle{headings} 19 | \section{一级标题 Section Heading} 20 | \subsection{二级标题 Subsection Heading} 21 | \clearpage 22 | 23 | \START 24 | \ExplSyntaxOn 25 | 26 | \TEST { Left~ header } 27 | { \CTEXLogMark \leftmark } 28 | 29 | \TEST { Right~ header } 30 | { \CTEXLogMark \rightmark } 31 | 32 | \ExplSyntaxOff 33 | \END 34 | 35 | \end{document} 36 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header01.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^b8^^80^^e8^^8a^^82\hskip 1em\relax ^^e4^^b8^^80^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Section Heading}. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > ^^e7^^ac^^ac^^e4^^b8^^80^^e5^^b0^^8f^^e8^^8a^^82\hskip 1em\relax ^^e4^^ba^^8c^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Subsection Heading. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header01.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > \MakeUppercase []{第一节\hskip 1em\relax 一级标题 Section Heading}. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > 第一小节\hskip 1em\relax 二级标题 Subsection Heading. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[oneside]{ctexart} 4 | 5 | \ctexset{ 6 | section = { 7 | name = {第,节}, 8 | number = \chinese{section}, 9 | }, 10 | subsection = { 11 | name = {第,小节}, 12 | number = \chinese{subsection}, 13 | }, 14 | } 15 | 16 | \begin{document} 17 | 18 | \pagestyle{headings} 19 | \section{一级标题 Section Heading} 20 | \subsection{二级标题 Subsection Heading} 21 | \clearpage 22 | 23 | \START 24 | \ExplSyntaxOn 25 | 26 | \TEST { Left~ header } 27 | { \CTEXLogMark \leftmark } 28 | 29 | \TEST { Right~ header } 30 | { \CTEXLogMark \rightmark } 31 | 32 | \ExplSyntaxOff 33 | \END 34 | 35 | \end{document} 36 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header02.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > . 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^b8^^80^^e8^^8a^^82\hskip 1em\relax ^^e4^^b8^^80^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Section Heading}. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header02.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > . 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > \MakeUppercase []{第一节\hskip 1em\relax 一级标题 Section Heading}. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header03.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[twoside]{ctexbook} 4 | 5 | \ctexset{ 6 | chapter = { 7 | name = {第,章}, 8 | number = \chinese{chapter}, 9 | }, 10 | section = { 11 | name = {第,节}, 12 | number = \chinese{section}, 13 | }, 14 | } 15 | 16 | \begin{document} 17 | 18 | \pagestyle{headings} 19 | \chapter{一级标题 Chapter Heading} 20 | \section{二级标题 Section Heading} 21 | \clearpage 22 | 23 | \START 24 | \ExplSyntaxOn 25 | 26 | \TEST { Left~ header } 27 | { \CTEXLogMark \leftmark } 28 | 29 | \TEST { Right~ header } 30 | { \CTEXLogMark \rightmark } 31 | 32 | \ExplSyntaxOff 33 | \END 34 | 35 | \end{document} 36 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header03.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^b8^^80^^e7^^ab^^a0\hskip 1em\relax ^^e4^^b8^^80^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Chapter Heading}. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^b8^^80^^e8^^8a^^82\hskip 1em\relax ^^e4^^ba^^8c^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Section Heading}. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header03.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > \MakeUppercase []{第一章\hskip 1em\relax 一级标题 Chapter Heading}. 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > \MakeUppercase []{第一节\hskip 1em\relax 二级标题 Section Heading}. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header04.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[oneside]{ctexbook} 4 | 5 | \ctexset{ 6 | chapter = { 7 | name = {第,章}, 8 | number = \chinese{chapter}, 9 | }, 10 | section = { 11 | name = {第,节}, 12 | number = \chinese{section}, 13 | }, 14 | } 15 | 16 | \begin{document} 17 | 18 | \pagestyle{headings} 19 | \chapter{一级标题 Chapter Heading} 20 | \section{二级标题 Section Heading} 21 | \clearpage 22 | 23 | \START 24 | \ExplSyntaxOn 25 | 26 | \TEST { Left~ header } 27 | { \CTEXLogMark \leftmark } 28 | 29 | \TEST { Right~ header } 30 | { \CTEXLogMark \rightmark } 31 | 32 | \ExplSyntaxOff 33 | \END 34 | 35 | \end{document} 36 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header04.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > . 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > \MakeUppercase []{^^e7^^ac^^ac^^e4^^b8^^80^^e7^^ab^^a0\hskip 1em\relax ^^e4^^b8^^80^^e7^^ba^^a7^^e6^^a0^^87^^e9^^a2^^98 Chapter Heading}. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/header04.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Left header 5 | ============================================================ 6 | > . 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Right header 10 | ============================================================ 11 | > \MakeUppercase []{第一章\hskip 1em\relax 一级标题 Chapter Heading}. 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexart} 4 | 5 | \def\BODY{% 6 | \part{部分 Part} 7 | \part*{部分(无编号) Part} 8 | \section{节 Section} 9 | 文字 10 | \section*{节(无编号) Section} 11 | 文字 12 | \subsection{小节 Subsection} 13 | 文字 14 | \subsection*{小节(无编号) Subsection} 15 | 文字 16 | \subsubsection{子小节 Subsubsection} 17 | 文字 18 | \subsubsection*{子小节(无编号) Subsubsection} 19 | 文字 20 | \paragraph{段落 Paragraph} 21 | 文字 22 | \paragraph*{段落(无编号) Paragraph} 23 | 文字 24 | \subparagraph{子段落 Subparagraph} 25 | 文字 26 | \subparagraph*{子段落(无编号) Subparagraph} 27 | 文字 28 | } 29 | 30 | \begin{document} 31 | 32 | \START 33 | 34 | \AUTHOR{Xiangdong Zeng} 35 | 36 | \loggingoutput 37 | 38 | \TEST{Main body}{ 39 | \BODY 40 | \clearpage 41 | } 42 | 43 | \TEST{Appendix}{ 44 | \appendix 45 | \BODY 46 | \clearpage 47 | } 48 | 49 | \END 50 | 51 | \end{document} 52 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexrep} 4 | 5 | \def\BODY{% 6 | \part{部分 Part} 7 | \part*{部分(无编号) Part} 8 | \chapter{章 Chapter} 9 | 文字 10 | \chapter*{章(无编号) Chapter} 11 | 文字 12 | \section{节 Section} 13 | 文字 14 | \section*{节(无编号) Section} 15 | 文字 16 | \subsection{小节 Subsection} 17 | 文字 18 | \subsection*{小节(无编号) Subsection} 19 | 文字 20 | \subsubsection{子小节 Subsubsection} 21 | 文字 22 | \subsubsection*{子小节(无编号) Subsubsection} 23 | 文字 24 | \paragraph{段落 Paragraph} 25 | 文字 26 | \paragraph*{段落(无编号) Paragraph} 27 | 文字 28 | \subparagraph{子段落 Subparagraph} 29 | 文字 30 | \subparagraph*{子段落(无编号) Subparagraph} 31 | 文字 32 | } 33 | 34 | \begin{document} 35 | 36 | \START 37 | 38 | \AUTHOR{Xiangdong Zeng} 39 | 40 | \loggingoutput 41 | 42 | \TEST{Main body}{ 43 | \BODY 44 | \clearpage 45 | } 46 | 47 | \TEST{Appendix}{ 48 | \appendix 49 | \BODY 50 | \clearpage 51 | } 52 | 53 | \END 54 | 55 | \end{document} 56 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading03.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexbook} 4 | 5 | \def\BODY{% 6 | \part{部分 Part} 7 | \part*{部分(无编号) Part} 8 | \chapter{章 Chapter} 9 | 文字 10 | \chapter*{章(无编号) Chapter} 11 | 文字 12 | \section{节 Section} 13 | 文字 14 | \section*{节(无编号) Section} 15 | 文字 16 | \subsection{小节 Subsection} 17 | 文字 18 | \subsection*{小节(无编号) Subsection} 19 | 文字 20 | \subsubsection{子小节 Subsubsection} 21 | 文字 22 | \subsubsection*{子小节(无编号) Subsubsection} 23 | 文字 24 | \paragraph{段落 Paragraph} 25 | 文字 26 | \paragraph*{段落(无编号) Paragraph} 27 | 文字 28 | \subparagraph{子段落 Subparagraph} 29 | 文字 30 | \subparagraph*{子段落(无编号) Subparagraph} 31 | 文字 32 | } 33 | 34 | \begin{document} 35 | 36 | \START 37 | 38 | \AUTHOR{Xiangdong Zeng} 39 | 40 | \loggingoutput 41 | 42 | \TEST{Front matter}{ 43 | \frontmatter 44 | \BODY 45 | \clearpage 46 | } 47 | 48 | \TEST{Main matter}{ 49 | \mainmatter 50 | \BODY 51 | \clearpage 52 | } 53 | 54 | \TEST{Bock matter}{ 55 | \backmatter 56 | \BODY 57 | \clearpage 58 | } 59 | 60 | \TEST{Appendix}{ 61 | \appendix 62 | \BODY 63 | \clearpage 64 | } 65 | 66 | \END 67 | 68 | \end{document} 69 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading04.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{book} 4 | \usepackage[fontset=fandol]{ctex} 5 | 6 | \def\BODY{% 7 | \part{部分 Part} 8 | \part*{部分(无编号) Part} 9 | \chapter{章 Chapter} 10 | 文字 11 | \chapter*{章(无编号) Chapter} 12 | 文字 13 | \section{节 Section} 14 | 文字 15 | \section*{节(无编号) Section} 16 | 文字 17 | \subsection{小节 Subsection} 18 | 文字 19 | \subsection*{小节(无编号) Subsection} 20 | 文字 21 | \subsubsection{子小节 Subsubsection} 22 | 文字 23 | \subsubsection*{子小节(无编号) Subsubsection} 24 | 文字 25 | \paragraph{段落 Paragraph} 26 | 文字 27 | \paragraph*{段落(无编号) Paragraph} 28 | 文字 29 | \subparagraph{子段落 Subparagraph} 30 | 文字 31 | \subparagraph*{子段落(无编号) Subparagraph} 32 | 文字 33 | } 34 | 35 | \begin{document} 36 | 37 | \START 38 | 39 | \AUTHOR{Xiangdong Zeng} 40 | 41 | \loggingoutput 42 | 43 | \TEST{Front matter}{ 44 | \frontmatter 45 | \BODY 46 | \clearpage 47 | } 48 | 49 | \TEST{Main matter}{ 50 | \mainmatter 51 | \BODY 52 | \clearpage 53 | } 54 | 55 | \TEST{Bock matter}{ 56 | \backmatter 57 | \BODY 58 | \clearpage 59 | } 60 | 61 | \TEST{Appendix}{ 62 | \appendix 63 | \BODY 64 | \clearpage 65 | } 66 | 67 | \END 68 | 69 | \end{document} 70 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading05.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,sub3section]{ctexart} 4 | 5 | \def\PARAGRAPH{% 6 | \paragraph{段落 Paragraph} 7 | 文字 8 | \paragraph*{段落(无编号) Paragraph} 9 | 文字 10 | \subparagraph{子段落 Subparagraph} 11 | 文字 12 | \subparagraph*{子段落(无编号) Subparagraph} 13 | 文字 14 | } 15 | 16 | \begin{document} 17 | 18 | \START 19 | 20 | \AUTHOR{Xiangdong Zeng} 21 | 22 | \loggingoutput 23 | 24 | \OMIT 25 | \section{标题} 26 | \subsection{标题} 27 | \subsubsection{标题} 28 | \TIMO 29 | 30 | \TEST{secnumdepth = 3}{ 31 | \PARAGRAPH 32 | \clearpage 33 | } 34 | 35 | \TEST{secnumdepth = 4}{ 36 | \setcounter{secnumdepth}{4} 37 | \PARAGRAPH 38 | \clearpage 39 | } 40 | 41 | \END 42 | 43 | \end{document} 44 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading06.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{article} 4 | \usepackage[fontset=fandol,sub4section]{ctex} 5 | 6 | \def\PARAGRAPH{% 7 | \paragraph{段落 Paragraph} 8 | 文字 9 | \paragraph*{段落(无编号) Paragraph} 10 | 文字 11 | \subparagraph{子段落 Subparagraph} 12 | 文字 13 | \subparagraph*{子段落(无编号) Subparagraph} 14 | 文字 15 | } 16 | 17 | \begin{document} 18 | 19 | \START 20 | 21 | \AUTHOR{Xiangdong Zeng} 22 | 23 | \loggingoutput 24 | 25 | \OMIT 26 | \section{标题} 27 | \subsection{标题} 28 | \subsubsection{标题} 29 | \TIMO 30 | 31 | \TEST{secnumdepth = 3}{ 32 | \PARAGRAPH 33 | \clearpage 34 | } 35 | 36 | \TEST{secnumdepth = 4}{ 37 | \setcounter{secnumdepth}{4} 38 | \PARAGRAPH 39 | \clearpage 40 | } 41 | 42 | \TEST{secnumdepth = 5}{ 43 | \setcounter{secnumdepth}{5} 44 | \PARAGRAPH 45 | \clearpage 46 | } 47 | 48 | \END 49 | 50 | \end{document} 51 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading07.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexart} 4 | 5 | \begin{document} 6 | 7 | \START 8 | 9 | \AUTHOR{Xiangdong Zeng} 10 | 11 | \TYPE{Numbering of headings} 12 | 13 | \loggingoutput 14 | 15 | \TEST{.../numbering}{ 16 | \begingroup 17 | \section{节标题} 18 | 文字 19 | \section*{节标题} 20 | 文字 21 | \ctexset{section/numbering=false} 22 | \section{节标题} 23 | 文字 24 | \section*{节标题} 25 | 文字 26 | \subsection{小节标题} 27 | 文字 28 | \subsection*{小节标题} 29 | 文字 30 | \ctexset{subsection/numbering=false} 31 | \subsection{小节标题} 32 | 文字 33 | \subsection*{小节标题} 34 | 文字 35 | \endgroup 36 | \clearpage 37 | } 38 | 39 | \TEST{.../name}{ 40 | \begingroup 41 | \ctexset{section/name={\S}} 42 | \section{节标题} 43 | 文字 44 | \subsection{小节标题} 45 | 文字 46 | \ctexset{section/name={第,小节}} 47 | \section{节标题} 48 | 文字 49 | \subsection{小节标题} 50 | 文字 51 | \endgroup 52 | \clearpage 53 | } 54 | 55 | \TEST{.../number}{ 56 | \begingroup 57 | \ctexset{ 58 | section/number = \Roman{section}, 59 | subsection/number = \chinese{section}、\chinese{subsection} 60 | } 61 | \section{节标题} 62 | 文字 63 | \subsection{小节标题} 64 | 文字 65 | \endgroup 66 | \clearpage 67 | } 68 | 69 | \ExplSyntaxOn 70 | \cs_new_protected:Npn \SHOWTHE 71 | { 72 | \exp_args:Nx \tl_log:n { \thepart } 73 | \exp_args:Nx \tl_log:n { \thesection } 74 | \exp_args:Nx \tl_log:n { \thesubsection } 75 | \exp_args:Nx \tl_log:n { \thesubsubsection } 76 | \sys_if_engine_pdftex:F 77 | { 78 | \exp_args:Nx \tl_log:n { \CTEXthepart } 79 | \exp_args:Nx \tl_log:n { \CTEXthesection } 80 | \exp_args:Nx \tl_log:n { \CTEXthesubsection } 81 | \exp_args:Nx \tl_log:n { \CTEXthesubsubsection } 82 | } 83 | } 84 | \ExplSyntaxOff 85 | 86 | \TEST{\CTEXthe...}{ 87 | \begingroup 88 | \ctexset{ 89 | section = { 90 | name = {第,小节}, 91 | number = \Roman{section}, 92 | }, 93 | subsection/number = \chinese{section}、\chinese{subsection} 94 | } 95 | \SHOWTHE 96 | \endgroup 97 | \clearpage 98 | } 99 | 100 | \END 101 | 102 | \end{document} 103 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading09.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{report} 4 | \usepackage[fontset=fandol,heading=true]{ctex} 5 | 6 | \begin{document} 7 | \input{headings-skip-body} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading10.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexbook} 4 | 5 | \begin{document} 6 | \input{headings-skip-body} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading11.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,sub3section]{ctexbook} 4 | 5 | \begin{document} 6 | \input{headings-skip-body} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading12.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,scheme=plain,sub4section]{ctexbook} 4 | 5 | \begin{document} 6 | \input{headings-skip-body} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading13.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexart} 4 | 5 | \begin{document} 6 | 7 | \START 8 | 9 | \AUTHOR{Xiangdong Zeng} 10 | 11 | \TYPE{Appendix (ctexart)} 12 | 13 | \loggingoutput 14 | 15 | \TEST{appendix/numbering}{ 16 | \begingroup 17 | \appendix 18 | \section{节标题} 19 | 文字 20 | \section*{节标题} 21 | 文字 22 | \subsection{小节标题} 23 | 文字 24 | \subsection*{小节标题} 25 | 文字 26 | \ctexset{appendix/numbering=false} 27 | \section{节标题} 28 | 文字 29 | \section*{节标题} 30 | 文字 31 | \subsection{小节标题} 32 | 文字 33 | \subsection*{小节标题} 34 | 文字 35 | \endgroup 36 | \clearpage 37 | } 38 | 39 | \TEST{appendix/name}{ 40 | \begingroup 41 | \appendix 42 | \ctexset{appendix/name={附录\S}} 43 | \section{节标题} 44 | 文字 45 | \section*{节标题} 46 | 文字 47 | \subsection{小节标题} 48 | 文字 49 | \ctexset{appendix/name={\appendixname 第,小节}} 50 | \section{节标题} 51 | 文字 52 | \section*{节标题} 53 | 文字 54 | \subsection{小节标题} 55 | 文字 56 | \endgroup 57 | \clearpage 58 | } 59 | 60 | \TEST{.../number}{ 61 | \begingroup 62 | \appendix 63 | \ctexset{appendix/number = \Roman{section}} 64 | \section{节标题} 65 | 文字 66 | \subsection{小节标题} 67 | 文字 68 | \ctexset{appendix/number = \chinese{section}、\chinese{subsection}} 69 | \section{节标题} 70 | 文字 71 | \subsection{小节标题} 72 | 文字 73 | \endgroup 74 | \clearpage 75 | } 76 | 77 | \END 78 | 79 | \end{document} 80 | -------------------------------------------------------------------------------- /ctex/test/testfiles/heading14.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,openany]{ctexbook} 4 | 5 | \begin{document} 6 | 7 | \START 8 | 9 | \AUTHOR{Xiangdong Zeng} 10 | 11 | \TYPE{Appendix (ctexbook)} 12 | 13 | \loggingoutput 14 | 15 | \TEST{appendix/numbering}{ 16 | \begingroup 17 | \appendix 18 | \chapter{章标题} 19 | 文字 20 | \chapter*{章标题} 21 | 文字 22 | \section{节标题} 23 | 文字 24 | \section*{节标题} 25 | 文字 26 | \ctexset{appendix/numbering=false} 27 | \chapter{章标题} 28 | 文字 29 | \chapter*{章标题} 30 | 文字 31 | \section{节标题} 32 | 文字 33 | \section*{节标题} 34 | 文字 35 | \endgroup 36 | \clearpage 37 | } 38 | 39 | \TEST{appendix/name}{ 40 | \begingroup 41 | \appendix 42 | \ctexset{appendix/name={附录\P}} 43 | \chapter{章标题} 44 | 文字 45 | \chapter*{章标题} 46 | 文字 47 | \section{节标题} 48 | 文字 49 | \section*{节标题} 50 | 文字 51 | \subsection{小节标题} 52 | 文字 53 | \ctexset{appendix/name={\appendixname 第,章}} 54 | \chapter{章标题} 55 | 文字 56 | \chapter*{章标题} 57 | 文字 58 | \section{节标题} 59 | 文字 60 | \section*{节标题} 61 | 文字 62 | \subsection{小节标题} 63 | 文字 64 | \endgroup 65 | \clearpage 66 | } 67 | 68 | \TEST{.../number}{ 69 | \begingroup 70 | \appendix 71 | \ctexset{appendix/number = \Roman{chapter}} 72 | \chapter{章标题} 73 | 文字 74 | \section{节标题} 75 | 文字 76 | \subsection{小节标题} 77 | 文字 78 | \ctexset{appendix/number = \chinese{chapter}、\chinese{section}} 79 | \chapter{章标题} 80 | 文字 81 | \section{节标题} 82 | 文字 83 | \subsection{小节标题} 84 | 文字 85 | \endgroup 86 | \clearpage 87 | } 88 | 89 | \END 90 | 91 | \end{document} 92 | -------------------------------------------------------------------------------- /ctex/test/testfiles/hyperref-headings.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{ctexbook} 4 | 5 | \usepackage{hyperref} 6 | 7 | \begin{document} 8 | 9 | \START 10 | \ExplSyntaxOn 11 | \seq_map_inline:Nn \c__ctex_headings_cs_seq 12 | { 13 | \exp_args:Nx \TEST { \token_to_str:c { @ #1 } } 14 | { 15 | \cs_if_eq:ccTF { @ #1 } { CTEX@ #1 } 16 | { \TRUE } 17 | { \FALSE } 18 | } 19 | } 20 | \ExplSyntaxOff 21 | \END 22 | 23 | \end{document} 24 | -------------------------------------------------------------------------------- /ctex/test/testfiles/hyperref-headings.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: \@part 5 | ============================================================ 6 | TRUE 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: \@spart 10 | ============================================================ 11 | TRUE 12 | ============================================================ 13 | ============================================================ 14 | TEST 3: \@chapter 15 | ============================================================ 16 | TRUE 17 | ============================================================ 18 | ============================================================ 19 | TEST 4: \@schapter 20 | ============================================================ 21 | TRUE 22 | ============================================================ 23 | ============================================================ 24 | TEST 5: \@sect 25 | ============================================================ 26 | TRUE 27 | ============================================================ 28 | ============================================================ 29 | TEST 6: \@ssect 30 | ============================================================ 31 | TRUE 32 | ============================================================ 33 | -------------------------------------------------------------------------------- /ctex/test/testfiles/hyperref-pdfstringdef01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{ctexbook} 4 | 5 | \usepackage{hyperref} 6 | 7 | \pdfstringdef\pdfStr{Innovation in China 中国智造,慧及全球 0123456789 \%} 8 | 9 | \ExplSyntaxOn 10 | \START 11 | \tl_log:N \pdfStr 12 | \END 13 | \ExplSyntaxOff 14 | 15 | \stop 16 | -------------------------------------------------------------------------------- /ctex/test/testfiles/hyperref-pdfstringdef01.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | > \pdfStr=\376\377\000I\000n\000n\000o\000v\000a\000t\000i\000o\000n\000\040\000i\000n\000\040\000C\000h\000i\000n\000a\000\040\116\055\126\375\146\172\220\040\377\014\141\147\123\312\121\150\164\003\000\040\0000\0001\0002\0003\0004\0005\0006\0007\0008\0009\000\040\000\045. 4 | -------------------------------------------------------------------------------- /ctex/test/testfiles/hyperref-pdfstringdef01.uptex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | > \pdfStr=Innovation in China 中国智造,慧及全球 0123456789 \045. 4 | -------------------------------------------------------------------------------- /ctex/test/testfiles/hyperref-pdfstringdef02.lvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/ctex/test/testfiles/hyperref-pdfstringdef02.lvt -------------------------------------------------------------------------------- /ctex/test/testfiles/hyperref-pdfstringdef02.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | > \pdfStr=Innovation in China ^^d6^^d0^^b9^^fa^^d6^^c7^^d4^^ec^^a3^^ac^^bb^^db^^bc^^b0^^c8^^ab^^c7^^f2 0123456789 \045. 4 | -------------------------------------------------------------------------------- /ctex/test/testfiles/hyperref-pdfstringdef02.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | pdfTeX Only. 4 | -------------------------------------------------------------------------------- /ctex/test/testfiles/hyperref-pdfstringdef03.lvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/ctex/test/testfiles/hyperref-pdfstringdef03.lvt -------------------------------------------------------------------------------- /ctex/test/testfiles/hyperref-pdfstringdef03.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | > \pdfStr=\376\377\000I\000n\000n\000o\000v\000a\000t\000i\000o\000n\000\040\000i\000n\000\040\000C\000h\000i\000n\000a\000\040\116\055\126\375\146\172\220\040\377\014\141\147\123\312\121\150\164\003\000\040\0000\0001\0002\0003\0004\0005\0006\0007\0008\0009\000\040\000\045. 4 | -------------------------------------------------------------------------------- /ctex/test/testfiles/hyperref-pdfstringdef03.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | pdfTeX Only. 4 | -------------------------------------------------------------------------------- /ctex/test/testfiles/indent.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexart} 4 | 5 | \def\TEXT{风急天高猿啸哀,渚清沙白鸟飞回。无边落木萧萧下,不尽长江滚滚来。万里悲秋常作客,百年多病独登台。艰难苦恨繁霜鬓,潦倒新停浊酒杯。} 6 | 7 | \begin{document} 8 | 9 | \START 10 | 11 | \AUTHOR{Xiangdong Zeng} 12 | 13 | \loggingoutput 14 | 15 | \ExplSyntaxOn 16 | 17 | \clist_map_inline:nn 18 | { true, false, 3, 0, -2, 4\ccwd, 2em, 3cm, 0pt, -7.5pt } 19 | { 20 | \TEST{autoindent~=~#1}{ 21 | \group_begin: 22 | \ctexset{autoindent=#1} 23 | \TEXT\par 24 | \small\TEXT\par 25 | \large\TEXT\par 26 | \group_end: 27 | \clearpage 28 | } 29 | } 30 | 31 | \ExplSyntaxOff 32 | 33 | \END 34 | 35 | \end{document} 36 | -------------------------------------------------------------------------------- /ctex/test/testfiles/koma-script.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | %% https://github.com/CTeX-org/ctex-kit/issues/469 3 | 4 | \documentclass{scrreprt} 5 | \usepackage{ctex} 6 | 7 | \START 8 | 9 | \ExplSyntaxOn 10 | \TEST { Preamble } 11 | { \ctex_parse_name:NN \cs_log:N \selectfont } 12 | \ExplSyntaxOff 13 | 14 | \OMIT 15 | 16 | \begin{document} 17 | 18 | \TIMO 19 | 20 | \ExplSyntaxOn 21 | \TEST { Document } 22 | { \ctex_parse_name:NN \cs_log:N \selectfont } 23 | \ExplSyntaxOff 24 | 25 | \END 26 | 27 | \end{document} 28 | -------------------------------------------------------------------------------- /ctex/test/testfiles/koma-script.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: Preamble 5 | ============================================================ 6 | > \selectfont =\long macro:->\ifx \f@linespread \baselinestretch \else \set@fontsize \baselinestretch \f@size \f@baselineskip \fi \ifx \delayed@f@adjustment \@empty \else \let \f@shape@saved \f@shape \let \f@series@saved \f@series \delayed@f@adjustment \maybe@load@fontshape \ifcsname \f@encoding /\f@family /\f@series /\f@shape \endcsname \else \let \f@shape \f@shape@saved \let \f@series \f@series@saved \let \delayed@merge@font@shape \merge@font@shape \let \delayed@merge@font@series \merge@font@series \delayed@f@adjustment \let \delayed@merge@font@shape \merge@font@shape@without@substitution \let \delayed@merge@font@series \merge@font@series@without@substitution \fi \let \delayed@f@adjustment \@empty \fi \@forced@seriesfalse \xdef \font@name {\csname \curr@fontshape /\f@size \endcsname }\pickup@font \font@name \UseHook {selectfont}\size@update \enc@update . 7 | ============================================================ 8 | ============================================================ 9 | TEST 2: Document 10 | ============================================================ 11 | > \selectfont =\long macro:->\ifx \f@linespread \baselinestretch \else \set@fontsize \baselinestretch \f@size \f@baselineskip \fi \ifx \delayed@f@adjustment \@empty \else \let \f@shape@saved \f@shape \let \f@series@saved \f@series \delayed@f@adjustment \maybe@load@fontshape \ifcsname \f@encoding /\f@family /\f@series /\f@shape \endcsname \else \let \f@shape \f@shape@saved \let \f@series \f@series@saved \let \delayed@merge@font@shape \merge@font@shape \let \delayed@merge@font@series \merge@font@series \delayed@f@adjustment \let \delayed@merge@font@shape \merge@font@shape@without@substitution \let \delayed@merge@font@series \merge@font@series@without@substitution \fi \let \delayed@f@adjustment \@empty \fi \@forced@seriesfalse \xdef \font@name {\csname \curr@fontshape /\f@size \endcsname }\pickup@font \font@name \UseHook {selectfont}\size@update \enc@update . 12 | ============================================================ 13 | -------------------------------------------------------------------------------- /ctex/test/testfiles/linespread01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,linespread=1.0]{ctexart} 4 | 5 | \begin{document} 6 | \input{linespread-body} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /ctex/test/testfiles/linespread02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,linespread=3.0]{ctexart} 4 | 5 | \begin{document} 6 | \input{linespread-body} 7 | \end{document} 8 | -------------------------------------------------------------------------------- /ctex/test/testfiles/linespread03.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[11pt]{book} 4 | \usepackage[fontset=fandol,linespread=1.3]{ctex} 5 | 6 | \begin{document} 7 | \input{linespread-body} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /ctex/test/testfiles/names.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexbook} 4 | 5 | \START 6 | 7 | \AUTHOR{Xiangdong Zeng} 8 | 9 | \ExplSyntaxOn 10 | 11 | \clist_const:Nn \c_test_clist 12 | { 13 | contentsname, 14 | listfigurename, 15 | listtablename, 16 | figurename, 17 | tablename, 18 | abstractname, 19 | indexname, 20 | appendixname, 21 | bibname, 22 | refname, 23 | proofname, 24 | algorithmname, 25 | continuation, 26 | } 27 | 28 | \TEST{Names~1}{ 29 | \clist_map_inline:Nn \c_test_clist { \cs_log:c {#1} } 30 | } 31 | 32 | \ctexset{ 33 | contentsname = 目錄, 34 | listfigurename = 插圖, 35 | listtablename = 表格, 36 | figurename = 圖, 37 | tablename = 表, 38 | abstractname = 摘要, 39 | indexname = 索引, 40 | appendixname = 附錄, 41 | bibname = 參考文獻, 42 | proofname = 證明, 43 | } 44 | 45 | \TEST{Names~2}{ 46 | \clist_map_inline:Nn \c_test_clist { \cs_log:c {#1} } 47 | } 48 | 49 | \ExplSyntaxOff 50 | 51 | \END 52 | 53 | \end{document} 54 | -------------------------------------------------------------------------------- /ctex/test/testfiles/names.pdftex.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | Author: Xiangdong Zeng 4 | ============================================================ 5 | TEST 1: Names 1 6 | ============================================================ 7 | > \contentsname=macro:->^^e7^^9b^^ae^^e5^^bd^^95. 8 | > \listfigurename=macro:->^^e6^^8f^^92^^e5^^9b^^be. 9 | > \listtablename=macro:->^^e8^^a1^^a8^^e6^^a0^^bc. 10 | > \figurename=macro:->^^e5^^9b^^be. 11 | > \tablename=macro:->^^e8^^a1^^a8. 12 | > \abstractname=macro:->^^e6^^91^^98^^e8^^a6^^81. 13 | > \indexname=macro:->^^e7^^b4^^a2^^e5^^bc^^95. 14 | > \appendixname=macro:->^^e9^^99^^84^^e5^^bd^^95. 15 | > \bibname=macro:->^^e5^^8f^^82^^e8^^80^^83^^e6^^96^^87^^e7^^8c^^ae. 16 | > \refname=undefined. 17 | > \proofname=macro:->^^e8^^af^^81^^e6^^98^^8e. 18 | > \algorithmname=undefined. 19 | > \continuation=undefined. 20 | ============================================================ 21 | ============================================================ 22 | TEST 2: Names 2 23 | ============================================================ 24 | > \contentsname=macro:->^^e7^^9b^^ae^^e9^^8c^^84. 25 | > \listfigurename=macro:->^^e6^^8f^^92^^e5^^9c^^96. 26 | > \listtablename=macro:->^^e8^^a1^^a8^^e6^^a0^^bc. 27 | > \figurename=macro:->^^e5^^9c^^96. 28 | > \tablename=macro:->^^e8^^a1^^a8. 29 | > \abstractname=macro:->^^e6^^91^^98^^e8^^a6^^81. 30 | > \indexname=macro:->^^e7^^b4^^a2^^e5^^bc^^95. 31 | > \appendixname=macro:->^^e9^^99^^84^^e9^^8c^^84. 32 | > \bibname=macro:->^^e5^^8f^^83^^e8^^80^^83^^e6^^96^^87^^e7^^8d^^bb. 33 | > \refname=undefined. 34 | > \proofname=macro:->^^e8^^ad^^89^^e6^^98^^8e. 35 | > \algorithmname=undefined. 36 | > \continuation=undefined. 37 | ============================================================ 38 | -------------------------------------------------------------------------------- /ctex/test/testfiles/names.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | Author: Xiangdong Zeng 4 | ============================================================ 5 | TEST 1: Names 1 6 | ============================================================ 7 | > \contentsname=macro:->目录. 8 | > \listfigurename=macro:->插图. 9 | > \listtablename=macro:->表格. 10 | > \figurename=macro:->图. 11 | > \tablename=macro:->表. 12 | > \abstractname=macro:->摘要. 13 | > \indexname=macro:->索引. 14 | > \appendixname=macro:->附录. 15 | > \bibname=macro:->参考文献. 16 | > \refname=undefined. 17 | > \proofname=macro:->证明. 18 | > \algorithmname=undefined. 19 | > \continuation=undefined. 20 | ============================================================ 21 | ============================================================ 22 | TEST 2: Names 2 23 | ============================================================ 24 | > \contentsname=macro:->目錄. 25 | > \listfigurename=macro:->插圖. 26 | > \listtablename=macro:->表格. 27 | > \figurename=macro:->圖. 28 | > \tablename=macro:->表. 29 | > \abstractname=macro:->摘要. 30 | > \indexname=macro:->索引. 31 | > \appendixname=macro:->附錄. 32 | > \bibname=macro:->參考文獻. 33 | > \refname=undefined. 34 | > \proofname=macro:->證明. 35 | > \algorithmname=undefined. 36 | > \continuation=undefined. 37 | ============================================================ 38 | -------------------------------------------------------------------------------- /ctex/test/testfiles/punct.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{minimal} 4 | 5 | \usepackage{ctex} 6 | 7 | \def\TEXT{% 8 | {Basic punct 1}{标点、标点,标点。标点、标点,标点。标点、标点,标点。}, 9 | {Basic punct 2}{「标点」、「『标点』」,《标点》、〈标点〉。「标点」、「『标点』」,《标点》、〈标点〉。「标点」、「『标点』」,《标点》、〈标点〉。}, 10 | {Basic punct 3}{「标点。」「『标』点,」《标点。》(Biao、)〔Dian、〕「标点。」「『标』点,」《标点。》(Biao、)〔Dian、〕「标点。」「『标』点,」《标点。》(Biao、)〔Dian、〕}, 11 | {Complex punct 1}{「何谓『标点挤压』?」何谓「标点『挤压』」呢?让我来告诉你何谓「『标点』挤压」。让我来告诉你何谓「『标点』挤压。」「就这样,我、『那个人』和他们战斗了数个钟头,(最后)没输没赢……『那个人』逃之夭夭。」}, 12 | {Complex punct 2}{轻声叨念道——「好的……」「『好』·不好」「『好』・不好」「『好』、不好」《书名》〈篇名〉(内容)「『好』、不好」}, 13 | {Punct+latin 1}{Dian、Dian,Dian。Dian、Dian,Dian。Dian、Dian,Dian。}, 14 | {Punct+latin 2}{「Biao」Dian,「〔Biao〕」Dian,[Biao]。「Biao」Dian,「〔Biao〕」Dian,[Biao]。「Biao」Dian,「〔Biao〕」Dian,[Biao]。}, 15 | {Latin punct 1}{為‘什’麼;為“什”麼?为‘什’么;为“什”么?}, 16 | {Latin punct 2}{這是一個句子[漢字123]然後就沒有然後了;這是一個句子[漢123字]然後就沒有然後了;這是一個句子(漢字123)然後就沒有然後了;這是一個句子(漢123字)然後就沒有然後了.} 17 | } 18 | 19 | \ExplSyntaxOn 20 | \sys_if_engine_luatex:T 21 | { 22 | \clist_map_inline:nn 23 | { quanjiao, banjiao, kaiming, CCT, plain } 24 | { 25 | \group_begin: 26 | \ctexset { punct = #1 } 27 | \setCJKfamilyfont { punct-#1 } { FandolSong-Regular.otf } 28 | \group_end: 29 | } 30 | } 31 | \cs_new_protected:Npn \TEST:nn #1#2 32 | { 33 | \TEST {#1} 34 | { 35 | \clist_map_inline:nn 36 | { quanjiao, banjiao, kaiming, CCT, plain } 37 | { 38 | \group_begin: 39 | \sys_if_engine_luatex:TF 40 | { \CJKfamily { punct-##1 } } 41 | { \ctexset { punct = ##1 } } 42 | #2 43 | \group_end: 44 | \par 45 | } 46 | \clearpage 47 | } 48 | } 49 | \ExplSyntaxOff 50 | 51 | \begin{document} 52 | 53 | \START 54 | 55 | \AUTHOR{Xiangdong Zeng} 56 | 57 | \loggingoutput 58 | 59 | \ExplSyntaxOn 60 | \clist_map_inline:Nn \TEXT { \TEST:nn #1 } 61 | \ExplSyntaxOff 62 | 63 | \END 64 | 65 | \end{document} 66 | -------------------------------------------------------------------------------- /ctex/test/testfiles/space.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol]{ctexart} 4 | 5 | \def\TEXTA{% 6 | 汉字一 分词一 7 | 汉字二~分词二% 8 | 汉字三\ 分词三\ 9 | 技术 English} 10 | \def\TEXTB{文字文字 AAAAAAAAAA} 11 | 12 | \begin{document} 13 | \setbox0=\hbox{一} % trigger font info; also keep line numbers 14 | \START 15 | 16 | \AUTHOR{Xiangdong Zeng} 17 | 18 | \loggingoutput 19 | 20 | \ExplSyntaxOn 21 | 22 | \clist_map_inline:nn 23 | { true, false, auto } 24 | { 25 | \TEST{space~=~#1}{ 26 | \group_begin: 27 | \ctexset{space=#1} 28 | \TEXTA 29 | \group_end: 30 | \clearpage 31 | } 32 | } 33 | 34 | \clist_map_inline:nn 35 | { \ccwd, 0, 2, 0.1pt, 10pt, \maxdimen } 36 | { 37 | \TEST{linestretch~=~#1}{ 38 | \group_begin: 39 | \ctexset{linestretch=#1} 40 | \fbox{\parbox{6.9em}{\TEXTB}}\par 41 | \Large 42 | \fbox{\parbox{6.9em}{\TEXTB}}\par 43 | \group_end: 44 | \clearpage 45 | } 46 | } 47 | 48 | \ExplSyntaxOff 49 | 50 | \END 51 | 52 | \end{document} 53 | -------------------------------------------------------------------------------- /ctex/test/testfiles/titlesec01.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=none]{ctexbook} 4 | 5 | \usepackage[T1]{fontenc} 6 | \usepackage{lmodern} 7 | \normalfont 8 | 9 | \usepackage{titlesec} 10 | 11 | \START 12 | \ExplSyntaxOn 13 | 14 | \seq_map_inline:Nn \c__ctex_headings_seq 15 | { 16 | \TEST {#1} 17 | { 18 | \cs_log:c { ttlf@ #1 } 19 | \cs_log:c { ttls@ #1 } 20 | \cs_log:c { ttl@toc #1 } 21 | } 22 | } 23 | 24 | \ExplSyntaxOff 25 | \END 26 | -------------------------------------------------------------------------------- /ctex/test/testfiles/titlesec01.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: part 5 | ============================================================ 6 | > \ttlf@part=undefined. 7 | > \ttls@part=macro:->{\z@ }{\z@ }{\z@ \@plus 1fil}{\z@ \@plus 1fil}{\z@ }. 8 | > \ttl@tocpart=\protected\long macro:->\tl_set:Nn \ttl@a {\CTEXthepart \hspace {1em}}. 9 | ============================================================ 10 | ============================================================ 11 | TEST 2: chapter 12 | ============================================================ 13 | > \ttlf@chapter=undefined. 14 | > \ttls@chapter=macro:->{\z@ }{\z@ }{50\p@ }{\ttl@chapafter }{\z@ }. 15 | > \ttl@tocchapter=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXthechapter }}. 16 | ============================================================ 17 | ============================================================ 18 | TEST 3: section 19 | ============================================================ 20 | > \ttlf@section=macro:->\ttlh@hang {\normalfont \CTEX@section@format }{\@seccntformat {section}}{\z@ }{\ttl@passexplicit }{}. 21 | > \ttls@section=macro:->{\CTEX@section@indent }{\z@ }{15.88202pt plus 4.53772pt minus 0.90752pt}{10.43677pt plus 0.90752pt}{\@ne }. 22 | > \ttl@tocsection=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXthesection }}. 23 | ============================================================ 24 | ============================================================ 25 | TEST 4: subsection 26 | ============================================================ 27 | > \ttlf@subsection=macro:->\ttlh@hang {\normalfont \CTEX@subsection@format }{\@seccntformat {subsection}}{\z@ }{\ttl@passexplicit }{}. 28 | > \ttls@subsection=macro:->{\CTEX@subsection@indent }{\z@ }{14.74759pt plus 4.53772pt minus 0.90752pt}{6.80658pt plus 0.90752pt}{\@ne }. 29 | > \ttl@tocsubsection=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXthesubsection }}. 30 | ============================================================ 31 | ============================================================ 32 | TEST 5: subsubsection 33 | ============================================================ 34 | > \ttlf@subsubsection=macro:->\ttlh@hang {\normalfont \CTEX@subsubsection@format }{\@seccntformat {subsubsection}}{\z@ }{\ttl@passexplicit }{}. 35 | > \ttls@subsubsection=macro:->{\CTEX@subsubsection@indent }{\z@ }{14.74759pt plus 4.53772pt minus 0.90752pt}{6.80658pt plus 0.90752pt}{\@ne }. 36 | > \ttl@tocsubsubsection=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXthesubsubsection }}. 37 | ============================================================ 38 | ============================================================ 39 | TEST 6: paragraph 40 | ============================================================ 41 | > \ttlf@paragraph=macro:->\ttlh@runin {\normalfont \CTEX@paragraph@format }{\@seccntformat {paragraph}}{\z@ }{\ttl@passexplicit }{}. 42 | > \ttls@paragraph=macro:->{\CTEX@paragraph@indent }{\z@ }{14.74759pt plus 4.53772pt minus 0.90752pt}{10.53937pt}{\@ne }. 43 | > \ttl@tocparagraph=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXtheparagraph }}. 44 | ============================================================ 45 | ============================================================ 46 | TEST 7: subparagraph 47 | ============================================================ 48 | > \ttlf@subparagraph=macro:->\ttlh@runin {\normalfont \CTEX@subparagraph@format }{\@seccntformat {subparagraph}}{\z@ }{\ttl@passexplicit }{}. 49 | > \ttls@subparagraph=macro:->{\CTEX@subparagraph@indent }{\z@ }{14.74759pt plus 4.53772pt minus 0.90752pt}{10.53937pt}{\@ne }. 50 | > \ttl@tocsubparagraph=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXthesubparagraph }}. 51 | ============================================================ 52 | -------------------------------------------------------------------------------- /ctex/test/testfiles/titlesec02.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=none]{ctexbook} 4 | 5 | \usepackage[T1]{fontenc} 6 | \usepackage{lmodern} 7 | \normalfont 8 | 9 | \usepackage[explicit]{titlesec} 10 | 11 | \START 12 | \ExplSyntaxOn 13 | 14 | \seq_map_inline:Nn \c__ctex_headings_seq 15 | { 16 | \TEST {#1} 17 | { 18 | \cs_log:c { ttlf@ #1 } 19 | \cs_log:c { ttls@ #1 } 20 | \cs_log:c { ttl@toc #1 } 21 | } 22 | } 23 | 24 | \ExplSyntaxOff 25 | \END 26 | -------------------------------------------------------------------------------- /ctex/test/testfiles/titlesec02.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: part 5 | ============================================================ 6 | > \ttlf@part=undefined. 7 | > \ttls@part=macro:->{\z@ }{\z@ }{\z@ \@plus 1fil}{\z@ \@plus 1fil}{\z@ }. 8 | > \ttl@tocpart=\protected\long macro:->\tl_set:Nn \ttl@a {\CTEXthepart \hspace {1em}}. 9 | ============================================================ 10 | ============================================================ 11 | TEST 2: chapter 12 | ============================================================ 13 | > \ttlf@chapter=undefined. 14 | > \ttls@chapter=macro:->{\z@ }{\z@ }{50\p@ }{\ttl@chapafter }{\z@ }. 15 | > \ttl@tocchapter=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXthechapter }}. 16 | ============================================================ 17 | ============================================================ 18 | TEST 3: section 19 | ============================================================ 20 | > \ttlf@section=macro:#1->\ttlh@hang {\normalfont \CTEX@section@format }{\@seccntformat {section}}{\z@ }{\ttl@passexplicit }{}. 21 | > \ttls@section=macro:->{\CTEX@section@indent }{\z@ }{15.88202pt plus 4.53772pt minus 0.90752pt}{10.43677pt plus 0.90752pt}{\@ne }. 22 | > \ttl@tocsection=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXthesection }}. 23 | ============================================================ 24 | ============================================================ 25 | TEST 4: subsection 26 | ============================================================ 27 | > \ttlf@subsection=macro:#1->\ttlh@hang {\normalfont \CTEX@subsection@format }{\@seccntformat {subsection}}{\z@ }{\ttl@passexplicit }{}. 28 | > \ttls@subsection=macro:->{\CTEX@subsection@indent }{\z@ }{14.74759pt plus 4.53772pt minus 0.90752pt}{6.80658pt plus 0.90752pt}{\@ne }. 29 | > \ttl@tocsubsection=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXthesubsection }}. 30 | ============================================================ 31 | ============================================================ 32 | TEST 5: subsubsection 33 | ============================================================ 34 | > \ttlf@subsubsection=macro:#1->\ttlh@hang {\normalfont \CTEX@subsubsection@format }{\@seccntformat {subsubsection}}{\z@ }{\ttl@passexplicit }{}. 35 | > \ttls@subsubsection=macro:->{\CTEX@subsubsection@indent }{\z@ }{14.74759pt plus 4.53772pt minus 0.90752pt}{6.80658pt plus 0.90752pt}{\@ne }. 36 | > \ttl@tocsubsubsection=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXthesubsubsection }}. 37 | ============================================================ 38 | ============================================================ 39 | TEST 6: paragraph 40 | ============================================================ 41 | > \ttlf@paragraph=macro:#1->\ttlh@runin {\normalfont \CTEX@paragraph@format }{\@seccntformat {paragraph}}{\z@ }{\ttl@passexplicit }{}. 42 | > \ttls@paragraph=macro:->{\CTEX@paragraph@indent }{\z@ }{14.74759pt plus 4.53772pt minus 0.90752pt}{10.53937pt}{\@ne }. 43 | > \ttl@tocparagraph=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXtheparagraph }}. 44 | ============================================================ 45 | ============================================================ 46 | TEST 7: subparagraph 47 | ============================================================ 48 | > \ttlf@subparagraph=macro:#1->\ttlh@runin {\normalfont \CTEX@subparagraph@format }{\@seccntformat {subparagraph}}{\z@ }{\ttl@passexplicit }{}. 49 | > \ttls@subparagraph=macro:->{\CTEX@subparagraph@indent }{\z@ }{14.74759pt plus 4.53772pt minus 0.90752pt}{10.53937pt}{\@ne }. 50 | > \ttl@tocsubparagraph=\protected\long macro:->\tl_set:Nn \ttl@a {\protect \numberline {\CTEXthesubparagraph }}. 51 | ============================================================ 52 | -------------------------------------------------------------------------------- /ctex/test/testfiles/titlesec03.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{ctexbook} 4 | \usepackage{titlesec} 5 | 6 | \ExplSyntaxOn 7 | 8 | \NewDocumentCommand \TESTCTEXifname { m s } 9 | { 10 | \OMIT 11 | \bool_if:NTF #2 { #1 * } { #1 } { } 12 | \TIMO 13 | \exp_args:Ne \TEST 14 | { 15 | \tl_if_empty:nF {#1} { \token_to_str:N #1 } 16 | \bool_if:NT #2 { * } 17 | } 18 | { \CTEXifname { \TRUE } { \FALSE } } 19 | } 20 | 21 | \ExplSyntaxOff 22 | 23 | 24 | \begin{document} 25 | \START 26 | 27 | \TESTCTEXifname{} 28 | 29 | \TYPE{****** frontmatter ******} 30 | \frontmatter 31 | \TESTCTEXifname\chapter 32 | \TESTCTEXifname\section 33 | \TESTCTEXifname\section* 34 | 35 | \OMIT 36 | \cleardoublepage 37 | \TIMO 38 | 39 | \TYPE{****** mainmatter ******} 40 | \mainmatter 41 | 42 | \TESTCTEXifname\chapter 43 | \TESTCTEXifname\chapter* 44 | \TESTCTEXifname\section 45 | \TESTCTEXifname\section* 46 | \TESTCTEXifname\subsection 47 | \TESTCTEXifname\subsubsection 48 | \TESTCTEXifname\chapter 49 | \TESTCTEXifname\section 50 | 51 | \END 52 | \end{document} 53 | -------------------------------------------------------------------------------- /ctex/test/testfiles/titlesec03.tlg: -------------------------------------------------------------------------------- 1 | This is a generated file for the l3build validation system. 2 | Don't change this file in any respect. 3 | ============================================================ 4 | TEST 1: 5 | ============================================================ 6 | FALSE 7 | ============================================================ 8 | ****** frontmatter ****** 9 | ============================================================ 10 | TEST 2: \chapter 11 | ============================================================ 12 | FALSE 13 | ============================================================ 14 | ============================================================ 15 | TEST 3: \section 16 | ============================================================ 17 | TRUE 18 | ============================================================ 19 | ============================================================ 20 | TEST 4: \section* 21 | ============================================================ 22 | FALSE 23 | ============================================================ 24 | ****** mainmatter ****** 25 | ============================================================ 26 | TEST 5: \chapter 27 | ============================================================ 28 | TRUE 29 | ============================================================ 30 | ============================================================ 31 | TEST 6: \chapter* 32 | ============================================================ 33 | FALSE 34 | ============================================================ 35 | ============================================================ 36 | TEST 7: \section 37 | ============================================================ 38 | TRUE 39 | ============================================================ 40 | ============================================================ 41 | TEST 8: \section* 42 | ============================================================ 43 | FALSE 44 | ============================================================ 45 | ============================================================ 46 | TEST 9: \subsection 47 | ============================================================ 48 | TRUE 49 | ============================================================ 50 | ============================================================ 51 | TEST 10: \subsubsection 52 | ============================================================ 53 | FALSE 54 | ============================================================ 55 | ============================================================ 56 | TEST 11: \chapter 57 | ============================================================ 58 | TRUE 59 | ============================================================ 60 | ============================================================ 61 | TEST 12: \section 62 | ============================================================ 63 | TRUE 64 | ============================================================ 65 | -------------------------------------------------------------------------------- /ctex/test/testfiles/toc.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass[fontset=fandol,openany]{ctexbook} 4 | 5 | \begin{document} 6 | 7 | \START 8 | 9 | \AUTHOR{Xiangdong Zeng} 10 | 11 | \loggingoutput 12 | 13 | \TEST{\tableofcontents}{ 14 | \tableofcontents 15 | \clearpage 16 | } 17 | 18 | \TEST{\listoffigures}{ 19 | \listoffigures 20 | \clearpage 21 | } 22 | 23 | \TEST{\listoftables}{ 24 | \listoftables 25 | \clearpage 26 | } 27 | 28 | \OMIT 29 | 30 | \chapter{章标题} 31 | 文字 32 | \chapter*{章标题} 33 | 文字 34 | \section{节标题} 35 | 文字 36 | \section*{节标题} 37 | 文字 38 | \subsection{小节标题} 39 | 40 | \begin{figure}[htp] 41 | \caption{图片} 42 | \end{figure} 43 | 44 | \subsection*{小节标题} 45 | 46 | \begin{table}[htp] 47 | \caption{表格} 48 | \end{table} 49 | 50 | \begingroup 51 | \ctexset{chapter/numbering=false, section/numbering=false} 52 | \chapter{章标题} 53 | 文字 54 | \chapter*{章标题} 55 | 文字 56 | \section{节标题} 57 | 文字 58 | \section*{节标题} 59 | 文字 60 | \subsection{小节标题} 61 | 62 | \begin{figure}[htp] 63 | \caption{Another 图片} 64 | \end{figure} 65 | 66 | \subsection*{小节标题} 67 | 68 | \begin{table}[htp] 69 | \caption{Another 表格} 70 | \end{table} 71 | \endgroup 72 | 73 | \appendix 74 | 75 | \chapter[短名]{章标题} 76 | 文字 77 | \chapter*{章标题} 78 | 文字 79 | \section[短名]{节标题} 80 | 文字 81 | \section*{节标题} 82 | 文字 83 | \subsection{小节标题} 84 | 文字 85 | \subsection*{小节标题} 86 | 文字 87 | 88 | \end{document} 89 | -------------------------------------------------------------------------------- /ctex/test/testfiles/zhnumber.lvt: -------------------------------------------------------------------------------- 1 | \input{regression-test} 2 | 3 | \documentclass{article} 4 | \usepackage[fontset=fandol]{ctex} 5 | 6 | \START 7 | 8 | \AUTHOR{Xiangdong Zeng} 9 | 10 | \ExplSyntaxOn 11 | 12 | \clist_const:Nn \c_test_clist 13 | { 14 | 0, 15 | 1, 16 | 2, 17 | 100, 18 | 1000000, 19 | 1.2, 20 | 2020020200, 21 | 2~012~020~120, 22 | {2,012,020,120}, 23 | 2020.020200, 24 | 2020., 25 | .2020, 26 | 2020/2019, 27 | /2020, 28 | 2020/, 29 | 1.1.2, 30 | -2020, 31 | --2020, 32 | +2020, 33 | 2020/2/2, 34 | 2020/2//3, 35 | 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068, 36 | 3141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068, 37 | } 38 | 39 | \TEST{\zhnumber}{ 40 | \clist_map_inline:Nn \c_test_clist 41 | { \tl_log:x { \zhnumber {#1} } } 42 | } 43 | 44 | \TEST{\zhdigits}{ 45 | \clist_map_inline:Nn \c_test_clist 46 | { \tl_log:x { \zhdigits {#1} } } 47 | } 48 | 49 | \TEST{\CTEXnumber}{ 50 | \clist_map_inline:Nn \c_test_clist 51 | { 52 | \group_begin: 53 | \CTEXnumber \TEST: {#1} 54 | \cs_log:N \TEST: 55 | \group_end: 56 | } 57 | } 58 | 59 | \TEST{\CTEXdigits}{ 60 | \clist_map_inline:Nn \c_test_clist 61 | { 62 | \group_begin: 63 | \CTEXdigits \TEST: {#1} 64 | \cs_log:N \TEST: 65 | \group_end: 66 | } 67 | } 68 | 69 | \TEST{\today}{ 70 | \group_begin: 71 | \year=1926 \month=8 \day=17 72 | \clist_map_inline:nn { small, big, old } 73 | { 74 | \ctexset{today=#1} 75 | \tl_log:x { \today } 76 | } 77 | \group_end: 78 | } 79 | 80 | \ExplSyntaxOff 81 | 82 | \OMIT 83 | 84 | \begin{document} 85 | 86 | \section{} 87 | \section{} 88 | \clearpage 89 | 90 | \TIMO 91 | 92 | \ExplSyntaxOn 93 | 94 | \loggingoutput 95 | 96 | \TEST{\chinese}{ 97 | \chinese{section} 98 | \pagenumbering{chinese} 99 | \clearpage 100 | } 101 | 102 | \TEST{\CTeX}{ 103 | \cs_log:N { \CTeX } 104 | \exp_args:Nx \tl_log:n { \CTeX } 105 | } 106 | 107 | \ExplSyntaxOff 108 | 109 | \END 110 | 111 | \end{document} 112 | -------------------------------------------------------------------------------- /gbk2uni/Makefile: -------------------------------------------------------------------------------- 1 | gbk2uni: gbk2uni.c 2 | -------------------------------------------------------------------------------- /gbk2uni/gbk2uni.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/gbk2uni/gbk2uni.tex -------------------------------------------------------------------------------- /gbkmac/c.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/gbkmac/c.tex -------------------------------------------------------------------------------- /gbkmac/cjkmap.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/gbkmac/cjkmap.tex -------------------------------------------------------------------------------- /gbkmac/gbkmac.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/gbkmac/gbkmac.tex -------------------------------------------------------------------------------- /gbkmac/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/gbkmac/readme.txt -------------------------------------------------------------------------------- /jiazhu/build.lua: -------------------------------------------------------------------------------- 1 | 2 | module = "jiazhu" 3 | 4 | packtdszip = true 5 | 6 | sourcefiles = {"jiazhu.dtx"} 7 | unpackfiles = {"jiazhu.dtx"} 8 | installfiles = {"*.sty"} 9 | unpacksuppfiles = {"jiazhu.id", "ctxdocstrip.tex"} 10 | typesetsuppfiles = {"ctxdoc.cls"} 11 | 12 | dofile("../support/build-config.lua") 13 | -------------------------------------------------------------------------------- /support/ctxdocstrip.tex: -------------------------------------------------------------------------------- 1 | %% 2 | %% File ctxdocstrip.tex 3 | %% 4 | %% Copyright (C) 2016--2020 5 | %% CTEX.ORG and any individual authors listed in the documentation. 6 | %%--------------------------------------------------------------------- 7 | %% 8 | %% This work may be distributed and/or modified under the 9 | %% conditions of the LaTeX Project Public License, either 10 | %% version 1.3c of this license or (at your option) any later 11 | %% version. This version of this license is in 12 | %% http://www.latex-project.org/lppl/lppl-1-3c.txt 13 | %% and the latest version of this license is in 14 | %% http://www.latex-project.org/lppl.txt 15 | %% and version 1.3 or later is part of all distributions of 16 | %% LaTeX version 2005/12/01 or later. 17 | %% 18 | %% This work has the LPPL maintenance status "maintained". 19 | %% 20 | %%--------------------------------------------------------------------- 21 | %% 22 | \csname ctxDocstripLoaded\endcsname 23 | \let\ctxDocstripLoaded\endinput 24 | \input l3docstrip % 25 | \edef\ctxResetCatcode{% 26 | \catcode\number`\$=\the\catcode`\$\relax 27 | \catcode\number`\@=\the\catcode`\@\relax 28 | } 29 | \makeOther\$ 30 | \catcode`\@=11\relax 31 | \def\plusOption+#1>#2$#3$\endLine{% 32 | \maybeMsg{<+#1 . >}% 33 | \Evaluate{#1}% 34 | \def\ctxCMD{#2}% 35 | \def\ctxID{$#3$}% 36 | \def\do##1##2##3{% 37 | \if1\Expr{##2}% 38 | \ctxReadIDFile 39 | \StreamPut##1{\inLine}% 40 | \fi 41 | }% 42 | \activefiles 43 | } 44 | \def\ctxReadIDFile{% 45 | \openin\inputcheck=\jobname.id\relax 46 | \ifeof\inputcheck\else 47 | \read \inputcheck to \inLine 48 | \closein\inputcheck 49 | \ifx\inLine\empty\else 50 | \let\ctxID\inLine 51 | \fi 52 | \fi 53 | \maybeMsg{^^J\ctxID^^J}% 54 | \def\inLine{\ctxCMD\ctxID}% 55 | } 56 | \keepsilent 57 | \askforoverwritefalse 58 | \declarepreamble\emptypreamble 59 | \endpreamble 60 | \declarepostamble\emptypostamble 61 | \endpostamble 62 | \begingroup\expandafter\expandafter\expandafter\endgroup 63 | \expandafter\ifx\csname directlua\endcsname\relax 64 | \expandafter\ctxResetCatcode\expandafter\endinput 65 | \fi 66 | \let\OriginalStreamClose\StreamClose 67 | \def\ctxStreamClose#1{% 68 | \OriginalStreamClose{#1}% 69 | \ctxConvFile{#1}% 70 | } 71 | \def\ctxConvFile#1{% 72 | \ifcsname zhconv@\csstring#1\endcsname 73 | \ctxConv{\lastnamedcs}% 74 | {\begincsname pth@\csstring#1\endcsname}% 75 | \fi 76 | } 77 | \def\ctxLuaFunc{% 78 | \directlua{ 79 | local zhconv = require("ctex-zhconv").conv 80 | local scan_arg = token.scan_argument 81 | local t = lua.get_functions_table() 82 | local id = 233 83 | while t[id] do id = id + 1 end 84 | t[id] = function () 85 | local enc = scan_arg() 86 | local file = scan_arg() 87 | return zhconv(enc, file, file) 88 | end 89 | token.set_lua("ctxConv", id, "global", "protected") 90 | }% 91 | \global\let\ctxLuaFunc\relax 92 | } 93 | \def\convfile{% 94 | \ifx\@file\file 95 | \expandafter\ctxfile\else 96 | \expandafter\setconvfile\fi 97 | } 98 | \def\setconvfile#1#2{% 99 | \ctxLuaFunc 100 | \Name\def{zhconv@#2}{#1}% 101 | \let\StreamClose\ctxStreamClose 102 | } 103 | \def\ctxfile#1#2{% 104 | \setconvfile{#1}{#2}% 105 | \file{#2}% 106 | } 107 | \ctxResetCatcode 108 | %% 109 | %% 110 | %% End of file ctxdocstrip.tex 111 | -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/t-simplefonts/readme.txt: -------------------------------------------------------------------------------- 1 | update: 2 | 2009-09-16 ConTeXt Minimals 升级到最新版本 3 | t-simplefonts 升级到最新版本 1612d942f218, 2009-09-15 4 | test.tex 里字体属性按照新的 t-simplefonts 要求加上 font 后缀。 5 | ============================ 6 | from http://bitbucket.org/wolfs/simplefonts/ at rev e93f68af160e 7 | 8 | 9 | from http://bbs.ctex.org/viewthread.php?tid=49623 10 | 11 | 12 | [ConTeXt] MkIV simplefonts module 13 | Wolfgang Schuster 最近写了一个用于设定不同语言字体的模块(现在可以用它替 14 | 换掉丑陋的 zhfonts.tex 了)。 15 | 16 | 项目主页:http://bitbucket.org/wolfs/simplefonts/ 17 | 18 | 现在,中/英文混合文档格式如下: 19 | 20 | 1. \usemodule[simplefonts] 21 | 2. 22 | 23 | 3. % 设置西文字体 24 | 4. \setmainfont{TeXGyrePagella} 25 | 5. \setsansfont{TeXGyreHeros} 26 | 6. \setmonofont{TeXGyreCursor} 27 | 7. 28 | 29 | 8. % 设置中文字体 30 | 9. \setcjkmainfont[AdobeSongStd][regular={* 31 | Light},italic={AdobeKaitiStd Regular},bold={AdobeHeitiStd 32 | Regular},bolditalic={AdobeHeitiStd Regular}] 33 | 10. 34 | 35 | 11. \setcjksansfont[AdobeKaitiStd][bold={AdobeHeitiStd 36 | Regular},bolditalic={AdobeHeitiStd Regular}] 37 | 12. 38 | 39 | 13. \setcjkmonofont[AdobeFangsongStd][bold={AdobeHeitiStd 40 | Regular},bolditalic={AdobeHeitiStd Regular}] 41 | 14. 42 | 43 | 15. % 启用中文断行 44 | 16. \setscript[hanzi] 45 | 17. 46 | 47 | 18. % 正文 48 | 19. \starttext 49 | 20. 50 | 51 | 21. ... ... ... 52 | 22. 53 | 54 | 23. \stoptext 55 | 56 | 复制代码 57 | 附件是一份测试示例以及输出结果。 58 | 59 | [ 本帖最后由 LiYanrui 于 2009-5-13 13:23 编辑 ] 60 | 61 | test.tex (1.06 KB) 62 | 63 | 下载次数:19 64 | 65 | 2009-5-8 08:38 66 | 67 | test.pdf (58.94 KB) 68 | 69 | -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/t-simplefonts/test.tex: -------------------------------------------------------------------------------- 1 | % download simplefonts module at http://modules.contextgarden.net/ 2 | 3 | \usemodule[simplefonts] 4 | \setupsimplefonts[size=12pt] 5 | 6 | \setmainfont{TeXGyrePagella} 7 | \setsansfont{TeXGyreHeros} 8 | \setmonofont{TeXGyreCursor} 9 | 10 | \setcjkmainfont[AdobeSongStd][regularfont={* Light},italicfont={AdobeKaitiStd Regular},boldfont={AdobeHeitiStd Regular},bolditalicfont={AdobeHeitiStd Regular}] 11 | \setcjksansfont[AdobeKaitiStd][boldfont={AdobeHeitiStd Regular},bolditalicfont={AdobeHeitiStd Regular}] 12 | \setcjkmonofont[AdobeFangsongStd][boldfont={AdobeHeitiStd Regular},bolditalicfont={AdobeHeitiStd Regular}] 13 | 14 | % 启用中文断行 15 | \setscript[hanzi] 16 | 17 | \starttext 18 | 19 | {\rm\tf roman \it italic \bf bold \bi bolditalic} 20 | 21 | {\ss\tf roman \it italic \bf bold \bi bolditalic} 22 | 23 | {\tt\tf roman \it italic \bf bold \bi bolditalic} 24 | 25 | \blank 26 | 27 | {\rm\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財} 28 | 29 | {\ss\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財} 30 | 31 | {\tt\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財} 32 | 33 | \blank 34 | 35 | 20 世纪 70 年代的时候,一些神奇的科学家在 MIT 人工智能实验室 (AI Lab) 开发了一个神奇的编辑工具,它被叫作 Emacs (The extensible customizable self-documenting display editor)。其中一位就是著名的自由软件基金会 (FSF) 创始人 Richard Stallman。想要了解更多 Richard 和他的自由软件的读者可以去读他写的 Free as in Freedom。 36 | 37 | \stoptext 38 | -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/t-zhfonts/readme.txt: -------------------------------------------------------------------------------- 1 | from http://bbs.ctex.org/viewthread.php?tid=51583 2 | 3 | [ConTeXt] 一个 MkIV 中文字体模块 4 | 本帖最后由 LiYanrui 于 2009-7-30 07:40 编辑 5 | 6 | 折腾了一下午,总算有了一点点成就,但是 ConTeXt 宏编程语法,对我来说还是 7 | 像天书一样。 8 | 9 | 下载 t-zhfonts.tex (2.82 KB) 10 | 下载次数: 16 11 | 2009-7-29 23:44 12 | ,扔到 $TEXMFLOCAL/tex/context/third/t-zhfonts 目录里,然后: 13 | 14 | 1. $ context --generate 15 | 16 | 复制代码 17 | 刷新一下“ConTeXt 数据库”。 18 | 19 | 这个模块的使用方法如下: 20 | 21 | 1. \usemodule[zhfonts] 22 | 2. \setupbodyfont[zhfonts,rm,24pt] 23 | 3. \starttext 24 | 4. 25 | 26 | 5. 世界 Hello World 你好\par 27 | 6. {\bf 世界 Hello World 你好}\par 28 | 7. {\it 世界 Hello World 你好}\par 29 | 8. {\bi 世界 Hello World 你好}\par 30 | 9. 31 | 32 | 10. {\ss 世界 Hello World 你好}\par 33 | 11. {\ss\bf 世界 Hello World 你好}\par 34 | 12. {\ss\it 世界 Hello World 你好}\par 35 | 13. {\ss\bi 世界 Hello World 你好}\par 36 | 14. 37 | 38 | 15. {\tt 世界 Hello World 你好}\par 39 | 16. {\tt\bf 世界 Hello World 你好}\par 40 | 17. {\tt\it 世界 Hello World 你好}\par 41 | 18. {\tt\bi 世界 Hello World 你好}\par 42 | 19. 43 | 44 | 20. \stoptext 45 | 46 | 复制代码 47 | 示例的编译结果见 test.pdf (27.29 KB) 48 | 下载次数: 20 49 | 2009-7-29 23:45 50 | 。 51 | 52 | 打开这份 pdf,可以看到中文字体只有一种,是 AdobeSongStd-Light,英文字体 53 | 很齐全。这是因为我在 t-zhfonts 模块中对 Serif、Sans、Mono 定义了预设值, 54 | 如下: 55 | 56 | 1. \setupzhfonts[Serif][AdobeSongStd-Light][TeXGyrePagella-Regular] 57 | 2. \setupzhfonts[SerifBold][AdobeSongStd-Light][TeXGyrePagella-Bold] 58 | 3. 59 | \setupzhfonts[SerifItalic][AdobeSongStd-Light][TeXGyrePagella-Italic] 60 | 4. 61 | \setupzhfonts[SerifBoldItalic][AdobeSongStd-Light][TeXGyrePagella-BoldItalic] 62 | 5. 63 | 64 | 6. \setupzhfonts[Sans][AdobeSongStd-Light][TeXGyreHeros-Regular] 65 | 7. \setupzhfonts[SansBold][AdobeSongStd-Light][TeXGyreHeros-Bold] 66 | 8. \setupzhfonts[SansItalic][AdobeSongStd-Light][TeXGyreHeros-Italic] 67 | 9. 68 | \setupzhfonts[SansBoldItalic][AdobeSongStd-Light][TeXGyreHeros-BoldItalic] 69 | 10. 70 | 71 | 11. \setupzhfonts[Mono][AdobeSongStd-Light][TeXGyreCursor-Regular] 72 | 12. \setupzhfonts[MonoBold][AdobeSongStd-Light][TeXGyreCursor-Bold] 73 | 13. 74 | \setupzhfonts[MonoItalic][AdobeSongStd-Light][TeXGyreCursor-Italic] 75 | 14. 76 | \setupzhfonts[MonoBoldItalic][AdobeSongStd-Light][TeXGyreCursor-BoldItalic] 77 | 78 | 复制代码 79 | 当然,你可以像上面那样,在自己的文档中使用 \setupzhfonts 进行字体设定。 80 | 81 | 82 | 本帖最后由 LiYanrui 于 2009-8-1 08:35 编辑 83 | 84 | 这个东西大致是照着 Wolfgang 的 simplefonts 写的,不过 Wolfgang 的 85 | simlefonts 模块对于中文用户而言,运行的有点慢,并且在设置字号方面有些问 86 | 题,所以我才 diy 了一个,现在只是够自己用。 87 | 88 | 补充: 89 | 90 | 昨晚,Wolfgang 发给我一封邮件,指出: 91 | 92 | the test file 33 will show you my module is not as slow as you think 93 | and don't have to stay behind your zhfonts module. 94 | 95 | 我测试了一下,果然,甚至还有点慢。 96 | 97 | 98 | -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/t-zhfonts/t-zhfonts.tex: -------------------------------------------------------------------------------- 1 | %D \module 2 | %D [file=t-zhfonts, 3 | %D version=2009.08.01, 4 | %D title=\CONTEXT\ User Macros, 5 | %D subtitle=Font for simple Chinese users, 6 | %D author=Li Yanrui, 7 | %D date=\currentdate, 8 | %D copyright=Public Domain] 9 | 10 | \writestatus{loading}{ConTeXt User Module / zhfonts} 11 | \unprotect 12 | 13 | %D 定义 latinfallback 字体 14 | \def\latinfallbackarea{0x0000-0x0400} 15 | \def\definelatinfallbackfont[#1]% 16 | {\definefontfallback[latin#1][\getvalue{latin#1}][\latinfallbackarea][force=yes]} 17 | 18 | %D 定义中文字体,并将 latin 字体灌注到部分中文字符区域 19 | \starttypescript[serif][zhfont] 20 | \definefontsynonym[Serif][\zhSerif][fallbacks=latinSerif] 21 | \definefontsynonym[SerifBold][\zhSerifBold][fallbacks=latinSerifBold] 22 | \definefontsynonym[SerifItalic][\zhSerifItalic][fallbacks=latinSerifItalic] 23 | \definefontsynonym[SerifBoldItalic][\zhSerifBoldItalic][fallbacks=latinSerifBoldItalic] 24 | \stoptypescript 25 | 26 | \starttypescript[sans][zhfont] 27 | \definefontsynonym[Sans][\zhSans][fallbacks=latinSans] 28 | \definefontsynonym[SansBold][\zhSansBold][fallbacks=latinSansBold] 29 | \definefontsynonym[SansItalic][\zhSansItalic][fallbacks=latinSansItalic] 30 | \definefontsynonym[SansBoldItalic][\zhSansBoldItalic][fallbacks=latinSansBoldItalic] 31 | \stoptypescript 32 | 33 | \starttypescript[mono][zhfont] 34 | \definefontsynonym[Mono][\zhMono][fallbacks=latinMono] 35 | \definefontsynonym[MonoBold][\zhMonoBold][fallbacks=latinMonoBold] 36 | \definefontsynonym[MonoItalic][\zhMonoItalic][fallbacks=latinMonoItalic] 37 | \definefontsynonym[MonoBoldItalic][\zhMonoBoldItalic][fallbacks=latinMonoBoldItalic] 38 | \stoptypescript 39 | 40 | %D 定义字样 41 | \starttypescript[zhfonts] 42 | \definetypeface[zhfonts][rm][serif][zhfont][default] 43 | \definetypeface[zhfonts][ss][sans][zhfont][default] 44 | \definetypeface[zhfonts][tt][mono][zhfont][default] 45 | \stoptypescript 46 | 47 | %D 字体定义命令 48 | \def\setupzhfonts 49 | {\dotripleargument\dosetupzhfonts} 50 | 51 | \def\dosetupzhfonts[#1][#2][#3]% 52 | {\setvalue{zh#1}{name:#2}% 53 | \setvalue{latin#1}{name:#3}% 54 | \definelatinfallbackfont[#1]} 55 | 56 | \setupzhfonts[Serif][AdobeSongStd-Light][TeXGyrePagella-Regular] 57 | \setupzhfonts[SerifBold][AdobeSongStd-Light][TeXGyrePagella-Bold] 58 | \setupzhfonts[SerifItalic][AdobeSongStd-Light][TeXGyrePagella-Italic] 59 | \setupzhfonts[SerifBoldItalic][AdobeSongStd-Light][TeXGyrePagella-BoldItalic] 60 | 61 | \setupzhfonts[Sans][AdobeSongStd-Light][TeXGyreHeros-Regular] 62 | \setupzhfonts[SansBold][AdobeSongStd-Light][TeXGyreHeros-Bold] 63 | \setupzhfonts[SansItalic][AdobeSongStd-Light][TeXGyreHeros-Italic] 64 | \setupzhfonts[SansBoldItalic][AdobeSongStd-Light][TeXGyreHeros-BoldItalic] 65 | 66 | \setupzhfonts[Mono][AdobeSongStd-Light][TeXGyreCursor-Regular] 67 | \setupzhfonts[MonoBold][AdobeSongStd-Light][TeXGyreCursor-Bold] 68 | \setupzhfonts[MonoItalic][AdobeSongStd-Light][TeXGyreCursor-Italic] 69 | \setupzhfonts[MonoBoldItalic][AdobeSongStd-Light][TeXGyreCursor-BoldItalic] 70 | 71 | \usetypescript[zhfonts]% 72 | \setscript[hanzi] 73 | 74 | \protect 75 | \endinput 76 | 77 | -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/t-zhfonts/test.tex: -------------------------------------------------------------------------------- 1 | \usemodule[zhfonts] 2 | \setupbodyfont[zhfonts,rm,24pt] 3 | \starttext 4 | 5 | 世界 Hello World 你好\par 6 | {\bf 世界 Hello World 你好}\par 7 | {\it 世界 Hello World 你好}\par 8 | {\bi 世界 Hello World 你好}\par 9 | 10 | {\ss 世界 Hello World 你好}\par 11 | {\ss\bf 世界 Hello World 你好}\par 12 | {\ss\it 世界 Hello World 你好}\par 13 | {\ss\bi 世界 Hello World 你好}\par 14 | 15 | {\tt 世界 Hello World 你好}\par 16 | {\tt\bf 世界 Hello World 你好}\par 17 | {\tt\it 世界 Hello World 你好}\par 18 | {\tt\bi 世界 Hello World 你好}\par 19 | 20 | \stoptext 21 | 22 | -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/zhfonts-new/readme.txt: -------------------------------------------------------------------------------- 1 | from http://bbs.ctex.org/viewthread.php?tid=48176 2 | 3 | 发表于 2009-3-5 08:53 | 只看该作者 4 | 5 | [ConTeXt] MkIV 中文排版支持的最近更新介绍 6 | 7 | Wolfgang 写了一份新的 zhfonts.tex,默认定义了 pagella, palatino, termes, 8 | times 四种西文字体以及 Adobe 宋体、仿宋、楷体、黑体四种中文字体。我对这 9 | 份文件进行了一点小修改,硬性设定了中文与西文字符的间距大小,并且禁止在数 10 | 学公式中直接使用中文字体,其下载见附件。 11 | 12 | Hans 对 CJK 框架进行了调整,并且已将这部分内容的变动写入了 MkIV 13 | Reference 文档中,见 http://www.pragma-ade.com/general/manuals/mk.pdf。 14 | 不幸的是在新版本中,中文标点压缩的功能被去除了,以后或许会出现。 15 | 16 | 最近,Hans 在最新的 ConTeXt Minimals Beta 版本中添加了中文 label 支持, 17 | 也就是说,现在基本上可以使用“第 x 章”、"图 x"、"表 x" 这样的中文本地化 18 | label 的内建功能了,但是效果并不理想。 19 | 20 | 附件中包含了适合新版本的中文文档基本格式与所需的 zhfonts.tex。 21 | 22 | [ 本帖最后由 LiYanrui 于 2009-3-24 11:21 编辑 ] 23 | 本主题由 Neals 于 2009-3-5 12:38 设置高亮 24 | 25 | 26 | 注意,只有 ConTeXt Minimal beta 2009.02.25 之后的版本才可以编译该示例。 27 | 28 | -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/zhfonts-new/test.tex: -------------------------------------------------------------------------------- 1 | % 加载字体定义文件 2 | \usetypescriptfile[zhfonts] 3 | 4 | % 设定西文字体 5 | \usetypescript[serif][pagella] 6 | \usetypescript[sans][heros] 7 | \usetypescript[mono][cursor] 8 | 9 | % 加载字体定义 10 | \usetypescript[myfont] 11 | 12 | % 设置文档默认字体 13 | \setupbodyfont[myfont,rm,12pt] 14 | 15 | % 启用中文断行规则 16 | \setscript[hanzi] 17 | 18 | % 使用本地化 label [可选] 19 | \mainlanguage[cn] 20 | 21 | % 首行缩进与行间距设置 22 | \setupindenting[always,2em,first] 23 | \setupinterlinespace[big] 24 | \setuphead[chapter][indentnext=yes] 25 | 26 | \starttext 27 | 28 | \chapter{MkIV 中文排版支持的最近更新介绍} 29 | 30 | Wolfgang 写了一份新的 zhfonts.tex,默认定义了 pagella, palatino, termes, times 四种西文字体以及 Adobe 宋体、仿宋、楷体、黑体四种中文字体。我对这份文件进行了一点小修改,硬性设定了中文与西文字符的间距大小,并且禁止在数学公式中直接使用中文字体,其下载见附件。 31 | 32 | Hans 对 CJK 框架进行了调整,并且已将这部分内容的变动写入了 MkIV Reference 文档中,见 http://www.pragma-ade.com/general/manuals/mk.pdf 33 | 34 | 最近,Hans 在最新的 ConTeXt Minimals Beta 版本中添加了中文 label 支持,也就是说,现在基本上可以使用“第 x 章”、"图 x"、"表 x" 这样的中文本地化 label 的内建功能了。 35 | 36 | \stoptext -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/zhfonts/ch1.tex: -------------------------------------------------------------------------------- 1 | \startcomponent ch1 2 | \product mkiv 3 | 4 | \chapter{基础知识} 5 | 6 | 介绍下基本知识。 7 | 8 | \page[yes] 9 | 第二页。 10 | 11 | \page[yes] 12 | 第三页。 13 | \page[yes] 14 | 第四ss页 aaa 中文。\crlf 15 | 中文中文\crlf 16 | 嗯,中文好 17 | 18 | \stopcomponent 19 | 20 | -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/zhfonts/ch2.tex: -------------------------------------------------------------------------------- 1 | \startcomponent ch1 2 | \product mkiv 3 | 4 | \chapter{基础知识} 5 | 6 | 介绍下基本知识。 7 | 8 | \stopcomponent 9 | 10 | -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/zhfonts/cover.tex: -------------------------------------------------------------------------------- 1 | \startcomponent cover 2 | \product mkiv 3 | 4 | \definecolor [BackgroundColor] [h=cccccc] 5 | \definecolor [OrnamentColor] [h=99ccff] 6 | \definecolor [TitleColor] [h=336699] 7 | 8 | \startMPinclusions 9 | def random_hash_frame (expr width, height, offset, linewidth ) = 10 | 11 | def delta = ((uniformdeviate .5offset) + .25offset) enddef ; 12 | x1 := offset ; y1 := offset ; x2 := width-offset ; y2 := height-offset ; 13 | 14 | drawoptions(withpen pencircle scaled linewidth withcolor transparent(1,.8,\MPcolor{BackgroundColor})) ; 15 | fill z1--(x2,y1)--z2--(x1,y2)--cycle ; 16 | 17 | drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{OrnamentColor}) ; 18 | draw (x1-delta,y1)--(x2+delta,y1) ; 19 | draw (x2,y1-delta)--(x2,y2+delta) ; 20 | draw (x2+delta,y2)--(x1-delta,y2) ; 21 | draw (x1,y2+delta)--(x1,y1-delta) ; 22 | 23 | drawoptions(); 24 | setbounds currentpicture to unitsquare xscaled width yscaled height ; 25 | enddef ; 26 | \stopMPinclusions 27 | 28 | \startuseMPgraphic{TitleGraphic} 29 | for i=1 upto 400 : 30 | offset := uniformdeviate 10pt ; 31 | width := 2*offset + 40pt + uniformdeviate 30pt ; 32 | height := 2*offset + 30pt + uniformdeviate 10pt ; 33 | addto currentpicture also 34 | image(random_hash_frame(width,height,offset,1pt)) shifted 35 | (uniformdeviate OverlayWidth, uniformdeviate OverlayHeight) ; 36 | endfor ; 37 | \stopuseMPgraphic 38 | 39 | \defineoverlay [TitleGraphic] [\useMPgraphic{TitleGraphic}] 40 | 41 | \setupbackgrounds 42 | [page] 43 | [background={TitleGraphic,NextPage}] 44 | 45 | \startstandardmakeup 46 | \startcolor[white] 47 | \startframedtext[middle][width=.8\textwidth,height=6cm] 48 | \dontleavehmode 49 | \blank[.5cm] 50 | \hfil\bfd\ConTeXt\ 文档模板\hfil 51 | \blank[1cm] 52 | \hfil\bfa Author Name\hfil 53 | \blank[.5cm] 54 | \hfil\bf \currentdate\hfil 55 | \stopframedtext 56 | \stopcolor 57 | 58 | \blank[14cm] 59 | \stopstandardmakeup 60 | 61 | \setupbackgrounds[page] 62 | [background=] 63 | 64 | \stopcomponent 65 | 66 | -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/zhfonts/main.tex: -------------------------------------------------------------------------------- 1 | \startproduct mkiv 2 | \environment doc-env 3 | 4 | \component cover 5 | 6 | \startfrontmatter 7 | \setuppagenumbering[conversion=romannumerals] 8 | \setuppagenumber[number=1] 9 | \pagereference[Content] 10 | 11 | \completecontent 12 | \completelistoffigures 13 | \completelistoftables 14 | \stopfrontmatter 15 | 16 | \startbodymatter 17 | \setuppagenumbering[conversion=numbers] 18 | \setuppagenumber[number=1] 19 | \setups{HeaderFooter} 20 | 21 | \component ch1 22 | \component ch2 23 | \stopbodymatter 24 | 25 | \startappendices 26 | \completepublications 27 | \completeindex 28 | \stopappendices 29 | 30 | \startbackmatter 31 | \stopbackmatter 32 | 33 | \stopproduct 34 | 35 | -------------------------------------------------------------------------------- /templates/ConTeXt-MkIV/zhfonts/readme.txt: -------------------------------------------------------------------------------- 1 | ConTeXt MkIV 文档模板,大部分代码来自 Liu Yanrui 的 2 | ctxnotes:http://code.google.com/p/ctxnotes/ 3 | 4 | -------------------------------------------------------------------------------- /templates/LaTeX/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: $(MAKECMDGOALS) makefile-help 2 | 3 | makefile-help: 4 | @echo Usage: 5 | @echo ' make [TOOLCHAINS=xelatex,pdflatex,dvipdfmx,dvips] [SYNCTEX=0] doc-without-suffix...' 6 | @echo 7 | @echo xelatex is the default toolchain. 8 | 9 | 10 | AVAILABLE_TOOLCHAINS := xelatex pdflatex dvipdfmx dvips 11 | SYNCTEX := 1 12 | 13 | define xelatex 14 | %$1.pdf : %.tex 15 | xelatex -jobname="$$(@:.pdf=)" -synctex=$(SYNCTEX) $$< 16 | xelatex -jobname="$$(@:.pdf=)" -synctex=$(SYNCTEX) $$< 17 | endef 18 | 19 | define pdflatex 20 | %$1.pdf : %.tex 21 | pdflatex -jobname="$$(@:.pdf=)" -synctex=$(SYNCTEX) $$< 22 | pdflatex -jobname="$$(@:.pdf=)" -synctex=$(SYNCTEX) $$< 23 | if grep -q "^[^%].*\\documentclass\s*\[.*GBK" $$< ; then \ 24 | gbk2uni $$(@:.pdf=.out) ; \ 25 | pdflatex -jobname="$$(@:.pdf=)" -synctex=$(SYNCTEX) $$< ; \ 26 | fi 27 | endef 28 | 29 | define dvipdfmx 30 | %$1.pdf : %.tex 31 | latex -jobname="$$(@:.pdf=)" -synctex=$(SYNCTEX) $$< 32 | latex -jobname="$$(@:.pdf=)" -synctex=$(SYNCTEX) $$< 33 | if grep -q "^[^%].*\\documentclass\s*\[.*GBK" $$< ; then \ 34 | if ! kpsewhich -format="cmap files" GBK-EUC-UCS2 ; then \ 35 | gbk2uni $$(@:.pdf=.out) ; \ 36 | latex -jobname="$$(@:.pdf=)" -synctex=$(SYNCTEX) $$< ; \ 37 | fi ; \ 38 | fi 39 | dvipdfmx $$(@:.pdf=.dvi) 40 | endef 41 | 42 | define dvips 43 | %$1.pdf : %.tex 44 | latex -jobname="$$(@:.pdf=)" -synctex=$(SYNCTEX) $$< 45 | latex -jobname="$$(@:.pdf=)" -synctex=$(SYNCTEX) $$< 46 | if grep -q "^[^%].*\\documentclass\s*\[.*GBK" $$< ; then \ 47 | gbk2uni $$(@:.pdf=.out) ; \ 48 | latex -jobname="$$(@:.pdf=)" -synctex=$(SYNCTEX) $$< ; \ 49 | fi 50 | dvips $$(@:.pdf=.dvi) 51 | ps2pdf $$(@:.pdf=.ps) 52 | endef 53 | 54 | 55 | override TOOLCHAINS := $(strip $(TOOLCHAINS)) 56 | ifeq ($(TOOLCHAINS),) 57 | override TOOLCHAINS := xelatex 58 | endif 59 | 60 | comma := , 61 | empty := 62 | space := $(empty) $(empty) 63 | override TOOLCHAINS := $(subst $(comma),$(space),$(TOOLCHAINS)) 64 | 65 | ifneq ($(filter-out $(AVAILABLE_TOOLCHAINS),$(TOOLCHAINS)),) 66 | $(error Unrecognized toolchains: $(TOOLCHAINS) (available: $(AVAILABLE_TOOLCHAINS))) 67 | endif 68 | 69 | SOURCES := $(filter-out clean distclean,$(MAKECMDGOALS)) 70 | 71 | ifneq ($(SOURCES),) 72 | ifeq ($(words $(TOOLCHAINS)),1) 73 | $(SOURCES): % : %.pdf 74 | $(eval $(call $(TOOLCHAINS))) 75 | else 76 | $(SOURCES): % : $(addprefix %-,$(addsuffix .pdf,$(TOOLCHAINS))) 77 | $(foreach toolchain,$(TOOLCHAINS),$(eval $(call $(toolchain),-$(toolchain)))) 78 | endif 79 | endif 80 | 81 | clean: 82 | rm -f *.log *.aux *.toc *.out *.dvi *.xdv *.synctex.gz *.out.bak 83 | 84 | distclean: clean 85 | rm -f *.pdf *.ps 86 | 87 | -------------------------------------------------------------------------------- /templates/LaTeX/all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir t && cd t || exit 1 4 | 5 | cp ../utf8.tex utf8-cjkfonts.tex 6 | cp ../utf8.tex utf8-winfonts.tex 7 | cp ../utf8.tex utf8-adobefonts.tex 8 | 9 | sed -i -e 's/\/cjkfonts/' utf8-cjkfonts.tex 10 | sed -i -e 's/\/adobefonts/' utf8-adobefonts.tex 11 | 12 | for f in *.tex; do 13 | for t in xelatex pdflatex dvipdfmx; do 14 | make -f ../Makefile TOOLCHAINS="$t,$t" "${f%.tex}" 15 | done 16 | 17 | sed -i -e 's/\/ps2pdf/' "$f" 18 | make -f ../Makefile TOOLCHAINS=dvips,dvips "${f%.tex}" 19 | done 20 | 21 | -------------------------------------------------------------------------------- /templates/LaTeX/utf8.tex: -------------------------------------------------------------------------------- 1 | % LaTeX-chinese-template v0.4 2 | % https://github.com/CTeX-org/ctex-kit/ 3 | % 4 | % You may need to check the instructions at the end of this file. 5 | % See the manual for the collection CTeX for more details. 6 | % 7 | \documentclass[UTF8, zihao=-4, a4paper]{ctexart} 8 | \usepackage{hyperref} 9 | 10 | \title{\LaTeX{} 中文文档模板} 11 | \author{作者} 12 | 13 | \begin{document} 14 | 15 | \maketitle 16 | \tableofcontents 17 | 18 | \section{前言} 19 | 20 | 你好,\CTeX{} 文档类。 21 | 22 | \section{正文} 23 | 24 | 世界你好! 25 | 26 | \section{后记} 27 | 28 | 非常好! 29 | 30 | \end{document} 31 | 32 | ----- How to Compile ----- 33 | 34 | This LaTeX manuscript should be saved as UTF-8 encoding, and be compiled by 35 | 36 | * LaTeX - DVIPDFMx or, 37 | * pdfLaTeX or, 38 | * XeLaTeX or, 39 | * LuaLaTeX. 40 | 41 | Note that, the later two compiling method are recommended. 42 | 43 | ----- Fonts ----- 44 | 45 | The collection CTeX at version 2.0 or later has the ability to detect what 46 | kind of operation system that you are using. As a result, the collection will 47 | automatically choose an appropriate fontset for the specific OS. 48 | 49 | * Mac OS X - SinoType(华文) will be selected 50 | * Windows - Sim(中易) will be selected 51 | * Others - Fandol, which is distributed alone with TeX Live, will be selected 52 | 53 | Since the fontset SinoType couldn't work under pdfTeX, you may only use XeLaTeX 54 | and/or LuaLaTeX on Mac OS X. Otherwise, you will have to choose a fontset 55 | manually. 56 | 57 | ----- Environment ----- 58 | 59 | Tested with TeX Live 2015 on Mac OS X (10.9.5). 60 | 61 | * xetex r37058 3.14159265-2.6-0.99992 (TeX Live 2015) 62 | * pdftex r37159 3.14159265-2.6-1.40.16 (TeX Live 2015) 63 | * luatex r37078 Version beta-0.80.0 (TeX Live 2015) (rev 5228) 64 | 65 | * CTeX 5d27e06 v2.0 2015/05/08 66 | * CJK r36951 v4.8.4 67 | * xeCJK r35946 v3.3.0 68 | * LuaTeX-ja r36992 20150420.0 69 | 70 | Hope these information useful for TeX newbies :-) 71 | Liu Yubao 72 | 73 | ChangeLog: 74 | 2009-09-11 Liu Yubao 75 | * initial version, v0.1 76 | 77 | 2009-09-13 Liu Yubao 78 | * use zhwinfonts to embed truetype fonts with pdflatex and dvipdfmx 79 | * set hyperref properly for different encodings and TeX engines to avoid garbled bookmarks 80 | % release v0.2 81 | 82 | 2010-06-20 Liu Haiyang 83 | * simpify zhwinfonts and hyperref, v0.3 84 | 85 | 2015-05-08 Liam Huang 86 | * CTeX 2.0 is about to release 87 | * v0.4 88 | -------------------------------------------------------------------------------- /templates/README: -------------------------------------------------------------------------------- 1 | This directory contains some simple chinese document templates to help 2 | newbies kick start. 3 | 4 | These files are licensed in LPPL. 5 | 6 | If you are interested in the process of development you 7 | may observe 8 | 9 | https://github.com/CTeX-org/ctex-kit/tree/master/templates 10 | 11 | - Liu Yubao 12 | 13 | -------------------------------------------------------------------------------- /xCJK2uni/build.lua: -------------------------------------------------------------------------------- 1 | 2 | module = "xcjk2uni" 3 | 4 | packtdszip = true 5 | 6 | sourcefiles = {"xCJK2uni.dtx"} 7 | unpackfiles = {"xCJK2uni.dtx"} 8 | installfiles = {"*.sty", "xCJK2uni-U*.def", "*.cmap", "*.ins"} 9 | unpacksuppfiles = {"xCJK2uni.id", "ctxdocstrip.tex"} 10 | typesetsuppfiles = {"ctxdoc.cls"} 11 | 12 | tdslocations = { 13 | "source/latex/xcjk2uni/*.ins", 14 | "tex/latex/xcjk2uni/cmap/*.cmap", 15 | } 16 | 17 | dofile("../support/build-config.lua") 18 | -------------------------------------------------------------------------------- /xpinyin/build.lua: -------------------------------------------------------------------------------- 1 | 2 | module = "xpinyin" 3 | 4 | packtdszip = true 5 | 6 | sourcefiles = {"xpinyin.dtx", "xpinyin.ins"} 7 | unpackfiles = {"xpinyin.ins"} 8 | gitverfiles = {"xpinyin.dtx"} 9 | installfiles = {"*.sty", "*.def", "*.ins"} 10 | unpacksuppfiles = {"xpinyin.id", "xpinyin.db", "ctxdocstrip.tex"} 11 | typesetsuppfiles = {"ctxdoc.cls"} 12 | 13 | tdslocations = { 14 | "source/latex/xpinyin/*.ins", 15 | } 16 | 17 | function unpack_prehook() 18 | cleandir(unpackdir) 19 | cp("ctxdocstrip.tex", supportdir, currentdir) 20 | os.execute(unpackexe .. " -output-directory=" .. unpackdir .." xpinyin.dtx > " .. os_null) 21 | rmfile(".", "ctxdocstrip.tex") 22 | cp("xpinyin.ins", unpackdir, currentdir) 23 | cp("xpinyin.lua", unpackdir, supportdir) 24 | run(supportdir, "texlua xpinyin.lua") 25 | end 26 | 27 | function unpack_posthook() 28 | rmfile(currentdir, "ctxdocstrip.tex") 29 | rmfile(currentdir, "xpinyin.ins") 30 | end 31 | 32 | dofile("../support/build-config.lua") 33 | -------------------------------------------------------------------------------- /zh-luatex/test/test.tex: -------------------------------------------------------------------------------- 1 | \input zhluatex 2 | \font\a=YourFont at 11pt\a 3 | 4 | \baselineskip = 1.5\baselineskip % double spacing 5 | \topskip .5in 6 | \narrower\narrower 7 | 8 | 暖国的雨,向来没有变过冰冷的坚硬的灿烂的雪花。博识的人们觉得他单调,他自己也以为不幸否耶?江南的雪,可是滋润美艳之至了;那是还在隐约着的青春的消息,是极壮健的处子的皮肤。雪野中有血红的宝珠山茶,白中隐青的单瓣梅花,深黄的磬口的蜡梅花;雪下面还有冷绿的杂草。蝴蝶确乎没有;蜜蜂是否来采山茶花和梅花的 蜜,我可记不真切了。但我的眼前仿佛看见冬花开在雪野中,有许多蜜蜂们忙碌地飞着,也 听得他们嗡嗡地闹着。 9 | 10 | 孩子们呵着冻得通红,像紫芽姜一般的小手,七八个一齐来塑雪罗汉。因为不成功,谁的父亲也来帮忙了。罗汉就塑得比孩子们高得多,虽然不过是上小下大的一堆,终于分不清是壶卢还是罗汉;然而很洁白,很明艳,以自身的滋润相粘结,整个地闪闪地生光。孩子们 用龙眼核给他做眼珠,又从谁的母亲的脂粉奁中偷得胭脂来涂在嘴唇上。这回确是一个大阿 罗汉了。他也就目光灼灼地嘴唇通红地坐在雪地里。 11 | 12 | 第二天还有几个孩子来访问他;对了他拍手,点头,嘻笑。但他终于独自坐着了。晴天又来消释他的皮肤,寒夜又使他结一层冰,化作不透明的水晶模样;连续的晴天又使他成为不知道算什么,而嘴上的胭脂也褪尽了。 13 | 14 | 但是,朔方的雪花在纷飞之后,却永远如粉,如沙,他们决不粘连,撒在屋上,地上,枯草上,就是这样。屋上的雪是早已就有消化了的,因为屋里居人的火的温热。别的,在晴 天之下,旋风忽来,便蓬勃地奋飞,在日光中灿灿地生光,如包藏火焰的大雾,旋转而且升腾,弥漫太空,使太空旋转而且升腾地闪烁。 15 | 16 | 在无边的旷野上,在凛冽的天宇下,闪闪地旋转升腾着的是雨的精魂……是的,那是孤独的雪,是死掉的雨,是雨的精魂。 17 | 18 | \bye 19 | -------------------------------------------------------------------------------- /zh-luatex/tex/scrp-zhpunc.lua: -------------------------------------------------------------------------------- 1 | zhpunc = {} 2 | 3 | local has_attribute = node.has_attribute 4 | local glyph = node.id('glyph') 5 | local hlist = node.id('hlist') 6 | local number_to_kind = scripts.number_to_kind 7 | local prestat = attributes.numbers['prestat'] 8 | 9 | local insert_node_after = node.insert_after 10 | local insert_node_before = node.insert_before 11 | local make_glue_node = nodes.glue 12 | local fontdata = fonts.ids 13 | 14 | local zhpunc_space = 0 15 | 16 | local function set_parameters(font, data) 17 | local parameters = fontdata[font].parameters 18 | local quad = (parameters and parameters.quad or parameters[6]) or 0 19 | zhpunc_space = (data.zhpunc_space_factor / data.num) * quad 20 | end 21 | 22 | local dataset = { 23 | num = 1, 24 | zhpunc_space_factor = 0.55, 25 | } 26 | 27 | function zhpunc.proc (head, groupcode) 28 | if groupcode ~= "" then return true end 29 | 30 | local tmpnode = head 31 | local paralist = {} 32 | local pcount = 0 33 | while tmpnode do 34 | if tmpnode.id == hlist then 35 | pcount = pcount + 1 36 | paralist[pcount] = tmpnode 37 | end 38 | tmpnode = tmpnode.next 39 | end 40 | 41 | for i, para in ipairs (paralist) do 42 | if i == pcount then break end 43 | local lcount = 0 44 | local inline = para.list 45 | local last = nil 46 | local line = {} 47 | while inline do 48 | if inline.id == glyph then 49 | lcount = lcount + 1 50 | line[lcount] = inline 51 | last = inline 52 | end 53 | inline = inline.next 54 | end 55 | if last then 56 | local a = has_attribute(last, prestat) 57 | local zhchar = number_to_kind[a] 58 | if zhchar == "full_width_close" then 59 | local font = last.font 60 | dataset.num = lcount 61 | set_parameters(font,dataset) 62 | for j, v in ipairs (line) do 63 | insert_node_after(head, v, make_glue_node(zhpunc_space, 0, 0)) 64 | end 65 | end 66 | line = nil 67 | end 68 | end 69 | return head 70 | end 71 | 72 | return zhpunc 73 | -------------------------------------------------------------------------------- /zh-luatex/tex/zhluatex.tex: -------------------------------------------------------------------------------- 1 | \directlua { 2 | dofile(kpse.find_file("scrp-ini.lua","tex")) 3 | dofile(kpse.find_file("scrp-cjk.lua","tex")) 4 | chinese=scripts.names['hanzi'] 5 | preproc=attributes.private("preproc") 6 | function myfunc(head, groupcode) 7 | for t in node.traverse(head) do 8 | node.set_attribute(t,preproc, chinese) 9 | end 10 | scripts.preprocess(head) 11 | return true 12 | end 13 | callback.register('pre_linebreak_filter', myfunc) 14 | } 15 | 16 | \directlua { 17 | dofile (kpse.find_file ("scrp-zhpunc.lua", "tex")) 18 | callback.register ("post_linebreak_filter", zhpunc.proc) 19 | } 20 | -------------------------------------------------------------------------------- /zhlineskip/CJKmetrics.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/zhlineskip/CJKmetrics.pdf -------------------------------------------------------------------------------- /zhlineskip/Latinmetrics.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTeX-org/ctex-kit/a45eac4db008e6c9f5b776ab1cc7c050b98db6c0/zhlineskip/Latinmetrics.pdf -------------------------------------------------------------------------------- /zhlineskip/README.md: -------------------------------------------------------------------------------- 1 | zhlineskip 2 | ========== 3 | 4 | `zhlineskip` is a package for typesetting CJK documents. This package allows users 5 | to specify two ratios: One between the leading and the font size of the body text 6 | and the other between those of the footnote text. 7 | For Latin typography, these ratios usually range 8 | [from 1.2 to 1.45](https://practicaltypography.com/line-spacing.html), 9 | but they should be larger for CJK typography (usually from 1.5 to 1.67). 10 | 11 | Although CJK text requires larger line spacing, maths formulae should follow 12 | the rules of Latin typography, since maths often consists of only Latin-based 13 | letters and symbols. The `zhlineskip` package is capable of restoring the 14 | maths leading to that of the Latin text. 15 | 16 | Finally, it is possible to achieve the “Microsoft Word multiple line spacing” 17 | style using `zhlineskip`. 18 | 19 | Contributing 20 | ------------ 21 | 22 | This package is a part of the [CTeX-kit](https://github.com/CTeX-org/ctex-kit) project. 23 | 24 | Issues and pull requests are welcome. 25 | 26 | Copyright and Licence 27 | --------------------- 28 | 29 | Copyright (C) 2018, 2019 by Ruixi Zhang 30 | 31 | This work may be distributed and/or modified under the 32 | conditions of the LaTeX Project Public License, either version 1.3c 33 | of this license or (at your option) any later version. 34 | The latest version of this license is in 35 | https://www.latex-project.org/lppl.txt 36 | and version 1.3c or later is part of all distributions of LaTeX 37 | version 2005/12/01 or later. 38 | 39 | This work has the LPPL maintenance status `maintained'. 40 | 41 | The Current Maintainer of this work is Ruixi Zhang. 42 | 43 | This work consists of the files zhlineskip.sty, 44 | zhlineskip.tex, 45 | zhlineskip-test.tex, 46 | Latinmetrics.pdf, 47 | CJKmetrics.pdf, 48 | README.md (this file) 49 | and the derived file zhlineskip.pdf. -------------------------------------------------------------------------------- /zhlineskip/zhlineskip-test.tex: -------------------------------------------------------------------------------- 1 | % !TeX program = XeLaTeX 2 | \documentclass[no-math,a4paper]{ctexart} 3 | \usepackage{newpxtext,newpxmath} % https://ctan.org/pkg/newpx 4 | \usepackage{blindtext} % https://ctan.org/pkg/blindtext 5 | \usepackage{zhlipsum} % https://ctan.org/pkg/zhlipsum 6 | \usepackage{amsmath} % https://ctan.org/pkg/amsmath 7 | \usepackage{caption} % https://ctan.org/pkg/caption 8 | \usepackage{booktabs} % https://ctan.org/pkg/booktabs 9 | \usepackage[width=378bp]{geometry} % https://ctan.org/pkg/geometry 10 | 11 | \usepackage{zhlineskip} 12 | \SetTextEnvironmentSinglespace{1.05} 13 | \RestoreTextEnvironmentLeading{tabular} 14 | \SetMathEnvironmentSinglespace{1.05} 15 | 16 | \begin{document} 17 | \zhlipsum*[1]\footnote{\zhlipsum*[2]}下面是欧拉公式的推导: 18 | \begin{align} 19 | e^{i z} & = 1 + i z + \frac{(i z)^2}{2!} + \frac{(i z)^3}{3!} 20 | + \frac{(i z)^4}{4!} + \frac{(i z)^5}{5!} 21 | + \frac{(i z)^6}{6!} + \frac{(i z)^7}{7!} + \dotsb \\ 22 | & = \Bigl( 1 - \frac{z^2}{2!} + \frac{z^4}{4!} 23 | - \frac{z^6}{6!} + \dotsb \Bigr) 24 | + i \, \Bigl( z - \frac{z^3}{3!} + \frac{z^5}{5!} 25 | - \frac{z^7}{7!} + \dotsb \Bigr) \\ 26 | & = \cos z + i \sin z. 27 | \end{align} 28 | 又一个脚注\footnote{\zhlipsum*[3]}。 29 | \begin{table}[ht] 30 | \centering 31 | \caption[短标题]{一个非常非常非常非常非常非常非常非常非常非常非常非常 32 | 非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常长的标题。} 33 | \begin{tabular}{c c} 34 | \toprule 35 | 第一项 & 第二项 \\ 36 | \midrule 37 | $10$ & $20$ \\ 38 | $10$ & $20$ \\ 39 | \bottomrule 40 | \end{tabular} 41 | \end{table} 42 | \zhlipsum[4] 43 | \begin{quotation} 44 | \linespread{1.05}\selectfont 45 | \blindtext 46 | \end{quotation} 47 | \zhlipsum[5] 48 | \end{document} -------------------------------------------------------------------------------- /zhmetrics-uptex/README.md: -------------------------------------------------------------------------------- 1 | zhmetrics-uptex 2 | =============================================== 3 | 4 | **2016/04/23 Ver 1.0** 5 | 6 | The `zhmetrics-uptex` package contains some Chinese font metrics (JFM, VF, etc) for upTeX engine, together with a simple DVIPDFMx font mapping of Fandol fonts for DVIPDFMx. 7 | 8 | The font mapping can be loaded in the TeX source file, or changed in the document to use other fonts. 9 | 10 | Files 11 | ----- 12 | 13 | * `upzh*-{h,v}.tfm` are the JFM files used by upTeX. 14 | * `upzh*-{h,v}.vf` are the virtual fonts used by the output driver (dvipdfmx). 15 | * `up*-{h,v}.tfm` are the PS TFM files used by the output driver. 16 | * `upzhfandolfonts.tex` contains the font mappings of Fandol fonts for DVIPDFMx. 17 | * `upzhfandolfonts-test.tex` is a small LaTeX test file. 18 | * `upzhm-{h,v}.pl` are the JPL source files used to produce JFM files. 19 | * `makemetrics.lua` is the build script. 20 | 21 | Build 22 | ----- 23 | 24 | To create the metric files, just run: 25 | ```shell 26 | texlua makemetrics.lua 27 | ``` 28 | in the source directory. 29 | 30 | Contributing 31 | ------------ 32 | 33 | This font package is a part of the [ctex-kit](https://github.com/CTeX-org/ctex-kit) project. 34 | 35 | Issues and pull requests are welcome. 36 | 37 | Copyright and Licence 38 | --------------------- 39 | 40 | Copyright (C) 2016 by Leo Liu 41 | 42 | This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version. The latest version of this license is in 43 | http://www.latex-project.org/lppl.txt 44 | and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. 45 | 46 | This work has the LPPL maintenance status `maintained'. 47 | 48 | The Current Maintainer of this work is Leo Liu. 49 | 50 | This work consists of the files 51 | makemetrics.lua 52 | upzhm-{h,v}.pl 53 | upzhfandolfonts.tex 54 | upzhfandolfongs-test.tex 55 | README.md 56 | and the derived files 57 | upzhserif-{h,v}.tfm 58 | upzhserifit-{h,v}.tfm 59 | upzhserifb-{h,v}.tfm 60 | upzhsans-{h,v}.tfm 61 | upzhsnasb-{h,v}.tfm 62 | upzhmono-{h,v}.tfm 63 | upzhserif-{h,v}.vf 64 | upzhserifit-{h,v}.vf 65 | upzhserifb-{h,v}.vf 66 | upzhsans-{h,v}.vf 67 | upzhsnasb-{h,v}.vf 68 | upzhmono-{h,v}.vf 69 | upserif-{h,v}.tfm 70 | upserifit-{h,v}.tfm 71 | upserifb-{h,v}.tfm 72 | upsans-{h,v}.tfm 73 | upsnasb-{h,v}.tfm 74 | upmono-{h,v}.tfm 75 | -------------------------------------------------------------------------------- /zhmetrics-uptex/build.lua: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env texlua 2 | 3 | -- zhmetrics-uptex v1.0 4 | -- Copyright (C) 2016 by Leo Liu 5 | 6 | local fonts = {'serif', 'serifit', 'serifb', 'sans', 'sansb', 'mono'} 7 | 8 | function copyfile(path_src, path_dst) 9 | local cp = 'cp -f' 10 | if os.type == 'windows' then 11 | cp = 'copy /y' 12 | path_src = path_src:gsub('/', '\\') 13 | path_dst = path_dst:gsub('/', '\\') 14 | end 15 | os.execute(cp .. ' ' .. path_src .. ' ' .. path_dst) 16 | end 17 | 18 | function move(path_src, path_dst) 19 | local mv = 'mv -f' 20 | if os.type == 'windows' then 21 | mv = 'move /y' 22 | path_src = path_src:gsub('/', '\\') 23 | path_dst = path_dst:gsub('/', '\\') 24 | end 25 | os.execute(mv .. ' ' .. path_src .. ' ' .. path_dst) 26 | end 27 | 28 | function mkdir(dir) 29 | if lfs.attributes(dir) ~= nil then 30 | do return end 31 | end 32 | local md = 'mkdir -p' 33 | if os.type == 'windows' then 34 | md = 'mkdir' 35 | dir = dir:gsub('/', '\\') 36 | end 37 | os.execute(md .. ' ' .. dir) 38 | end 39 | 40 | function rmdir(dir) 41 | if lfs.attributes(dir) == nil then 42 | do return end 43 | end 44 | local rd = 'rm -r -f' 45 | if os.type == 'windows' then 46 | rd = 'rmdir /s /q' 47 | dir = dir:gsub('/', '\\') 48 | end 49 | os.execute(rd .. ' ' .. dir) 50 | end 51 | 52 | function packfiles(zipname, workdir, tfmdir, vfdir, texdir, sourcedir, docdir) 53 | mkdir(tfmdir) 54 | mkdir(vfdir) 55 | mkdir(texdir) 56 | mkdir(sourcedir) 57 | mkdir(docdir) 58 | for _, hv in pairs({'h', 'v'}) do 59 | for _, fnt in pairs(fonts) do 60 | local jfm = string.format('upzh%s-%s.tfm', fnt, hv) 61 | local vf = string.format('upzh%s-%s.vf', fnt, hv) 62 | local pstfm = string.format('up%s-%s.tfm', fnt, hv) 63 | copyfile(jfm, tfmdir .. '/') 64 | copyfile(pstfm, tfmdir .. '/') 65 | copyfile(vf, vfdir .. '/') 66 | end 67 | local pl = string.format('upzhm-%s.pl', hv) 68 | copyfile(pl, sourcedir .. '/') 69 | end 70 | copyfile('makemetrics.lua', sourcedir .. '/') 71 | copyfile('upzhfandolfonts.tex', texdir .. '/') 72 | copyfile('README.md', docdir .. '/') 73 | copyfile('upzhfandolfonts-test.tex', docdir .. '/') 74 | copyfile('upzhfandolfonts-test.pdf', docdir .. '/') 75 | local tdszipname = 'zhmetrics-uptex.tds.zip' 76 | if lfs.attributes(zipname) then 77 | os.remove(zipname) 78 | end 79 | local curdir = lfs.currentdir() 80 | lfs.chdir(workdir) 81 | os.execute('zip -r ' .. curdir .. '/' .. zipname .. ' *') 82 | lfs.chdir(curdir) 83 | end 84 | 85 | function tds() 86 | packfiles('zhmetrics-uptex.tds.zip', 'tds', 87 | 'tds/fonts/tfm/zhmetrics-uptex', 88 | 'tds/fonts/vf/zhmetrics-uptex', 89 | 'tds/tex/uptex/zhmetrics-uptex', 90 | 'tds/source/fonts/zhmetrics-uptex', 91 | 'tds/doc/fonts/zhmetrics-uptex') 92 | end 93 | 94 | function ctan() 95 | packfiles('zhmetrics-uptex.zip', 'ctan', 96 | 'ctan/tfm', 97 | 'ctan/vf', 98 | 'ctan/tex', 99 | 'ctan/source', 100 | 'ctan/doc') 101 | copyfile('README.md', 'ctan/') 102 | os.execute('zip zhmetrics-uptex.zip README.md') 103 | end 104 | 105 | function clean() 106 | for _, hv in pairs({'h', 'v'}) do 107 | for _, fnt in pairs(fonts) do 108 | local jfm = string.format('upzh%s-%s.tfm', fnt, hv) 109 | local vf = string.format('upzh%s-%s.vf', fnt, hv) 110 | local pstfm = string.format('up%s-%s.tfm', fnt, hv) 111 | os.remove(jfm) 112 | os.remove(vf) 113 | os.remove(pstfm) 114 | end 115 | end 116 | rmdir('tds') 117 | rmdir('ctan') 118 | end 119 | 120 | function main(target) 121 | local unpack = function() 122 | dofile('makemetrics.lua') 123 | os.execute('uplatex upzhfandolfonts-test') 124 | os.execute('dvipdfmx upzhfandolfonts-test') 125 | for _, suf in pairs({'.aux', '.log', '.dvi'}) do 126 | os.remove('upzhfandolfonts-test' .. suf) 127 | end 128 | end 129 | if target == 'unpack' then 130 | unpack() 131 | elseif target == 'tds' then 132 | unpack() 133 | tds() 134 | elseif target == 'ctan' then 135 | unpack() 136 | ctan() 137 | elseif target == 'clean' then 138 | clean() 139 | else 140 | print('Usage: ' .. arg[0] .. ' [unpack|tds|ctan|clean]') 141 | end 142 | end 143 | 144 | main(arg[1]) 145 | -------------------------------------------------------------------------------- /zhmetrics-uptex/makemetrics.lua: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env texlua 2 | 3 | -- zhmetrics-uptex v1.0 4 | -- Copyright (C) 2016 by Leo Liu 5 | 6 | local fonts = {'serif', 'serifit', 'serifb', 'sans', 'sansb', 'mono'} 7 | local pltopf = 'uppltotf -kanji=uptex' 8 | local makejvf = 'makejvf -e -3 -i -u gb' 9 | 10 | for _, hv in pairs({'h', 'v'}) do 11 | for _, fnt in pairs(fonts) do 12 | local pl = string.format('upzhm-%s.pl', hv) 13 | local jfm = string.format('upzh%s-%s.tfm', fnt, hv) 14 | local vf = string.format('upzh%s-%s.vf', fnt, hv) 15 | local pstfm = string.format('up%s-%s.tfm', fnt, hv) 16 | os.execute(string.format('%s %s %s', pltopf, pl, jfm)) 17 | os.execute(string.format('%s %s %s', makejvf, jfm, pstfm)) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /zhmetrics-uptex/upzhfandolfonts-test.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \usepackage[dvipdfm,a5paper,margin=1in]{geometry} 4 | \newcommand\vertical{% 5 | \clearpage 6 | \newgeometry{width=\textheight,height=\textwidth,left=1in,top=1in}% 7 | \tate} 8 | 9 | \font\rm=upzhserif-h 10 | \font\it=upzhserifit-h 11 | \font\bf=upzhserifb-h 12 | \font\sf=upzhsans-h 13 | \font\sfbf=upzhsansb-h 14 | \font\tt=upzhmono-h 15 | \font\vrm=upzhserif-v 16 | \font\vit=upzhserifit-v 17 | \font\vbf=upzhserifb-v 18 | \font\vsf=upzhsans-v 19 | \font\vsfbf=upzhsansb-v 20 | \font\vtt=upzhmono-v 21 | 22 | \AtBeginDvi{\input{upzhfandolfonts}} 23 | 24 | \begin{document} 25 | 26 | \makeatletter 27 | \@for\fnt:=\rm,\it,\bf,\sf,\sfbf,\tt \do{% 28 | {\fnt 29 | 庄子曰:“吾生也有涯,而知也无涯。以有涯随无涯,殆已!已而为知者,殆而已矣! 30 | 为善无近名,为恶无近刑,缘督以为经,可以保身,可以全生,可以养亲,可以尽年。” 31 | \par} 32 | } 33 | 34 | \vertical 35 | 36 | \@for\fnt:=\vrm,\vit,\vbf,\vsf,\vsfbf,\vtt \do{% 37 | {\fnt 38 | 庄子曰:「吾生也有涯,而知也无涯。以有涯随无涯,殆已!已而为知者,殆而已矣! 39 | 为善无近名,为恶无近刑,缘督以为经,可以保身,可以全生,可以养亲,可以尽年。」 40 | \par} 41 | } 42 | \end{document} 43 | -------------------------------------------------------------------------------- /zhmetrics-uptex/upzhfandolfonts.tex: -------------------------------------------------------------------------------- 1 | % Fandol font mapping for dvipdfmx 2 | 3 | \special{pdf:mapline upserif-h UniGB-UTF16-H FandolSong-Regular.otf} 4 | \special{pdf:mapline upserifit-h UniGB-UTF16-H FandolKai-Regular.otf} 5 | \special{pdf:mapline upserifb-h UniGB-UTF16-H FandolSong-Bold.otf} 6 | \special{pdf:mapline upsans-h UniGB-UTF16-H FandolHei-Regular.otf} 7 | \special{pdf:mapline upsansb-h UniGB-UTF16-H FandolHei-Bold.otf} 8 | \special{pdf:mapline upmono-h UniGB-UTF16-H FandolFang-Regular.otf} 9 | 10 | \special{pdf:mapline upserif-v UniGB-UTF16-V FandolSong-Regular.otf} 11 | \special{pdf:mapline upserifit-v UniGB-UTF16-V FandolKai-Regular.otf} 12 | \special{pdf:mapline upserifb-v UniGB-UTF16-V FandolSong-Bold.otf} 13 | \special{pdf:mapline upsans-v UniGB-UTF16-V FandolHei-Regular.otf} 14 | \special{pdf:mapline upsansb-v UniGB-UTF16-V FandolHei-Bold.otf} 15 | \special{pdf:mapline upmono-v UniGB-UTF16-V FandolFang-Regular.otf} 16 | 17 | \endinput 18 | -------------------------------------------------------------------------------- /zhmetrics-uptex/upzhm-h.pl: -------------------------------------------------------------------------------- 1 | (COMMENT Chinese Font Metrics for upTeX Horizontal Typesetting) 2 | (DIRECTION YOKO) 3 | (FAMILY UPZHM HANZI) 4 | (FACE F MRR) 5 | (CODINGSCHEME TEX KANJI TEXT) 6 | (DESIGNSIZE R 10.0) 7 | (COMMENT DESIGNSIZE IS IN POINTS) 8 | (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) 9 | (CHECKSUM O 0) 10 | (FONTDIMEN 11 | (SLANT R 0.0) 12 | (SPACE R 0.0) 13 | (STRETCH R 0.100000) 14 | (SHRINK R 0.0) 15 | (XHEIGHT R 1.000000) 16 | (QUAD R 1.000000) 17 | (EXTRASPACE R 0.250000) 18 | (EXTRASTRETCH R 0.200000) 19 | (EXTRASHRINK R 0.125000) 20 | ) 21 | (GLUEKERN 22 | (LABEL O 0) 23 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 24 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 25 | (STOP) 26 | (LABEL O 1) 27 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 28 | (STOP) 29 | (LABEL O 2) 30 | (GLUE O 0 R 0.500000 R 0.0 R 0.500000) 31 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 32 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 33 | (GLUE O 5 R 0.500000 R 0.0 R 0.500000) 34 | (STOP) 35 | (LABEL O 3) 36 | (GLUE O 0 R 0.250000 R 0.0 R 0.250000) 37 | (GLUE O 1 R 0.250000 R 0.0 R 0.250000) 38 | (GLUE O 2 R 0.250000 R 0.0 R 0.250000) 39 | (GLUE O 3 R 0.500000 R 0.0 R 0.250000) 40 | (GLUE O 4 R 0.250000 R 0.0 R 0.250000) 41 | (GLUE O 5 R 0.250000 R 0.0 R 0.250000) 42 | (STOP) 43 | (LABEL O 4) 44 | (GLUE O 0 R 0.500000 R 0.0 R 0.0) 45 | (GLUE O 1 R 0.500000 R 0.0 R 0.0) 46 | (GLUE O 3 R 0.750000 R 0.0 R 0.250000) 47 | (GLUE O 5 R 0.500000 R 0.0 R 0.0) 48 | (STOP) 49 | (LABEL O 5) 50 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 51 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 52 | (KRN O 5 R 0.0) 53 | (STOP) 54 | ) 55 | (CHARSINTYPE O 1 56 | ‘ “ ( 〔 [ { 〈 《 「 『 57 | 【 58 | UFF5F U3018 U3016 U301D 59 | U2329 U301A 60 | ) 61 | (CHARSINTYPE O 2 62 | 、 , : ; ’ ” ) 〕 ] } 〉 》 63 | 」 』 】 64 | UFF60 U3019 U3017 U301F 65 | U232A U301B U301E 66 | ) 67 | (CHARSINTYPE O 3 68 | ・ 69 | U00B7 70 | ) 71 | (CHARSINTYPE O 4 72 | 。 . ? ! 73 | ) 74 | (CHARSINTYPE O 5 75 | — ― … ‥ 76 | ) 77 | (TYPE O 0 78 | (CHARWD R 1.000000) 79 | (CHARHT R 0.880000) 80 | (CHARDP R 0.120000) 81 | (COMMENT 82 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 83 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 84 | ) 85 | ) 86 | (TYPE O 1 87 | (CHARWD R 0.500000) 88 | (CHARHT R 0.880000) 89 | (CHARDP R 0.120000) 90 | (COMMENT 91 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 92 | ) 93 | ) 94 | (TYPE O 2 95 | (CHARWD R 0.500000) 96 | (CHARHT R 0.880000) 97 | (CHARDP R 0.120000) 98 | (COMMENT 99 | (GLUE O 0 R 0.500000 R 0.0 R 0.500000) 100 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 101 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 102 | (GLUE O 5 R 0.500000 R 0.0 R 0.500000) 103 | ) 104 | ) 105 | (TYPE O 3 106 | (CHARWD R 0.500000) 107 | (CHARHT R 0.880000) 108 | (CHARDP R 0.120000) 109 | (COMMENT 110 | (GLUE O 0 R 0.250000 R 0.0 R 0.250000) 111 | (GLUE O 1 R 0.250000 R 0.0 R 0.250000) 112 | (GLUE O 2 R 0.250000 R 0.0 R 0.250000) 113 | (GLUE O 3 R 0.500000 R 0.0 R 0.250000) 114 | (GLUE O 4 R 0.250000 R 0.0 R 0.250000) 115 | (GLUE O 5 R 0.250000 R 0.0 R 0.250000) 116 | ) 117 | ) 118 | (TYPE O 4 119 | (CHARWD R 0.500000) 120 | (CHARHT R 0.880000) 121 | (CHARDP R 0.120000) 122 | (COMMENT 123 | (GLUE O 0 R 0.500000 R 0.0 R 0.0) 124 | (GLUE O 1 R 0.500000 R 0.0 R 0.0) 125 | (GLUE O 3 R 0.750000 R 0.0 R 0.250000) 126 | (GLUE O 5 R 0.500000 R 0.0 R 0.0) 127 | ) 128 | ) 129 | (TYPE O 5 130 | (CHARWD R 1.000000) 131 | (CHARHT R 0.880000) 132 | (CHARDP R 0.120000) 133 | (COMMENT 134 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 135 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 136 | (KRN O 5 R 0.0) 137 | ) 138 | ) 139 | -------------------------------------------------------------------------------- /zhmetrics-uptex/upzhm-v.pl: -------------------------------------------------------------------------------- 1 | (COMMENT Chinese Font Metrics for upTeX Vertical Typesetting) 2 | (DIRECTION TATE) 3 | (FAMILY UPZHM HANZI) 4 | (FACE F MRR) 5 | (CODINGSCHEME TEX KANJI TEXT) 6 | (DESIGNSIZE R 10.0) 7 | (COMMENT DESIGNSIZE IS IN POINTS) 8 | (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) 9 | (CHECKSUM O 0) 10 | (FONTDIMEN 11 | (SLANT R 0.0) 12 | (SPACE R 0.0) 13 | (STRETCH R 0.100000) 14 | (SHRINK R 0.0) 15 | (XHEIGHT R 1.000000) 16 | (QUAD R 1.000000) 17 | (EXTRASPACE R 0.250000) 18 | (EXTRASTRETCH R 0.200000) 19 | (EXTRASHRINK R 0.125000) 20 | ) 21 | (GLUEKERN 22 | (LABEL O 0) 23 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 24 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 25 | (STOP) 26 | (LABEL O 1) 27 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 28 | (STOP) 29 | (LABEL O 2) 30 | (GLUE O 0 R 0.500000 R 0.0 R 0.500000) 31 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 32 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 33 | (GLUE O 5 R 0.500000 R 0.0 R 0.500000) 34 | (STOP) 35 | (LABEL O 3) 36 | (GLUE O 0 R 0.250000 R 0.0 R 0.250000) 37 | (GLUE O 1 R 0.250000 R 0.0 R 0.250000) 38 | (GLUE O 2 R 0.250000 R 0.0 R 0.250000) 39 | (GLUE O 3 R 0.500000 R 0.0 R 0.250000) 40 | (GLUE O 4 R 0.250000 R 0.0 R 0.250000) 41 | (GLUE O 5 R 0.250000 R 0.0 R 0.250000) 42 | (STOP) 43 | (LABEL O 4) 44 | (GLUE O 0 R 0.500000 R 0.0 R 0.0) 45 | (GLUE O 1 R 0.500000 R 0.0 R 0.0) 46 | (GLUE O 3 R 0.750000 R 0.0 R 0.250000) 47 | (GLUE O 5 R 0.500000 R 0.0 R 0.0) 48 | (STOP) 49 | (LABEL O 5) 50 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 51 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 52 | (KRN O 5 R 0.0) 53 | (STOP) 54 | ) 55 | (CHARSINTYPE O 1 56 | ‘ “ ( 〔 [ { 〈 《 「 『 57 | 【 58 | UFF5F U3018 U3016 U301D 59 | U2329 U301A 60 | ) 61 | (CHARSINTYPE O 2 62 | 、 , ’ ” ) 〕 ] } 〉 》 63 | 」 』 】 64 | UFF60 U3019 U3017 U301F 65 | U232A U301B U301E 66 | ) 67 | (CHARSINTYPE O 3 68 | ・ : ; 69 | U00B7 70 | ) 71 | (CHARSINTYPE O 4 72 | 。 . 73 | ) 74 | (CHARSINTYPE O 5 75 | — ― … ‥ 76 | ) 77 | (TYPE O 0 78 | (CHARWD R 1.000000) 79 | (CHARHT R 0.500000) 80 | (CHARDP R 0.500000) 81 | (COMMENT 82 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 83 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 84 | ) 85 | ) 86 | (TYPE O 1 87 | (CHARWD R 0.500000) 88 | (CHARHT R 0.500000) 89 | (CHARDP R 0.500000) 90 | (COMMENT 91 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 92 | ) 93 | ) 94 | (TYPE O 2 95 | (CHARWD R 0.500000) 96 | (CHARHT R 0.500000) 97 | (CHARDP R 0.500000) 98 | (COMMENT 99 | (GLUE O 0 R 0.500000 R 0.0 R 0.500000) 100 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 101 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 102 | (GLUE O 5 R 0.500000 R 0.0 R 0.500000) 103 | ) 104 | ) 105 | (TYPE O 3 106 | (CHARWD R 0.500000) 107 | (CHARHT R 0.500000) 108 | (CHARDP R 0.500000) 109 | (COMMENT 110 | (GLUE O 0 R 0.250000 R 0.0 R 0.250000) 111 | (GLUE O 1 R 0.250000 R 0.0 R 0.250000) 112 | (GLUE O 2 R 0.250000 R 0.0 R 0.250000) 113 | (GLUE O 3 R 0.500000 R 0.0 R 0.250000) 114 | (GLUE O 4 R 0.250000 R 0.0 R 0.250000) 115 | (GLUE O 5 R 0.250000 R 0.0 R 0.250000) 116 | ) 117 | ) 118 | (TYPE O 4 119 | (CHARWD R 0.500000) 120 | (CHARHT R 0.500000) 121 | (CHARDP R 0.500000) 122 | (COMMENT 123 | (GLUE O 0 R 0.500000 R 0.0 R 0.0) 124 | (GLUE O 1 R 0.500000 R 0.0 R 0.0) 125 | (GLUE O 3 R 0.750000 R 0.0 R 0.250000) 126 | (GLUE O 5 R 0.500000 R 0.0 R 0.0) 127 | ) 128 | ) 129 | (TYPE O 5 130 | (CHARWD R 1.000000) 131 | (CHARHT R 0.500000) 132 | (CHARDP R 0.500000) 133 | (COMMENT 134 | (GLUE O 1 R 0.500000 R 0.0 R 0.500000) 135 | (GLUE O 3 R 0.250000 R 0.0 R 0.250000) 136 | (KRN O 5 R 0.0) 137 | ) 138 | ) 139 | -------------------------------------------------------------------------------- /zhmetrics/Make-zhmCJK.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | if "%1"=="clean" goto clean 3 | 4 | texlua zhmCJK.lua map 5 | pdftex zhmCJK.ins 6 | move /y README.txt README 7 | tounix zhmCJK.map texfonts.map 8 | latex zhmCJK.dtx 9 | makeindex -s gind zhmCJK.idx 10 | makeindex -s gglo -o zhmCJK.gls zhmCJK.glo 11 | latex zhmCJK.dtx 12 | latex zhmCJK.dtx 13 | dvipdfmx zhmCJK.dvi 14 | call :clean_tmp 15 | 16 | if "%1"=="zip" call :zip 17 | if "%1"=="tds" call :tds 18 | shift 19 | if "%1"=="zip" call :zip 20 | if "%1"=="tds" call :tds 21 | goto end 22 | 23 | :zip 24 | call :clean_zip 25 | zip zhmCJK zhmCJK.dtx zhmCJK.ins zhmCJK.lua README zhmCJK.sty zhmCJK.pdf zhmCJK.tfm texfonts.map zhmCJK.map zhmCJK-test.tex 26 | if exist fallback.tar.bz2 zip zhmCJK fallback.tar.bz2 27 | exit /b 28 | 29 | :clean_zip 30 | if exist zhmCJK.zip del zhmCJK.zip 31 | exit /b 32 | 33 | :tds 34 | call :clean_tds 35 | mkdir source\latex\zhmCJK 36 | copy zhmCJK.dtx source\latex\zhmCJK\ 37 | copy zhmCJK.ins source\latex\zhmCJK\ 38 | copy zhmCJK.lua source\latex\zhmCJK\ 39 | copy zhmCJK-addmap.pl source\latex\zhmCJK\ 40 | mkdir tex\latex\zhmCJK 41 | copy zhmCJK.sty tex\latex\zhmCJK\ 42 | mkdir doc\latex\zhmCJK 43 | copy zhmCJK.pdf doc\latex\zhmCJK\ 44 | copy zhmCJK-test.tex doc\latex\zhmCJK\ 45 | copy README doc\latex\zhmCJK\ 46 | mkdir fonts\map\fontname 47 | copy zhmCJK.map fonts\map\fontname\ 48 | copy texfonts.map fonts\map\fontname\ 49 | mkdir fonts\tfm\zhmCJK 50 | copy zhmCJK.tfm fonts\tfm\zhmCJK\ 51 | if exist fallback.tar.bz2 copy fallback.tar.bz2 fonts\tfm\zhmCJK\ 52 | zip -r zhmCJK-tds source tex doc fonts 53 | exit /b 54 | 55 | :clean_tds 56 | if exist zhmCJK-tds.zip del zhmCJK-tds.zip 57 | for %%i in (doc fonts source tex) do if exist %%i rmdir /s /q %%i 58 | exit /b 59 | 60 | :clean_tmp 61 | for %%i in (zhmCJK.dvi zhmCJK.aux zhmCJK.log zhmCJK.glo zhmCJK.gls zhmCJK.idx zhmCJK.ind zhmCJK.ilg zhmCJK.out zhmCJK.tmp zhmCJK.hd zhmCJK.*~ Make-zhmCJK.bat~) do if exist %%i del %%i 62 | for %%i in (zhmCJK-test.dvi zhmCJK-test.aux zhmCJK-test.log zhmCJK-test.*~) do if exist %%i del %%i 63 | for %%i in (*.synctex.*) do del %%i 64 | exit /b 65 | 66 | :clean 67 | call :clean_tmp 68 | call :clean_zip 69 | call :clean_tds 70 | for %%i in (zhmCJK.tfm texfonts.map zhmCJK.map zhmCJK.pdf zhmCJK.sty README README.txt zhmCJK-test.tex) do if exist %%i del %%i 71 | for %%i in (zhmCJK-test.pdf) do if exist %%i del %%i 72 | 73 | :end 74 | -------------------------------------------------------------------------------- /zhmetrics/build.lua: -------------------------------------------------------------------------------- 1 | 2 | module = "zhmcjk" 3 | 4 | packtdszip = true 5 | 6 | gitverfiles = { } 7 | sourcefiles = {"zhmCJK.dtx", "zhmCJK.ins", "zhmCJK.lua", "zhmCJK-addmap.pl"} 8 | unpackfiles = {"zhmCJK.ins"} 9 | installfiles = {"zhmCJK.sty"} 10 | typesetfiles = {"zhmCJK.dtx", "zhmCJK-test.tex"} 11 | unpackexe = "pdftex" 12 | typesetexe = "latex" 13 | 14 | dtxchecksum = dtxchecksum or { } 15 | dtxchecksum.exe = "latex" 16 | dtxchecksum.cfgfile = "ltxdoc.cfg" 17 | 18 | function docinit_hook() 19 | cp("zhmCJK-test.tex", unpackdir, typesetdir) 20 | return 0 21 | end 22 | 23 | function doc_posthook() 24 | for _, i in pairs(typesetfiles) do 25 | local name = jobname(i) 26 | run(typesetdir, "dvipdfmx " .. name) 27 | cp(name .. ".pdf", typesetdir, currentdir) 28 | end 29 | end 30 | 31 | function copyctan_posthook() 32 | mkdir(supportdir) 33 | cp("zhmCJK.lua", currentdir, supportdir) 34 | run(supportdir, "texlua zhmCJK.lua map") 35 | if not lfs.isfile(supportdir .. "/miktex-tfm.tar.bz2") then 36 | run(supportdir, "texlua zhmCJK.lua nomap") 37 | run(supportdir, "tar --remove-files -cjf miktex-tfm.tar.bz2 miktex-tfm") 38 | end 39 | local ctandir = ctandir .. "/" .. ctanpkg 40 | local mapdir = tdsdir .. "/fonts/map/fontname" 41 | mkdir(mapdir) 42 | for _, i in ipairs{"texfonts.map.template", "zhmCJK.map"} do 43 | cp(i, supportdir, ctandir) 44 | cp(i, supportdir, mapdir) 45 | end 46 | local tfmdir = tdsdir .. "/fonts/tfm/" .. ctanpkg 47 | mkdir(tfmdir) 48 | for _, i in ipairs{"zhmCJK.tfm", "miktex-tfm.tar.bz2"} do 49 | cp(i, supportdir, ctandir) 50 | cp(i, supportdir, tfmdir) 51 | end 52 | end 53 | 54 | dofile("../support/build-config.lua") 55 | -------------------------------------------------------------------------------- /zhmetrics/zhfd.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2009 Lingyun Wu 2 | -- This file may be distributed and/or modified under the 3 | -- conditions of the LaTeX Project Public License, either version 1.3 4 | -- of this license or (at your option) any later version. 5 | -- The latest version of this license is in 6 | -- http://www.latex-project.org/lppl.txt 7 | -- and version 1.3 or later is part of all distributions of LaTeX 8 | -- version 2005/12/01 or later. 9 | 10 | 11 | -- global settings 12 | settings = { 13 | name = "zhfd", 14 | version = "v1.0", 15 | date = "2009/09/23", 16 | slant = "sl", 17 | } 18 | 19 | -- expand the variables in string 20 | function expand(s, t) 21 | return (string.gsub(s, "%$(%w+)", t or settings)) 22 | end 23 | expand_path = expand 24 | 25 | -- replace default io.open 26 | do 27 | local open = io.open 28 | io.open = function(f, m) return open(expand_path(f), m) end 29 | end 30 | 31 | -- fd file template 32 | fdfile = [[ 33 | % This is the file $fdprelower$fdname.fd of the CJK package 34 | % for using Asian logographs (Chinese/Japanese/Korean) with LaTeX2e 35 | % 36 | % automatically generated by $name $version 37 | 38 | \def\fileversion{4.8.2} 39 | \def\filedate{$date} 40 | \ProvidesFile{$fdprelower$fdname.fd}[\filedate\space\fileversion] 41 | 42 | % Chinese characters 43 | % 44 | % character set: $encoding 45 | % font encoding: CJK ($encoding) 46 | 47 | \DeclareFontFamily{$fdpre}{$fdname}{\hyphenchar \font\m@ne} 48 | 49 | \DeclareFontShape{$fdpre}{$fdname}{m}{n}{<-> CJK * $prefix$cjkname}{\CJKnormal} 50 | \DeclareFontShape{$fdpre}{$fdname}{b}{n}{<-> CJKb * $prefix$cjkname}{\CJKbold} 51 | \DeclareFontShape{$fdpre}{$fdname}{bx}{n}{<-> CJKb * $prefix$cjkname}{\CJKbold} 52 | \DeclareFontShape{$fdpre}{$fdname}{m}{it}{<-> CJK * $prefix$cjkname$slant}{\CJKnormal} 53 | \DeclareFontShape{$fdpre}{$fdname}{b}{it}{<-> CJKb * $prefix$cjkname$slant}{\CJKbold} 54 | \DeclareFontShape{$fdpre}{$fdname}{bx}{it}{<-> CJKb * $prefix$cjkname$slant}{\CJKbold} 55 | \DeclareFontShape{$fdpre}{$fdname}{m}{sl}{<-> CJK * $prefix$cjkname$slant}{\CJKnormal} 56 | \DeclareFontShape{$fdpre}{$fdname}{b}{sl}{<-> CJKb * $prefix$cjkname$slant}{\CJKbold} 57 | \DeclareFontShape{$fdpre}{$fdname}{bx}{sl}{<-> CJKb * $prefix$cjkname$slant}{\CJKbold} 58 | 59 | \endinput 60 | ]] 61 | 62 | function generate_fd (encoding, fdpre, fdname, prefix, cjkname) 63 | settings.encoding = encoding 64 | settings.fdpre = fdpre 65 | settings.fdprelower = string.lower(fdpre) 66 | settings.fdname = fdname 67 | settings.prefix = prefix 68 | settings.cjkname = cjkname 69 | local f = io.open([[$fdprelower$fdname.fd]], "w") 70 | if f then 71 | f:write(expand(fdfile)) 72 | io.close(f) 73 | end 74 | end 75 | 76 | generate_fd("GBK", "C19", "zhsong", "gbk", "song") 77 | generate_fd("GBK", "C19", "zhhei", "gbk", "hei") 78 | generate_fd("GBK", "C19", "zhkai", "gbk", "kai") 79 | generate_fd("GBK", "C19", "zhfs", "gbk", "fs") 80 | generate_fd("GBK", "C19", "zhli", "gbk", "li") 81 | generate_fd("GBK", "C19", "zhyou", "gbk", "you") 82 | 83 | generate_fd("UTF8", "C70", "zhsong", "uni", "song") 84 | generate_fd("UTF8", "C70", "zhhei", "uni", "hei") 85 | generate_fd("UTF8", "C70", "zhkai", "uni", "kai") 86 | generate_fd("UTF8", "C70", "zhfs", "uni", "fs") 87 | generate_fd("UTF8", "C70", "zhli", "uni", "li") 88 | generate_fd("UTF8", "C70", "zhyou", "uni", "you") 89 | 90 | generate_fd("GBK", "C19", "hei", "gbk", "hei") 91 | generate_fd("GBK", "C19", "kai", "gbk", "kai") 92 | generate_fd("GBK", "C19", "fs", "gbk", "fs") 93 | generate_fd("GBK", "C19", "li", "gbk", "li") 94 | generate_fd("GBK", "C19", "you", "gbk", "you") 95 | 96 | generate_fd("UTF8", "C70", "hei", "uni", "hei") 97 | generate_fd("UTF8", "C70", "kai", "uni", "kai") 98 | generate_fd("UTF8", "C70", "fs", "uni", "fs") 99 | generate_fd("UTF8", "C70", "li", "uni", "li") 100 | generate_fd("UTF8", "C70", "you", "uni", "you") 101 | -------------------------------------------------------------------------------- /zhmetrics/zhmCJK-addmap.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | # Copyright (C) 2012--2016 by Leo Liu 4 | # 5 | # Run this script to add tfm font map for zhmCJK package. 6 | 7 | chomp ( my $texmfdist = `kpsewhich -var-value=TEXMFDIST` ) ; 8 | my $texfontsmap = "$texmfdist/fonts/map/fontname/texfonts.map"; 9 | 10 | my $absent = 1; 11 | 12 | if (-r "$texfontsmap") { 13 | open (FOO, "<$texfontsmap"); 14 | my @lines = ; 15 | chomp(@lines); 16 | close(FOO); 17 | for my $line (@lines) { 18 | if ($line =~ m/^\s*include\s+zhmCJK\.map\s*/) { 19 | $absent = 0; 20 | } 21 | } 22 | } 23 | 24 | if ($absent) { 25 | open (FOO, ">>$texfontsmap") || die("Cannot write $texfontsmap\n"); 26 | print FOO "include zhmCJK.map\n"; 27 | close(FOO); 28 | } 29 | -------------------------------------------------------------------------------- /zhnumber/build.lua: -------------------------------------------------------------------------------- 1 | 2 | module = "zhnumber" 3 | 4 | packtdszip = true 5 | 6 | sourcefiles = {"zhnumber.dtx"} 7 | unpackfiles = {"zhnumber.dtx"} 8 | installfiles = {"*.sty", "*.cfg", "*.ins"} 9 | unpacksuppfiles = {"zhnumber.id", "ctxdocstrip.tex", "ctex-zhconv.lua", "ctex-zhconv-index.lua"} 10 | typesetsuppfiles = {"ctxdoc.cls"} 11 | 12 | tdslocations = { 13 | "source/latex/zhnumber/*.ins", 14 | } 15 | 16 | dofile("../support/build-config.lua") 17 | -------------------------------------------------------------------------------- /zhspacing/README.md: -------------------------------------------------------------------------------- 1 | zhspacing 2 | ========= 3 | 4 | `zhspacing` is a package for typesetting CJK documents in XeTeX 5 | for plain TeX, LaTeX and ConTeXt. 6 | 7 | Contributing 8 | ------------ 9 | 10 | This package is a part of the [ctex-kit](https://github.com/CTeX-org/ctex-kit) project. 11 | 12 | Issues and pull requests are welcome. 13 | 14 | Copyright and Licence 15 | --------------------- 16 | 17 | Copyright (C) 2007--2009 by Yin Dian 18 | Copyright (C) 2010--2012 by Leo Liu 19 | Copyright (C) 2016 by Qing Lee 20 | ---------------------------------------------------------------------- 21 | 22 | This work may be distributed and/or modified under the 23 | conditions of the LaTeX Project Public License, either 24 | version 1.3c of this license or (at your option) any later 25 | version. This version of this license is in 26 | http://www.latex-project.org/lppl/lppl-1-3c.txt 27 | and the latest version of this license is in 28 | http://www.latex-project.org/lppl.txt 29 | and version 1.3 or later is part of all distributions of 30 | LaTeX version 2005/12/01 or later. 31 | 32 | This work has the LPPL maintenance status `maintained'. 33 | 34 | The Current Maintainer of this work is Qing Lee. 35 | 36 | This package consists of the files zhspacing.sty, 37 | zhsmyclass.sty, 38 | zhsusefulmacros.sty, 39 | zhfont.sty, 40 | zhmath.sty, 41 | zhulem.sty, 42 | t-zhspacing.tex, 43 | zhs-man.tex, 44 | zhspacing-context-test.tex, 45 | README.md (this file), 46 | and the derived files zhs-man.pdf. 47 | -------------------------------------------------------------------------------- /zhspacing/build.lua: -------------------------------------------------------------------------------- 1 | 2 | module = "zhspacing" 3 | 4 | packtdszip = true 5 | tdsroot = "generic" 6 | 7 | unpackfiles = { } 8 | sourcefiles = {"*.sty", "t-zhspacing.tex"} 9 | installfiles = sourcefiles 10 | typesetfiles = {"zhs-man.tex"} 11 | docfiles = {"zhspacing-context-test.tex"} 12 | typesetexe = "xelatex" 13 | 14 | tdslocations = { 15 | "tex/xelatex/zhspacing/zhfont.sty", 16 | "tex/xelatex/zhspacing/zhulem.sty", 17 | "tex/context/third/zhspacing/t-zhspacing.tex", 18 | } 19 | -------------------------------------------------------------------------------- /zhspacing/zhspacing-context-test.tex: -------------------------------------------------------------------------------- 1 | \usemodule[zhspacing] 2 | 3 | 4 | 这是中文测试。中文和English的混排。中 5 | 文和$E=mc^2$的混排。 6 | 7 | 九齿钉耙学名上宝沁晶耙,是俺的武器。九齿钉耙并非普通的农具,而是由 8 | 太上老君\footnote{太上老君,三清之第三位。又称“道德天尊”、 9 | “混元老君”、“降生天尊”、“太清大帝”等。}用神冰铁亲自锤炼,借五方五 10 | 帝、六丁六甲之力锻造而成,有诗为证: 11 | 12 | 九齿钉耙学名上宝沁晶耙,是俺的武器。九齿钉耙并非普通的农具,而是由 13 | 太上老君\footnote{太上老君,三清之第三位。又称“道德天尊”、 14 | “混元老君”、“降生天尊”、“太清大帝”等。}用神冰铁亲自锤炼,借五方五 15 | 帝、六丁六甲之力锻造而成,有诗为证: 16 | 17 | \rm\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps 18 | 19 | \ss\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps 20 | 21 | \tt\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps 22 | 23 | \blank 24 | 25 | \rm\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 26 | \rm\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 27 | \rm\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 28 | \rm\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 29 | 30 | \blank 31 | 32 | \ss\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 33 | \ss\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 34 | \ss\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 35 | \ss\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 36 | 37 | \blank 38 | 39 | \tt\tf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 40 | \tt\it 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 41 | \tt\bf 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 42 | \tt\bi 兡也包因沘氓侷柵苗孫孫財 text 兡也包因沘氓侷柵苗孫孫財\par 43 | 44 | 45 | \bye -------------------------------------------------------------------------------- /zhspacing/zhsusefulmacros.sty: -------------------------------------------------------------------------------- 1 | % zhsusefulmacros.sty 2 | % This file provides several useful LaTeX macros as well as \ifLaTeX@e, 3 | % and \futurenonspacelet. 4 | % Licensed under LPPL. 5 | \catcode`\@=11 6 | \ifx\@usefulmacros@defined\@undefined\else 7 | \expandafter\endinput 8 | \fi 9 | \def\@usefulmacros@defined{\relax} 10 | \def\@usefulmacros@LaTeX@e{LaTeX2e} 11 | \def\ifLaTeX@e{\ifx\fmtname\@usefulmacros@LaTeX@e} 12 | \ifLaTeX@e\else 13 | \def\@nnil{\@nil}% 14 | \def\@empty{}% 15 | \def\@fornoop#1\@@#2#3{}% 16 | \long\def\@for#1:=#2\do#3{% 17 | \expandafter\def\expandafter\@fortmp\expandafter{#2}% 18 | \ifx\@fortmp\@empty \else 19 | \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi}% 20 | \long\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else 21 | #5\def#4{#2}\ifx #4\@nnil \else#5\@iforloop #3\@@#4{#5}\fi\fi}% 22 | \long\def\@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil 23 | \expandafter\@fornoop \else 24 | #4\relax\expandafter\@iforloop\fi#2\@@#3{#4}}% 25 | \def\@tfor#1:={\@tf@r#1 }% 26 | \long\def\@tf@r#1#2\do#3{\def\@fortmp{#2}\ifx\@fortmp\space\else 27 | \@tforloop#2\@nil\@nil\@@#1{#3}\fi}% 28 | \long\def\@tforloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil 29 | \expandafter\@fornoop \else 30 | #4\relax\expandafter\@tforloop\fi#2\@@#3{#4}}% 31 | \long\def\@ifnextchar#1#2#3{% 32 | \let\reserved@d=#1% 33 | \def\reserved@a{#2}% 34 | \def\reserved@b{#3}% 35 | \futurelet\@let@token\@ifnch} 36 | \def\@ifnch{% 37 | \ifx\@let@token\@sptoken 38 | \let\reserved@c\@xifnch 39 | \else 40 | \ifx\@let@token\reserved@d 41 | \let\reserved@c\reserved@a 42 | \else 43 | \let\reserved@c\reserved@b 44 | \fi 45 | \fi 46 | \reserved@c} 47 | \def\:{\let\@sptoken= } \: % this makes \@sptoken a space token 48 | \def\:{\@xifnch} \expandafter\def\: {\futurelet\@let@token\@ifnch} 49 | % 50 | \long\def\@firstoftwo#1#2{#1} 51 | \long\def\@secondoftwo#1#2{#2} 52 | \expandafter\ifx\csname ifcsname\endcsname\relax 53 | \def\@ifundefined#1{% 54 | \expandafter\ifx\csname#1\endcsname\relax 55 | \expandafter\@firstoftwo 56 | \else 57 | \expandafter\@secondoftwo 58 | \fi} 59 | \else 60 | \def\@ifundefined#1{% 61 | \unless\ifcsname#1\endcsname 62 | \expandafter\@firstoftwo 63 | \else 64 | \expandafter\@secondoftwo 65 | \fi} 66 | \fi 67 | % 68 | \def\@namedef#1{\expandafter\def\csname #1\endcsname} 69 | % 70 | \fi % end of \ifLaTeX@e\else 71 | 72 | \def\@BTcs{} 73 | \let\nexttoken\relax 74 | \let\next\relax 75 | \def\futurenonspacelet#1{\def\@BTcs{#1}% 76 | \afterassignment\@BTfnslone\let\nexttoken= } 77 | \def\@BTfnslone{\expandafter\futurelet\@BTcs\@BTfnsltwo} 78 | \def\@BTfnsltwo{\expandafter\ifx\@BTcs\@sptoken\let\next=\@BTfnslthree 79 | \else\let\next=\nexttoken\fi \next} 80 | \def\@BTfnslthree{\afterassignment\@BTfnslone\let\next= } 81 | 82 | \ifx\fbox\@undefined 83 | \newbox\fbox@tmpbox 84 | \newdimen\fbox@linewidth 85 | \newdimen\fbox@tmpdim 86 | \fbox@linewidth=0.4pt 87 | \long\def\fbox#1{% 88 | \setbox\fbox@tmpbox=\hbox{#1}% 89 | \fbox@tmpdim=2\fbox@linewidth 90 | \advance\fbox@tmpdim\wd\fbox@tmpbox 91 | \leavevmode\hbox{\vbox{\hrule height \fbox@linewidth width \fbox@tmpdim 92 | \hbox{\vrule width \fbox@linewidth height \ht\fbox@tmpbox 93 | #1\vrule width \fbox@linewidth height \ht\fbox@tmpbox}% 94 | \hrule height \fbox@linewidth width \fbox@tmpdim 95 | }}% 96 | } 97 | \fi 98 | -------------------------------------------------------------------------------- /zhspacing/zhulem.sty: -------------------------------------------------------------------------------- 1 | % zhulem.sty coded by YIN Dian 2 | % Fix compatibility problem with ulem 3 | % Hist: 070822 Changed \UL@reskip and \UL@@penalty, able to work. 4 | \NeedsTeXFormat{LaTeX2e}[1996/12/01] 5 | \def\fileversion{0.4} 6 | \def\filedate{2007/08/22} 7 | \ProvidesPackage{zhulem}[\filedate\space\fileversion] 8 | \RequirePackage{ulem}[2000/05/26] 9 | %\let\zhulem@printfont\zhs@printf@nt 10 | \def\zhulem@printfont#1{} 11 | \def\UL@reskip{\zhs@savef@nt{tmp}\UL@stop \zhulem@printfont{tmp}\UL@leaders 12 | \UL@start\zhs@restoref@nt{tmp}} 13 | \def\UL@@penalty{\LA@penalty \ifnum\count@=\z@ 14 | \@ne \else \count@ \fi % zero penalty => no penalty, so use 1 instead. 15 | \zhs@savef@nt{tmp}\UL@stop \zhulem@printfont{tmp}\UL@start 16 | \zhs@restoref@nt{tmp}} 17 | 18 | \endinput 19 | --------------------------------------------------------------------------------