From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/74636 Path: news.gmane.org!not-for-mail From: Mari Voipio Newsgroups: gmane.comp.tex.context Subject: Re: Getting changing/random graphics? Date: Wed, 22 Feb 2012 10:22:14 +0200 Message-ID: References: <4F3CD15D.6050903@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1329898962 27991 80.91.229.3 (22 Feb 2012 08:22:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Feb 2012 08:22:42 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Feb 22 09:22:41 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 1S07TD-0004Vo-0l for gctc-ntg-context-518@m.gmane.org; Wed, 22 Feb 2012 09:22:39 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1A12BCB23C; Wed, 22 Feb 2012 09:22:36 +0100 (CET) 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 m62S0WnRdiJU; Wed, 22 Feb 2012 09:22:28 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BF9AACB231; Wed, 22 Feb 2012 09:22:28 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5DDC4CB231 for ; Wed, 22 Feb 2012 09:22:27 +0100 (CET) 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 3BGufRbr365I for ; Wed, 22 Feb 2012 09:22:16 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 0FEEBCB211 for ; Wed, 22 Feb 2012 09:22:16 +0100 (CET) Original-Received: from mail-lpp01m010-f41.google.com (mail-lpp01m010-f41.google.com [209.85.215.41]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q1M8MEiu021169 for ; Wed, 22 Feb 2012 09:22:15 +0100 Original-Received: by lamf4 with SMTP id f4so11526042lam.14 for ; Wed, 22 Feb 2012 00:22:14 -0800 (PST) Received-SPF: pass (google.com: domain of mvoipio@gmail.com designates 10.112.51.77 as permitted sender) client-ip=10.112.51.77; Authentication-Results: mr.google.com; spf=pass (google.com: domain of mvoipio@gmail.com designates 10.112.51.77 as permitted sender) smtp.mail=mvoipio@gmail.com; dkim=pass header.i=mvoipio@gmail.com Original-Received: from mr.google.com ([10.112.51.77]) by 10.112.51.77 with SMTP id i13mr11064133lbo.3.1329898934636 (num_hops = 1); Wed, 22 Feb 2012 00:22:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=KxfcihyzQObPEQwp+QbYgOdcRjNE18z3Gn2pn+RWX80=; b=Tp1UeP2VU0zfT71ptS2rU1Vn8N3i3ohwSU+2hst9/JfhcD1ld7wzmqXZnHs+GCPa6x yFt8thk/qkG4ySZrXVX6FDqfznFeVdQAmoAOAM6SabVR5oiAsPwn2QFv3KxegJ9Uq3Gv zBd+W6oMLC+PdNOBdYyxXXLShztFn6uqIaeOA= Original-Received: by 10.112.51.77 with SMTP id i13mr9277774lbo.3.1329898934558; Wed, 22 Feb 2012 00:22:14 -0800 (PST) Original-Received: by 10.152.37.103 with HTTP; Wed, 22 Feb 2012 00:22:14 -0800 (PST) In-Reply-To: <4F3CD15D.6050903@wxs.nl> X-Google-Sender-Auth: gRq3DdCwZt_KmBDi8qP-nK0iz0M X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.215.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08GAUmfQC - 45399cbb0252 - 20120222 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:74636 Archived-At: On Thu, Feb 16, 2012 at 11:50, Hans Hagen wrote: > On 16-2-2012 07:43, Mari Voipio wrote: > >> I'm trying to do something that should be possible and I think >> "variables" is the answer, I just can't figure out how. > > > attached .. (will be in test suite) It works. :-) However, this one apparently uses each pic only once and after that I just get "dummies". Nesting this \dorecurse didn't work (not that I expected it to, but had to try anyway) - how to tell this code either "when you've used up all the photos, start over" or "add any random graphic in this directory"? It looks like I'm going to have 50-100 pages, so if there are 10-15 graphics and they are added completely at random, the likelihood of each one to appear at least once is pretty high (at least according to what I remember of my probability math). Thus I won't need any complicated checkups, any old randomizer in the "take a card out of a bag and put it bag" sense should do the trick; I'm just not used to doing this type of stuff, so I cannot even fathom where to start! Hmm... I'd like to include besides png and jpg also vector graphics in pdf format, but obviously I need to exclude any pdf documents in the same directory. Of course one solution is to put the graphics into a separate directory, but if I only want to included .png, .jpg and .pdf with a certain name (like 33s-sensor.jpg, 33s-cutthrough.pdf, etc.), how should the lua code then look like? The name can be written into the code, as long as I put decent comments in, I should be able to adjust it as needed. (File size shouldn't be a concern, the graphics are going to be 2-2.5 cm tall and once I've collected the appropriate graphics, I'll make sure the bitmaps are fit for this use. Besides, I'll be using a print shop and they get a lot worse than anything I can produce with ConTeXt...) In a "need-to-know" mode, Mari ___________________________________________________________________________________ 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 ___________________________________________________________________________________