fix qed bug and use local math font for missing \setminus

This commit is contained in:
Yu Cong 2025-05-30 22:44:46 +08:00
parent b9f4a1ed9c
commit 2dc48241f5
2 changed files with 33 additions and 21 deletions

View File

@ -5,24 +5,31 @@
\title{思源黑体 + FiraGO} \title{思源黑体 + FiraGO}
\author{丛宇}
\date{\today} \date{\today}
\begin{document} \begin{document}
\maketitle \maketitle
test math font. test math font.
\(
\[
G'=(V,E) G'=(V,E)
\] \)
\textbf{math!!! 粗的!}
$MATH$
\section{is this bold $MATH \Z$?} 测试中文
\textbf{粗中文a}
$\mathbf{Bold Math}$
\section{$Bold \; MATH \Z\R \Q$ in title $\mathbf{Bold Math \Z \R \Q}$?}
\section{这是bold $\text{你好abc}\R$?} \section{这是bold $\text{你好abc}\R$?}
\begin{theorem}[sbada] \begin{theorem}[sbada]
aaa 中文 aaa 中文
\end{theorem} \end{theorem}
\begin{proof}
test setminus and qed $A\setminus B$
\end{proof}
\begin{equation} \begin{equation}
\begin{aligned} \begin{aligned}
@ -40,7 +47,11 @@ return ss
\end{algo} \end{algo}
\caption{this is a fig 这是图} \caption{this is a fig 这是图}
\end{figure} \end{figure}
\textsc{Sans}
\texttt{monolM} \textsc{Small Capital}
\textit{italic}
\texttt{mono}
\end{document} \end{document}

View File

@ -1,6 +1,6 @@
\ProvidesPackage{myctex} \ProvidesPackage{myctex}
\usepackage[fontset=none, scheme=plain]{ctex} \RequirePackage[fontset=none, scheme=plain]{ctex}
\usepackage{fontspec} \RequirePackage{fontspec}
\newif\ifmyctex@sans \newif\ifmyctex@sans
\myctex@sansfalse % Default is serif \myctex@sansfalse % Default is serif
@ -15,8 +15,9 @@
\setCJKmainfont{Source Han Sans SC}[BoldFont=*, ItalicFont=*] \setCJKmainfont{Source Han Sans SC}[BoldFont=*, ItalicFont=*]
\setCJKsansfont{Source Han Sans SC} \setCJKsansfont{Source Han Sans SC}
\setCJKmonofont{Source Han Sans SC} \setCJKmonofont{Source Han Sans SC}
\usepackage[fira]{fontsetup} \RequirePackage[fira]{fontsetup}
\usepackage{FiraMono} \RequirePackage{FiraMono}
\setmathfont{Fira Math}[range=\setminus]
\else \else
\setCJKmainfont{Source Han Serif SC}[BoldFont=*, ItalicFont=*] \setCJKmainfont{Source Han Serif SC}[BoldFont=*, ItalicFont=*]
@ -95,10 +96,10 @@
% ---------------------------------------------------------------------- % ----------------------------------------------------------------------
\def\etal{\emph{et~al.}} % and others \def\etal{\emph{et~al.}} % and others
%\def\ie{\emph{i.e.}} % that is \def\ie{\emph{i.e.}} % that is
\def\ie{\textcolor{red}{that is}} % \def\ie{\textcolor{red}{that is}}
%\def\eg{\emph{e.g.}} % for example \def\eg{\emph{e.g.}} % for example
\def\eg{\textcolor{red}{for example}} % \def\eg{\textcolor{red}{for example}}
% ----------------------- % -----------------------
% Common Names % Common Names
@ -109,14 +110,14 @@
% useful shortcuts % useful shortcuts
% ----------------------- % -----------------------
\def\cost{\cent} % \def\cost{\cent}
% ---------------------------------------------------------------------- % ----------------------------------------------------------------------
% Simple math stuff % Simple math stuff
% ---------------------------------------------------------------------- % ----------------------------------------------------------------------
\renewcommand{\subset}{\subseteq} % \renewcommand{\subset}{\subseteq}
% ---- SYMBOLS ---- % ---- SYMBOLS ----
\let\e\varepsilon % a ``real'' epsilon — better yet, just use Unicode ε. \let\e\epsilon % a ``real'' epsilon — better yet, just use Unicode ε.
% %
% I give up. These are in the wrong font, but my kludged versions % I give up. These are in the wrong font, but my kludged versions
% LOOK like kludges, especially \Z, \Q, and \C. % LOOK like kludges, especially \Z, \Q, and \C.
@ -316,9 +317,9 @@
\newif\ifneedqed \newif\ifneedqed
\global\needqedfalse \global\needqedfalse
\@ifundefined{square}{\let\square\Box}{} % grumble latex2e \@ifundefined{square}{\let\square\Box}{} % grumble latex2e
\def\QED{\ensuremath{{\square}}} % \def\QED{\ensuremath{{\square}}}
\def\markatright#1{\leavevmode\unskip\nobreak\quad\hspace*{\fill}{#1}} \def\markatright#1{\leavevmode\unskip\nobreak\quad\hspace*{\fill}{#1}}
\def\qed{\ifneedqed\markatright{\QED}\global\needqedfalse\else\null\fi} \def\qed{\ifneedqed\markatright{\ensuremath{{\square}}}\global\needqedfalse\else\null\fi}
\newproof{proof}{Proof\global\needqedtrue}[\qed] \newproof{proof}{Proof\global\needqedtrue}[\qed]
\newproof{sketch}{Proof Sketch\global\needqedtrue}[\qed] \newproof{sketch}{Proof Sketch\global\needqedtrue}[\qed]