From: Otared Kavian <otared@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: setuphead for in-paragraph head ?
Date: Thu, 9 Jan 2014 15:19:33 +0100 [thread overview]
Message-ID: <A2132E8B-69E8-4CBA-A5B7-17427F90D774@gmail.com> (raw)
In-Reply-To: <CAN2kUOK6KGuMUECOtDwjN5T_5pJ-J9GyFjd3=h+=BEmnRcffEA@mail.gmail.com>
Hi Jean Guillaume,
I guess Marco Patzer and Wolfgang Schuster gave you already the appropriate answers.
Nevertheless, I wanted to share with you the definitions I use for the kind of work you want to do:
%%% begin example-exercise.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% defining \startexo, \stopexo as an enumeration:
\startsetups style:simple
\defineenumeration[exo]
[alternative=hanging,
width=fit,
stopper={.},
text=Exercise,
% between=,
before=,
after=\blank]
\stopsetups % style:simple
\startsetups style:textrule
\definenumber[MyExoNumber][way=bysection,sectionumber=yes]
\setuptextrules[rulecolor=darkred]
\define\ExoCommand{\incrementnumber[MyExoNumber]
\textrule[top]{Exercise \getnumber[MyExoNumber]}
\startbackground[frame=off,leftframe=on,backgroundcolor=white,
framecolor=darkred]}
\defineenumeration[exo]
[alternative=hanging,
width=fit,
text={},
number=hide,
number=no,
before={\ExoCommand},
after={\stopbackground\blank}]
\stopsetups % style:textrule
% end defining \startexo, \stopexo as an enumeration
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%defining numbered questions
\defineconversion[exercise][\numbers]
%\setupitemize[packed]
\def\StartQuestions{%
\startitemize[exercise][width=2em,packed,style=bold,stopper=,right=)]}
\def\StopQuestions{\stopitemize}
\def\q{\item}
% trye each of the following
\setups[style:simple]
%\setups[style:textrule]
\starttext
\startexo
Prove that for all $a,b\in {\Bbb K}$, a field of characteristic 2, one has $(a+b)^2 = a^2 + b^2$.
\stopexo
\startexo
Prove that for all $a,b\in {\Bbb K}$, a field of characteristic 2, one has $(a+b)^4 = a^4 + b^4$.
\stopexo
\startexo
\StartQuestions
\q Prove that
\startformula
\sum_{n=1}^\infty{1 \over n^2} = {\pi^2 \over 6}.
\stopformula
\q Prove that for any $n \geq 1$ integer one has
\startformula
\sum_{k=1}^n k^3 = \left({n(n+1) \over 2}\right)^2.
\stopformula
\StopQuestions
\stopexo
\stoptext
%%% end example-exercise.tex
Best regards: OK
On 9 janv. 2014, at 14:23, Jean-Guillaume <jnglgr@gmail.com> wrote:
> But this:
>
> \definehead
> [Exercise] [subsection]
> [after=]
> \starttext
> \startExercise [title=This is the exercise's title]
> The exercise's content.
> \stopExercise
> \stoptext
>
> results to:
>
> 1 This is the exercise's title
> The exercise's content.
>
> and I would like it to be:
>
> 1 This is the exercise's title The exercise's content.
>
> (When I can typeset that, I will see about formatting the number and so on.)
>
> I'm sorry it wasn't very clear. Now I understand that I misunderstood
> \startExercise{...} for \startExercise[title=...] and that's why I was
> confused about which newline I want to get rid of.
>
> Jean-Guillaume
> ___________________________________________________________________________________
> 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 : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2014-01-09 14:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-09 13:23 Jean-Guillaume
2014-01-09 13:24 ` Wolfgang Schuster
2014-01-09 14:19 ` Otared Kavian [this message]
2014-01-09 14:48 ` Jaroslav Hajtmar
2014-01-09 15:36 ` Otared Kavian
2014-01-09 17:12 ` Aditya Mahajan
2014-01-09 17:23 ` Wolfgang Schuster
2014-01-09 17:36 ` Otared Kavian
2014-01-09 17:41 ` Wolfgang Schuster
2014-01-10 6:56 ` Jaroslav Hajtmar
2014-01-10 23:36 ` Otared Kavian
2014-01-11 9:12 ` Wolfgang Schuster
2014-01-11 19:01 ` Otared Kavian
2014-01-12 10:45 ` Jaroslav Hajtmar
2014-01-12 16:08 ` Otared Kavian
2014-01-12 19:29 ` Jaroslav Hajtmar
2014-01-12 20:30 ` Wolfgang Schuster
2014-01-12 20:47 ` Otared Kavian
2014-01-12 21:40 ` Wolfgang Schuster
2014-01-13 3:41 ` Otared Kavian
2014-01-13 10:07 ` Wolfgang Schuster
-- strict thread matches above, loose matches on Subject: below --
2014-01-09 12:44 Jean-Guillaume
2014-01-09 13:03 ` Marco Patzer
2014-01-09 9:43 Jean-Guillaume
2014-01-09 11:27 ` Marco Patzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A2132E8B-69E8-4CBA-A5B7-17427F90D774@gmail.com \
--to=otared@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).