\textbf{}、\textit{} 在 beamer 中无法工作

\textbf{}、\textit{} 在 beamer 中无法工作

我使用的是 IMSAloquioum 模板,并做了一些修改,如下所示

\documentclass[final]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{nicematrix}
\usepackage{xcolor}
\usepackage{utopia} %font utopia imported
\usepackage{setspace}  % <---
\setstretch{1.3}

\bibliographystyle{alpha}
\usepackage[absolute,overlay]{textpos}
\usepackage{tikz}
\usepackage{tikz-feynman}
\tikzfeynmanset{vanilla/.style=}
\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=0.5cm,text centered, draw=cyan, fill=cyan!20]
\tikzstyle{arrow} = [thick,->,>=stealth]

\usetikzlibrary{positioning}
\usetheme{imsa}
\usecolortheme{imsa}
\usefonttheme[onlymath]{serif}
\usepackage[most]{tcolorbox}
\usepackage{colortbl}
\usepackage{wrapfig}
\usepackage[labelformat=empty]{caption}
\setbeamertemplate{background}
{\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{pointbackground.png}}
%------------------------------------------------------------

%Mergin selection%
\setbeamersize
{
    text margin left=0.7cm,
    text margin right=0.7cm
}
%This block of code defines the information to appear in the
%Title page





\setbeamertemplate{frametitle}{%
  \begin{tcolorbox}[colframe=blue,boxrule=0.5pt,top=0.7mm,bottom=0.7mm,grow to left by=5.8mm, grow to right by=5.9mm, before skip=0.07cm,
  interior style={left color=blue, right color=white}]
    \usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}\insertframetitle
  \end{tcolorbox}
}
\begin{document}



% Title Page
\frame{
\titlepage
}
\AtBeginSection[]
{
{
\setbeamertemplate{background}
{\includegraphics[width = \the\paperwidth, height = \the\paperheight]{toc.png}}
  \begin{frame}
    \frametitle{Table of Contents}
    \tableofcontents[currentsection]
  \end{frame}
  }
}

\setbeamertemplate{background}
{\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{pointbackground.png}}

\small
\begin{frame}{Cross section}
    
\end{frame}


%Bibilographies
\begin{frame}[allowframebreaks]{Bibilography}
    \bibliography{bibitems}
\end{frame}
\end{document}

但问题是,斜体和粗体字体都不起作用。我尝试删除utopia并插入其他字体系列,但没有帮助。图中,标题出现了,但Fig X.X没有出现。

答案1

\usepackage[T1]{fontenc}imsa 主题尝试在旨在使用 unicode 引擎(如 xelatex 或 lualatex)编译的文档中使用(由于使用了该fontspec包)。这不是一个好主意。正如之前所说,您应该联系作者来修复此问题。

同时,你可以用以下代码替换主题:

% !TeX TS-program = lualatex
\documentclass{beamer}
%\usetheme{imsa}

\usepackage[default]{sourcesanspro}
\newfontfamily\DinFF{DINBold.ttf}
%\usepackage[T1]{fontenc}
\RequirePackage{exscale}
\RequirePackage{ragged2e}
\RequirePackage{changepage}
\RequirePackage{fontspec}
%\usepackage{fontspec}


% ====================
% Fonts
% ====================

\setbeamerfont{headline}{family=\DinFF}
\setbeamerfont{headline title}{size=\Huge,family=\DinFF}
\setbeamerfont{frametitle}{size=\Large,family=\DinFF}
\setbeamerfont{headline author}{size=\Large,family=\DinFF}
\setbeamerfont{headline institute}{size=\normalsize,family=\DinFF}
\setbeamerfont{block title}{family=\DinFF,size=\large,series=\bfseries}
\setbeamerfont{block body}{family=\DinFF}
\setbeamerfont{heading}{family=\DinFF}
\setbeamerfont{caption}{size=\small}

\begin{document}
\begin{frame}
text \textbf{text} \textit{text}
\end{frame}
\end{document}

在此处输入图片描述

相关内容