General ⇒ QED square in all environments
-
- Posts: 120
- Joined: Fri Nov 14, 2008 9:40 pm
QED square in all environments
Hello everybody,
I simply want to add a QED square (the same as the one used to show a proof is finished) in the end of all my environments.
For example, if I define the environment "sample", I want, when using , a QED square to be printed at the end of the sample environment.
What can I do? Thanks!
I simply want to add a QED square (the same as the one used to show a proof is finished) in the end of all my environments.
For example, if I define the environment "sample", I want, when using , a QED square to be printed at the end of the sample environment.
What can I do? Thanks!
NEW: TikZ book now 40% off at Amazon.com for a short time.
Re: QED square in all environments
Please do not do that 

-
- Posts: 120
- Joined: Fri Nov 14, 2008 9:40 pm
Re: QED square in all environments
Why? I only have two or three environments and I think it is nice. What can I do for a given environment? Thanks
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
QED square in all environments
You could incorporate a new command to all your own environments. A first approach could look like this.
All predefined environments have to be redefined.
Best regards
Thorsten¹
Code: Select all
Code, edit and compile here:
\documentclass[11pt,a4paper,english]{article}\usepackage[T1]{fontenc}\usepackage[latin1]{inputenc}\usepackage{babel}\usepackage{amsmath}\usepackage{amssymb}\usepackage{lmodern}\usepackage{blindtext}\parindent0em\newcommand*{\signed}[1]{%\unskip\hspace*{1em plus 1fill}%\nolinebreak[3]\hspace*{\fill}%\mbox{#1}}\begin{document}\blindtext\signed{$\square$}\end{document}
Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 120
- Joined: Fri Nov 14, 2008 9:40 pm
QED square in all environments
Ok, but if I define my environments using successively:
, how do I put the code your proposed into mine?
Code: Select all
Code, edit and compile here:
\newtheoremstyle{theorem}%name{10pt} % space above{10pt} % space below{\slshape} % bofy font{\parindent} % ident - empty=no indent, \parindent= paragraph indent{\bfseries} % thm head font{. } % punctuation after thm head{ } % space after thm head: `` ``=normal \newline=linebreak{} % thm head specification\theoremstyle{theorem}\newtheorem{theorem}{\textcolor{red}{Thèorème}}[section]\newtheorem{corollary}{\textcolor{orange}{Corollaire}}[section]\newtheorem{proposition}{Proposition}[section]\newtheorem{lemma}{\textcolor{green}{Lemme}}[section]\newtheorem{property}{\textcolor{magenta}{Propriété}}[section]\newtheoremstyle{exemple}{10pt}{10pt}{\itshape \footnotesize}{}{\itshape \footnotesize}{.}{\newline}{}%{\thmnumber{{\upshape\bfseries#2.}\ }\thmname{#1}\thmnote{ #3}}\theoremstyle{exemple}\newtheorem{exemple}{\textcolor{brown}{Exemple}}[section]\newtheoremstyle{defi}%name{10pt} % space above{10pt} % space below{\rmfamily} % bofy font{\parindent} % ident - empty=no indent, \parindent= paragraph indent{\bfseries} % thm head font{. } % punctuation after thm head{ } % space after thm head: `` ``=normal \newline=linebreak{} % thm head specification\theoremstyle{defi}\newtheorem{definition}{\textcolor{blue}{Définition}}[section]
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
QED square in all environments
You talked about environments, not about theorems. This is simply done with the amsthm package.
Code: Select all
Code, edit and compile here:
\documentclass[english]{scrartcl}\usepackage[T1]{fontenc}\usepackage[latin1]{inputenc}\usepackage{babel}\usepackage{amsthm}\usepackage{lmodern}\usepackage{xcolor}\usepackage{blindtext}\setlength{\parindent}{0em}\newtheoremstyle{theorem} % name{10pt} % space above{10pt} % space below{\slshape} % body font{\parindent} % indent - empty=no indent, \parindent= paragraph indent{\bfseries} % theorem head font{. } % punctuation after theorem head{ } % space after theorem head: " "=normal \newline=linebreak{} % theorem head specification\theoremstyle{theorem}\newtheorem{theorem}{\textcolor{red}{Thèorème}}[section]\newtheorem{corollary}{\textcolor{orange}{Corollaire}}[section]\newtheorem{proposition}{Proposition}[section]\newtheorem{lemma}{\textcolor{green}{Lemme}}[section]\newtheorem{property}{\textcolor{magenta}{Propriété}}[section]\begin{document}\begin{theorem}\blindtext\qed\end{theorem}\end{document}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 120
- Joined: Fri Nov 14, 2008 9:40 pm
Re: QED square in all environments
Sorry. And is there no way to make this process automatic?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
QED square in all environments
I think you should be grateful (like me) that it can be done so easy. And hitting four keys to get that shouldn't cause too much inconvenience. Otherwise take a look at the package code and redefine the critical parts.latexforever wrote:Sorry. And is there no way to make this process automatic?
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 120
- Joined: Fri Nov 14, 2008 9:40 pm
Re: QED square in all environments
Thanks. Yes, it is a very easy thing to do, but I thought it could be specified in the theorems' options.
Thanks for everything.
Thanks for everything.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
QED square in all environments
Finally I found a possible solution that may be better. Take a look at the ntheorem package. It lets you specify a kind of end-of-theorem symbol.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10