frabjous wrote:I wonder if enumerations would be better than theorems, etc.
What I'm writing in this list aren't theorems. It's a list of physical principles : #1 principle of homogeneity of space, #2 principle of homogeneity of time, #3 principle of isotropy of space, #4 principle of causality, etc, each one with some description and comments.
So what should be the best way to build this "list" ?
"Theorem" is just a generic name in this case. "Principle" or "Definition" works just as well. Yeah, I'd definitely go that route. See the amsthm or ntheorem documentation.
frabjous wrote:See the amsthm or ntheorem documentation.
Really, I don't understand this documentation. It's extremely dense and confusing, and I'm unable to find any clear and explicit examples for what I want to do.
\documentclass{article}
\usepackage{ntheorem}
\newtheorem{principle}{Principle}
\newtheorem{subprinciple}{Subprinciple}[principle]
% the [...] at the end tells it to number
% within the principle counter
\renewcommand{\thesubprinciple}{\arabic{principle}\alph{subprinciple}}
\begin{document}
Here is a well known axiom:
\begin{principle}[Hofstadter's Law]
Things always take longer than you expect, even when you take into account Hofstadter's law.\label{hof}
\end{principle}
Here is another.
\begin{principle}[Murphy's Law]
Whatever can go wrong, will go wrong.\label{murphy}
\end{principle}
This one has certain corollaries:
\begin{subprinciple}[The Gravitational Law of Toast]
The chance of the buttered side of the bread falling face down is directly proportional to the cost of the carpet.\label{toast}
\end{subprinciple}
\begin{subprinciple}[The Timing Principle]
If there is a worse time for something to go wrong, it will happen then.
\end{subprinciple}
One might also argue that principle \ref{hof} is, like \ref{toast}, a corollary of principle \ref{murphy}.
\end{document}
\documentclass{article}
\usepackage{ntheorem}
\newtheorem{principle}{Principle}
\newtheorem{subprinciple}{Subprinciple}[principle]
% the [...] at the end tells it to number
% within the principle counter
\renewcommand{\thesubprinciple}{\arabic{principle}\alph{subprinciple}}
\begin{document}
Here is a well known axiom:
\begin{principle}[Hofstadter's Law]
Things always take longer than you expect, even when you take into account Hofstadter's law.\label{hof}
\end{principle}
Here is another.
\begin{principle}[Murphy's Law]
Whatever can go wrong, will go wrong.\label{murphy}
\end{principle}
This one has certain corollaries:
\begin{subprinciple}[The Gravitational Law of Toast]
The chance of the buttered side of the bread falling face down is directly proportional to the cost of the carpet.\label{toast}
\end{subprinciple}
\begin{subprinciple}[The Timing Principle]
If there is a worse time for something to go wrong, it will happen then.
\end{subprinciple}
One might also argue that principle \ref{hof} is, like \ref{toast}, a corollary of principle \ref{murphy}.
\end{document}
Okay, how do you remove the emphasis on the text ?
How do you remove the parenthesis around the principle title, and use a ":" at the end instead ?
And how do you add a dot "." after each number, without having it in the references ?
Also, how do you add space at left and at right, so the principle is centered inside the main text ?
Hmm. I couldn't figure out how to indent on the right using ntheorem (to my surprise), but here's a solution with the environments more or less written from scratch:
\documentclass{article}
\newcounter{principle}
\newcounter{subprinciple}[principle]
\renewcommand{\thesubprinciple}{\theprinciple\alph{subprinciple}}
\newenvironment{principle}[1]
{\list{}{\leftmargin=0.5in\rightmargin=0.5in}\item[] \refstepcounter{principle}\textbf{Principle \theprinciple.\ #1:}}{\endlist}
\newenvironment{subprinciple}[1]
{\list{}{\leftmargin=0.5in\rightmargin=0.5in}\item[]\refstepcounter{subprinciple}\textbf{Subprinciple \thesubprinciple.\ #1:}}{\endlist}
\begin{document}
Here is a well known axiom:
\begin{principle}{Hofstadter's Law}
Things always take longer than you expect, even when you take into account Hofstadter's law.\label{hof}
\end{principle}
Here is another.
\begin{principle}{Murphy's Law}
Whatever can go wrong, will go wrong.\label{murphy}
\end{principle}
This one has certain corollaries:
\begin{subprinciple}{The Gravitational Law of Toast}
The chance of the buttered side of the bread falling face down is directly proportional to the cost of the carpet.\label{toast}
\end{subprinciple}
\begin{subprinciple}{The Timing Principle}
If there is a worse time for something to go wrong, it will happen then.
\end{subprinciple}
One might also argue that principle \ref{hof} is, like \ref{toast}, a corollary of principle \ref{murphy}.
\end{document}
(Notice that the names of the principles now go in braces rather than brackets.)
That appears to be a very good solution. I'll try to work with it.
However, the enumerate solution feel much simpler to me. I don't see the disadvantages of it yet.
EDIT : There are two small glitches with your last solution :
1. It would be better to put the subprinciple numerotation in "italics" (emphasize), but just the letter (not the number before it).
2. It doesn't make sense to have the subprinciple with the same numerotation as the principle above it. It should start with an higher numerotation, like this :