数学模式下不打印撇号

数学模式下不打印撇号

我正在尝试使用大学要求的文档类来撰写我的论文,并在 overleaf 中工作(大学也建议这样做)。奇怪的是,数学模式中的撇号 (') 未打印在输出 pdf 中。请参见下图。

问题

这当然是个大问题。如果我在 Overleaf 中打开另一个简单的 tex 文件并使用数学模式,那么一切都会正常进行。

以下是我正在使用的软件包。前几个软件包(没有说明)来自我想要包含在论文中的论文。其余的是大学提供的模板的一部分。有人知道问题可能是什么吗?

\usepackage{amsmath,amssymb,amsthm, bm}
\usepackage{enumerate}
%\usepackage{marginfix}
\usepackage{cite}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage[normalem]{ulem}
\usepackage{tikz}

\usepackage[spanish, english]{babel}
%\usepackage[ansinew]{inputenc}
\usepackage{here}

% PurdueThesis.cls loads the rotating package which loads the graphicx
% package.  From
%     Packages in the `graphics' bundle
% at
%     http://ftp.math.purdue.edu/mirrors/ctan.org/macros/latex/required/graphics/grfguide.pdf
% on page 12
%     \graphicspath{<dir-list>}
%         This optional declaration may be used to specify a list of
%         directories in which tosearch for graphics files.  The
%         format is the same as for the LATEX 2e primitive\input@path.
%         A list of directories, each in a{}group (even if there is
%         only one in the list).  For
%         example:\graphicspath{{eps/}{tiff/}}would cause the system
%         to look in the subdirectories eps and tiff of the
%         currentdirectory.  (All modern TeX systems use / as the
%         directory separator, even on Windows.)   The default setting of
%         this path is \input@path that is: graphics files will be found
%         whereever TeX files are found.
%
% Look in the "graphics" subfolder for graphics files.
% This is done to reduce the number of files in the main thesis folder
% so the ones in there are easier to find.
\graphicspath{{graphics/}}

% Look in the "packages" subfolder for packages.
% This is done to reduce the number of files in the main thesis folder
% so the ones in there are easier to find.
\makeatletter
  \def\input@path{{packages/}}
\makeatother

%
% Configure bibliography.
%
% Automatically configure the bibliography.  Based on the
% institution, campus, and program listed in the \documentclass
% command \bibprocessor is set to "biblatex" or "bibtex".
% For biblatex, a
%    \usepackage[...]{biblatex}
% is done.  Put your bibliography entries in all-biblatex.bib.
% For bibtex, a
%     \bibliographystyle{...}
% command is done.  Put your bibliography entries in all-bibtex.bib.
%
% All combinations of institution, campus, and program use biblatex.
% Exceptions that use bibtex:
%     o  "Purdue University", "West Lafayette", "Earth, Atmospheric,
%        and Planetary Sciences" uses the ametsoc2014 bibliography style.
%     o  "Purdue University", "West Lafayette", "Veterinary Clinical
%        Sciences" uses the ama bibliography style.
%
% To override the default choices picked by \ConfigureBibliography, change,
% for example,
%     \ConfigureBibliography
% to
%     % \ConfigureBibliography
%     \newcommand{\bibprocessor}{biblatex}
%     \usepackage[backend=biber, citestyle=apa, dashed=false, sortcites=true, style=apa]{biblatex}
%     \addbibresource{all-biblatex.bib}
\ConfigureBibliography

%
% This is only relevant if you are using biblatex.
%
% This is an example of how to ignore urldate fields in your .bib file.
% See the first complete example on page 201 of
%     https://mirrors.rit.edu/CTAN/macros/latex/contrib/biblatex/doc/biblatex.pdf
%
% If you don't want to ignore urldate fields,
% comment out (put "%" before) the next ten lines.
%
\ifthen{\equal{biblatex}{\bibprocessor}}
{
  \DeclareSourcemap{
    \maps[datatype=bibtex]{
      \map{
        \step[fieldset=urldate, null]
      }
    }
  }
}

% For chemical figures, \chemfig.
%\usepackage{chemfig}

% For \VerbatimInput.
\usepackage{fancyvrb}
  % https://andreas.scherbaum.la/blog/archives/670-Read-number-lines-in-a-file-in-LaTeX.html
  % Indent verbatim by 23.5pt so line numbers are within margin.
  \makeatletter
    \@totalleftmargin=23.5pt
  \makeatother
  

% pages 11--12.  
\usepackage{cancel}
  
% This gets rid of
%     [5] (./thesis.toc
%     ! Undefined control sequence.
%     \vbox_set:Nn ...box:D {\color_group_begin: #2\par 
%                                                       \color_group_end: }
%     l.32 ...}Basic Circuit Components}{31}{section.67}
%                                                       %
%     ? 
% and
%     [6]
%     ! Undefined control sequence.
%     \vbox_set:Nn ...box:D {\color_group_begin: #2\par 
%                                                       \color_group_end: }
%     l.61 ...rline {P.1}Frenchspacing}{67}{section.445}
%                                                       %
%     ?
% errors.
% See
%     https://github.com/latex3/latex2e/issues/73
\usepackage{etoc}


% For indexing.  Making an index is optional.
% Make these commands available:
%     COMMAND           DESCRIPTION
%     \index{string}    put "string" in index information
%     \makeindex        save information to make the index
%     \printindex       print the index
% See
%     https://ctan.org/pkg/makeidx?lang=en
% for more information.
\usepackage{makeidx}
  % By default \index ignores its argument.
  % This activates indexing.
  \makeindex
  % The "chapter name" for the index.
  \renewcommand{\indexname}{INDEX}

% For TeX, LaTeX, METAFONT, METAPOST, etc. related logos.
% This includes all the logos in the dtk-logos package, see
%     http://mirrors.ctan.org/macros/latex/contrib/hologo/hologo.pdf
% plus some extra definitions I made in pa-logos.sty.
\usepackage{pa-logos}

% For typographical conventions stuff including
%     \Emph{...}
%     \First{...}
%     \Keys{...}
%     \Literal{...}
%     \Menu{...}
%     \Place{...}
%     \Shell{...}
\usepackage{pa-typographic-conventions}

% For FloatBarrier.
% Put \FloatBarrier to process all unproccesed floats (tables and figures).
\usepackage{placeins}

% The mathtools package
% (see http://mirror.utexas.edu/ctan/macros/latex/required/amsmath/amsmath.pdf)
% loads the amsmath package which defines the
%     align
%     align*
%     alignat
%     alignat*
%     equation
%     equation*
%     flalign
%     flalign*
%     gather
%     gather*
%     multitaper
%     multitaper*
%     split
% environments and extends amsmath by defining many other commands.
% See
%     https://ctan.org/pkg/amsmath
% for information about amsmath and
%     http://ctan.math.washington.edu/tex-archive/macros/latex/contrib/mathtools/mathtools.pdf
% for information about mathtools.
\usepackage{mathtools}

% Follow ISO 80000-2:2019
%     o   put e, i, and pi in upright font automatically
%     o   use, for example, "\di x" to get "\,mathrm{d}\/x"
% This loads
%     o   amsmath.sty (which is already loaded above)
%     o   mathtools.sty
%     o   upgreek.sty
% Load the package.
\usepackage{pa-mismath}
  % Tell mismath that e, i, j, and pi in upright font automatically.
  \enumber
  \inumber
  \jnumber
  \pinumber
  % To typeset math italic e, i, j, and pi use
  %     \mathit e
  %     \mathit i
  %     \mathit j
  %     \itpi

% Define \includemedia.
\usepackage{media9}

% Define ``multicols'' environment environment used in demo-multicols.tex.
% CHANGE NEXT LINE?
\usepackage{multicol}

% For \ditto command.
\usepackage{pa-ditto}

% For \DigitDash---a dash the width of a digit in the current font.
\usepackage{pa-figure-dash}

% For \MyRepeat---????.
\usepackage{pa-repeat}

% For \textcent.
\usepackage{textcomp}
  

% Needed for chapter "Graphics", section "TikZ and PGF".
\usepackage{tikz}

% Needed for the Feynman diagram in ap-physics.tex.
% Tikz-feynman requires lualatex instead of pdflatex be run.
\usepackage[compat=1.1.0]{tikz-feynman}

% For \verbatiminput.
\usepackage{verbatim}

答案1

$ f^{\prime}(x) $作为后备方案,你可以使用$ f'(x) $。但是,带重音符号的符号应该可以工作,下面介绍如何修复该问题。

就像评论中讨论的那样,如果不知道你那边发生了什么,就很难真正提供帮助。但我最好的猜测是,撇号 ( ') 被修改了某个地方,让引号工作得“更好”,但没有考虑到它在数学模式下的使用。

尝试在您的上方添加以下代码\begin{document}

\let\oldapo='
\makeatletter
\catcode`\'=\active
\def'{\ifmmode ^\bgroup\expandafter\prim@s\else\expandafter\oldapo\fi}
\makeatother

数学中是否仍缺少素数?如果是,请尝试将此代码移至 之后\begin{document}


如果不起作用

删除上面提供的代码并将以下内容添加到您的文档中:

\PackageWarning{DEBUG}{Meaning of accent1: (\meaning')}
(Meaning of accent1: (\meaning'))

\catcode`\'=\active
\PackageWarning{DEBUG}{Meaning of accent2: (\meaning')}
(Meaning of accent2: (\meaning'))

\catcode`\'=12
\PackageWarning{DEBUG}{Meaning of accent3: (\meaning')}
(Meaning of accent3: (\meaning'))

这应该会在您的代码中输出一些警告。在我的答案的评论中分享它们,或更新您的原始问题以包含它们。这些信息可以帮助我们了解您那边发生了什么。

如果您找不到警告,这些行也应该作为普通文本打印在您的文档中。复制它,或对其进行截图。


一定要说清楚它是否对你有用!:)

相关内容