我想用合适的符号来创作——不是使用 TikZ 或其他绘图方法 — 大和 ( \bigsum
) 和大乘 ( \mybigtimes
) 数学符号,分别表示笛卡尔和和笛卡尔积,即:
\bigcup
与和 的垂直尺寸相同\bigcap
;\bigcup
具有与和中的曲线相同粗细的笔触\bigcap
;- 对于
\mybigtimes
,仅在水平方向上缩小; - 将正确缩放以适应内联数学、显示数学等(大概通过使用
\mathchoice
;和 - 可与 pdfLaTeX 和 `XeLaTeX 一起使用。
如何才能做到这一点?
This does \emph{not} work
这是我目前所得到的。仅当注释掉后面的部分时才会产生所示的输出。
\documentclass[12pt,fleqn]{article}
\usepackage{amsmath}
\usepackage{iftex}
\ifTUTeX
\usepackage{fontspec}
\usepackage{unicode-math}
\defaultfontfeatures{ Scale=MatchLowercase, Ligatures=TeX }
\setmainfont{TeX Gyre Termes}[Scale=1.0]
\setmathfont{TeX Gyre Termes Math}
\mathchardef\timessymbol=\numexpr\times-"2000\relax % WHAT IS THE NAME-NUMBER?
\else
\RequirePackage[scaled=0.93]{newtxtext}
\RequirePackage{newtxmath}%
\mathchardef\timessymbol=\numexpr\times-"2000\relax % WHAT IS THE NAME-NUMBER?
\fi
\usepackage{graphicx}
\usepackage{scalerel}
\DeclareMathOperator*{\bigplus}{\scalerel*{+}{\sum}}
\DeclareMathOperator*{\Bigplus}{\scalerel*{+}{\textstyle\sum}}
% Attempt to shrink a big times horizontally:
\DeclareMathOperator*{\mybigtimes}{\scalebox{0.7}[1]{\timessymbol}}
\begin{document}
\ifTUTeX With Xe\LaTeX\else With pdf\LaTeX\fi
\bigskip
These work, but geometry is wrong:
\bigskip
$\bigtimes_{n=0}^{\infty} X_{i} = \bigcup_{k=0}^{\infty}U_{k}$
\quad to shrink \verb!\bigtimes! horizontally (but not vertically)
\bigskip
$\bigplus_{n=0}^{\infty} X_{i} = \bigcap_{k=0}^{\infty}U_{k}$ \quad \verb!\bigsum! too thick
%
\begin{gather*}
\bigtimes_{n=0}^{\infty} X_{i}= \bigcup_{k=0}^{\infty}U_{k}
\quad \text{to shrink bigtimes symbol horizontally (but not vertically)}
\\
\bigplus_{n=0}^{\infty} X_{i} = \bigcap_{k=0}^{\infty}U_{k}
\quad \text{bigplus symbol too thick}
\end{gather*}
This does \emph{not} work:
$\mybigtimes_{n=0}^{\infty} X_{i}$
\[
\mybigtimes_{n=0}^{\infty} X_{i}
\]
\end{document}
有关的:
https://tex.stackexchange.com/a/394912/13492
使用 Lucida Math 字体的大笛卡尔积和笛卡尔和符号?
继续:看制作非方形大片。
答案1
您可以\pdfliteral
直接在 pdfTeX 中使用:
\def\mybigtimes{\mathop{\mathchoice{%display:
\vcenter{\hbox to10bp{\vrule height15bp width0pt \pdfliteral{
q 1 J .8 w 0 1 m 10 14 l S 0 14 m 10 1 l S Q
}\hss}}}{%text:
\vcenter{\hbox to10bp{\kern1bp\vrule height10bp width0pt \pdfliteral{
q 1 J .65 w 0 0 m 8 10 l S 0 10 m 8 0 l S Q
}\hss}}}{\times}{\times}%script, scriptscript not defined
}}
\def\mybigplus{\mathop{\mathchoice{%display:
\vcenter{\hbox to12bp{\vrule height15bp width0pt \pdfliteral{
q 1 J .8 w 0 7.5 m 12 7.5 l S 6 1 m 6 14 l S Q
}\hss}}}{%text:
\vcenter{\hbox to12bp{\kern1bp\vrule height10bp width0pt \pdfliteral{
q 1 J .65 w 0 5 m 10 5 l S 5 0 m 5 10 l S Q
}\hss}}}{+}{+}%script, scriptscript not defined
}}
您可以在 XeTeX 中定义\def\pdfliteral#1{\special{pdf:literal #1}}
,然后使用相同的宏。
答案2
这是带有以下内容的图像pdflatex
:
这是带有以下内容的图像xelatex
:
出于神秘的原因,TeX Gyre Termes Math 的开发人员决定不为所有大运算符赋予相同的维度。您可以自行决定是否将其用作\bigcup
模型,或者\sum
像下面的代码一样。
\documentclass{article}
\usepackage{amsmath,pict2e}
\usepackage{iftex}
\ifTUTeX
\usepackage{unicode-math}
\setmainfont{TeX Gyre Termes}[Scale=1.0]
\setmathfont{TeX Gyre Termes Math}
\else
\usepackage{newtxtext,newtxmath}
\fi
\makeatletter
\newcommand{\murray@big}[1]{%
\mathop{\vphantom{\sum}\mathpalette\murray@makebig{#1}}\slimits@
}
\AtBeginDocument{%
\DeclareRobustCommand{\bigplus}{\DOTSB\murray@big\murray@plus}%
\DeclareRobustCommand{\bigtimes}{\DOTSB\murray@big\murray@times}%
}
\newcommand{\murray@makebig}[2]{%
\vcenter{%
\sbox\z@{$\m@th#1\sum$}%
\setlength{\unitlength}{0.9\dimexpr\ht\z@+\dp\z@}%
\hbox{\kern0.1\wd\z@\murray@draw{#1}{#2}\kern0.1\wd\z@}%
}%
}
\newcommand{\murray@draw}[2]{%
\begin{picture}(1,1)
\linethickness{%
\ifx#1\displaystyle 1.2\fontdimen8\textfont3\else
\ifx#1\textstyle 1.1\fontdimen8\textfont3\else
\ifx#1\scriptstyle1\fontdimen8\scriptfont3\else
1\fontdimen8\scriptscriptfont3\fi\fi\fi
}%
#2
\end{picture}%
}
\newcommand{\murray@plus}{%
\roundcap
\Line(0.5,0)(0.5,1)
\Line(0,0.5)(1,0.5)
}
\newcommand{\murray@times}{%
\roundcap
\Line(0.14645,0.14645)(0.85355,0.85355)
\Line(0.14646,0.85355)(0.85355,0.14645)
}
\makeatother
\begin{document}
$\displaystyle\bigplus_{k=0}^\infty \bigcup_{k=0}^\infty \bigtimes_{k=0}^\infty$
\medskip
$\textstyle\bigplus_{k=0}^\infty \bigcup_{k=0}^\infty \bigtimes_{k=0}^\infty$
\medskip
$\scriptstyle\bigplus_{k=0}^\infty \bigcup_{k=0}^\infty \bigtimes_{k=0}^\infty$
\medskip
$\scriptscriptstyle\bigplus_{k=0}^\infty \bigcup_{k=0}^\infty \bigtimes_{k=0}^\infty$
\end{document}