我只想让标题中的几个单词变成斜体,而不是整个标题。我在这里看到过其他关于将部分图形/表格标题设为斜体的问题,但我看到的所有解决方案都只是使用命令\textit{}
。我当然试过这个,但它对我来说不起作用。\emph{}
也不起作用。但是我可以用 获得粗体文本\textbf{}
,所以这对我来说很奇怪。
这是我使用的代码:
\begin{figure}
\centering
\includegraphics[width=0.6\textwidth]{Figures/myfigure.png}
\caption[Caption for in TOC.]{Caption for in TOC. This would be my longer caption that appears
in my actual document. I would like some words to be \textit{italic, such as this part.} However,
it just comes out as \emph{normal text}. Obviously, \textbf{bold text works just fine}.}
\label{fig:myfigure}
\end{figure}
这是我得到的输出:
附加信息:
我正在使用这个字幕包:\usepackage[labelfont=bf,justification=centerlast]{caption}
我也在使用该tudelft-report.cls
课程。我觉得我需要在这里做些更改,但由于我远非 LaTeX 专家,我不知道如何修复此问题。该课程可在此处获取:https://github.com/praseodym/tudelft-report-latex/blob/master/tudelft-report.cls。
我正在使用 pdfLaTeX 编译器。
提前谢谢了! :)
编辑:我尽力制作了 MWE。显然,为了清晰起见,我删除了一些序言,但我保留了所有可能与标题有关的内容(我认为)。
\RequirePackage{silence}
\WarningFilter{pdfcolmk}{Nothing to fix}
\documentclass[table]{tudelft-report}
\usepackage{notoccite}
\usepackage{changes}
%%%%%
\usepackage[utf8]{inputenc} % for accent letters
\usepackage[T1]{fontenc} % also for accent letters
\usepackage[labelfont=bf,justification=centerlast]{caption} % editing caption layout
\usepackage{wrapfig} % for wrapping text around figures
\usepackage{graphicx} % something with figures
\begin{document}
\begin{figure}
\centering
\includegraphics[width=0.6\textwidth]{Figures/myfigure.png}
\caption[Caption for in TOC.]{Caption for in TOC. This would be my longer caption that appears
in my actual document. I would like some words to be \textit{italic, such as this part.} However,
it just comes out as \emph{normal text}. Obviously, \textbf{bold text works just fine}.}
\label{fig:myfigure}
\end{figure}
\end{document}