From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: A "Lorem ipsum" module?
Date: Thu, 19 Jul 2012 13:08:55 +0200 [thread overview]
Message-ID: <5007EAC7.6090402@wxs.nl> (raw)
In-Reply-To: <7F211FE8-9457-4D0D-AD7F-AB1C03806FD4@emory.edu>
On 19-7-2012 03:27, Rogers, Michael K wrote:
> On 2012-07-18 Marcin Borkowski <mbork@???> wrote:
>
>> in LaTeX, there is quite a useful package called "lipsum", for
>> typesetting varioud amounts of "Lorem ipsum" stuff. Is there anything
>> like that in ConTeXt? (I know about \input knuth, \input tufte etc.,
>> but that is not exactly what I have in mind, especially when giving a
>> sample of some design to a customer;).)
>
> The LaTeX lipsum seems to have been pre-download from lipsum.com<http://lipsum.com>. ConTeXt makes this relatively easy. The one problem that might be solved better is that the paragraphs come in a single xml node separated by single newlines. I defined a lines environment to make these into paragraphs, which is not as pretty as I would like.
>
> \startxmlsetups xml:Lorem:base
> \xmlsetsetup{Lorem}{*}{-}
> \xmlsetsetup{Lorem}{feed|lipsum}{xml:Lorem:*}
> \stopxmlsetups
> \xmlregisterdocumentsetup{Lorem}{xml:Lorem:base}
> \startxmlsetups xml:Lorem:feed
> \xmlflush{#1}
> \stopxmlsetups
> \startxmlsetups xml:Lorem:lipsum
> \xmlflush{#1}
> \stopxmlsetups
> \definelines[LoremLines]
> \def\Lorem#1{% #1 = number of paragraphs to request
> \startLoremLines
> \xmlprocessfile{Lorem}{http://www.lipsum.com/feed/xml?amount=#1&what=paras&start=yes}{}
> \stopLoremLines
> }
> \starttext
> \setupindenting[yes,20pt]
> \setuplines[LoremLines][command=\blank,indenting=yes]
> \Lorem{12}
> \stoptext
I've added a module m-ipsum. I have no clue if it provides what one
expects from such a module
\usemodule[ipsum]
\setupbodyfont[dejavu,11pt]
\starttext
\ipsum[alternative=paragraph,before=\blank,after=\blank]
\ipsum[alternative=lines,n=2,right=\par,before=\blank,after=\blank]
\ipsum[alternative=lines,n=random,before=\blank,after=\blank]
\ipsum[alternative=lines,before=\startitemize,after=\stopitemize,left=\startitem,right=\stopitem]
\ipsum[alternative=words,left=(,right=),inbetween=\space]
\page
\defineipsum
[ward]
[file=ward,
before=\blank,
after=\blank]
\defineipsum
[ward:itemize]
[ward]
[alternative=lines,
before={\startitemize[packed]},
after=\stopitemize,
left=\startitem,
right=\stopitem]
\defineipsum
[ward:title]
[ward]
[alternative=lines,
n=random]
\subject{\directipsum{ward:title}}
\ipsum[ward]
\ipsum[ward:itemize]
\stoptext
Rather trivial code.
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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:[~2012-07-19 11:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 1:27 Rogers, Michael K
2012-07-19 5:30 ` Henning Hraban Ramm
2012-07-19 11:08 ` Hans Hagen [this message]
2012-07-19 14:42 ` Marco
2012-07-19 14:52 ` Wolfgang Schuster
2012-07-19 14:59 ` luigi scarso
2012-07-19 15:17 ` Marco
2012-07-19 23:20 ` Sietse Brouwer
-- strict thread matches above, loose matches on Subject: below --
2012-07-18 9:42 Marcin Borkowski
2012-07-18 10:18 ` Marco
2012-07-18 11:33 ` Philipp Gesang
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=5007EAC7.6090402@wxs.nl \
--to=pragma@wxs.nl \
--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).