Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在英文模板中添加中文摘要 #294

Open
stone-zeng opened this issue Mar 19, 2023 · 1 comment
Open

在英文模板中添加中文摘要 #294

stone-zeng opened this issue Mar 19, 2023 · 1 comment

Comments

@stone-zeng
Copy link
Owner

一个简单的 workaround:

% 导言区
\ExplSyntaxOn
\NewDocumentEnvironment { abstract* } { }
  { \__fdu_abstract_begin: } { \__fdu_abstract_end: }
\cs_new_protected:Npn \__fdu_abstract_begin:
  {
    \ctexset
      {
        chapter / afterindent = true,
        chapter / numbering   = false,
      }
    \__fdu_line_spread:N \c__fdu_line_spread_fp
    \dim_set:Nn \parindent { 2 \ccwd }
    \chapter { 中文摘要 }
    \__fdu_chapter_header:n { 中文摘要 }
  }
\cs_new_protected:Npn \__fdu_abstract_end:
  {
    \__fdu_keywords:nNn
      { \sffamily \c__fdu_name_keywords_tl \c__fdu_fwid_colon_tl }
      \l__fdu_info_keywords_clist { \c__fdu_fwid_semicolon_tl }
    \skip_vertical:n { 1ex }
    \tl_if_empty:NF \l__fdu_info_clc_tl
      {
        \__fdu_clc_jel:nn
          { \sffamily \c__fdu_name_clc_tl \c__fdu_fwid_colon_tl }
          { \l__fdu_info_clc_tl }
      }
  }
\ExplSyntaxOff

% 正文
\begin{abstract*}
中文摘要
\end{abstract*}
@honghui-liu
Copy link

非常好用!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants