为什么当我使用 \hat 时它不起作用?

为什么当我使用 \hat 时它不起作用?

源代码

\documentclass[a4paper,twoside]{article}
\usepackage{upquote}
\usepackage{pgfkeys}
\usepackage{graphicx}
\usepackage{listings}
 \usepackage{courier}
\usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\parbox{\textwidth}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}\vskip-4pt}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}

 \lstset{
         basicstyle=\footnotesize\ttfamily, 
         numbers=left,               
         numberstyle=\tiny,          
         stepnumber=2,               
         numbersep=5pt,              
         tabsize=2,                  
         extendedchars=true,        
         breaklines=true,            
         keywordstyle=\color{red},
         stringstyle=\color{blue}\ttfamily, 
         showspaces=false,          
         showtabs=false,             
         xleftmargin=6pt,
         framexleftmargin=6pt,
         framexrightmargin=6pt,
         framexbottommargin=4pt,
         backgroundcolor=\color{yellow},
         showstringspaces=false            
 }
\usepackage{aeguill}
\usepackage{prerex}
\usepackage{helvet}
\renewcommand{\rmdefault}{\sfdefault}
\usepackage[printonlyused,withpage]{acronym}%
\usetikzlibrary{chains,positioning}
\usepackage{verbatim}
\usepackage{xcolor}
\usepackage{pdfpages}
\DefineNamedColor{named}{BrickRed}{cmyk}{0,0.89,0.94,0.28}
\DefineNamedColor{named}{DarkRed}{cmyk}{0.4,0.89,0.94,0.28}
\renewcommand{\familydefault}{\sfdefault}
\usetikzlibrary{calc,shapes,positioning,arrows,positioning,shapes.geometric,fit,trees}
\usetikzlibrary{arrows,calc,fit}
\tikzset{box/.style={draw, rectangle, rounded corners, thick, node distance=7em, text width=6em, text centered, minimum height=3.5em}}
\tikzset{container/.style={draw, rectangle, dashed, inner sep=2em}}
\tikzset{line/.style={draw, thick, -latex'}}
\tikzstyle{every picture}=[sibling distance=3cm, shorten >=1pt, node distance=2cm]%>=stealth', bend angle=10, auto, initial text=]
\newcommand*{\stereotype}[1]{
    \guillemotleft {#1}\guillemotright%
}                                      
\usepackage{tikz}
%\usepackage{tikz-uml}
%\usepackage{pgf-umlsd}
\usepackage{lmodern,smartdiagram}
\smartdiagramset{set color list={
  white!20!white,
  white!20!white,
  white!70!white,
  white!40!white,
  white!20!white,
 } }
\tikzstyle{b} = [rectangle, draw, fill=blue!20, node distance=4.5cm, text width=8em, text centered, rounded corners, minimum height=4em, thick]
\tikzstyle{c} = [rectangle, draw, node distance=3cm, minimum height=1cm, minimum width=1cm, dashed]
\tikzstyle{l} = [draw, -latex,thick]
\usepackage{epsfig}
\usepackage[ruled,vlined]{algorithm2e}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
 \usepackage{amsmath, amsthm, amssymb, amsfonts}
\interdisplaylinepenalty=2500
\usepackage[cmintegrals]{newtxmath}
\hyphenation{op-tical net-works semi-conduc-tor}

\usepackage{epsfig}
\usepackage{subfigure}
\usepackage{calc}
\usepackage{amssymb}
\usepackage{amstext}
\usepackage{multicol}
\usepackage{pslatex}
\usepackage{apalike}
%\usepackage{SCITEPRESS}     % Please add other packages that you may need BEFORE the SCITEPRESS.sty package.

\subfigtopskip=0pt
\subfigcapskip=0pt
\subfigbottomskip=0pt

\begin{document}


$\hat{\boldsymbol{U}}_{K}$ and its old position $\hat{\boldsymbol{X}}_{K}$ at k:
\begin{equation}
\hat{\boldsymbol{X}}_{k+1}=f(\hat{\boldsymbol{X}}_{k},\hat{\boldsymbol{U}}_{k})=\left[\begin{array}{c}x_{k+1}\\y_{k+1}\\ \theta_{k+1} \end{array}\right]=\left[\begin{array}{c} x_{k}+\Delta D_{k}\cos\theta_{k}\\y_{k}+\Delta D_{k}\sin\theta_{k}\\ \theta_{k}+\Delta \theta_{k} \end{array}\right]
\end{equation}
Where $\Delta D_{k}$, $\Delta \theta_{k}$, $X_{k}$ and $U_{k}$ are:


\end{document}

答案1

你的序言很乱。很难理解你想使用的字体是什么。无论如何,有几个包你不能加载。

  1. aeguill已过时且不推荐使用
  2. pgfkeys已加载tikz
  3. epsfig已弃用
  4. lmodernhelvet如果你加载无衬线字体并将其设置为默认字体,则毫无用处
  5. subfigurecaption已经过时,无论如何都不应该一起加载
  6. pslatex已经过时

我离开了他们,但\tikzstyle他们已被弃用。

\documentclass[a4paper,twoside]{article}
\usepackage[T1]{fontenc}

\usepackage{amsmath}
\usepackage{amssymb} % not along with newtxmath
\usepackage{amsthm}
\usepackage{bm}

\usepackage{helvet}
\usepackage{courier}
\usepackage[cmintegrals]{newtxmath}

\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{pdfpages}

\usepackage{caption}

\usepackage{upquote}
\usepackage{listings}
\usepackage{prerex}
\usepackage[printonlyused,withpage]{acronym}
\usepackage{verbatim}
\usepackage[ruled,vlined]{algorithm2e}

\usepackage{tikz}
%\usepackage{tikz-uml}
%\usepackage{pgf-umlsd}
\usepackage{smartdiagram}

\usepackage{calc}
\usepackage{multicol}
\usepackage{apalike}
%\usepackage{SCITEPRESS}     % Please add other packages that you may need BEFORE the SCITEPRESS.sty package.

\renewcommand{\rmdefault}{\sfdefault}

\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{%
  \parbox{\textwidth}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}\vskip-4pt}%
}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}

\lstset{
  basicstyle=\footnotesize\ttfamily, 
  numbers=left,               
  numberstyle=\tiny,          
  stepnumber=2,               
  numbersep=5pt,              
  tabsize=2,                  
  extendedchars=true,        
  breaklines=true,            
  keywordstyle=\color{red},
  stringstyle=\color{blue}\ttfamily, 
  showspaces=false,          
  showtabs=false,             
  xleftmargin=6pt,
  framexleftmargin=6pt,
  framexrightmargin=6pt,
  framexbottommargin=4pt,
  backgroundcolor=\color{yellow},
  showstringspaces=false            
}

\DefineNamedColor{named}{BrickRed}{cmyk}{0,0.89,0.94,0.28}
\DefineNamedColor{named}{DarkRed}{cmyk}{0.4,0.89,0.94,0.28}

\usetikzlibrary{chains,positioning}
\usetikzlibrary{calc,shapes,positioning,arrows,positioning,shapes.geometric,fit,trees}
\usetikzlibrary{arrows,calc,fit}

\tikzset{
  box/.style={
    draw,
    rectangle,
    rounded corners,
    thick,
    node distance=7em,
    text width=6em,
    text centered,
    minimum height=3.5em
  }
}
\tikzset{
  container/.style={
    draw,
    rectangle,
    dashed,
    inner sep=2em
  }
}
\tikzset{line/.style={draw, thick, -latex'}}
\tikzstyle{every picture}=[
  sibling distance=3cm,
  shorten >=1pt,
  node distance=2cm,
  % >=stealth',
  % bend angle=10,
  % auto,
  % initial text=
]
\tikzstyle{b}=[
  rectangle,
  draw,
  fill=blue!20,
  node distance=4.5cm,
  text width=8em,
  text centered,
  rounded corners,
  minimum height=4em,
  thick
]
\tikzstyle{c}=[
  rectangle,
  draw,
  node distance=3cm,
  minimum height=1cm,
  minimum width=1cm,
  dashed
]
\tikzstyle{l}=[draw, -latex,thick]

\smartdiagramset{set color list={
  white!20!white,
  white!20!white,
  white!70!white,
  white!40!white,
  white!20!white,
 } }

\newcommand*{\stereotype}[1]{%
  \guillemotleft {#1}\guillemotright
}
\interdisplaylinepenalty=2500
\hyphenation{op-tical net-works semi-conduc-tor}

\begin{document}


$\hat{\boldsymbol{U}}_{K}$ and its old position $\hat{\boldsymbol{X}}_{K}$ at $k$:
\begin{equation}
\hat{\boldsymbol{X}}_{k+1}=f(\hat{\boldsymbol{X}}_{k},\hat{\boldsymbol{U}}_{k})=
\begin{bmatrix} x_{k+1}\\y_{k+1}\\ \theta_{k+1} \end{bmatrix}=
\begin{bmatrix} 
  x_{k}+\Delta D_{k}\cos\theta_{k}\\
  y_{k}+\Delta D_{k}\sin\theta_{k}\\
  \theta_{k}+\Delta \theta_{k}
\end{bmatrix}
\end{equation}
Where $\Delta D_{k}$, $\Delta \theta_{k}$, $X_{k}$ and $U_{k}$ are:

\end{document}

在此处输入图片描述

答案2

您的某个软件包更改了 的定义\hat。作为快速修复,您可以添加

\def\hat{\mathaccent "705E\relax}

在你的数学之前,使用这个重音。

在此处输入图片描述

相关内容