ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* "verbatim boxes"
@ 2012-11-26 20:42 Erik Margraf
  2012-11-26 21:35 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Erik Margraf @ 2012-11-26 20:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear List,

is there a Context function/macro which enables me to set
a box with verbatim file input. I.e. something
similar to :

\setbox\scratchbox\hbox{\verbatimfileinput{FileName}}

regards

Erik
___________________________________________________________________________________
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] 3+ messages in thread

* Re: "verbatim boxes"
  2012-11-26 20:42 "verbatim boxes" Erik Margraf
@ 2012-11-26 21:35 ` Wolfgang Schuster
       [not found]   ` <CAAaWjtHh2X9Xm+FO5etsBLQ_uNca35GaxYDqfyd0vUDUPoBNFQ@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2012-11-26 21:35 UTC (permalink / raw)
  To: erik.margraf, mailing list for ConTeXt users


Am 26.11.2012 um 21:42 schrieb Erik Margraf <erik.margraf@gmail.com>:

> Dear List,
> 
> is there a Context function/macro which enables me to set
> a box with verbatim file input. I.e. something
> similar to :
> 
> \setbox\scratchbox\hbox{\verbatimfileinput{FileName}}


You have to use a \vbox because a \hbox would put everything in a single line.

The important question is why do you want to store the text in a box.

When you plan to frame the text something like this can be used:

\definetyping
  [framedfile]
  [file]
  [before={\startframedtext[width=max]},
    after=\stopframedtext]

\starttext
\typefile[framedfile]{knuth.tex}
\stoptext

To store text and reuse it buffers are the best tool:

\startbuffer[ward]
The Earth, as a habitat for animal life, is in old age and
has a fatal illness. Several, in fact. It would be happening
whether humans had ever evolved or not. But our presence is
like the effect of an old-age patient who smokes many packs
of cigarettes per day – and we humans are the cigarettes.
\stopbuffer

\starttext

\typebuffer[ward]

\getbuffer[ward]

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: "verbatim boxes"
       [not found]   ` <CAAaWjtHh2X9Xm+FO5etsBLQ_uNca35GaxYDqfyd0vUDUPoBNFQ@mail.gmail.com>
@ 2012-11-26 22:32     ` Wolfgang Schuster
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2012-11-26 22:32 UTC (permalink / raw)
  To: erik.margraf; +Cc: mailing list for ConTeXt users


Am 26.11.2012 um 23:06 schrieb Erik Margraf <erik.margraf@gmail.com>:

> I thought a box would be the best to use it in connection with the
> "FunnyFrame" of the Metafun manual page 137. In particular
> I wanted to set the the Frametitle with the contents of a file.
> (The actual contents of the file should be short enough to fit
> in the title frame) Actually the definition of FrameTitle uses a \hbox …

It puts the “title” (in the example "Zapf (…)”) in the box and not the text.

The text itself for the frame is put in a framedtext environment.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-26 22:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-26 20:42 "verbatim boxes" Erik Margraf
2012-11-26 21:35 ` Wolfgang Schuster
     [not found]   ` <CAAaWjtHh2X9Xm+FO5etsBLQ_uNca35GaxYDqfyd0vUDUPoBNFQ@mail.gmail.com>
2012-11-26 22:32     ` Wolfgang Schuster

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