From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/77440 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: A "Lorem ipsum" module? Date: Thu, 19 Jul 2012 13:08:55 +0200 Message-ID: <5007EAC7.6090402@wxs.nl> References: <7F211FE8-9457-4D0D-AD7F-AB1C03806FD4@emory.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1342696168 30264 80.91.229.3 (19 Jul 2012 11:09:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 19 Jul 2012 11:09:28 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jul 19 13:09:28 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Srobn-0000hq-EZ for gctc-ntg-context-518@m.gmane.org; Thu, 19 Jul 2012 13:09:27 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7B6E910230; Thu, 19 Jul 2012 13:09:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8L8RQOMObyBD; Thu, 19 Jul 2012 13:09:24 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 3AF4A101FA; Thu, 19 Jul 2012 13:09:24 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9C57C101FA for ; Thu, 19 Jul 2012 13:09:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tOIlUr+K0sTs for ; Thu, 19 Jul 2012 13:09:17 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 9D2FD101F7 for ; Thu, 19 Jul 2012 13:09:17 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q6JB9GCV017463 for ; Thu, 19 Jul 2012 13:09:16 +0200 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by pragma-net.nl (SurgeMail 5.3h2) with ESMTP (TLS) id 1170-1713362 for multiple; Thu, 19 Jul 2012 13:09:09 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: <7F211FE8-9457-4D0D-AD7F-AB1C03806FD4@emory.edu> X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=03; city=Hattem; latitude=52.4724; longitude=6.0696; http://maps.google.com/maps?q=52.4724,6.0696&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0THAb9glM - b5d83971edce - 20120719 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:77440 Archived-At: On 19-7-2012 03:27, Rogers, Michael K wrote: > On 2012-07-18 Marcin Borkowski 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. 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 ___________________________________________________________________________________