无法在小节标题上显示 \textsuperscript 和商标符号

无法在小节标题上显示 \textsuperscript 和商标符号

这就是我所拥有的:, 来源:如何在普通文本模式下排版下标?

\subsection{Code from Moral Kombat\texorpdfstring{\textsuperscript{\texttrademark}{Code from Moral Kombat\texttrademark}}}

软件包:

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\pagenumbering{Roman}
\setcounter{page}{1}

\usepackage{verbatim}
\usepackage{minted}
\usemintedstyle{xcode}
\usepackage{xspace}
\usepackage{scrhack}
\usepackage{mathptmx}
\usepackage{caption}
\usepackage{blindtext}
\usepackage{pifont,mdframed}
\usepackage{enumitem}
\usepackage{amssymb}
\usepackage{amsmath} % For using \text in equations
\usepackage{fixltx2e}
\usepackage{hyperref} % Hyperlinks
\usepackage[nameinlink,noabbrev,capitalise]{cleveref} % Better in-doc refs
\usepackage[numbered]{bookmark}
\usepackage{endnotes}
\input{hyperendnotes.sty}
\usepackage{etoolbox}
\usepackage[title,toc,titletoc,page]{appendix}
\usepackage{multirow}
\usepackage[margin=2cm]{geometry}
\usepackage{graphicx}
\usepackage{float} % Better figure and table placements
\usepackage{tabularx}
\usepackage{csquotes} % For blockquote
\usepackage[labelfont=it, labelsep=period]{caption}
\usepackage{subcaption}
\usepackage{color}
\usepackage{xcolor,colortbl}
\usepackage[final]{pdfpages} % used to include pdf to appendicies
\usepackage{lipsum}
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage{lettrine}
\usepackage{longtable}
% \usepackage{ragged2e}
\usepackage[export]{adjustbox}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{tabularray}
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage{xpatch}

结果:

在此处输入图片描述


编辑:这有效:

\subsection{Code from Moral Kombat\textsuperscript{\texttrademark}}

但是,这会导致以下警告。

Package hyperref Warning: Token not allowed in a PDF string (Unicode): removing `\mathsurround' on input line 9.

Package hyperref Warning: Token not allowed in a PDF string (Unicode): removing `\z@' on input line 9.

Package hyperref Warning: Token not allowed in a PDF string (Unicode): removing `superscript' on input line 9.

在此处输入图片描述

答案1

这是解决方案:

\subsection{Code from Mortal Kombat\texorpdfstring{\textsuperscript{\texttrademark}}{ (TM)}}

相关内容