From bc8d679111a43044ca3bd341326aa46073156d23 Mon Sep 17 00:00:00 2001 From: Xinyu Liu Date: Thu, 13 Jun 2024 15:15:19 +0800 Subject: [PATCH] 1. Detect Noto font for bibel; 2. Avoid redefine theorems --- prelude.sty | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/prelude.sty b/prelude.sty index 96f504af1..5b212c741 100644 --- a/prelude.sty +++ b/prelude.sty @@ -332,17 +332,57 @@ } \DeclareOption{en}{ - \babelfont[chinese]{rm}{Noto Serif CJK SC} + \IfFontExistsTF{Noto Serif CJK SC}{ + \message{Apply Noto Serif CJK SC for bible} + \babelfont[chinese]{rm}{Noto Serif CJK SC} + }{ % else + \IfFontExistsTF{Noto Serif SC}{ + \message{Apply Noto Serif SC for bible} + \babelfont[chinese]{rm}{Noto Serif SC} + }{ % else + \ifwindows{ + \message{Apply SimSun for bible} + \babelfont[chinese]{rm}{SimSun} + }\else{ + \IfFontExistsTF{STSong}{ + \message{Apply STSong for bible} + \babelfont[chinese]{rm}{STSong} + }{ % else + \message{No CN default font} + } % end if exits STSong + }\fi % end if windows + } % end if exits Noto Serif SC + } % end if exits Noto Serif CJK SC + \theoremstyle{plain} + \ifdefined\theorem\else \newtheorem{theorem}{Theorem}[section] + \fi + + \ifdefined\lemma\else \newtheorem{lemma}[theorem]{Lemma} + \fi + + \ifdefined\proposition\else \newtheorem{proposition}[theorem]{Proposition} + \fi + + \ifdefined\corollary\else \newtheorem{corollary}[theorem]{Corollary} + \fi \theoremstyle{definition} + \ifdefined\axiom\else \newtheorem{axiom}{Axiom}[section] + \fi + + \ifdefined\definition\else \newtheorem{definition}{Definition}[section] + \fi + + \ifdefined\example\else \newtheorem{example}{Example}[section] + \fi \AtEndEnvironment{Exercise}{ \par \rightline{\AnswerListName: \cpageref{\ExerciseLabel-Answer}}}