stmaryrd 和 stix 包兼容吗?

stmaryrd 和 stix 包兼容吗?

我想知道斯特玛丽德斯蒂克斯包是相互兼容的,即使它们与我使用的包兼容,也可以在下面的代码中看到:事实上,我看到 \Lbag 和 \Rbag 分隔符在 stmaryrd 和 stix 包中是不同的(对吗?),而且我看到 amssymb 包中出现了其他符号,但奇怪的是,我没有发现链接指南中存在任何不兼容的情况。

\documentclass[10pt]{article}

\usepackage[paperheight=29.7cm,paperwidth=21cm,textwidth=17cm,textheight=25 cm]{geometry}
\usepackage{layout}
\usepackage{titlesec}
\usepackage[hang,flushmargin]{footmisc}
\usepackage{hyperref}
\usepackage{caption}
\usepackage{soulutf8}
\usepackage[T1]{fontenc}
\usepackage{fontsize}
\linespread{1.5}

\usepackage{amsfonts}
\usepackage{mathrsfs}
\usepackage{yfonts}

\usepackage{enumitem}
\usepackage{amssymb}

\usepackage{amsmath}
\usepackage{amsthm}

\setcounter{footnote}{-1}
\setcounter{equation}{-1}

\newtheorem{lemma}[equation]{Lemma}

\newtheorem{proposition}[equation]{Proposizione}

\newtheorem{corollary}[equation]{Corollario}

\newtheorem{theorem}[equation]{Teorema}

\hypersetup{colorlinks,citecolor=black,filecolor=black,linkcolor=black,urlcolor=black}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%I get the following code from [here](https://tex.stackexchange.com/a/614685/296807) to manipulate the fontsize of an equation.
\ExplSyntaxOn
\NewDocumentEnvironment{sequation}{O{\small}b}
 {
  \yufip_sequation:nnn {equation}{#1}{#2}
 }{}
\NewDocumentEnvironment{sequation*}{O{\small}b}
 {
  \yufip_sequation:nnn {equation*}{#1}{#2}
 }{}
\cs_new_protected:Nn \yufip_sequation:nnn
 {
  \begin{#1}
  \mbox{#2$\displaystyle#3$}
  \end{#1}
 }
\ExplSyntaxOff

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
% Here I wrote my document using some mathematical symbols as \cup, \cap, \bigcup, \bigcap, \setminus, \bot, \top, \rightthreetimes, \leftthreetimes, \odot, \oplus etc... and any any mathematical fonts as \mathcal, \mathfrak and \mathscr
\end{document}

那么有人可以帮帮我吗?

答案1

你用任何一个 stmaryrd 或者 stix2amssymb。如果您选择不加载stix2:这个包旨在尽可能广泛地覆盖数学符号。

现在,我可能明白您更喜欢\Lbag和而\Rbag不是stmaryrd提供的符号stix2

这真的很简单(我只加载所需的包):

\documentclass{article}
\usepackage{amsmath}
\usepackage{stix2}
\usepackage[only,Lbag,Rbag]{stmaryrd}

\begin{document}

$\Lbag x\Rbag$ from stmaryrd

$\lbag x\rbag$ from stix2

\end{document}

在此处输入图片描述

然而,由于stix2标准发生了变化\DeclareMathSizes,您可能希望使其stmryrd完全可扩展。

\documentclass{article}
\usepackage{amsmath}
\usepackage{stix2}
\usepackage[only,Lbag,Rbag]{stmaryrd}

\DeclareFontFamily{U}{stmry}{}
\DeclareFontShape{U}{stmry}{m}{n}
 {
  <-5.5> stmary5
  <5.5-6.5> stmary6
  <6.5-7.5> stmary7
  <7.5-8.5> stmary8
  <8.5-9.5> stmary9
  <9.5->  stmary10
 }{}


\begin{document}

$\Lbag x\Rbag$ from stmaryrd

$\lbag x\rbag$ from stix2

\end{document}

这可以避免恼人的警告并在下标/上标中使用正确的大小。

如果您缺少数学组,您可以用稍微复杂的方式获得相同的效果。

\documentclass{article}
\usepackage{amsmath}
\usepackage{stix2}

\DeclareFontFamily{U}{stmry}{}
\DeclareFontShape{U}{stmry}{m}{n}
 {
  <-5.5> stmary5
  <5.5-6.5> stmary6
  <6.5-7.5> stmary7
  <7.5-8.5> stmary8
  <8.5-9.5> stmary9
  <9.5->  stmary10
 }{}
\DeclareRobustCommand{\Lbag}{\mathopen{\text{\usefont{U}{stmry}{m}{n}\symbol{"48}}}}
\DeclareRobustCommand{\Rbag}{\mathclose{\text{\usefont{U}{stmry}{m}{n}\symbol{"49}}}}

\begin{document}

$\Lbag x\Rbag$ from stmaryrd

$\lbag x\rbag$ from stix2

\end{document}

相关内容