0

I have a bit of an issue that I want to resolve. The issue here is that I want the next line in the proof environment to also be bolded and so on, that is consider the following 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}

This is how it'll look like: enter image description here

But I want the big red bolded letters of "proof" to also affect the style of the next part that says "Proof of theorem 1.1", how can I achieve this?

1 Answer 1

2

You seem to want to redefine proof with a mandatory argument.

\NewCommandCopy{\oldproof}{\proof}
\NewCommandCopy{\endoldproof}{\endproof}

\renewenvironment{proof}[1]
 {\oldproof[\Large\bfseries\color{red}#1]}
 {\endoldproof}

If your LaTeX is older than 2020-10-01, you need to load the letltxmacro package and use

\LetLtxMacro{\oldproof}{\proof}
\LetLtxMacro{\endoldproof}{\endproof}

instead of the \NewCommandCopy command.

Here's an edited version of the relevant part of the document. I removed the title part that's not needed for the example.

Math formulas should be always be typed in as such. A single equation should not use gather.

There is no \Autoref, that I changed into \autoref. You didn't load xcolor and hyperref. You also passed options to babel without loading it. And if you say english among the options to \documentclass there's no point in passing again the same option.

\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}

enter image description here

Do you really want to punch your readers in their eye?

1
  • Hey um, I don't wanna remake the question but do you think it'd be possible for you to show me how to make it look more like this? i.imgur.com/zhlRLWj.png Note that I'd much prefer if I don't re-define the actual \proof environment for that, I want to keep that one as it is, but the way you showed me the solution forces me to always write \proof{stuff here} in a manner of speaking, I'd like to perhaps define proofname instead so that \proof always writes "Proof" while "proofname" I get to choose what to write in it. Hopefully this clarifies my request.
    – faycalki
    Nov 16, 2020 at 13:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .