我想知道是否有任何方法可以防止 Overleaf 忽略在桌面上编译时出现的错误。
例如,以下模板代码在 Overleaf 上完美运行,但在 TeXMaker(我使用的是 MikTeX)中,存在与declaretheorem
代码行相关的错误。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
% Useful packages
\usepackage{amsmath,amsthm,mathtools}
\usepackage{thmtools}
%Entornos matemáticos en español
\declaretheoremstyle[
spaceabove=0pt, spacebelow=0pt,
headfont=\normalfont\bfseries,
notefont=\bfseries, notebraces={(}{)},
bodyfont=\normalfont\itshape,
postheadspace=1em,
qed={},
numberwithin=section,
]{Theorem}
\declaretheorem[style=Theorem, name=Theorem]{theorem}
\declaretheorem[style=Theorem, name=Lemma, numberlike=theorem]{lemma}
\declaretheorem[style=Theorem, name=Corollary, numberlike=theorem]{corollary}
\declaretheorem[style=Theorem, name=Proposition, numberlike=theorem]{proposition}
\usepackage{graphicx}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\title{Your Paper}
\author{You}
\begin{document}
\maketitle
\begin{abstract}
Your abstract.
\end{abstract}
\section{Introduction}
Your introduction goes here! Simply start writing your document and use the Recompile button to view the updated PDF preview. Examples of commonly used commands and features are listed below, to help you get started.
Once you're familiar with the editor, you can find various project settings in the Overleaf menu, accessed via the button in the very top left of the editor. To view tutorials, user guides, and further documentation, please visit our \href{https://www.overleaf.com/learn}{help library}, or head to our plans page to \href{https://www.overleaf.com/user/subscription/plans}{choose your plan}.
\section{Some examples to get started}
\begin{theorem}\label{th:example}
No three positive integers $a, b$, and c satisfy the equation $a^n + b^n = c^n$ for any integer value of $n$ greater than 2.
\end{theorem}
\begin{proposition}
Hi! I'm a proposition.
\end{proposition}
As explained in theorem \ref{th:example}...
\end{document}
我希望 Overleaf 也能正确显示这些错误,而不是强制编译,因为
- 有时我需要在线编写文档,然后在没有网络的情况下在桌面上编写,
- 向期刊提交文章时,代码必须能够在桌面上良好运行。
我非常感激您的任何想法。