GeneralQED square in all environments

LaTeX specific issues not fitting into one of the other forums of this category.
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Re: QED square in all environments

Post by latexforever »

Thanks! I'm going to read it. It's just a matter of time.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

QED square in all environments

Post by latexforever »

I've looked at the package, and, even if I have tested 10 or 11 different configurations, it still does not work.

In the order of my document's code, I have, among other declarations:

Code: Select all

\documentclass[10pt,a4paper,twoside,final,openright]{book}%report

%% -- USED PACKAGES --

\usepackage[latin1]{inputenc}
%\usepackage{everyshi}
%\usepackage{onglet}
\usepackage[frenchb,english]{babel}
\usepackage{amsmath}
\usepackage[amsmath,thmmarks,amsthm,hyperref]{ntheorem}
\usepackage{amsthm}
\begin{document}

%% Declaration of theorems %%

\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}
\theoremsymbol{\qed}
\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}{}

\theoremstyle{exemple}
\theoremsymbol{\qed}
\newtheorem{exemple}{\textcolor{brown}{Exemple}}[section]


\newtheoremstyle{defi}%name

{10pt} % space above
{10pt} % space below
{\rmfamily} % body 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}
\theoremsymbol{\qed}
\newtheorem{definition}{\textcolor{blue}{Définition}}[section]

%% Declaration of theorems %%
%% BEGINNING OF DOCUMENT %%

\begin{document}
\begin{property}Here is a test.\end{property}
\end{document}
Compilation shows me ``Command \theoremstyle already defined''.
Why? Thanks.
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

QED square in all environments

Post by phi »

please read the manual of all packages you use! The ntheorem manuel says explicitly,
amsthm.sty conflicts with the definition of theorem layouts in theorem.sty, some features of amsthm.sty have been incorporated into option [amsthm] which has to be used instead of \usepackage{amsthm}.
You cannot use both packages at the same time. There are other severe errors in your document (e.g. double \begin{document}, missing color package, paragraph end between parameters). Here is a fixed version that at least compiles:

Code: Select all

\documentclass[10pt,a4paper,twoside,final,openright]{book}%report

%% -- USED PACKAGES --

\usepackage{xcolor}
\usepackage[latin1]{inputenc}
%\usepackage{everyshi}
%\usepackage{onglet}
\usepackage[frenchb,english]{babel}
\usepackage{amsmath}
%\usepackage[amsmath,thmmarks,amsthm,hyperref]{ntheorem}
\usepackage{amsthm}
%\begin{document}

%% Declaration of theorems %%

\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}
%\theoremsymbol{\qed}
\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}{}

\theoremstyle{exemple}
%\theoremsymbol{\qed}
\newtheorem{exemple}{\textcolor{brown}{Exemple}}[section]


\newtheoremstyle{defi}%name
{10pt} % space above
{10pt} % space below
{\rmfamily} % body 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}
%\theoremsymbol{\qed}
\newtheorem{definition}{\textcolor{blue}{Définition}}[section]

%% Declaration of theorems %%
%% BEGINNING OF DOCUMENT %%

\begin{document}
\begin{property}Here is a test.\end{property}
\end{document}
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Re: QED square in all environments

Post by latexforever »

Thanks for correcting my mistakes. Is there anyway a solution for the QED square? Thanks.
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

QED square in all environments

Post by phi »

It should be possible with ntheorem instead of amsthm, as Thorsten already pointed out, but then you have to follow the syntax of ntheorem, not the syntax of amsthm.
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Re: QED square in all environments

Post by latexforever »

Thanks.
Post Reply