I want to use stix2 to make this adjustable symbol $\rParen$,
, but it changes my $\mathbb{Z}$ from this
to this $\mathbb{Z}$
. I tried using the package mathbbol to use $\Rparen$ so that I didn't have to use stix2 and not clash with amssymb but the symbolical cannot be adjusted. For example, $\bigg\Rparen$ does nothing. So it appears that stix2 is the only option.
- 377
-
3The look depends on the overall fonts being used. Of which you give us no information, please provide a full but minimal example as is tradition around here – daleif Aug 15 '21 at 05:08
-
1That's just different fonts' representation of the same character. Some templates tend to include fancy fonts (along with fancy formats) to show that they are different; but then they break people's expectation so it's hard to say if that's any better. – Symbol 1 Aug 15 '21 at 05:28
-
I'm using so many packages it isn't funny. Is there a way to force the font wanted no matter the packages being used? – TheGreatJRB Aug 15 '21 at 05:29
-
4The best solution for now is to do A/B test (remove one package at a time and compile to see if there is any change). For long term, I suggest simplify your preamble. – Symbol 1 Aug 15 '21 at 05:44
-
1obviously you can not force the font you wanted no matter what package is used, each package is designed to do something including packages which select fonts. If you use a package that selects one font when you actually wanted a different font how can latex know that? If you start from an empty preamble and only add packages when you need them you do not get into the problem of wondering what non standard configuration you have. If you start from a "template" that loads many packages with undocumented uses then this sort of thing happens. – David Carlisle Aug 15 '21 at 07:34
-
What if I want to use both fonts at different times? It makes no sense to not be able to manually select a font per character. – TheGreatJRB Aug 17 '21 at 20:59
-
I have found the clash. I have updated my question – TheGreatJRB Nov 03 '21 at 23:35
-
You might find some useful hints in this question: Importing a single symbol from a different font – barbara beeton Nov 04 '21 at 02:02
-
See also xetex - unicode-math but ordinary blackboard bold - TeX - LaTeX Stack Exchange although it's not the same package – user202729 Nov 04 '21 at 04:44
2 Answers
If you want to load only a small number of symbols from stix2, you can always simply copy the relevant lines from the package instead of loading the whole of it. Here's a way to load only the double struck parentheses. They can still be resized, and the font will not be changed.
\documentclass{article}
\usepackage{amsmath,amssymb}
\makeatletter
\def\stix@undefine#1{%
\if\relax\noexpand#1\let#1=\@undefined\fi}
\def\stix@MathDelimiter#1#2#3#4#5#6{%
\stix@undefine#1%
\DeclareMathDelimiter{#1}{#2}{#3}{#4}{#5}{#6}}
\DeclareFontEncoding{LS2}{}{\noaccents@}
\DeclareFontSubstitution{LS2}{stix2}{m}{n}
\DeclareSymbolFont{largesymbols}{LS2}{stix2ex}{m}{n}
\stix@MathDelimiter{\lParen}{\mathopen}{largesymbols}{"DE}{largesymbols}{"02}
\stix@MathDelimiter{\rParen}{\mathclose}{largesymbols}{"DF}{largesymbols}{"03}
\makeatother
\begin{document}
\(\Bigl\lParen\mathbb{Z}\Bigr\rParen\)
\end{document}
- 20,157
The easiest way to get \mathbb symbols from amssymb along with stix2 symbols is:
\usepackage{stix2}
\usepackage[bb=ams]{mathalpha}
You can also load any other symbols you want on top of stix2, although be careful not to exceed the limit of 16 math alphabets in legacy TeX.
If you can use unicode-math, this becomes much easier. To use only those two STIX Two symbols with another font, you can do this:
\usepackage{mathtools}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math} % For example.
\setmathfont{STIX Two Math}[
range={\lParen,\rParen},
Scale=MatchUppercase]
\DeclarePairedDelimiter\Parens{\lParen}{\rParen}
This lets you write the command \Parens{x}, which you can give a scaling option. For examle, \Parens[\big]{x} gives you \bigl and \bigr outline parentheses, and \Parens*{x} gives you auto-scaling ones. (See section 3.6 of the mathtools manual.) There is some sample code here. You can also use \left\lParen x \right\rParen.
- 44,045
