内联数学和脚注前的显示行为很奇怪,但在脚注后却正常

内联数学和脚注前的显示行为很奇怪,但在脚注后却正常

我对我的文件中这种奇怪的数学显示行为感到困惑:

奇怪的行为

这是用LuaLatex编译的latex文件:

\usepackage[portuguese]{babel}
\babelposthyphenation{portuguese}{.=.}{
    {},
    { no = -, pre = -, post = -, data = 1 },
    {}
}
\babelprovide[transforms = hyphen.repeat]{portuguese}
\addto\captionsportuguese{% Substitui ``Conteudo'' por ``Índice''
\renewcommand{\contentsname}{Índice}
\renewcommand{\appendixtocname}{Apêndices}%
\renewcommand{\appendixpagename}{Apêndices}%
\renewcommand\bibname{Referências Bibliográficas}%
\renewcommand{\chaptername}{Capítulo}
}


%Hyphenation rules
%--------------------------------------
\usepackage{hyphenat}
\hyphenation{mate-ma-tica re-cu-pe-rar pres-su-pos-to jamovi Krus-kal-Wallis Wilco-xon-Mann-Whitney}
%--------------------------------------
% Para usar fontes do Windows
% as fonts tem de estar instaladas em c:\windows\fonts
\usepackage{lmodern}
\usepackage[no-math]{fontspec}
\setmainfont[Ligatures=TeX,Scale=1.15] {Adobe Garamond Pro}
\setsansfont {MyriadPro-BoldSemiCn} %{MyriadPro-SemiCn} %{Lato}{MyriadPro-SemiboldSemiCn}
%\setmonofont{CMU Typewriter Text}

% para passar a fonte das formulas para EB Garamond
%\setmainfont{EB Garamond}%You should have installed the font
%\setmathfont{Garamond-Math.otf}[StylisticSet={7,9}]%Use StylisticSet that you like
%%ou
%%\usepackage[urw-garamond]{mathdesign}
%\usepackage[adobe-garamond]{mathdesign}

\usepackage{fix-cm}% just to avoid some spurious messages
\usepackage{mathtools}
%\usepackage{amsmath} %loaded by mathtools
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{multicol} % multiplas colunas para os exercicios
\usepackage{hyphenat}
\usepackage{graphicx}
\usepackage{lettrine}
\usepackage{xstring}
\usepackage{nccmath}
\usepackage{subcaption}
\usepackage[export]{adjustbox}
\usepackage{titlesec}
\usepackage{xcolor}
\usepackage{tabularray}
\usepackage{multirow,bigdelim} % para adicionar chavetas em tabelas

