diff options
author | Karl Berry <karl@freefriends.org> | 2015-05-14 21:23:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-05-14 21:23:11 +0000 |
commit | 9591c0c57b007ba49f15f0970009bc27efa23db4 (patch) | |
tree | 4ef2076432f70e69f1d944b127898e217b269ae6 /Master/texmf-dist/tex/latex/ctex/ctexsize.sty | |
parent | 99d7ad5df8ac48132b622ee369d7493853592a61 (diff) |
ctex (14may15)
git-svn-id: svn://tug.org/texlive/trunk@37393 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/ctexsize.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ctex/ctexsize.sty | 215 |
1 files changed, 215 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty new file mode 100644 index 00000000000..bb8d7120944 --- /dev/null +++ b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty @@ -0,0 +1,215 @@ +%% +%% This is file `ctexsize.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ctex.dtx (with options: `package,ctexsize') +%% +%% Copyright (C) 2003--2015 +%% CTEX.ORG and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang. +%% +%% ------------------------------------------------------------------------------ +%% +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{expl3} +\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $ + {Chinese font size definition (CTEX)} +\ProvidesExplPackage{ctexsize} + {\ExplFileDate}{2.0}{\ExplFileDescription} +\RequirePackage { xparse , l3keys2e } +\cs_new_eq:NN \g__ctex_font_size_flag \c_minus_one +\keys_define:nn { ctex / option } + { + zihao .choice: , + zihao .default:n = { 5 } , + zihao / 5 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } , + zihao / -4 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_one } , + zihao / false .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_two } , + } +\tl_clear:N \l__ctex_tmp_tl +\clist_map_inline:nn + { + 10pt , 11pt , 12pt , + 8pt , 9pt , 14pt , 17pt , 20pt , 25pt , 30pt , 36pt , 48pt , 60pt + } + { + \tl_put_right:Nn \l__ctex_tmp_tl + { + #1 .code:n = + { \cs_gset_eq:NN \g__ctex_font_size_flag \c_minus_one } , + #1 .value_forbidden: , + } + } +\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l__ctex_tmp_tl } } } +\tl_clear:N \l__ctex_tmp_tl +\ProcessKeysOptions { ctex / option } +\NewDocumentCommand \zihao { m } + { \exp_args:Nx \ctex_zihao:n {#1} \tex_ignorespaces:D } +\cs_new_protected_nopar:Npn \ctex_zihao:n #1 + { + \prop_get:NnNTF \c__ctex_font_size_prop {#1} \l__ctex_font_size_tl + { \exp_after:wN \fontsize \l__ctex_font_size_tl \selectfont } + { \msg_error:nnn { ctex } { fontsize } {#1} } + } +\msg_new:nnnn { ctex } { fontsize } + { Undefined~Chinese~font~size~`#1'~in~command~\token_to_str:N \zihao.} + { + The~old~font~size~is~used~if~you~continue.\\ + The~available~font~sizes~are~listed~as~follow.\\ + \seq_use:Nnnn \c__ctex_font_size_seq { ~and~ } { ,~ } { ,~and~ }. + } +\prop_new:N \c__ctex_font_size_prop +\seq_new:N \c__ctex_font_size_seq +\cs_new_protected_nopar:Npn \__ctex_save_font_size:nn #1#2 + { + \use:x + { + \prop_gput:Nnn \exp_not:N \c__ctex_font_size_prop {#1} + { + { \dim_to_decimal:n {#2} } + { \dim_to_decimal:n { (#2) * \c_six / \c_five } } + } + } + \seq_gput_right:Nn \c__ctex_font_size_seq {#1} + } +\clist_map_inline:nn + { + { 8 } { 5 bp } , + { 7 } { 5.5 bp } , + { -6 } { 6.5 bp } , + { 6 } { 7.5 bp } , + { -5 } { 9 bp } , + { 5 } { 10.5 bp } , + { -4 } { 12 bp } , + { 4 } { 14 bp } , + { -3 } { 15 bp } , + { 3 } { 16 bp } , + { -2 } { 18 bp } , + { 2 } { 22 bp } , + { -1 } { 24 bp } , + { 1 } { 26 bp } , + { -0 } { 36 bp } , + { 0 } { 42 bp } + } + { \__ctex_save_font_size:nn #1 } +\cs_new_protected_nopar:Npn \ctex_declare_math_sizes:nnnn #1#2#3#4 + { + \__ctex_get_font_sizes:Nn \l__ctex_font_size_tl { {#1} {#2} {#3} {#4} } + \exp_after:wN \DeclareMathSizes \l__ctex_font_size_tl + } +\cs_new_protected_nopar:Npn \__ctex_get_font_sizes:Nn #1#2 + { + \tl_clear:N #1 + \tl_map_inline:nn {#2} + { + \prop_get:NnNTF \c__ctex_font_size_prop {##1} \l__ctex_tmp_tl + { \tl_put_right:Nx #1 { { \tl_head:N \l__ctex_tmp_tl } } } + { \tl_put_right:Nx #1 { { \dim_to_decimal:n { ##1 } } } } + } + } +\clist_map_inline:nn + { + { 8 }{ 8 }{ 5pt }{ 5pt } , + { 7 }{ 7 }{ 5pt }{ 5pt } , + { -6 }{ -6 }{ 5pt }{ 5pt } , + { 6 }{ 6 }{ 5pt }{ 5pt } , + { -5 }{ -5 }{ 6pt }{ 5pt } , + { 5 }{ 5 }{ 7pt }{ 5pt } , + { -4 }{ -4 }{ 8pt }{ 6pt } , + { 4 }{ 4 }{ 5 }{ 6 } , + { -3 }{ -3 }{ -4 }{ -5 } , + { 3 }{ 3 }{ 4 }{ 5 } , + { -2 }{ -2 }{ -3 }{ -4 } , + { 2 }{ 2 }{ 3 }{ 4 } , + { -1 }{ -1 }{ -2 }{ -3 } , + { 1 }{ 1 }{ 2 }{ 3 } , + { -0 }{ -0 }{ -1 }{ -2 } , + { 0 }{ 0 }{ 1 }{ 2 } + } + { \ctex_declare_math_sizes:nnnn #1 } +\cs_new_protected:Npn \ctex_set_font_size:Nnn #1#2#3 + { + \prop_get:NnNTF \c__ctex_font_size_prop {#2} \l__ctex_font_size_tl + { \exp_after:wN \__ctex_set_font_size:nnNn \l__ctex_font_size_tl #1 {#3} } + { \msg_error:nnn { ctex } { fontsize } {#2} } + } +\cs_new_protected:Npn \__ctex_set_font_size:nnNn #1#2#3#4 + { \cs_set_protected_nopar:Npn #3 { \@setfontsize #3 {#1} {#2} #4 } } +\if_case:w \g__ctex_font_size_flag + \ctex_file_input:n { ctex-c5size.clo } +\or: + \ctex_file_input:n { ctex-cs4size.clo } +\fi: +\normalsize +%% +%% This package consists of the file ctex.dtx, +%% and the derived files ctex.pdf, +%% ctex.ins, +%% ctex.sty, +%% ctexcap.sty, +%% ctexsize.sty, +%% ctexart.cls, +%% ctexbook.cls, +%% ctexrep.cls, +%% ctex-c5size.clo, +%% ctex-cs4size.clo, +%% ctex-article.def, +%% ctex-book.def, +%% ctex-report.def, +%% ctex-scheme-plain.def, +%% ctex-scheme-plain-article.def, +%% ctex-scheme-plain-book.def, +%% ctex-scheme-plain-report.def, +%% ctex-scheme-chinese.def, +%% ctex-scheme-chinese-article.def, +%% ctex-scheme-chinese-book.def, +%% ctex-scheme-chinese-report.def, +%% ctex-name-gbk.cfg, +%% ctex-name-utf8.cfg, +%% ctex.cfg, +%% ctexopts.cfg, +%% ctex-engine-pdftex.def, +%% ctex-engine-xetex.def, +%% ctex-engine-luatex.def, +%% c19rm.fd, +%% c19sf.fd, +%% c19tt.fd, +%% c70rm.fd, +%% c70sf.fd, +%% c70tt.fd, +%% ctex-fontset-windows.def, +%% ctex-fontset-windowsnew.def, +%% ctex-fontset-windowsold.def, +%% ctex-fontset-adobe.def, +%% ctex-fontset-fandol.def, +%% ctex-fontset-mac.def, +%% ctex-fontset-founder.def, +%% ctex-fontset-ubuntu.def, +%% ctexspa.def, +%% ctexpunct.spa, +%% ctexmakespa.tex, +%% ctexspamacro.tex, +%% zhadobefonts.tex, +%% zhfandolfonts.tex, +%% zhfounderfonts.tex, +%% zhubuntufonts.tex, +%% zhwindowsfonts.tex, and +%% README. +%% +%% End of file `ctexsize.sty'. |