0

In my document there already exists a math font configuration, but it doesn't contain the symbol for double brackets. Following this answer, I imported the one from the fourier font.

However, as can be seen from the picture, the symbol looks too small compare to the normal bracket:

enter image description here

Actually I think even [\mkern-4mu[ looks better, but unfortunately this does not work with \left and \right.

Thus, my question is that, would it be possible to scale these imported symbols? Or, even better, is there some way to define this symbol to look like [\mkern-4mu[ (thus consistent with the current math font) but can be automatically scaled with \left and \right (without having to write \left[\mkern-4mu\left[)?

Below is a MWE. To me the \mkern-4mu one is the most beautiful one, and I would be really apprieciable to know a way to define \llbracket as this.

\documentclass{article}

\usepackage[warnings-off={mathtools-colon, mathtools-overbracket}]{unicode-math}
\unimathsetup{math-style = ISO, partial = upright, nabla = upright}
\setmathfont{KpMath-Regular.otf}

\usepackage{mathtools}
\DeclareFontEncoding{FML}{}{}%
\DeclareFontSubstitution{FML}{futm}{m}{it}%
\DeclareFontEncoding{FMS}{}{}
\DeclareFontSubstitution{FMS}{futm}{m}{n}
\DeclareFontEncoding{FMX}{}{}
\DeclareFontSubstitution{FMX}{futm}{m}{n}
\DeclareSymbolFont{symbols}{FMS}{futm}{m}{n}%
\DeclareSymbolFont{largesymbols}{FMX}{futm}{m}{n}%

\DeclareMathDelimiter{\llbracket}{\mathopen}{symbols}{153}{largesymbols}{133}
\DeclareMathDelimiter{\rrbracket}{\mathclose}{symbols}{154}{largesymbols}{134}

\begin{document}

\begin{center}
    \( K  \llbracket X \rrbracket  [X]  [\mkern-4mu[ X ]\mkern-4mu]  \)
\end{center}

\[
    \left\llbracket \frac{X}{Y} \right\rrbracket  \left[ \frac{X}{Y} \right]  \left[\mkern-4mu\left[ \frac{X}{Y} \right]\mkern-4mu\right]
\]

\end{document}

enter image description here

1 Answer 1

1

First of all, you should use different names than symbols and largesymbols; then you can scale the symbols font scaled.

\documentclass{article}

\usepackage[warnings-off={mathtools-colon, mathtools-overbracket}]{unicode-math}
\unimathsetup{math-style = ISO, partial = upright, nabla = upright}
\setmathfont{KpMath-Regular.otf}

\usepackage{mathtools}

\DeclareFontEncoding{FML}{}{}
\DeclareFontSubstitution{FML}{futm}{m}{it}
\DeclareFontEncoding{FMS}{}{}
\DeclareFontSubstitution{FMS}{futm}{m}{n}
\DeclareFontEncoding{FMX}{}{}
\DeclareFontSubstitution{FMX}{futm}{m}{n}

\DeclareFontFamily{FMS}{futm}{\skewchar \font =48}
\DeclareFontShape{FMS}{futm}{m}{n}{<-> s * [1.2] futsy}{}

%\DeclareFontFamily{FMX}{futm}{}
%\DeclareFontShape{FMX}{futm}{m}{n}{<-> s * [0.92] fourier-mex}{}

\DeclareSymbolFont{fouriersymbols}{FMS}{futm}{m}{n}%
\DeclareSymbolFont{fourierlargesymbols}{FMX}{futm}{m}{n}%

\DeclareMathDelimiter{\llbracket}{\mathopen}{fouriersymbols}{153}{fourierlargesymbols}{133}
\DeclareMathDelimiter{\rrbracket}{\mathclose}{fouriersymbols}{154}{fourierlargesymbols}{134}

\begin{document}

\begin{center}
\( K  \llbracket X \rrbracket  [X] \)
\end{center}

\[
\left\llbracket \frac{X}{Y} \right\rrbracket  \left[ \frac{X}{Y} \right]  
\]

\end{document}

I reported (commented out) the setting for the large symbols font.

enter image description here

Experiment with various scaling factors, but you'll not get good alignment anyway.

A different strategy might be to do

\usepackage[only,llbracket,rrbracket]{stmaryrd}

instead of importing from fourier.

enter image description here

3
  • Thank you for this! I was aware of the stmaryrd approach, but this package seems to be very old and the appearance is not very consistent with the main font. By the way, do you think defining \llbracket with normal bracket and \mkern-4mu would be possible? I'm not sure if there is a way to read in and pass the \left to every bracket.
    – Jinwen
    Commented Apr 16, 2022 at 22:29
  • @Jinwen I believe that the simplest strategy would be to convince the maintainer of Kpfonts to add the double brackets.
    – egreg
    Commented Apr 16, 2022 at 23:00
  • Thank you, now that you mentioned it, I took a look at the CTAN page of kpfonts-otf and surprisingly found in the attached glyph demonstration file that unicode-math already has \lBrack and \rBrack for this, which are even more perfect than my \mkern-4mu version.
    – Jinwen
    Commented Apr 17, 2022 at 6:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .