diff --git a/dwev/.gitignore b/dwev/.gitignore new file mode 100644 index 0000000..5acfb17 --- /dev/null +++ b/dwev/.gitignore @@ -0,0 +1,6 @@ +/*.pdf +/*_files + + + + diff --git a/dwev/_extensions/drwater/dwev/eisvogel.tex b/dwev/_extensions/drwater/dwev/eisvogel.tex index 3688e4f..8f92341 100644 --- a/dwev/_extensions/drwater/dwev/eisvogel.tex +++ b/dwev/_extensions/drwater/dwev/eisvogel.tex @@ -361,6 +361,48 @@ $highlighting-macros$ \DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,fontsize=$if(code-block-font-size)$$code-block-font-size$$else$\small$endif$,commandchars=\\\{\}} $endif$ + +% 为中文添加支持 by Ming Su +$if(CJK)$ +\usepackage[fallback]{xeCJK} +\setCJKmainfont{Noto Serif CJK SC}[BoldFont=NotoSerifCJKsc-Bold, ItalicFont=NotoSansCJKsc-Light] +\setCJKfallbackfamilyfont{rm}{Noto Serif CJK SC} +$if(book)$ +\usepackage{ctex} %调用中文字体宏包 +\usepackage{indentfirst} %调用首行缩进宏包 +\usepackage{ctex} % 确保中文字体支持 +\usepackage{zhnumber} +% 修改 chapter 格式为 "第X章" +% \renewcommand{\chapterformat}{第~\thechapter~章} +% \renewcommand{\chapterformat}{第\zhnumber{\thechapter}章} +\renewcommand{\chaptermarkformat}{第~\zhnumber{\thechapter}~章} +\renewcommand{\chapterformat}{第\zhnumber{\thechapter}章} +\renewcommand*{\chapterlinesformat}[3]{% + \parbox{\linewidth}{\centering #2~\quad~#3} % 居中 + "·" 分隔 + % 或改用冒号分隔: + % \parbox{\linewidth}{\centering #2:#3} +} +\RedeclareSectionCommand[ + beforeskip=1.5em plus 0.5em minus 0.5em, + afterskip=1em plus 0.2em, + font=\large\bfseries +]{section} +\usepackage{zhnumber} % 确保已加载(或直接用 ctex) +% 修改目录中的章节编号为中文 +\addtokomafont{chapterentry}{\normalfont} % 可选:调整目录字体 +\renewcommand*{\chapterformat}{第\zhnumber{\thechapter}章} % 正文标题格式 +\renewcommand*{\chaptermarkformat}{第\zhnumber{\thechapter}章} % 页眉标题格式 +% 关键!覆盖目录中的章节编号 +\renewcommand{\addchaptertocentry}[2]{% + \addtocentrydefault{chapter}{第\zhnumber{#1}章}{#2}% +} +\RedeclareSectionCommand[ + tocentryindent=0pt, + tocentrynumwidth=3.5em % 确保编号区域足够宽 +]{chapter} +$endif$ +$endif$ + $if(tables)$ \usepackage{longtable,booktabs,array} $if(multirow)$ @@ -814,10 +856,17 @@ $endif$ % % remove paragraph indentation % +% \setlength{\parindent}{0pt} +$if(parindent)$ +\setlength{\parindent}{2em} %设置首行缩进为2字符 +$else$ \setlength{\parindent}{0pt} +$endif$ \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em} % prevent overfull lines + + % % % Listings diff --git a/dwev/bookcn.pdf b/dwev/bookcn.pdf index 11d0206..b819004 100644 Binary files a/dwev/bookcn.pdf and b/dwev/bookcn.pdf differ diff --git a/dwev/bookcn.qmd b/dwev/bookcn.qmd index caed11f..257edbe 100644 --- a/dwev/bookcn.qmd +++ b/dwev/bookcn.qmd @@ -1,12 +1,11 @@ --- title: "中文报告模板" author: "苏命" -date: "2017-02-20" +date: "today" subject: "Markdown" keywords: [Markdown, Example] book: true -# top-level-division: chapter -documentclass: ctexbook # 使用ctexbook文档类专门处理中文 +top-level-division: chapter classoption: - fntef - UTF8 @@ -19,6 +18,7 @@ classoption: - titlestyle=hang # classoption: [oneside] titlepage: true +keep-tex: false # titlepage-rule-color: "360049" titlepage-text-color: "360049" titlepage-rule-height: 0 @@ -28,9 +28,11 @@ title-size: "Huge" author-vskip: -4em date-vskip: -1em numbersections: true +parindent: true # titlepage-logo: "inst/rceeslogo.pdf" # logo-width: 30mm lang: zh-CN +CJK: true fig-pos: "!t" colorlinks: true urlcolor: blue @@ -48,6 +50,7 @@ CJKsansfont: "Noto Sans CJK SC" CJKmonofont: "Noto Sans Mono CJK SC" CJKoptions: | AutoFakeBold=true +# include-in-header: header.tex format: dwev-pdf --- @@ -71,6 +74,8 @@ rmdify::rmd_init() # 项目背景与国内外现状介绍 +*asdfsd* *你好* 阿斯顿发 **你好** asdf + ::: callout-warning Book in early development. Planned release in 202X. ::: diff --git a/dwev/eisvogel.tex b/dwev/eisvogel.tex index 3688e4f..8f92341 100644 --- a/dwev/eisvogel.tex +++ b/dwev/eisvogel.tex @@ -361,6 +361,48 @@ $highlighting-macros$ \DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,fontsize=$if(code-block-font-size)$$code-block-font-size$$else$\small$endif$,commandchars=\\\{\}} $endif$ + +% 为中文添加支持 by Ming Su +$if(CJK)$ +\usepackage[fallback]{xeCJK} +\setCJKmainfont{Noto Serif CJK SC}[BoldFont=NotoSerifCJKsc-Bold, ItalicFont=NotoSansCJKsc-Light] +\setCJKfallbackfamilyfont{rm}{Noto Serif CJK SC} +$if(book)$ +\usepackage{ctex} %调用中文字体宏包 +\usepackage{indentfirst} %调用首行缩进宏包 +\usepackage{ctex} % 确保中文字体支持 +\usepackage{zhnumber} +% 修改 chapter 格式为 "第X章" +% \renewcommand{\chapterformat}{第~\thechapter~章} +% \renewcommand{\chapterformat}{第\zhnumber{\thechapter}章} +\renewcommand{\chaptermarkformat}{第~\zhnumber{\thechapter}~章} +\renewcommand{\chapterformat}{第\zhnumber{\thechapter}章} +\renewcommand*{\chapterlinesformat}[3]{% + \parbox{\linewidth}{\centering #2~\quad~#3} % 居中 + "·" 分隔 + % 或改用冒号分隔: + % \parbox{\linewidth}{\centering #2:#3} +} +\RedeclareSectionCommand[ + beforeskip=1.5em plus 0.5em minus 0.5em, + afterskip=1em plus 0.2em, + font=\large\bfseries +]{section} +\usepackage{zhnumber} % 确保已加载(或直接用 ctex) +% 修改目录中的章节编号为中文 +\addtokomafont{chapterentry}{\normalfont} % 可选:调整目录字体 +\renewcommand*{\chapterformat}{第\zhnumber{\thechapter}章} % 正文标题格式 +\renewcommand*{\chaptermarkformat}{第\zhnumber{\thechapter}章} % 页眉标题格式 +% 关键!覆盖目录中的章节编号 +\renewcommand{\addchaptertocentry}[2]{% + \addtocentrydefault{chapter}{第\zhnumber{#1}章}{#2}% +} +\RedeclareSectionCommand[ + tocentryindent=0pt, + tocentrynumwidth=3.5em % 确保编号区域足够宽 +]{chapter} +$endif$ +$endif$ + $if(tables)$ \usepackage{longtable,booktabs,array} $if(multirow)$ @@ -814,10 +856,17 @@ $endif$ % % remove paragraph indentation % +% \setlength{\parindent}{0pt} +$if(parindent)$ +\setlength{\parindent}{2em} %设置首行缩进为2字符 +$else$ \setlength{\parindent}{0pt} +$endif$ \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em} % prevent overfull lines + + % % % Listings diff --git a/dwev/figure/fig-fig1-1.pdf b/dwev/figure/fig-fig1-1.pdf index cdf3afd..89f64b1 100644 Binary files a/dwev/figure/fig-fig1-1.pdf and b/dwev/figure/fig-fig1-1.pdf differ