o this, even if I realized now that there is a similar example in the wiki.
For the list, in case in the future this would be useful for another user,
below is the complete minimal example using this approach.
% - Minimal working example :
\setuppapersize[S5][S5]
\enablemode[Professor]
\de
, I tried to think differently.
One solution would be to define a block for each course. Something like this (a
working minimal example, redone in order this would be more easier to
understand (I hope!) what I’m trying to do):
% —
\setuppapersize[S5][S5]
\enablemode[Professor]
TeX capacity exceeded, sorry [input stack size=5]
%
The problem can be summarized in this minimal non working example :
% — MWE —
\setuppapersize[S5][S5]
\enablemode[Professor]
\defineblock[Complement]
\setupblock[Complement][
before={\page[yes]\setuppagenum
}
%{\stopsidebar}
%{\stopbuffer}},
% ]
\starttext
Before
\startChangePR
\input knuth
\stopChangePR
After
\stoptext
\defineblock
[ChangePR]
\defineblock
[ChangeRP]
\setupblock
[ChangePR]
[before={\startsidebar[rulecolor=red]},
after={\blank[overlay]\stopsidebar}]
\setupblock
trainings in both English and Dutch in the same file. Instead of modes, I use blocks. Like this: \defineblock[ENblok]\defineblock[NLblok] \setupblock[NLblok][before={\mainlanguage[nl]},after=]\setupblock[ENblok][before={\mainlanguage[en]},after=] Then, determine which blocks you want to use in your file
up an
xml file. You can then have the overview via scripts.
Yet for short texts it can be a solution. I have case material for my trainings
in both English and Dutch in the same file. Instead of modes, I use blocks.
Like this:
\defineblock[ENblok]
\defineblock[NLblok]
\setupblock[NLblok][before
om} {
>\keepblocks[Question]
> }
>
> \starttext
>
>Text A
>
>\beginQuestion
>Question A….
>\endQuestion
>
>Text B
>
>\beginQuestion
>Question B….
>\endQuestion
>
>\page
>
>\doifnotmod
re defined).
>
> Is it possible? What have I missed?
>
> Blocks only store their content without expanding counters etc. and when
> you flush them you have the same result as putting them into the appendices
> by hand.
>
> Related: Is there a better way to set answers to questions? (
ithout expanding counters etc. and when
you flush them you have the same result as putting them into the appendices
by hand.
Related: Is there a better way to set answers to questions? (Perhaps
not having to write both the \begin... \start... \stop... \end... for
every question?
\setupblock[A][
{margin}] %%
\setupblock[question][before=\startquestion,after=\stopquestion]
\setupinmargin[stack=continue]
\starttext
\beginquestion
Text
\endquestion
\beginquestion
Text
\endquestion
\useblocks[question]
\stoptext
Sent from Windows Mail
From: Jan Willem Flamma
Sent
ible?
>
> Kind regards,
> Jan Willem
>
>
> MWE:
> \defineblock[question]
> \hideblocks[question]
>
> \defineenumeration
>[question]
>[text=Question]
>
> \setupblock[question][before=\startquestion,after=\stopquestion]
>
>
> \start
\hideblocks[question]
>
> \defineenumeration
> [question]
> [text=Question]
>
> \setupblock[question][before=\startquestion,after=\stopquestion]
\setupinmargin
[stack=yes] %% yes or continue
Marco
_
Dear list members
In the following MWE, the margin text appears at question 1 but not at question
2.
How is this possible?
Kind regards,
Jan Willem
MWE:
\defineblock[question]
\hideblocks[question]
\defineenumeration
[question]
[text=Question]
\setupblock[question][before
,
text={Hint for question},
headstyle={\bi},
stopper={.}]
\defineenumeration[answer]
[alternative=hanging,width=4.5cm,
text={Answer to question},
headstyle={\bi},
stopper={.}]
\setupblock[question][before={\startquestion},after
={Hint for question},
headstyle={\bi},
stopper={.}]
\defineenumeration[answer]
[alternative=hanging,width=4.5cm,
text={Answer to question},
headstyle={\bi},
stopper={.}]
\setupblock[question][before={\startquestion},after={\stopquestion
,
text={},
headstyle={},
stopper={.}]
\setupblock[question][before={\startquestion},after={\stopquestion}]
\setupblock[hint][before={\starthint},after={\stophint}]
\setupblock[answer][before={\startanswer},after={\stopanswer}]
\keepblocks[question]
\hideblocks[hint]
\hideblocks[answer
={},
headstyle={},
stopper={.}]
\setupblock[question][before={\startquestion},after={\stopquestion}]
\setupblock[hint][before={\starthint},after={\stophint}]
\setupblock[answer][before={\startanswer},after={\stopanswer}]
\keepblocks[question]
\hideblocks[hint]
\hideblocks[answer]
\starttext
=,
before={\startcolumns[n=4]},
after=\stopcolumns,
width=0.5em,
text={},
headstyle={},
stopper={.}]
\setupblock[question][before={\startquestion},after={\stopquestion}]
\setupblock[hint][before={\starthint},after={\stophint}]
\setupblock[answer][before={\startanswer},after
Hi Wolfgang,
Many thanks for your attention and insight.
With your code everything works as expected. In case others would be
interested, I give here a slight modification of what you sent, which works
very well with mkiv: I only added
\setupblock[question][before={\startquestion
,
width=fit,
]
\defineblock[question]
\defineblock[answer]
\keepblocks[question]
\hideblocks[answer]
\setupblock[question][before=\startquestion,after=\stopquestion]
\setupblock[answer][before=\startanswer,after=\stopanswer]
\def\noanswer{\incrementnumber[answer]}
\starttext
\beginquestion
Thank you for your answers,
in my case, start-/stoplines is actually much better.
Kind regards,
Ingo
___
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist :
to accomplish:
The user writes the address, and he should not have to use \crlf or have
to use several distinct commands.
Why does the following not work?
\defineblock[Address]
\setupblock[Address][
before=\starttyping,
after=\stoptyping
]
\starttext
\beginAddress
Peter Pan
Somewhere over
.
So here it goes ...
What I want to accomplish:
The user writes the address, and he should not have to use \crlf or have
to use several distinct commands.
Why does the following not work?
\defineblock[Address]
\setupblock[Address][
before=\starttyping,
after=\stoptyping
]
you pick
, and
some problems are showing up now.
So here it goes ...
What I want to accomplish:
The user writes the address, and he should not have to use \crlf or have
to use several distinct commands.
Why does the following not work?
\defineblock[Address]
\setupblock[Address][
before=\starttyping
---
\defineblock[Block]
\defineenumeration[Enum][location=left,text=Test]
\setupblock[Block][before=\startEnum,after=\stopEnum]
\keepblocks[Block]
\starttext
\section{Use}
\useblocks[Block]
\reset[Enum]
\section{Define}
\beginBlock
jhdsa hdsfhj lh dsfjh jkhasdf
sdakjhfsal sdkajhf kljsdh
]
\defineenumeration[Enum][location=left,text=Test]
\setupblock[Block][before=\startEnum,after=\stopEnum]
\starttext
\beginBlock
Some text A
\endBlock
\stoptext
Wolfgang
___
If your question is of interest to others as well, please
Dear all,
When selecting multiple blocks: \useblocks[someblock,otherblock],
the blocks are selected but the before and after statements are not
processed.
Is the expected behaviour?
Tia, Bernard
Example:
\defineblock[someblock]
\defineblock[otherblock]
\setupblock[someblock]
[before
), e.g.
\setupenumerations[problem,remark][stopper=)]
so name of commands are correct (in some sense one is a limit of several :).
You could also use more names in \setuphead, \setupblock etc. but these
command names are singular. Changing \setupenumerations/descriptions is
no option but one can
the text from any tex commands (except for a single type of begin/end
sequence). Conceptually :-
manual-env.tex:
\defineblock[EN,de,it]
\setupblock[EN][file=EN]
\setupblock[DE][file=DE]
\setupblock[IT][file=IT]
\doifmode[EN]{\def\lang{EN}}
\doifmode[DE]{\def\lang{DE}}
\doifmode[IT]{\def\lang
# \setlayerframed
# \setlocalhsize
# \setstrut
\settextvariable[name]{text}
\setupalign[options]
\setuparranging[options]
# \setupattachments
\setupbackground[options]
\setupbackgrounds[position][position][state][settings]
\setupblackrules[options]
\setupblank[options]
\setupblock[names][options
sfarsit
fin
\stopelements
\defineenumeration[Answer][text=Question]
\defineenumeration[Question]
\defineblock[answer,question]
\setupblock
[answer][before={\startAnswer\resetscore},after={\savescore\stopAnswer}
]
\setupblock
[question][before
[answer,question]
\setupblock[answer][before={\startAnswer\resetscore},after={\savescore\stopAnswer}]
\setupblock[question][before={\startQuestion},after={\stopQuestion}]
\makecounter{totalscore}
\definelist[Score]
[ pagenumber=no,
width=5em
fine sfarsit
fin
\stopelements
\defineenumeration[Answer][text=Question]
\defineenumeration[Question]
\defineblock[answer,question]
\setupblock
[answer][before={\startAnswer\resetscore},after={\savescore\stopAnswer}]
\setupblock
]
\defineblock[answer,question]
\setupblock
[answer][before={\startAnswer\resetscore},after={\savescore
\stopAnswer}]
\setupblock
[question][before={\startQuestion},after={\stopQuestion}]
\makecounter{totalscore}
\definelist[Score]
[ pagenumber=no,
width=5em
sfarsit
fin
\stopelements
\defineenumeration[Answer][text=Question]
\defineenumeration[Question]
\defineblock[answer,question]
\setupblock
[answer][before={\startAnswer},after={\stopAnswer}]
\setupblock
[question][before={\startQuestion},after
fine sfarsit
fin
\stopelements
\defineenumeration[Answer][text=Question]
\defineenumeration[Question]
\defineblock[answer,question]
\setupblock
[answer][before={\startAnswer},after={\stopAnswer}]
\setupblock
konec
fine sfarsit
fin
\stopelements
\defineenumeration[Answer][text=Question]
\defineenumeration[Question]
\defineblock[answer,question]
\setupblock
[answer][before={\startAnswer\resetscore},after={\savescore
in the 'begin' and
'after' fields of '\setupblock'. Does the '\useblocks' command not produce
plain TeX-Code in iterative fashion (like a for-loop over all textblocks)?
Is there somebody in the list, who already had a similar problem?
Michael
Hi Michael,
I looked a little bit into the code
.
It would be really nice to have a solution where I can typeset the to
textblocks (Requirements and Priority) in a list, each block in a cell.
I don't understand why I can't place arbitrary commands in the 'begin' and
'after' fields of '\setupblock'. Does the '\useblocks' command not produce
plain
but unfortunately it didn't work:
\defineenumeration[Requirement][location=left,text=Req,width=broad,after={\blank[small]}]
\defineblock[Requirement,Priority]
\setupblock[Requirement][after=]
\hideblocks[Priority]
\starttext
\chapter{Description of requirements}
\beginRequirement
\Requirement
to list all the requirements together with their priority.
I tried the following code but unfortunately it didn't work:
\defineenumeration[Requirement][location=left,text=Req,width=broad,after={\blank[small]}]
\defineblock[Requirement,Priority]
\setupblock[Requirement][after=]
\hideblocks
want to list all the requirements together with their priority.
I tried the following code but unfortunately it didn't work:
\defineenumeration[Requirement][location=left,text=Req,width=broad,after={\blank[small]}]
\defineblock[Requirement,Priority]
\setupblock[Requirement][after=]
\hideblocks
,text=Req,width=broad,after={\blank[small]}]
\defineblock[Requirement,Priority]
\setupblock[Requirement][after=]
\hideblocks[Priority]
\starttext
\chapter{Description of requirements}
\beginRequirement
\Requirement A requirement \par
\endRequirement
\beginPriority
the requirements together with their priority.
I tried the following code but unfortunately it didn't work:
\defineenumeration[Requirement][location=left,text=Req,width=broad,after={\blank[small]}]
\defineblock[Requirement,Priority]
\setupblock[Requirement][after=]
\hideblocks[Priority
Rob Ermers wrote:
Hi,
If I make sure there is enough space, i.e. more than one space, between
the \begin... and the text, it works! However in the pdf the item drops
a line down, like this:
See \def\dodefineblock in core-buf.tex.
Does
\setupblock[Nederlandsblok][before=,after
]
\setupblock[Nederlandsblok][before=,after=]
\setupblock[Engelsblok][before=,after=]
\hideblocks[Nederlandsblok]
%\hideblocks[Engelsblok]
\starttext
there
\beginNederlandsblok
Ik vraag me af of ze ook appels verkopen 1
\endNederlandsblok
\beginEngelsblok
I really wonder if they do sell apples 1
]
\defineblock[question, answer]
\hideblocks[answer]
\setupblock[question][before=\startquestion,after=\stopquestion]
\setupblock[answer][before=\startanswer,after=\stopanswer]
\starttext
\chapter{Questions}
\beginquestion
Question one
\endquestion
\beginanswer
Answer one
\endanswer
\beginquestion
Hi,
the example
\setupblock[homework][file=student]
that Hans describes in his docu does not work for me!
Help needed!
Thanks in advance
Bernd
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context
At 12:01 26/09/2003 +0200, you wrote:
Hi,
the example
\setupblock[homework][file=student]
that Hans describes in his docu does not work for me!
Help needed!
did you define the block?
\defineblock[homework]
== test.tex ===
\defineblock[homework]
\setupblock[homework
49 matches
Mail list logo