如何调整帽子从格里菲斯大卫的书

如何调整帽子从格里菲斯大卫的书

我很难将帽子的大胆强调放在中心,就像在格里菲斯大卫的书中一样,如下图所示,它是从书中摘录的:

在此处输入图片描述

我的输出使用

\usepackage{baskervald}
\usepackage[baskervaldx]{newtxmath}

与书的原图有所不同。

 \documentclass[12pt,a4paper,oneside]{book}
 \usepackage[lmargin=7cm,rmargin=.7cm,bmargin=2cm,marginparwidth=5.5cm,marginparsep=2em]{geometry}
    \usepackage{lipsum,sidenotes,tabularx}
    \reversemarginpar % Page margins
    \usepackage{graphicx} % Required for including pictures
    \usepackage{xcolor}
    \usepackage{baskervald}
    \usepackage[baskervaldx]{newtxmath}
    \usepackage[scr, scaled=1.1]{rsfso}
    \usepackage{bm}
    \usepackage{amsmath,amssymb}  
    \usepackage[italian]{babel}
    \usepackage[utf8]{inputenc} 
    \usepackage[T1]{fontenc} 
    \usepackage{mathtools}
    \usepackage{dsfont}
    \usepackage{mathrsfs}
    \usepackage{scalerel}


    %----------------------------------------------------------------------------------------
    %   r Griffiths, curls and fonts from mt2pro[lite]->pro
    %----------------------------------------------------------------------------------------


    \def\rcurs{{\mbox{$\resizebox{.09in}{.08in}{\includegraphics[trim= 1em 0 14em 0, clip]{ScriptR}}$}}}
    \def\brcurs{{\mbox{$\resizebox{.09in}{.08in}{\includegraphics[trim= 1em 0 14em 0, clip]{BoldR}}$}}}
    \def\hrcurs{{\mbox{$\hat \brcurs$}}}
    \begin{document}
    \[V(\mathbf r)=\frac{1}{4\pi \epsilon_0}\int_{\mathcal V} \frac{\mathbf P(\mathbf r')\cdot \hrcurs}{\rcurs^2}d\tau'\]
    \end{document}

实际上我的输出是:

在此处输入图片描述

我该如何修复这个问题?

答案1

\documentclass{article}

%% Preamble
\ifdefined\pdfliteral
    \let\griffPdfliteral\pdfliteral
\else \def\griffPdfliteral#1{\special{pdf: literal #1}} \fi

\newcommand\griffr[1][2]{\leavevmode\hbox{\kern1pt\vbox to1ex{}\griffPdfliteral{%
    q 1 J .27 0 0 .27 0 0 cm #1 w
    0 2 m
    0 2 8.1 9.7 9.2 13.2 c
    10.4 16.8 8.4 15.4 8 14.7 c
    7.6 14 6.8 12.6 12 13 c
    17 13.5 14.5 7.8 13.7 6 c
    12.8 4.3 10.3 1.2 11.4 .2 c
    12.6 -.7 18.8 3.6 18.8 3.6 c
    18.8 3.6 l S Q
}\kern6pt}}
\newcommand\hatgriffr{\skew3\hat{\griffr}}

%% Body
\begin{document}
    A$\hatgriffr$B\griffr[0.5]C\griffr[3]D
\end{document}

输出

但是,必须手动调整这些值来适应周围的文本。

答案2

我倾向于使用 stix2,它已经设置了多种与时代兼容的字母,包括脚本和粗体脚本

在此处输入图片描述

\documentclass[12pt,a4paper,oneside]{book}


%----------------------------------------------------------------------------------------
%   VARIOUS REQUIRED PACKAGES AND CONFIGURATIONS
%----------------------------------------------------------------------------------------
\usepackage[lmargin=7cm,rmargin=.7cm,bmargin=2cm,marginparwidth=5.5cm,marginparsep=2em]{geometry}
\usepackage{lipsum,sidenotes,tabularx}
\reversemarginpar % Page margins
\usepackage{graphicx} % Required for including pictures
\usepackage{xcolor}


%----------------------------------------------------------------------------------------
%   FONTS
%----------------------------------------------------------------------------------------

\usepackage[full]{textcomp}
\usepackage{baskervald}

% you could consider using stix rather than newtxmatn
%\usepackage[baskervaldx]{newtxmath}


%\usepackage{bm}
\usepackage{amsmath,amssymb}  
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{mathtools}

%using stix double struck for consistency
% \usepackage{dsfont}

% you can't want rsfso and mathrsfs (which are basically the same thing)
% but here I use stix script anyway
%%\usepackage[scr, scaled=1.1]{rsfso}
%% \usepackage{mathrsfs}

\usepackage{scalerel}
%\usepackage{amsthm}

\usepackage{stix2}
%----------------------------------------------------------------------------------------
%   bracket
%----------------------------------------------------------------------------------------

\usepackage{braket}

%----------------------------------------------------------------------------------------
%   cancel
%----------------------------------------------------------------------------------------
\usepackage{cancel}


%----------------------------------------------------------------------------------------
%   r Griffiths, curls and fonts from mt2pro[lite]->pro
%----------------------------------------------------------------------------------------


\def\rcurs{\mathscr{r}}
\def\brcurs{\mathbfscr{r}}
\def\hrcurs{\hat{\brcurs}}


\begin{document}
\[V(\mathbf{r})=\frac{1}{4\pi \epsilon_0}\int_{\!\!\mathscr{V}}\!
\frac{\mathbf{P}(\mathbf{r}')\cdot \hrcurs}{\rcurs^2}d\tau'\]
\end{document}

答案3

原帖者的总体思路是合理可行的,尽管它确实将符号表示为光栅图像。但是,trim我认为在经常出现的符号上使用 并不明智。我只是截取了原帖者的符号(常规和粗体为scriptr.jpgscriptrb.jpg),然后在编辑器中仔细修剪它们并直接保存。

然后,未经修剪的定义变成

\def\rcurs{{\mbox{$\resizebox{.09in}{.08in}{\includegraphics{scriptr}}$}}}
\def\brcurs{{\mbox{$\resizebox{.09in}{.08in}{\includegraphics{scriptrb}}$}}}
\def\hrcurs{{\mbox{$\hat \brcurs$}}}

这样做了之后,帽子就没有问题了(虽然代码确实抱怨\Bbbk已经被定义,但我没有解决这个问题):

\documentclass[12pt,a4paper,oneside]{book}
\usepackage[lmargin=7cm,rmargin=.7cm,bmargin=2cm,marginparwidth=5.5cm,marginparsep=2em]{geometry}
\usepackage{lipsum,sidenotes,tabularx}
\reversemarginpar % Page margins
\usepackage{graphicx} % Required for including pictures
\usepackage{xcolor}
\usepackage{baskervald}
\usepackage[baskervaldx]{newtxmath}
\usepackage[scr, scaled=1.1]{rsfso}
\usepackage{bm}
\usepackage{amsmath,amssymb}  
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{mathtools}
\usepackage{dsfont}
\usepackage{mathrsfs}
\usepackage{scalerel}


%----------------------------------------------------------------------------------------
%   r Griffiths, curls and fonts from mt2pro[lite]->pro
%----------------------------------------------------------------------------------------


\def\rcurs{{\mbox{$\resizebox{.09in}{.08in}{\includegraphics{scriptr}}$}}}
\def\brcurs{{\mbox{$\resizebox{.09in}{.08in}{\includegraphics{scriptrb}}$}}}
\def\hrcurs{{\mbox{$\hat \brcurs$}}}
\begin{document}
\[V(\mathbf r)=\frac{1}{4\pi \epsilon_0}\int_{\mathcal V} \frac{\mathbf P(\mathbf r')\cdot \hrcurs}{\rcurs^2}d\tau'\]
\end{document}

在此处输入图片描述

答案4

由于您的 MWE 无法为我编译,我用frcusrive包中的法语草书字体替换了它(并且还用 设置了数学字母mathalpha)。

\documentclass[12pt,a4paper,oneside]{book}
\tracinglostchars=2
\usepackage[lmargin=7cm,rmargin=.7cm,bmargin=2cm,marginparwidth=5.5cm,marginparsep=2em]{geometry}
%\usepackage{lipsum,sidenotes,tabularx}
\reversemarginpar % Page margins
\usepackage{graphicx} % Required for including pictures
\usepackage{xcolor}
\usepackage{amsmath, mathtools}  
\usepackage{baskervald}
\usepackage[baskervaldx]{newtxmath}
\usepackage[bb=dsserif, scr=rsfso]{mathalpha}
\usepackage{bm}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 


    %----------------------------------------------------------------------------------------
    %   r Griffiths, curls and fonts from mt2pro[lite]->pro
    %----------------------------------------------------------------------------------------


%    \def\rcurs{{\mbox{$\resizebox{.09in}{.08in}{\includegraphics[trim= 1em 0 14em 0, clip]{ScriptR}}$}}}
%    \def\brcurs{{\mbox{$\resizebox{.09in}{.08in}{\includegraphics[trim= 1em 0 14em 0, clip]{BoldR}}$}}}
%    \def\hrcurs{{\mbox{$\hat \brcurs$}}}

% Substitute french Cursive font for script r:
\newcommand\rcurs{\text{\usefont{T1}{frc}{m}{sl}r}}
\newcommand\brcurs{\text{\usefont{T1}{frc}{bx}{sl}r}}
\newcommand\hrcurs{\boldsymbol{\hat{\brcurs}}}

    \begin{document}
    \[V(\mathbf r)=\frac{1}{4\pi \epsilon_0}\int_{\mathcal V} \frac{\mathbf P(\mathbf r')\cdot \hrcurs}{\rcurs^2}d\tau'\]
    \end{document}

Baskervald + bewtx + frcursive 示例

这并不完美,但确实为您提供了可缩放字体的脚本 r。如果您愿意切换到unicode-math(如果您的目标是复制使用经典 LaTeX 排版的书籍外观,您可能不会),您将有更多选择。

要微调数学重音的位置,请使用命令\skew。 的定义\hrcurs将帽子向右移动:

\documentclass[12pt,a4paper,oneside]{book}
\tracinglostchars=2
\usepackage[lmargin=7cm,rmargin=.7cm,bmargin=2cm,marginparwidth=5.5cm,marginparsep=2em]{geometry}
%\usepackage{lipsum,sidenotes,tabularx}
\reversemarginpar % Page margins
\usepackage{graphicx} % Required for including pictures
\usepackage{xcolor}
\usepackage{amsmath, mathtools}  
\usepackage{baskervald}
\usepackage[baskervaldx]{newtxmath}
\usepackage[bb=dsserif, scr=rsfso]{mathalpha}
\usepackage{bm}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 


    %----------------------------------------------------------------------------------------
    %   r Griffiths, curls and fonts from mt2pro[lite]->pro
    %----------------------------------------------------------------------------------------


%    \def\rcurs{{\mbox{$\resizebox{.09in}{.08in}{\includegraphics[trim= 1em 0 14em 0, clip]{ScriptR}}$}}}
%    \def\brcurs{{\mbox{$\resizebox{.09in}{.08in}{\includegraphics[trim= 1em 0 14em 0, clip]{BoldR}}$}}}
%    \def\hrcurs{{\mbox{$\hat \brcurs$}}}

% Substitute french Cursive font for script r:
\newcommand\rcurs{\text{\usefont{T1}{frc}{m}{sl}r}}
\newcommand\brcurs{\text{\usefont{T1}{frc}{bx}{sl}r}}
\newcommand\hrcurs{\boldsymbol{\skew{4}{\hat}{\brcurs}}}

    \begin{document}
    \[V(\mathbf r)=\frac{1}{4\pi \epsilon_0}\int_{\mathcal V} \frac{\mathbf P(\mathbf r')\cdot \hrcurs}{\rcurs^2}d\tau'\]
    \end{document}

\skew 示例

相关内容