4

I used LaTeX for a long time before converting (with difficulty !) to ConteXt. For example, to define my new theorems, I used the amsthm package and I did this :

New Theorem Style

\newtheoremstyle{theoremdd}% name of the style to be used
   {\topsep}% measure of space to leave above the theorem. E.g.: 3pt
   {\topsep}% measure of space to leave below the theorem. E.g.: 3pt
   {\itshape}% name of font to use in the body of the theorem
   {0pt}% measure of space to indent
   {\bfseries}% name of head font
   {. ---}% punctuation between head and body
   { }% space after theorem head; " " = normal interword space
   {\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}}

\theoremstyle{theoremdd}
\newtheorem{thmd}{Theorem}[section]

enter image description here

Here is what I propose with ConteXt:

\setupenumerations[
   before={\blank},
   after={\blank},
   text=Théorème,
   alternative=serried,
   title=no,
   prefix=yes,
   prefixsegments=chapter,
   way=bysection,
   numberstopper={. ---},
   titlestyle=bold,
   style=italic,
   width=broad]


\defineenumeration[theorem]

Is this the right method ?

Henri Menke
  • 109,596
Fabrice
  • 3,636
  • 1
  • 21
  • 29
  • 2
    What is the expected output for your enumeration? When you show a image with the result from LaTeX it is easier to give you an answer for the ConTeXt setup. – Wolfgang Schuster Aug 01 '18 at 18:44
  • I'd also set title=yes, so that you can use \starttheorem[title=Pythagoras Theorem], which is similar to \begin{theorem}[Pythagoras Theorem] in LaTeX. – Aditya Aug 02 '18 at 02:55

1 Answers1

3

You don't want to have the --- in the numberstopper because then it will appear in the cross-references to that theorem as well. Instead you want to use headcommand to add the dash between the title and the contents. Additionally we want to set distance=none because I added the spacing in headcommand already. Since you set prefixsegments=chapter, I guess you also intended to use way=bychapter (instead of bysection).

\setupenumerations
  [before={\blank},
   after={\blank},
   text=Théorème,
   alternative=serried,
   title=no,
   headcommand=\groupedcommand{}{~---~},
   distance=none,
   prefix=yes,
   prefixsegments=chapter,
   way=bychapter,
   numberstopper={.},
   titlestyle=bold,
   style=italic,
   width=broad]

\defineenumeration[theorem]

\starttext

\startchapter[title={First}]

  \starttheorem[reference={thm:knuth}]
    \input knuth
  \stoptheorem

  \starttheorem
    See \in{Theorem}[thm:knuth]
    \input ward
  \stoptheorem

\stopchapter

\startchapter[title={Second}]

  \starttheorem
    \input zapf
  \stoptheorem

  \starttheorem
    \input tufte
  \stoptheorem

\stopchapter

\stoptext

enter image description here

Henri Menke
  • 109,596