Hi folks, I've recently started to consider ConTeXt as an alternative to my long-time friend LaTeX. I like ConTeXt very much but noticed a few things that are either less than ideal or maybe I simply haven't figured out yet how to do them right. Here are the first two: 1) Enumerations I've read in a few places that this is what is to be used whenever I would use theorem-style environments in latex. There are two things I seem to be unable to do: Creating Theorems that look like this. --------------------- THEOREM 1 It would be nice if Context could produce a theorem where the title is not separated from the text and the next line has no hanging indent. --------------------- I was able to produce only ---------------------- THEOREM 1 It would be nice ... ---------------------- or ---------------------- THEOREM 1 It would be nice ... ---------------------- using location=top or location=hanging. What I want is no hanging indent at all. (I also tried location=serried, which produced an overly large gap between THEOREM 1 and the theorem text. The second thing I am used to in latex is the option to place things in parentheses by providing an optional argument to the environment. E.g., in assignments I typeset, I often have either \begin{question} ... \end{question} which simply produces -------------------- Question 1 ... -------------------- or \begin{question}[20 marks] ... \end{question} which produces -------------------- Question 1 (20 marks) ... -------------------- This second option is easy to simulate if I can produce something that has no hanging indents. As it is, I can't. 2) Numbered labels I tried to use numbered labels plus a little bit of tex-code to simulate the above environment. The gist is that I used \definelabel[question][location=intext,text=Question] to define the label and, wherever I needed a new question, \question [ref]. The result of writing \question[ref], however, was "Question Question 1". The label always seemed to be duplicated for some reason. Is this a known bug? Thanks for your help with this. Cheers, Norbert -- NORBERT ZEH Faculty of Computer Science : Dalhousie University nzeh@cs.dal.ca : http://www.cs.dal.ca/~nzeh : 902.494.3154
2007/7/10, Norbert Zeh
Hi folks,
I've recently started to consider ConTeXt as an alternative to my long-time friend LaTeX. I like ConTeXt very much but noticed a few things that are either less than ideal or maybe I simply haven't figured out yet how to do them right. Here are the first two:
1) Enumerations
I've read in a few places that this is what is to be used whenever I would use theorem-style environments in latex. There are two things I seem to be unable to do: Creating Theorems that look like this.
--------------------- THEOREM 1 It would be nice if Context could produce a theorem where the title is not separated from the text and the next line has no hanging indent. ---------------------
\defineenumeration[theorem][text=THEOREM,location=left,hang=1] \starttext \theorem \input knuth \stoptext
I was able to produce only
---------------------- THEOREM 1
It would be nice ... ----------------------
or
---------------------- THEOREM 1 It would be nice ... ----------------------
using location=top or location=hanging. What I want is no hanging indent at all. (I also tried location=serried, which produced an overly large gap between THEOREM 1 and the theorem text. The second thing I am used to in latex is the option to place things in parentheses by providing an optional argument to the environment. E.g., in assignments I typeset, I often have either
\begin{question} ... \end{question}
which simply produces
-------------------- Question 1 ... --------------------
or
\begin{question}[20 marks] ... \end{question}
which produces
-------------------- Question 1 (20 marks) ... --------------------
This second option is easy to simulate if I can produce something that has no hanging indents. As it is, I can't.
2) Numbered labels
I tried to use numbered labels plus a little bit of tex-code to simulate the above environment. The gist is that I used
\definelabel[question][location=intext,text=Question]
to define the label and, wherever I needed a new question, \question [ref].
The result of writing \question[ref], however, was "Question Question 1". The label always seemed to be duplicated for some reason. Is this a known bug?
http://www.tug.org/pracjourn/2006-4/mahajan/
Thanks for your help with this.
Cheers, Norbert
Wolfgang
On Tue, 10 Jul 2007, Norbert Zeh wrote:
E.g., in assignments I typeset, I often have either
\begin{question} ... \end{question}
which simply produces
-------------------- Question 1 ... --------------------
or
\begin{question}[20 marks] ... \end{question}
which produces
-------------------- Question 1 (20 marks) ... --------------------
This second option is easy to simulate if I can produce something that has no hanging indents. As it is, I can't.
\defineenueration[question][title=yes] \startquestion ... \stopquestion and \startquestion {20 marks} .... \stopquestion title is a relatively new feature and right now there is no documentation for it. Search in the dev mailing list for theorems for some examples. If you want some specific details, ask here. I will write a myway on theorems "soon". Aditya
Ah, excellent. Also thanks to Wolfgang for his earlier comment. I had looked at location=left before but was thrown off by the excessive distance between the heading and the text...until I discovered the meaning of width=fit. As you can see, I'm new to context. Has anybody looked into the bug (?) with numbered labels? Cheers, Norbert On 11-Jul-07, at 4:39 AM, Aditya Mahajan wrote:
On Tue, 10 Jul 2007, Norbert Zeh wrote:
E.g., in assignments I typeset, I often have either
\begin{question} ... \end{question}
which simply produces
-------------------- Question 1 ... --------------------
or
\begin{question}[20 marks] ... \end{question}
which produces
-------------------- Question 1 (20 marks) ... --------------------
This second option is easy to simulate if I can produce something that has no hanging indents. As it is, I can't.
\defineenueration[question][title=yes]
\startquestion ... \stopquestion
and
\startquestion {20 marks} .... \stopquestion
title is a relatively new feature and right now there is no documentation for it. Search in the dev mailing list for theorems for some examples. If you want some specific details, ask here. I will write a myway on theorems "soon".
Aditya ______________________________________________________________________ _____________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ______________________________________________________________________ _____________
-- NORBERT ZEH Faculty of Computer Science : Dalhousie University nzeh@cs.dal.ca : http://www.cs.dal.ca/~nzeh : 902.494.3154
2007/7/11, Norbert Zeh
Ah, excellent. Also thanks to Wolfgang for his earlier comment. I had looked at location=left before but was thrown off by the excessive distance between the heading and the text...until I discovered the meaning of width=fit. As you can see, I'm new to context.
Has anybody looked into the bug (?) with numbered labels?
Cheers, Norbert
\unprotect \def\do@@label[#1][#2]% {\numberparameter{#1}\c!before \numberparameter{#1}\c!command {\doattributes{\@@thenumber{#1}}\c!headstyle\c!headcolor {%\dotextprefix{\numberparameter{#1}\c!text}% \getvalue{\e!next#1}[#2]}}% \numberparameter{#1}\c!after}% \protect \definelabel[frage][text=Frage,location=inmargin] \starttext \frage text \stoptext Wolfgang
participants (3)
-
Aditya Mahajan
-
Norbert Zeh
-
Wolfgang Schuster