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 ?

2
  • 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. Aug 1, 2018 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 2, 2018 at 2:55

1 Answer 1

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

2
  • Thank you very much Henri. Is it possible to have Theorem 1.1 instead of Theorem 1.1. ?
    – Fabrice
    Aug 1, 2018 at 23:21
  • @Fabrice Of course, just remove the numberstopper={.} (I thought you put it there, which is why I left it there). Aug 2, 2018 at 0:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .