해결하고 싶은 문제가 조금 있습니다. 여기서 문제는 증명 환경의 다음 줄도 굵게 표시되기를 원한다는 것입니다. 즉, 다음 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}
정말로 독자들의 눈을 때리고 싶나요?