diff options
author | Karl Berry <karl@freefriends.org> | 2016-08-27 22:15:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-08-27 22:15:39 +0000 |
commit | 5fd39aa8867152c78c0dd8676a185880b9a797b6 (patch) | |
tree | 91cfd1978672e3cbf522d286fc24347d044e1906 /Master/texmf-dist/tex/latex/ctex/ctex-book.def | |
parent | 68238e7a9debc8f575df34da39667b4464e6371f (diff) |
ctex (27aug16)
git-svn-id: svn://tug.org/texlive/trunk@41937 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/ctex-book.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/ctex/ctex-book.def | 77 |
1 files changed, 45 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-book.def b/Master/texmf-dist/tex/latex/ctex/ctex-book.def index a5c09a01673..7a2400e2e55 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-book.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-book.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx f12457f 2016-05-16 00:55:34 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx e653f84 2016-08-27 11:05:06 +0800 Qing Lee <sobenlee@gmail.com> $ {Heading modification for book (CTEX)} \ProvidesExplFile{ctex-book.def} - {\ExplFileDate}{2.4.2}{\ExplFileDescription} + {\ExplFileDate}{2.4.3}{\ExplFileDescription} \seq_new:N \c__ctex_section_headings_seq \seq_gset_from_clist:Nn \c__ctex_section_headings_seq { section , subsection , subsubsection , paragraph , subparagraph } @@ -86,6 +86,7 @@ #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } , #1 / numbering .bool_set:N = \exp_not:c { CTEX@#1@numbering } , #1 / afterindent .bool_set:N = \exp_not:c { CTEX@#1@afterindent } , + #1 / fixskip .bool_set:N = \exp_not:c { CTEX@#1@fixskip } , #1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } , #1 / format+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , @@ -121,10 +122,8 @@ \group_begin: \tl_set:Nn \l__ctex_tmp_tl { - part / pagestyle .tl_set:N = \CTEX@part@pagestyle , - chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , - part / fixbeforeskip .bool_set:N = \CTEX@part@fixbeforeskip , - chapter / fixbeforeskip .bool_set:N = \CTEX@chapter@fixbeforeskip , + part / pagestyle .tl_set:N = \CTEX@part@pagestyle , + chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , } \seq_map_inline:Nn \c__ctex_headings_seq { @@ -139,15 +138,22 @@ \cs_new_protected_nopar:Npn \CTEX@makeheadinganchor { } \ctex_at_end_package:nn { hyperref } { \cs_gset_protected_nopar:Npn \CTEX@makeheadinganchor { \phantomsection } } -\cs_new_protected_nopar:Npn \CTEX@fixbeforeskip +\cs_new_protected_nopar:Npn \CTEX@fixtopskip + { + \CTEX@fixheadingskip + \dim_compare:nNnF \tex_pagegoal:D < \c_max_dim + { \skip_sub:Nn \l__ctex_heading_skip { \tex_topskip:D } } + } +\cs_new_protected_nopar:Npn \CTEX@fixheadingskip { \par - \ifdim \pagegoal = \maxdimen - \advance \@tempskipa -\topskip - \advance \@tempskipa -\parskip - \nointerlineskip - \fi + \dim_set:Nn \tex_prevdepth:D { -1000pt } + \skip_sub:Nn \l__ctex_heading_skip { \tex_parskip:D } } +\skip_new:N \l__ctex_heading_skip +\cs_new_protected_nopar:Npn \CTEX@setheadingskip + { \skip_set:Nn \l__ctex_heading_skip } +\cs_new_eq:NN \CTEX@headingskip \l__ctex_heading_skip \renewcommand\part{% \if@openright \cleardoublepage @@ -161,11 +167,9 @@ \else \@tempswafalse \fi - \@tempskipa = \glueexpr \CTEX@part@beforeskip \relax - \ifodd \CTEX@part@fixbeforeskip - \CTEX@fixbeforeskip - \fi - \vspace*{\@tempskipa}% + \CTEX@setheadingskip \CTEX@part@beforeskip + \ifodd \CTEX@part@fixskip \CTEX@fixtopskip \fi + \vspace*{\CTEX@headingskip}% \secdef\@part\@spart} \def\@part[#1]#2{% \ifnum \c@secnumdepth >-2\relax @@ -195,7 +199,9 @@ \CTEX@part@aftertitle}% \@endpart} \def\@endpart{% - \vskip \glueexpr \CTEX@part@afterskip \relax + \CTEX@setheadingskip \CTEX@part@afterskip + \ifodd \CTEX@part@fixskip \CTEX@fixheadingskip \fi + \vskip \CTEX@headingskip \newpage \if@twoside \if@openright @@ -244,11 +250,9 @@ \@afterheading \fi} \def\@makechapterhead#1{% - \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax - \ifodd \CTEX@chapter@fixbeforeskip - \CTEX@fixbeforeskip - \fi - \vspace*{\@tempskipa}% + \CTEX@setheadingskip \CTEX@chapter@beforeskip + \ifodd \CTEX@chapter@fixskip \CTEX@fixtopskip \fi + \vspace*{\CTEX@headingskip}% {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format \ifnum \c@secnumdepth >\m@ne @@ -262,21 +266,23 @@ \CTEX@chapter@titleformat{#1}% \CTEX@chapter@aftertitle \nobreak - \vskip \glueexpr \CTEX@chapter@afterskip \relax + \CTEX@setheadingskip \CTEX@chapter@afterskip + \ifodd \CTEX@chapter@fixskip \CTEX@fixheadingskip \fi + \vskip \CTEX@headingskip }} \def\@makeschapterhead#1{% - \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax - \ifodd \CTEX@chapter@fixbeforeskip - \CTEX@fixbeforeskip - \fi - \vspace*{\@tempskipa}% + \CTEX@setheadingskip \CTEX@chapter@beforeskip + \ifodd \CTEX@chapter@fixskip \CTEX@fixtopskip \fi + \vspace*{\CTEX@headingskip}% {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format \interlinepenalty\@M \CTEX@chapter@titleformat{#1} \CTEX@chapter@aftertitle \nobreak - \vskip \glueexpr \CTEX@chapter@afterskip \relax + \CTEX@setheadingskip \CTEX@chapter@afterskip + \ifodd \CTEX@chapter@fixskip \CTEX@fixheadingskip \fi + \vskip \CTEX@headingskip }} \def\@startsection#1#2#3#4#5#6{% \if@noskipsec \leavevmode \fi @@ -290,7 +296,10 @@ \if@nobreak \everypar{}% \else - \addpenalty\@secpenalty\addvspace{\glueexpr #4\relax}% + \addpenalty\@secpenalty + \CTEX@setheadingskip{#4}% + \ifodd \CTEX@fixskip \CTEX@fixheadingskip \fi + \addvspace \CTEX@headingskip \fi \@ifstar {\@ssect{#3}{#4}{#5}{#6}}% @@ -358,7 +367,9 @@ \def\@xsect#1{% \unless \ifodd \CTEX@runin \par \nobreak - \vskip\glueexpr #1\relax + \CTEX@setheadingskip{#1}% + \ifodd \CTEX@fixskip \CTEX@fixheadingskip \fi + \vskip \CTEX@headingskip \@afterheading \else \@nobreakfalse @@ -382,11 +393,13 @@ \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle } \cs_set_eq:Nc \CTEX@afterindent { CTEX@#1@afterindent } + \cs_set_eq:Nc \CTEX@fixskip { CTEX@#1@fixskip } \cs_set_eq:Nc \CTEX@runin { CTEX@#1@runin } } \cs_new_eq:NN \CTEX@titleformat@n \use:n \cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing: \cs_new_eq:NN \CTEX@afterindent \c_true_bool +\cs_new_eq:NN \CTEX@fixskip \c_false_bool \cs_new_eq:NN \CTEX@runin \c_false_bool \int_zero:N \l__ctex_tmp_int \seq_map_inline:Nn \c__ctex_section_headings_seq |