
У меня есть небольшая проблема, которую я хочу решить. Проблема здесь в том, что я хочу, чтобы следующая строка в среде проверки также была жирной и т. д., то есть рассмотрим следующий MWE:
\documentclass[10pt, welsh, english, a4paper]{report}
\PassOptionsToPackage{english}{babel}
\usepackage[margin=1in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}
\usepackage{microtype}
\usepackage{fancyhdr}
\usepackage{amsmath}
\usepackage{enumitem,url,fancyref}
\usepackage{amsthm}
\newtheorem*{theorem*}{Theorem}
\newtheorem{theorem}{Theorem}[section]
\newtheorem*{corollary*}{Corollary}
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem*{lemma*}{Lemma}
\newtheorem{lemma}[theorem]{Lemma}
\expandafter\let\expandafter\oldproof\csname\string\proof\endcsname
\let\oldendproof\endproof
\renewenvironment{proof}[1][\proofname]{%
\oldproof[\Large \color{red}{\textbf{Proof}}]%
}{\oldendproof}
%Removing the punctuation from Proof environment and, note environment is the correct spelling of that word.
\usepackage{etoolbox} % etoolbox defines the command 'AtBeginEnvironment'
\makeatletter
\AtBeginEnvironment{proof}{\let\@addpunct\@gobble}
\makeatother
\title{LaTeX document for testing and faster compilations prior to organizing into other documents}
\author{Faycal Kilali\thanks{"It is not knowledge, but the act of learning, not possession but the act of getting there, which grants the greatest enjoyment." - Carl Friedrich Gauss}}
\date{\today}
\begin{document}
\begin{titlepage}
\maketitle
\end{titlepage}
\section{Placeholder section}
\begin{theorem}\label{thm:9.2}
If a connected plane graph has v vertices, e edges and f faces, then \begin{gather}
v - e + f = 1 \label{thm:9.2:1}
\end{gather}
\end{theorem}
\begin{proof}{Proof of \Autoref{thm:9.2}}
Here is the statement p(n) we are going to try to prove by induction: \\ p(n): every connected plane graph with n edges satisfies the formula \(v - n + f = 1\).
Notice that p(n) is a statement about lots of plane graphs. p(1) says that every connected plane graph with 1 edge satisfies the formula; there is only one such graph:
\end{proof}
Но я хочу, чтобы большие красные жирные буквы «доказательство» также повлияли на стиль следующей части, которая гласит «Доказательство теоремы 1.1». Как мне этого добиться?
решение1
Похоже, вы хотите переопределить это proof
с помощью обязательного аргумента.
\NewCommandCopy{\oldproof}{\proof}
\NewCommandCopy{\endoldproof}{\endproof}
\renewenvironment{proof}[1]
{\oldproof[\Large\bfseries\color{red}#1]}
{\endoldproof}
Если ваш LaTeX старше 2020-10-01, вам необходимо загрузить пакет letltxmacro
и использовать
\LetLtxMacro{\oldproof}{\proof}
\LetLtxMacro{\endoldproof}{\endproof}
вместо \NewCommandCopy
команды.
Вот отредактированная версия соответствующей части документа. Я удалил часть заголовка, которая не нужна для примера.
Математические формулы должны бытьвсегдабыть введено как таковое. Одно уравнение не должно использовать gather
.
Нет \Autoref
, что я изменил на \autoref
. Вы не загрузили xcolor
и hyperref
. Вы также передали опции в , babel
не загрузив его. И если вы говорите english
среди опций в \documentclass
нет смысла передавать снова ту же опцию.
\documentclass[10pt, welsh, english, a4paper]{report}
\usepackage{babel}
\usepackage[margin=1in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}
\usepackage{microtype}
\usepackage{fancyhdr}
\usepackage{amsmath}
\usepackage{enumitem,url,fancyref}
\usepackage{amsthm}
\usepackage{xcolor}
\usepackage{etoolbox} % etoolbox defines the command 'AtBeginEnvironment'
\usepackage{hyperref}
\newtheorem*{theorem*}{Theorem}
\newtheorem{theorem}{Theorem}[section]
\newtheorem*{corollary*}{Corollary}
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem*{lemma*}{Lemma}
\newtheorem{lemma}[theorem]{Lemma}
\NewCommandCopy{\oldproof}{\proof}
\NewCommandCopy{\oldendproof}{\endproof}
\renewenvironment{proof}[1]
{\oldproof[\Large\bfseries\color{red}#1]}
{\oldendproof}
%Removing the punctuation from proof environment
\makeatletter
\AtBeginEnvironment{proof}{\let\@addpunct\@gobble}
\makeatother
\begin{document}
\section{Placeholder section}
\begin{theorem}\label{thm:9.2}
If a connected plane graph has $v$ vertices, $e$ edges and $f$ faces, then
\begin{equation}
v - e + f = 1 \label{thm:9.2:1}
\end{equation}
\end{theorem}
\begin{proof}{Proof of \autoref{thm:9.2}}
Here is the statement \(p(n)\) we are going to try to prove by induction:
\begin{quote}
\(p(n)\): every connected plane graph with $n$ edges satisfies the formula \(v - n + f = 1\).
\end{quote}
Notice that \(p(n)\) is a statement about lots of plane graphs.
\(p(1)\) says that every connected plane graph with one edge satisfies the formula;
there is only one such graph:
\end{proof}
\end{document}
Вы действительно хотите ударить своих читателей в глаз?