Am 25.06.2013 um 22:25 schrieb Pablo Rodríguez <oi...@web.de>:

> On 25/06/13 21:55, Wolfgang Schuster wrote:
>> Am 25.06.2013 um 21:31 schrieb Pablo Rodríguez <oi...@web.de>:
>>> Dear list,
>>> 
>>> I need for a document explaining some ConTeXt features, to be able to
>>> include a document inside (a page that includes the feature).
>>> 
>>> I know I can create another document and then insert the pages, but it
>>> would be much easier for me to be able to have the code inside the main
>>> the document.
>>> 
>>> Is there a standard way to do it with ConTeXt?
>> 
>> http://www.ntg.nl/pipermail/ntg-context/2013/072963.html
> 
> Many thanks for your fast reply, Wolfgang.
> 
> I'm afraid I cannot get it working with the sample file I provided. I do
> need to be able to get a complete document, not a TEXpage.
> 
> Is that possible?

\startbuffer[extract:before]

  \mainlanguage[en]
  \setuplanguage[en][patterns={en,agr}]
  \definepapersize[mine][width=6in,height=2in]
  \setuppapersize[mine]
  \usemodule[simplefonts]
  \setmainfont[Theano Didot]
  \definelinenote[contxt]
  \setupnote[contxt][paragraph=yes, inbetween=\hskip1.5em]
  
\setupnotation[contxt][numbercommand=,alternative=serried,distance=1em,compress=yes,compressseparator=]

\stopbuffer

% \startbuffer[extract:after]
%   % empty
% \stopbuffer

\def\startextract
  {\dosingleempty\dostartextract}

\def\dostartextract[#1]%
  {\edef\extractfilename{#1}%
   \grabbufferdata[extract:content][startextract][stopextract]}

\def\stopextract
  {\doifsomething\extractfilename
     
{\savebuffer[list={extract:before,extract:content,extract:after},file=\extractfilename.tex,prefix=no]%
      \typesetfile[\extractfilename][]}}

\starttext

\startextract[dummy]
\startlinenumbering
οὐκ οἶσθ᾽\contxt{οἶσθ᾽: οἶσθα, 2nd sg.,
οἶσδα} ὅτι πολλῶν ἐτῶν\contxt{πολλῶν
ἐτῶν: for…; gen. time within} Ἀγάθων ἐνθάδε
οὐκ ἐπιδεδήμηκεν\contxt{ἐπιδεδήμηκεν: pf.
ἐπιδήμέω}, ἀφ᾽ οὗ\contxt{ἀφ᾽ οὗ: since;
“from which (time)”} δ᾽ ἐγὼ Σωκράτει
συνδιατρίβω\contxt{συνδιατρίβω: I have been
spending; pres. but pf. progressive in translation} καὶ
ἐπιμελὲς πεποίημαι\contxt{ἐπιμελὲς
πεποίημαι: I have made it my business; “have made it my
care,” pf.}
\stoplinenumbering
\stopextract

\stoptext

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

Reply via email to