ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* howto get good references in mkiv?
@ 2012-01-05 14:04 Rene van Hassel
  0 siblings, 0 replies; only message in thread
From: Rene van Hassel @ 2012-01-05 14:04 UTC (permalink / raw)
  To: ntg-context

Hello Members,

some piece of code, with the problems.
I hope somebody can use it to improve ConTeXt, 
Compilation with texexec is no problem,


Kind Regards,


Rene'


% Begin code:

\setupcolors[state=start]
\setupinteraction[state=start,color=orange]
\setupreferencing[state=start]

\defineblock[question]
\defineblock[answer]
\defineenumeration[question][location=top,coupling=answer]
\defineenumeration[answer][location=top,coupling=question]
\hideblocks[question]
\hideblocks[answer]

\defineblock[exercise]
\defineblock[solution]
\defineenumeration[exercise][location=top,text=Exercise]
\defineenumeration[solution][location=top,text=Solution]
\hideblocks[exercise]
\hideblocks[solution]


\defineblock[exer]
\defineblock[sol]
\defineenumeration[exer][location=top,text=Exercise]
\defineenumeration[sol][location=top,text=Solution]
\hideblocks[exer]
\hideblocks[sol]

\starttext

\chapter{Preface}
To write Lecture Notes or Exams I want to use a mechanism 
such that in just one paper the questions and the answers 
can be written. And then to hide the answers at some way or 
to get a coupling between the exercises and the solutions.\crlf
I wanted also a mechanism to give each exercise and each solution a number. 
These numbers have not to be equal. It is may be better for the students that 
numbers of the solutions are different from that of the exercises! Than they 
can play the game: "What exercise belongs to a certain solution?"\crlf
The Zeroth Attempt: a try to use "coupling".\crlf
The First Attempt: the use of blocks, but the coupling explicit made by myself 
and there is made use of \type{\defineenumeration}.\crlf
The Second Attempt: this I used already succesfully by texexec. I defined by 
myself a new counter and used that counter in \type{\itemize} and I referenced to 
the \type{\item}(s).\crlf\crlf
Used is the frozen texexec "version 6.2.1 - 1997-2009 - PRAGMA ADE/POD" and 
"version 2011.05.18 18:04", resp. "version 2012.01.02 21:59" of context. \crlf
On the way I learned howto work with a standalone ConTeXt and a system-wide 
installed ConTeXt. 

\chapter{Different mechanism to number exercises and solutions}
\subsection{Zeroth Attempt}
% Begin: Zeroth Attempt

This Zeroth Attempt is a tryout to see if the coupling mechanism works. 
I never used it before so I was curiuous. \crlf\crlf

If all the examples are done at once:\crlf
Compilation stopped at the places: First Question, Second Question,
First Answer and Second Answer. Pushed Enter and compilation continued.
\startitemize[n]
% oke
\item With texexec: no coupling. You don't see anything.
% oke
\item With context ( version: 2012.01.02 21:59):  
You see some text written in orange "somewhere", but no interactivity.\crlf
Compilation stopped at the places: First Question, Second Question,
First Answer and Second Answer. Pushed Enter and compilation continued.
% oke
\item With context ( version: 2011.05.18 18:04): \crlf
You see orange triangles as references, both the Exercises and the Solutions,
but there is no interaction.
\stopitemize

If the example is done separately:
\startitemize[n]
% oke
\item With texexec: no coupling. You don't see anything.
% oke
\item With context ( version: 2012.01.02 21:59): \crlf
You see some text written in orange "somewhere", but no interactivity.\crlf
Compilation stopped at the places: First Question, Second Question,
First Answer and Second Answer. Pushed Enter and compilation continued.
% oke
\item With context ( version: 2011.05.18 18:04): \crlf
You see orange triangles as references, both the Exercises and the Solutions,
but there is no interaction. \crlf
Compilation stopped at the places: First Question, Second Question,
First Answer and Second Answer. Pushed Enter and compilation continued.
\stopitemize

\page

\beginquestion
\startquestion
First Question
\stopquestion
\startquestion
Second Question
\stopquestion
\endquestion
\useblocks[question]
\page
\beginanswer
\startanswer
First Answer
\stopanswer
\startanswer
 Answer
\stopanswer
\endanswer
\useblocks[answer]
% End: Zeroth Attempt


