From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31080 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: \sometxt bodyfontsize in staticMPfigure (2006.09.27 beta) Date: Thu, 28 Sep 2006 09:25:50 +0200 Message-ID: <451B78FE.2030808@wxs.nl> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1159428390 7092 80.91.229.2 (28 Sep 2006 07:26:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 28 Sep 2006 07:26:30 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Sep 28 09:26:27 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1GSqHh-0007c8-Rx for gctc-ntg-context-518@m.gmane.org; Thu, 28 Sep 2006 09:26:17 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CA1E71FEEA; Thu, 28 Sep 2006 09:26:16 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 23412-05-3; Thu, 28 Sep 2006 09:26:06 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BCD291FEEC; Thu, 28 Sep 2006 09:26:05 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3F2BF1FEEC for ; Thu, 28 Sep 2006 09:26:02 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 23412-05-2 for ; Thu, 28 Sep 2006 09:25:54 +0200 (CEST) Original-Received: from mail.pragma-ade.net (dsl-083-247-100-017.solcon.nl [83.247.100.17]) by ronja.ntg.nl (Postfix) with SMTP id 850321FEEA for ; Thu, 28 Sep 2006 09:25:53 +0200 (CEST) Original-Received: from [10.100.1.104] (unverified [10.100.1.104]) by controller-1 (SurgeMail 3.7b8) with ESMTP id 10422 for ; Thu, 28 Sep 2006 09:25:52 +0200 User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) Original-To: mailing list for ConTeXt users In-Reply-To: X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:31080 Archived-At: Sanjoy Mahajan wrote: > [I'm testing the 2006.09.27 beta on Linux] > > Thanks for the new \sometxt in staticMPfigures. I'm just testing its > operation, and find that the text is not set in the document's bodyfont > size. For example, > > \setupbodyfont[20pt] > \starttext > > \startstaticMPfigure{fig} > label(\sometxt{in sometxt},origin); > \stopstaticMPfigure > > outside sometxt > \usestaticMPfigure[fig] > \stoptext > > produces a small "in sometxt" and a large "outside sometxt". > > With this file both are large, as I expected \sometxt to work: > > \setupbodyfont[20pt] > \starttext > > \startreusableMPgraphic{fig} > label(\sometxt{in sometxt},origin); > \stopreusableMPgraphic{ > > outside sometxt > \reuseMPgraphic{fig} > \stoptext > > I haven't figured out the full story. But in the intermediate .mp files > generated by texexec, the staticMPfigure case has > "BodyFontSize:=12.0pt;" whereas in the reusableMPgraphic case, the file > has "BodyFontSize:=20.0pt;". > this is runtime tex into passed to the graphic ... imagine that we flush this to the mp file ... it can contain info that is not known in that session (like overlay info) which willbreak the mp run the issue here is that a static graphic is processed in another, independent run, that's the whole idea behind static graphics (quick hack for independent graphics) we can spend a lot of time to make it more advanced but within a year from now we will have mp as a library in tex which willreduce runtime to nearly zero (at least that 's what experiments show) so .... what we can do is pass info from the mpenvironment" \startMPenvironment[global] \setupbodyfont[20pt] \stopMPenvironment \starttext \long\def\startstaticMPgraphic#1#2\stopstaticMPgraphic {\blabelgroup \def\MPgraphicfile{#1}% no \jobname here \let\MPwrite\MPstaticwrite \immediate\openout\MPwrite=\MPgraphicfile.mp \setMPrandomseedfalse \enableincludeMPgraphics \def\sometxt##1{\string\sometxt{##1}}% \the\everyMPgraphic \presetMPdefinitions \theMPinclusions % brrr \writeMPgraphic{\letterpercent mpenvironment: \the\everyMPTEXgraphic}% \writeMPgraphic{beginfig(1);}% \writeMPgraphic{#2}% \writeMPgraphic{endfig; end.}% \immediate\closeout\MPwrite \immediate\closeout\MPwrite \runMPgraphicstrue \executeMPgraphicfile \elabelgroup} \startstaticMPfigure{fig} label(\sometxt{in sometxt},origin); \stopstaticMPfigure outside sometxt \usestaticMPfigure[fig] \stoptext for this we need to patch tex.rb: def processmpstatic if filename = getvariable('filename') then filename += ".mp" unless filename =~ /\..+?$/ if FileTest.file?(filename) then begin data = IO.read(filename) File.open("texexec.tex",'w') do |f| f << "\\setupoutput[pdftex]\n" f << "\\setupcolors[state=start]\n" data.sub!(/^%mpenvironment\:\s*(.*?)$/mois) do f << $1 "\n" end f << "\\starttext\n" f << "\\startMPpage\n" f << data.gsub(/end\.*\s*$/m, '') # a bit of a hack f << "\\stopMPpage\n" f << "\\stoptext\n" end report("converting static '#{filename}'") runtex("texexec.tex") pdffile = File.suffixed(filename,'pdf') File.silentrename("texexec.pdf",pdffile) report ("#{filename} converted to #{pdffile}") rescue report("error in converting #{filename} (#{$!}") end end end reportruntime end but that's about it Hans -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------