Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I was trying to replace . with : in the proof environment and after trying a lot of answered questions here, I got [I'm using amsmath]

\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
  \pushQED{\qed}
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[\hskip\labelsep
        \itshape
    #1\@addpunct{:}]\ignorespaces}
    {\popQED\endtrivlist\@endpefalse}
\makeatother

but this isn't working very well for me. After dozens of tries, I came up with

\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[\hskip\labelsep
        \itshape
    #1\@addpunct{:}]\ignorespaces}
    {\endtrivlist\@endpefalse}
\makeatother

So, what is the problem with \pushQED{\qed} and \popQED? Without both of them, the code works, but I can't get the qed square.

share|improve this question
1  
What's "not working well" in the first case? –  egreg Jan 29 '13 at 7:37
    
And welcome to TeX.sx! –  egreg Jan 29 '13 at 8:06
    
An easier way to get a colon is to say \renewcommand{\proofname}{Proof:}. Something more complex is needed if you use babel, but the idea is the same. –  egreg Jan 29 '13 at 9:23
    
@egreg Not working well is one of this message per proof "! Undefined control sequence. \\proof [#1]->\par \pushQED {\qed } \normalfont \topsep 6\p@ \@plus 6\p@ \re... l.167 T" Thank you for the good reception! And yes, I think I'm going to need the "something more complex", because I'm using [brazil]{babel}. Also, I commented the babel and tried the solution you gave and I got "Proof:.". –  Alexandre Campos Jan 29 '13 at 11:48
add comment

1 Answer 1

This seems to work without any problem; note that you must load amsthm.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}

\usepackage{amsthm} % for the proof environment

\addto\captionsbrazil{\renewcommand{\proofname}{Demonstra\c{c}\~ao:}}

\begin{document}

\begin{proof}
Exercise for the reader.
\end{proof}

\end{document}

enter image description here

Alternative and perhaps better version:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}

\usepackage{amsthm} % for the proof environment

\makeatletter
\renewenvironment{proof}[1][\proofname]
  {\par\pushQED{\qed}%
   \normalfont \topsep6\p@\@plus6\p@\relax
   \trivlist
   \item[\hskip\labelsep
         \itshape
         #1\@addpunct{:}]\ignorespaces}
  {\popQED\endtrivlist\@endpefalse}
\makeatother

\begin{document}

\begin{proof}
Exercise for the reader.
\end{proof}

\end{document}

Another different version with patching (but it's just the same as the one before).

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}

\usepackage{amsthm} % for the proof environment

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\proof}{\@addpunct{.}}{\@addpunct{:}}{}{}
\makeatother

\begin{document}

\begin{proof}
Exercise for the reader.
\end{proof}

\end{document}
share|improve this answer
    
Man, thank you. Your post helped me in another direction. I tried to use amsmath and discovered it was conflicting with \usepackage[amsmath,amsthm,thmmarks]{ntheorem} \theoremstyle{change} that I was using to put the number before the newtheorem name. Then, I used the amsthm and \numberswap and I got it solved. Thank you a lot! –  Alexandre Campos Jan 29 '13 at 13:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.