Quantcast
Channel: Custom proof environment: spacing issue with when optional argument given - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

Custom proof environment: spacing issue with when optional argument given

$
0
0

Consider the following code, the purpose of which is to have a proof environment in which the "Proof." bit is bold.

\documentclass{article}\usepackage{amsthm} \renewenvironment{proof}[1][Proof]{\noindent{\bfseries #1.\ }}{\qed\\[2mm]}\begin{document}\begin{proof}    $A = X$.\end{proof}\begin{proof}[Proof]    $A = X$.\end{proof}\begin{proof}[Proof]%    $A = X$.\end{proof}\end{document}

This produces the following spacing inconsistency:enter image description hereIn particular, when the optional argument is provided, even when given exactly the same value as the default (Proof), an extra space appears after the period. Adding % after the argument bracket close fixes this, but why does this happen? And how to write the environment in such a way that this % is not necessary?


Viewing all articles
Browse latest Browse all 3

Trending Articles