-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: append and prepend pdf as covers
- Loading branch information
Showing
2 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5263,10 +5263,12 @@ Copyright (C) 2017–2024 by Xiangdong Zeng <[email protected]>. | |
} | ||
% \end{macrocode} | ||
% | ||
% \begin{variable}{\l_@@_auto_make_cover_bool,\l_@@_declaration_page_tl} | ||
% \begin{variable}{\l_@@_auto_make_cover_bool,\l_@@_declaration_page_tl, \l_@@_prepend_cover_tl, \l_@@_append_cover_tl} | ||
% \begin{macrocode} | ||
\bool_new:N \l_@@_auto_make_cover_bool | ||
\tl_new:N \l_@@_declaration_page_tl | ||
\tl_new:N \l_@@_prepend_cover_tl | ||
\tl_new:N \l_@@_append_cover_tl | ||
% \end{macrocode} | ||
% \end{variable} | ||
% | ||
|
@@ -5276,7 +5278,7 @@ Copyright (C) 2017–2024 by Xiangdong Zeng <[email protected]>. | |
\keys_define:nn { fdu / style } | ||
{ | ||
auto-make-cover .bool_set:N = \l_@@_auto_make_cover_bool, | ||
auto-make-cover .default:n = true, | ||
auto-make-cover .default:n = false, | ||
% \end{macrocode} | ||
% \end{macro} | ||
% | ||
|
@@ -5290,6 +5292,28 @@ Copyright (C) 2017–2024 by Xiangdong Zeng <[email protected]>. | |
\tl_set_eq:NN \l_@@_declaration_page_tl \l_keys_value_tl | ||
\RequirePackage { pdfpages } | ||
}, | ||
% \end{macrocode} | ||
% | ||
% \begin{macro}{style/declaration-page} | ||
% 插入预先生成的封面 PDF 到文档首,包括论文封面(封一)、论文撰写人承诺书(封二)等 | ||
% 仅当 auto-make-cover = false 时有效 | ||
% \begin{macrocode} | ||
prepend-cover .code:n = | ||
{ | ||
\tl_set_eq:NN \l_@@_prepend_cover_tl \l_keys_value_tl | ||
\RequirePackage { pdfpages } | ||
}, | ||
% \end{macrocode} | ||
% | ||
% \begin{macro}{style/declaration-page} | ||
% 插入预先生成的封底 PDF 到文档尾,包括教师审查意见(封三)等 | ||
% 仅当 auto-make-cover = false 时有效 | ||
% \begin{macrocode} | ||
append-cover .code:n = | ||
{ | ||
\tl_set_eq:NN \l_@@_append_cover_tl \l_keys_value_tl | ||
\RequirePackage { pdfpages } | ||
}, | ||
} | ||
% \end{macrocode} | ||
% \end{macro} | ||
|
@@ -5298,12 +5322,27 @@ Copyright (C) 2017–2024 by Xiangdong Zeng <[email protected]>. | |
% \begin{macrocode} | ||
\ctex_after_end_preamble:n | ||
{ | ||
\bool_if:NT \l_@@_auto_make_cover_bool | ||
\bool_if:NTF \l_@@_auto_make_cover_bool | ||
{ | ||
\begin{titlepage} | ||
\makecoveri \newpage \makecoverii | ||
\end{titlepage} | ||
} | ||
{ | ||
\begin{titlepage} | ||
\thispagestyle { empty } | ||
\tl_set:Nn \thepage { A } | ||
\tl_if_empty:NTF \l_@@_prepend_cover_tl | ||
{ \empty } | ||
{ | ||
% separate each pdf file with a comma | ||
\tl_set:Nn \l_tmpa_tl { \l_@@_prepend_cover_tl } | ||
\tl_replace_all:Nnn \l_tmpa_tl { , } { } | ||
|
||
\includepdf { \l_@@_prepend_cover_tl } | ||
} | ||
\end{titlepage} | ||
} | ||
} | ||
% \end{macrocode} | ||
% | ||
|
@@ -6044,7 +6083,7 @@ Copyright (C) 2017–2024 by Xiangdong Zeng <[email protected]>. | |
%<class> style / cjk-font = fandol, | ||
style / font-size = -4, | ||
%<class> style / fullwidth-stop = false, | ||
style / auto-make-cover = true, | ||
style / auto-make-cover = false, | ||
style / logo = { fudan-name.pdf }, | ||
style / logo-size = { 0.5 \textwidth }, | ||
style / hyperlink = color, | ||
|