\subsection{First Attempt}
% Begin: First Attempt
Nested hidden blocks give problems, such as the continuation of 
the enumerations and also the amount of times that something is repeated. \crlf

If all the examples are done at once:\crlf
Compilation stopped at the places: First Question, Second Question,
First Answer and Second Answer. Pushed Enter and compilation 
continued.
\startitemize[n]
% oke
\item With texexec: no problems.
% oke
\item With context ( version: 2012.01.02 21:59):
no references at all, so "??", both the Exercises and the Solutions.
% oke
\item With context ( version: 2011.05.18 18:04): \crlf
no references at all, so "??", both the Exercises and the Solutions.
\stopitemize

If the example is done separately:
\startitemize[n]
% oke
\item With texexec: no problems.
% oke
\item With context ( current version: 2012.01.02 21:59):
The references do what they have to do. No problems.
% oke
\item With context ( current version: 2011.05.18 18:04): 
The references do what they have to do. No problems.
\stopitemize


\beginexercise
\startexercise[exer-1] First exercise.\crlf
See \in{Solution}[sol-1].
\stopexercise
\startexercise[exer-2] Second exercise.\crlf
See \in{Solution}[sol-2].
\stopexercise
\endexercise

\beginsolution
\startsolution[sol-1]
First solution!\crlf
See \in{Exercise}[exer-1].
\stopsolution
\startsolution[sol-2]
Second solution!\crlf
See \in{Exercise}[exer-2].
\stopsolution
\endsolution

\useblocks[exercise]
\page
\useblocks[solution]
\page

% End: First Attempt


\subsection{Second Attempt}
% Begin: Second Attempt

If all the examples are done at once:\crlf
Compilation stopped at the places: First Question, Second Question,
First Answer and Second Answer. Pushed Enter and compilation 
continued.
\startitemize[n]
% oke
\item With texexec no problems.
% oke
\item With context ( version: 2012.01.02 21:59):
there are references, written in orange, but to the wrong 
places.
% oke
\item With context ( version: 2011.05.18 18:04): \crlf
there are references, written in orange, but to the wrong places.
\stopitemize

If the example is done separately:\crlf
\startitemize[n]
% oke
\item With texexec no problems.
% oke
\item With context ( version: 2012.01.02 21:59):
there are references, written in orange, but they don't work, so 
no interactivity\crlf
% oke
\item With context ( version: 2011.05.18 18:04): \crlf
there are references, written in orange, but they don't work, 
so no interaction.\crlf
\stopitemize


\def\nextnumber#1{\the\numexpr#1\relax}
\defineconversion[nee][\nextnumber]

\setupitemize[broad,packed]
\startitemize[nee][left={Ex-},stopper={: },width=1.5cm]
% nee: new exam exercise
% Exercise
\item[221106-Ex-4] Question 221106-Ex-4.\crlf
Solution, see \in{Sol-}[221106-Ex-4-sol].\crlf

% Exercise
\item[221106-Ex-5] Question 221106-Ex-5.\crlf
Solution, see \in{Sol-}[221106-Ex-5-sol].\crlf

% End list of Exercises:
\stopitemize

\page

% Start list of solutions:
%=0
% nsee (new solution exam exercises)
\def\nextnumber#1{\the\numexpr#1\relax}
\defineconversion[nsee][\nextnumber]

\setupitemize[broad,packed]
\startitemize[nsee][left={Sol-},stopper={: },width=1.5cm]
% Solution
\item[221106-Ex-4-sol]
Solution 221106-Ex-4.\crlf
See Exercise \in{Ex-}[221106-Ex-4]\crlf

% Solution
\item[221106-Ex-5-sol]
Solution 221106-Ex-5.\crlf
See Exercise \in{Ex-}[221106-Ex-5]\crlf

% End list of solutions
\stopitemize \crlf

At \at{page}[221106-Ex-4].\crlf
At \at{page}[exer-2].
% End: Second Attempt

\chapter{Summary}

My hope is that somebody can use these results to improve ConTeXt. \crlf
If the examples are compiled separately than the results are different 
from that as the examples are compiled together at once! \crlf
Yesterday sitting at home and outside it rained, I got also difficulties 
with TikZ, something with \type{catcode....}? But I have first to search 
for a little example before I send something to the mail-archive.

\stoptext

% End code.

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-05 14:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-05 14:04 howto get good references in mkiv? Rene van Hassel

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).