Skip to content

Commit

Permalink
xeCJK: 改用 xparse 的新参数类型 b 定义 CJKfilltwosides* 环境,不再依赖 environ 包
Browse files Browse the repository at this point in the history
closes #413
  • Loading branch information
qinglee committed Mar 25, 2019
1 parent a82420c commit d0dfb9e
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions xeCJK/xeCJK.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ Copyright and Licence
% \changes{v3.6.1}{2018/02/27}{减少 \texttt{bool} 运算。}
% \changes{v3.7.2}{2019/03/23}{同步 \LaTeXiii{} 2019/03/05。}
%
% \CheckSum{10910}
% \CheckSum{10906}
% \GetFileId{xeCJK.sty}
%
% \title{\bfseries\pkg{xeCJK} 宏包}
Expand Down Expand Up @@ -8997,7 +8997,6 @@ Copyright and Licence
% \begin{macrocode}
\RequirePackage { xeCJK }
\RequirePackage { ulem }
\RequirePackage { environ }
% \end{macrocode}
%
% 虽然我们不再依赖 \pkg{CJKfntef},但基于历史原因,我们仍然载入它。
Expand Down Expand Up @@ -10298,6 +10297,8 @@ Copyright and Licence
% \end{macrocode}
% \end{macro}
%
% \changes{v3.7.2}{2019/03/24}{改用 \pkg{xparse} 的新参数类型 \texttt{b}
% 定义 \env{CJKfilltwosides*} 环境,不再依赖 \pkg{environ} 包。}
%
% \begin{macro}{CJKfilltwosides}
% \changes{v3.2.4}{2013/06/26}{改用 \texttt{minipage} 和 \LaTeX 表格(\texttt{tabular})来实现。}
Expand All @@ -10315,39 +10316,27 @@ Copyright and Licence
\endminipage
\ignorespacesafterend
}
\NewEnviron { CJKfilltwosides* } [ 2 ] [ c ]
\DeclareDocumentEnvironment { CJKfilltwosides* } { O { c } m +b }
{
\mode_leave_vertical:
\cs_set_eq:NN \CJKglue \xeCJK_fntef_hfilll:
\tl_set:Nn \arraystretch { 1 }
\cs_if_free:NF \extrarowheight
{ \cs_set_eq:NN \extrarowheight \c_zero_dim }
\use:x { \@@_fill_two_sides:nn {#1} { \dim_eval:n {#2} } }
\use:x { \@@_fill_two_sides:nnn {#1} { \dim_eval:n {#2} } } {#3}
}
[ \ignorespacesafterend ]
\cs_new_protected:Npn \@@_fill_two_sides:nn #1#2
{ \ignorespacesafterend }
\cs_new_protected:Npn \@@_fill_two_sides:nnn #1#2#3
{
\dim_compare:nNnTF {#2} > \c_zero_dim
{
\hbox_set:Nn \l_@@_tmp_box
{
\tabular [#1] { @ { } c @ { } }
\BODY
\endtabular
}
{ \tabular [#1] { @ { } c @ { } } #3 \endtabular }
\dim_compare:nNnTF {#2} > { \box_wd:N \l_@@_tmp_box }
{
\tabular [#1] { @ { } p {#2} @ { } }
\BODY
\endtabular
}
{ \tabular [#1] { @ { } p {#2} @ { } } #3 \endtabular }
{ \box_use:N \l_@@_tmp_box }
}
{
\tabular [#1] { @ { } c @ { } }
\BODY
\endtabular
}
{ \tabular [#1] { @ { } c @ { } } #3 \endtabular }
}
% \end{macrocode}
% \end{macro}
Expand Down

0 comments on commit d0dfb9e

Please sign in to comment.