% Compile with XeLaTeX or LuaLaTeX
\defaultfontfeatures{Ligatures=TeX}
\definecolor{gray70}{gray}{0.70}
\definecolor{gray25}{gray}{0.25}
\definecolor{gray50}{gray}{0.50}
\definecolor{gray25}{RGB}{35, 140, 255}
\definecolor{gray70}{RGB}{125, 185, 250}
%\newcommand\bluebf[1]{\textcolor{gray70}{\textbf{#1}}}
\newcommand{\hsp}{\hspace{20pt}}

\setmainfont[Ligatures=TeX,Scale=1.1,BoldFeatures={Colour=gray70}] {Adobe Garamond Pro}

% Set formats for each heading level - rm, sf, tt,md, bf, up, it, sl, sc
\titleformat{\chapter}[display]
{\normalfont\huge\mdseries\color{gray70}}
{\chaptertitlename\huge\bfseries~\thechapter}{20pt}
{\Huge\bfseries\sffamily\color{gray25}\uppercase}

\titlespacing*{\chapter}{0pt}{20pt}{120pt}  %controls vertical margins on title

\titleformat{\section}
  {\normalfont\sffamily\Large\color{gray25}}
  {\thesection.}{0.4em}{}
\titleformat{\subsection}
  {\normalfont\sffamily\large\color{gray25}}
  {\thesubsection.}{0.4em}{}
  \titleformat{\subsubsection}
  {\normalfont\sffamily\large\itshape\color{gray25}}
  {\thesubsubsection.}{0.4em}{}
\usepackage[dotinlabels]{titletoc}

% Drop Cap
\usepackage{lettrine}
\usepackage{xstring}
\makeatletter
\let\ltx@@chapter\@chapter
\def\@chapter[#1]#2 #3 {%
    \ltx@@chapter[#1]{#2}
    \StrLeft{#3}{1}[\jpmd@temp]%
    \lettrine[lines=2, findent=1pt, nindent=1pt, slope=4pt]{\jpmd@temp}{\@gobble#3}\ }
\renewcommand{\LettrineTextFont}{\textnormal} 
\renewcommand{\LettrineFontHook}{\color{gray70} \bfseries}
\makeatother

%Define o paper size
\usepackage[paperwidth=160mm, paperheight=230mm, margin=15mm, bottom=20mm, top=30mm, headsep=15mm,footskip=12mm]{geometry}
\usepackage[cam,a4,center,pdftex]{crop}
\usepackage{fancyhdr}
\fancyhf{}
\fancyhead[LE]{\sffamily\color{gray70}\uppercase{\leftmark}}
\fancyhead[RO]{\sffamily\color{gray70}\nouppercase{\rightmark}}
\fancyfoot[LE,RO]{\thepage}
\pagestyle{fancy}
\setlength{\headheight}{20pt}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\chaptermark}[1]{%
\markboth{\MakeUppercase{%
\thechapter.%
\ #1}}{}}

% pacotes para várias coisas\usepackage{relsize}
\usepackage{enumitem}
\setlist[enumerate]{label*=\arabic*.}
\theoremstyle{definition}
\newtheorem{exer}{Exercícios}[section]

\usepackage{natbib}
\setlength{\bibsep}{0pt plus 0.3ex}
%\usepackage{fontspec}
\usepackage{pgf-pie}
\usepackage{float}
\usepackage[page,toc,titletoc,title]{appendix}
\usepackage{multicol, multirow}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{color, colortbl}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{longtable} % for 'longtable' environment
\usepackage{pdflscape} % rotating contents
\usepackage{ltxtable}
\usepackage{xr-hyper}
\usepackage[hidelinks, linktocpage=true, unicode]{hyperref}
\usepackage{cleveref}
\usepackage{enumitem}
\usepackage{caption}
\usepackage{booktabs} % para adicionar linhas às tabelas
% necessário para o ambiente dos exemplos
%\usepackage[math-style=TeX, bold-style=TeX]{unicode-math} % conflits with cooljaz math
%\usepackage{unicode-math}
\usepackage[rflt]{floatflt} % floating images nas Tabs.tex
\usepackage[most]{tcolorbox}
\usepackage{nicematrix}
\usepackage{tikz}
\usetikzlibrary{arrows}% only needed for the arrow tip stealth'
\usepackage{pgfplots}
\pgfplotsset{compat=1.8,every picture/.style={/utils/exec={\ttfamily}}}
\usepgfplotslibrary{fillbetween}
\usepgfplotslibrary{statistics}
% Trocar a fonte dos graficosTikz para Helvetica Light
\setmonofont[Ligatures=TeX,Scale=0.9]{HELVETICALT_0.TTF}
\tikzset{every picture/.style={/utils/exec={\ttfamily}}}
\usepackage{pstricks}    %for embedding pspicture.
\usepackage{pst-func,amsmath,xfp,pst-tree} %for calculations and normal functions
% Trocar a fonte dos graficos PStricks para Helvetica Light
\renewcommand{\pshlabel}[1]{\ttfamily #1}% for x-axis
\renewcommand{\psvlabel}[1]{\ttfamily #1}% for y-axis
%para centrar o icon com a o cabeçalho da box
\newcommand{\vcenteredinclude}[1]{\begingroup
\setbox0=\hbox{\includegraphics[scale=.75]{#1}}%
\parbox{\wd0}{\box0}\endgroup}

% makes gray box around text (precisa do pacakge tikz)
%\newcommand\mybox[2][fill=gray!20]{%
\newcommand\mybox[2][fill=gray70!20]{%
    \tikz[baseline]\node[%
    inner ysep=0pt, 
    inner xsep=2pt, 
    anchor=text, 
    rectangle, 
    rounded corners=0.2mm,
    #1] {\strut#2};%
}

\newcommand*{\Fbox}[1]{\fbox{\strut #1}}    

\def\pdfliteral#1{\special{pdf:literal #1}}
\def\mmybox#1{\leavevmode \setbox0=\hbox{#1}%
   \dimen0=\wd0 \edef\posxA{\expandafter\ignorept\the\dimen0 \space}%
   \hbox{\kern3pt\pdfliteral{q .9 g .9 G .9963 0 0 .9963 0 0 cm 1 j 1 J 6 w
                             0 0 m 0 5 l \posxA 5 l \posxA 0 l 0 0 l B Q}%
         \box0 \kern3pt}%
}
{\lccode`\?=`\p \lccode`\!=`\t  \lowercase{\gdef\ignorept#1?!{#1}}}

% define ambimente de exemplos
\makeatletter
\crefformat{tcb@cnt@Exemplo}{exemplo~#2#1#3}
\Crefformat{tcb@cnt@Exemplo}{Exemplo~#2#1#3}
\makeatother
\newtcbtheorem[auto counter, number within = section]{exemplo}{\, Exemplo}%
{ % frame stuff
    breakable,
    arc=40mm,
    size=normal,
    enhanced,%frame empty,interior empty,
    colframe=gray70,
    colback=white,colbacklower=white,
    borderline={0.01mm}{0.01mm}{gray70!10},
    % margens da frame
    top=0.3cm,left=0.2cm,bottom=0.2cm,right=0.2cm,
    % title stuff
    %attach boxed title to top left={yshift=0mm,xshift=-0mm},
    %boxsep=2mm,
    lefttitle=0.2cm, toptitle=0.1cm,bottomtitle=0.1cm,
    coltitle=gray70,
    fonttitle=\bfseries,
    colbacktitle=gray70!10,
    %boxed title style={boxrule=.0pt,sharp corners}
    rounded corners,
    %borderline=0.1pt,
    lifted shadow={2mm}{-2mm}{3mm}{0.1mm}{gray25!70!white},
    overlay={\node[anchor=north west,outer sep=-1pt, xshift=-11pt] at (frame.north west)                
    {\includegraphics[scale=0.65]{pencilblue}}; }
    }{ex}
   
      
%\usepackage[no-math]{fontspec}
%\usepackage{amsmath} loaded by mathtools

% Environment for hand resolution

\newfontfamily\cooljazz[NFSSFamily=cooljazz,BoldFont={Boogaloo Regular},Scale=0.85,Ligatures=TeX]{cooljazz}
\usepackage[subdued, defaultmathsizes]{mathastext}
\MTfamily{cooljazz}
\Mathastext[cooljazz]

\newenvironment{coolj}{

    \MTversion{cooljazz}\MTdonotfixfonts
    \setmainfont{cooljazz}[Scale = .8, Extension = .ttf ]
    % adjust some additional glyphs
    \Umathchardef\prod 1 \symmtoperatorfont `∏\relax % mathop
    \Umathchardef\sum  1 \symmtoperatorfont `∑\relax % mathop
    \Umathchardef\in   3 \symmtoperatorfont `∈\relax %
    \Umathchardef\int  1 \symmtoperatorfont `∫\relax % mathop
    \Umathchardef\neq  3 \symmtoperatorfont `≠\relax % mathrel
    %\Umathchardef\sqrt  1 \symmtoperatorfont `√\relax % mathrel
    \Umathchardef\mu  1 \symmtoperatorfont `μ\relax % greek
    \Umathchardef\sigma 1 \symmtoperatorfont `σ\relax % greek
    \Umathchardef\gamma 1 \symmtoperatorfont `γ\relax % greek
    \Umathchardef\beta 1 \symmtoperatorfont `β\relax % greek
    \Umathchardef\epsilon 1 \symmtoperatorfont `ε\relax % greek
    \Umathchardef\eta 1 \symmtoperatorfont `η\relax % greek
    \Umathchardef\alpha 1 \symmtoperatorfont `α\relax % greek
    \Umathchardef\theta 1 \symmtoperatorfont `θ\relax % greek
    \Umathchardef\rho 1 \symmtoperatorfont `ρ\relax % greek
    \Umathchardef\phi 1 \symmtoperatorfont `ϕ\relax % greek
    \Umathchardef\sim 1 \symmtoperatorfont `~\relax % greek
    \Umathchardef\chi 1 \symmtoperatorfont `χ\relax % greek
    \Umathchardef\ge 1 \symmtoperatorfont `≥\relax % greek
    \Umathchardef\le 1 \symmtoperatorfont `≤\relax % greek
    \Umathchardef\exists 1 \symmtoperatorfont `∃\relax % greek
    \Umathchardef\pm 1 \symmtoperatorfont `±\relax % greek
    \Umathchardef\forall1 \symmtoperatorfont `∀\relax % greek
    %
}{\par}

% Set TexaTI environment
\newfontfamily{\TIkeys}{TI84KEYSYMBOLS.TTF}
\DeclareTextFontCommand{\tikeys}{\TIkeys}
%\setmonofont{CMU Typewriter Text}[Scale = .90]
\newfontfamily{\CMU}{CMU Typewriter Text}[Scale = 1]
\DeclareTextFontCommand{\cmutext}{\CMU}
\newfontfamily{\TItext}{TI-83-PLUS-REGULAR.ttf}[Scale=0.7] 
\DeclareTextFontCommand{\titext}{\TItext}
% para alinhar os triangulos do ambiente TI84
\newcommand{\tri}{\raisebox{.15 em}{\tiny$\blacktriangleright$}}
\newfontfamily{\MSS}{Microsoft Sans Serif}[Scale = .85]
\DeclareTextFontCommand{\jmvtext}{\MSS}

\newfontfamily{\hlv}{Helvetica-Light}[Scale = .85]
\DeclareTextFontCommand{\hlvtext}{\hlv}

\newtcbtheorem[auto counter, number within = section]{Ti84}{\, Ti84}%
{ % frame stuff
    breakable,
    arc=40mm,
    size=normal,
    enhanced,%frame empty,interior empty,
colframe=gray70,
colback=white,colbacklower=white,
borderline={0pt}{0pt}{gray70!10},
% margens da frame
top=0.3cm,left=0.2cm,bottom=0.2cm,right=0.2cm,
% title stuff
%attach boxed title to top left={yshift=0mm,xshift=-0mm},
%boxsep=2mm,
lefttitle=0.2cm, toptitle=0.1cm,bottomtitle=0.1cm,
coltitle=gray70,
fonttitle=\bfseries,
colbacktitle=gray70!10,
%boxed title style={boxrule=.0pt,sharp corners}
rounded corners,
%borderline=0.1pt,
lifted shadow={2mm}{-2mm}{3mm}{0.1mm}{gray25!70!white},
    overlay={\node[anchor=north west,outer sep=-1pt, xshift=-11pt] at (frame.north west)  {\includegraphics[scale=0.65]{maquinablue}}; }
    }{ex}

%Summary Environment
\newtcbtheorem[auto counter, number within = chapter]{resumo}{\, \sffamily Resumo}%
{ % frame stuff
    %breakable,
    arc=40mm,
    size=normal,
    enhanced,%frame empty,interior empty,
colframe=gray25,
colback=gray70!10,colbacklower=white,
borderline={0pt}{0pt}{gray70!10},
% margens da frame
top=0.3cm,left=0.2cm,bottom=0.2cm,right=0.2cm,
% title stuff
%attach boxed title to top left={yshift=0mm,xshift=-0mm},
%boxsep=2mm,
lefttitle=0.2cm, toptitle=0.1cm,bottomtitle=0.1cm,
coltitle=gray25,
fonttitle=\bfseries,
colbacktitle=gray25!25,
%boxed title style={boxrule=.0pt,sharp corners}
rounded corners,
%borderline=0.1pt,
lifted shadow={2mm}{-2mm}{3mm}{0.1mm}{gray25!70!white},
    overlay={\node[anchor=north west,outer sep=-2pt, xshift=-11pt] at (frame.north west) {\includegraphics[scale=0.65]{bulbblue}}; }
    }{res}
\newenvironment{tabresumo}{
\small
\defaultfontfeatures{Scale=MatchUppercase}
\setmainfont{Myriad Pro}[Scale=.9,BoldFont={Myriad Pro Bold}]
%\renewcommand{\familydefault}{\sfdefault}
%\setmathfont[math-style=upright,range={up/{Latin,latin,num, italic}},Scale=0.85]{helvetica.otf}
%\setmathfont[Scale=0.9] {latinmodern-math.otf}%{NewCMMath-Regular.otf}
%\DeclareMathSizes{9}{8.5}{7}{5}  % o primeiro valor é o fontsize do texto, o segundo é o fontsize da font math, o 3º do subscripto e o 4º do subsubscripto.
}{\par} 

% jamov environment
\newtcbtheorem[auto counter, number within = section]{jamovi}{\, \cmutext{jamovi}}%
{ % frame stuff
    breakable,
    arc=40mm,
    size=normal,
    enhanced,%frame empty,interior empty,
colframe=gray70,
colback=white,colbacklower=white,
borderline={0pt}{0pt}{gray70!10},
% margens da frame
top=0.3cm,left=0.2cm,bottom=0.2cm,right=0.2cm,
% title stuff
%attach boxed title to top left={yshift=0mm,xshift=-0mm},
%boxsep=2mm,
lefttitle=0.2cm, toptitle=0.1cm,bottomtitle=0.1cm,
coltitle=gray70,
fonttitle=\bfseries,
colbacktitle=gray70!10,
%boxed title style={boxrule=.0pt,sharp corners}
rounded corners,
%borderline=0.1pt,
lifted shadow={2mm}{-2mm}{3mm}{0.1mm}{gray25!70!white},
    overlay={\node[anchor=north west,outer sep=-1pt, xshift=-11pt] at (frame.north west)  {\includegraphics[scale=0.65]{computerblue}}; }
}{exjmv}

% to center figures and tables without \centering
\makeatletter
\g@addto@macro\@floatboxreset\centering
\makeatother

% for inline figures:
\usepackage{graphicx,calc,scalerel}
\newcommand*\inlinegraphics[1]{%
    \raisebox{0\height}{\includegraphics[scale=0.5]{#1}}%
}
\newcommand*\inlinefig[1]{%
    \scalerel*{\includegraphics{#1}}{D}%
}

% To reference chapters
%\usepackage{cleveref}
\usepackage{nameref}
\usepackage{subcaption}
\usepackage{float}
\usepackage[font=footnotesize,labelfont=bf]{caption}
\usepackage[hang,flushmargin]{footmisc}

% Style for reports in the results examples
\def\relat#1{
    \begin{quote}
        \hspace*{-0.40cm}\raisebox{-1.2ex}{\color{lightgray}\huge \textbf{``}}{#1}
\end{quote} }


\newcommand*{\Comb}[2]{{}^{#1}C_{#2}} % defines Combinations
\newcommand{\mybar}[3]{% makes extra bar
\mathrlap{\hspace{#2}\overline{\scalebox{#1}[1]{\phantom{\ensuremath{#3}}}}}\ensuremath{#3}
}

%For bibliogtaphy
\usepackage{natbib}

% add dumb text
\usepackage{blindtext}

\usepackage{siunitx} % aligns numbers by decimal separator
\newcolumntype{d}{S[table-format=6.4]}

%font dos urls
%\urlstyle{tt}
\def\UrlFont{\CMU}
%para obter os Z e N dos numeros naturais
%\setmathfont{latinmodern-math.otf}
%\setmathfont[range={"211-"2124}]{texgyrepagella-math.otf}

% Main document with subchapter
% \usepackage{subfiles} % está no Book.tex

\newfontfamily\DejaSans{DejaVu Sans} % gets emoticons

如果我不使用前缀,则它按预期工作。所以一定是我在 中进行了某些设置\usepackage{xxx}。但我能弄清楚。

知道是什么原因导致了这种奇怪的行为吗?

谢谢!

答案1

nicematrix此图文需要 封装:在此处输入图片描述

nicematrix在声明之前采取行动mathfont就达到了目的。

相关内容