A fonte matemática caligráfica Boondox e a fonte matemática Arev não têm a mesma altura para letras maiúsculas e minúsculas.
Adaptando a resposta deVersalete falso com XeTeX/fontspec?, eu costumava scalebox
definir e corrigir as alturas para que correspondessem às letras maiúsculas e minúsculas. Veja abaixo a implementação da nova macro \mathcalbd
que inclui a correção de altura e da macro básica \mathcalbdnocorr
que exclui a correção.
Ocorrem dois problemas:
- subscritos e sobrescritos não são suportados
- há um conflito com o pacote
bm
\documentclass{article}
\usepackage{graphicx}
\usepackage{arevmath}
\usepackage{amsmath}
% \usepackage{bm}
\DeclareFontFamily{U}{BOONDOX-calo}{\skewchar\font=45}
\DeclareFontShape{U}{BOONDOX-calo}{m}{n}{<-> BOONDOX-r-calo}{}
\DeclareFontShape{U}{BOONDOX-calo}{b}{n}{<-> BOONDOX-b-calo}{}
\makeatletter
\DeclareMathAlphabet{\m@thcalbd}{U}{BOONDOX-calo}{m}{n}
\SetMathAlphabet{\m@thcalbd}{bold}{U}{BOONDOX-calo}{b}{n}
% https://tex.stackexchange.com/questions/55664/
\def\calfont@helper#1 #2\relax{%
\@calfont@helper#1\relax\relax%
\if\relax#2\relax\else\ \@calfont@helper#2\relax\fi}
\def\@calfont@helper#1#2\relax{%
\ifcat\relax#1#1% for escape sequences
\else%
\ifnum`#1=\lccode`#1\relax%
\mathchoice%
{\scalebox{1.20529}{$\m@th\m@thcalbd{#1}$}}%
{\scalebox{1.20529}{$\m@th\m@thcalbd{#1}$}}%
{\scalebox{.90396}{$\m@th\mkern-1.5mu\m@thcalbd{#1}$}}%
{\scalebox{.70308}{$\m@th\mkern-1.1mu\m@thcalbd{#1}$}}%
\else\m@thcalbd{#1}\fi%
\fi%
\ifx\relax#2\relax\else\@calfont@helper#2\relax\fi}
\newcommand*{\mathcalbd}[1]{\bgroup\calfont@helper#1 \relax\relax\egroup}
\newcommand*{\mathcalbdnocorr}[1]{\m@thcalbd{#1}}
\makeatother
\begin{document}
Without height correction: $A\mathcalbdnocorr{A} a\mathcalbdnocorr{a}$
With height correction: $A\mathcalbd{A} a\mathcalbd{a}$
\bigskip
Two problems with the \verb+\mathcalbd+ macro:
\begin{enumerate}
\item \verb+\mathcalbd{A_a}+ does not work while
\verb+\mathcalbdnocorr{A_a}+ does ($\mathcalbdnocorr{A_a}$). Same is
true for superscripts.
\item \verb+\boldsymbol{\mathcalbd{A}}+ ($\boldsymbol{\mathcalbd{A}}$)
does not work if package \texttt{bm} is loaded
\end{enumerate}
\end{document}
Responder1
Você pode usar duas famílias de fontes, com diferentes fatores de escala, para letras maiúsculas e minúsculas.
\documentclass{article}
\usepackage{arevmath}
\usepackage{amsmath}
\usepackage{bm}
\DeclareFontFamily{U}{BOONDOX-calo}{\skewchar\font=45 }
\DeclareFontShape{U}{BOONDOX-calo}{m}{n}{<-> s*[1.1] BOONDOX-r-calo}{}
\DeclareFontShape{U}{BOONDOX-calo}{b}{n}{<-> s*[1.1] BOONDOX-b-calo}{}
\DeclareFontFamily{U}{BOONDOX-calo-scaled}{\skewchar\font=45 }
\DeclareFontShape{U}{BOONDOX-calo-scaled}{m}{n}{<-> s*[1.20529] BOONDOX-r-calo}{}
\DeclareFontShape{U}{BOONDOX-calo-scaled}{b}{n}{<-> s*[1.20529] BOONDOX-b-calo}{}
\DeclareMathAlphabet{\mathcalupper}{U}{BOONDOX-calo}{m}{n}
\SetMathAlphabet{\mathcalupper}{bold}{U}{BOONDOX-calo}{b}{n}
\DeclareMathAlphabet{\mathcallower}{U}{BOONDOX-calo-scaled}{m}{n}
\SetMathAlphabet{\mathcallower}{bold}{U}{BOONDOX-calo-scaled}{b}{n}
\ExplSyntaxOn
\NewDocumentCommand{\mathcalbd}{m}
{{
\tl_set:Nn \l_tmpa_tl { #1 }
\regex_replace_all:nnN { [a-z] } { \{ \c{mathcallower}\{\0\} \} } \l_tmpa_tl
\mathcalupper{ \tl_use:N \l_tmpa_tl }
}}
\ExplSyntaxOff
\begin{document}
With height correction: $A\mathcalbd{A} a\mathcalbd{a}$
Subscript: $\mathcalbd{A_a} X_{a\mathcalbd{a}}$
Bold: $\bm{A} \bm{\mathcalbd{A}} \bm{a}\bm{\mathcalbd{a}}$
Bold with subscripts: $\bm{\mathcalbd{A_a}}$
\end{document}