From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64698 Path: news.gmane.org!not-for-mail From: Anand Raj Newsgroups: gmane.comp.tex.context Subject: Re: Html to pdf using pragma script Date: Tue, 21 Dec 2010 17:42:23 +0800 Message-ID: References: <4D106CD4.5080307@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0215430221==" X-Trace: dough.gmane.org 1292924571 20549 80.91.229.12 (21 Dec 2010 09:42:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 21 Dec 2010 09:42:51 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Dec 21 10:42:42 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PUyjx-0003Sq-Uw for gctc-ntg-context-518@m.gmane.org; Tue, 21 Dec 2010 10:42:42 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E761ACA903; Tue, 21 Dec 2010 10:42:40 +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 kJZ0DoQT5B+i; Tue, 21 Dec 2010 10:42:37 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B0844CA907; Tue, 21 Dec 2010 10:42:37 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 78C69CA907 for ; Tue, 21 Dec 2010 10:42: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 OMOF4KVx+2yv for ; Tue, 21 Dec 2010 10:42:25 +0100 (CET) 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 03E6CCA903 for ; Tue, 21 Dec 2010 10:42:24 +0100 (CET) Original-Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oBL9gNmD031866 for ; Tue, 21 Dec 2010 10:42:24 +0100 Original-Received: by fxm9 with SMTP id 9so3829519fxm.3 for ; Tue, 21 Dec 2010 01:42:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=2VHFv9HDTqpW80slgqay5w9i1fjQC3wje2F3IOFG+FM=; b=X9paV1IcCdHAGfFSkkOq9Ium4d6ZQ4kWwmoy/2q1PCoDJ0JuFvmrWuCUgUkRK1QqRV hhLrB27Vb0SNwpyM4j2rw39jeYQ5FFadbMHxCHvzx3+ZQDeCL+GdPPxt5WtG8TtEht1c bNU+kNlVuOGtkQtTuX93p+2Pt9xxIvVgOYKjE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iwCzxvJucWsWZPLVJoq8CMU67TFL69Si1t2gtC41fZg3V6m89PadGoZNv+uL+WCCv9 LtpEJ3EQn+vhEAGQ3Z1iuMWHN3gaF7qONWi3iHsVrMbi48hdgs9M5aHbZXRBAW414J+E ovxJbdAmdb7xx1Z+PJrVWRqYf+vwGW6ZtQc38= Original-Received: by 10.223.86.130 with SMTP id s2mr773749fal.66.1292924543328; Tue, 21 Dec 2010 01:42:23 -0800 (PST) Original-Received: by 10.223.111.129 with HTTP; Tue, 21 Dec 2010 01:42:23 -0800 (PST) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.44; 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: 0bDJJGo80 - 069bfc7602cf - 20101221 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:64698 Archived-At: --===============0215430221== Content-Type: multipart/alternative; boundary=20cf3054a45720677c0497e874af --20cf3054a45720677c0497e874af Content-Type: text/plain; charset=ISO-8859-1 Hi, I have input xml file say *input.xml*
Solve by factoring:

* 312 *

Give either of the two solutions.
Then I have the tex file to generate the pdf say *generate.tex* \usemodule[mathml] \setupbodyfont[palatino] \startxmlsetups xml:testsetups \xmlsetsetup{test} {document|b|p|i|br|am} {xml:*} \xmlsetsetup{test} {p[@class='tips']} {xml:tips} \xmlsetsetup{test} {br[tag(1)='br']} {xml:brbr} \xmlsetsetup{test} {div} {xml:div} \xmlsetsetup{test} {input} {xml:input} \xmlsetsetup{test} {input[@type='text']} {xml:inputtext} \xmlsetsetup{test} {script|span} {xml:skip} \xmlsetsetup{test} {div[@class='question']} {xml:question} \xmlsetsetup{test} {div[@class='review']} {xml:review} \stopxmlsetups \xmlregistersetup{xml:testsetups} \startxmlsetups xml:document \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:skip \removeunwantedspaces\ignorespaces \stopxmlsetups \startxmlsetups xml:input \stopxmlsetups \startxmlsetups xml:inputtext \blank % \dontleavehmode\strut\blackrule[height=1pt,depth=0pt,width=\textwidth] \dontleavehmode\underbar{\strut\char0\hskip\textwidth\strut} \blank \stopxmlsetups \startxmlsetups xml:div \blank \xmlflush{#1} \blank \stopxmlsetups \newcount\QuestionCounter \startxmlsetups xml:question \blank \global\advance\QuestionCounter\plusone \margintitle{\the\QuestionCounter} \xmlflush{#1} \blank \stopxmlsetups \startxmlsetups xml:review % \blank % \xmlflush{#1} % \blank \stopxmlsetups *\startxmlsetups xml:am \xmlprocessdata{}{ x2 + 4x + 4 }{} \stopxmlsetups * \startxmlsetups xml:br \par \stopxmlsetups \startxmlsetups xml:p \par \stopxmlsetups \startxmlsetups xml:tips \blank \bgroup\bf Tips: \egroup\xmlflush{#1} \blank \stopxmlsetups \startxmlsetups xml:brbr \blank \stopxmlsetups \startxmlsetups xml:i \bgroup\it\xmlflush{#1}\egroup \stopxmlsetups \startxmlsetups xml:b \bgroup\it\xmlflush{#1}\egroup \stopxmlsetups \starttext \xmlprocessfile{test}{whatever-011.xml}{} \stoptext \stop now, I need your help to use ** value from input.xml and use it in *\startxmlsetups xml:am* *\xmlprocessdata*as parameter. Thanks Anand On Tue, Dec 21, 2010 at 5:03 PM, luigi scarso wrote: > On Tue, Dec 21, 2010 at 10:01 AM, Hans Hagen wrote: > > On 21-12-2010 8:04, Anand Raj wrote: > >> > >> Hi, > >> > >> how to map svg tags from xml and tex file.? > > > > Dump the svg blob in a file (say image-1.svg) and then use > > \extenalfigure[image-1.svg] to place it. Conversion to pdf will happen > > automatically then > if you have inkscape installed > > > -- > luigi > > ___________________________________________________________________________________ > 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 > > ___________________________________________________________________________________ > --20cf3054a45720677c0497e874af Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I have input xml file say input.xml

<?xml versi= on=3D"1.0" encoding=3D"UTF-8"?>
<document><= br>=A0=A0=A0 <div class=3D'question'>
=A0=A0=A0=A0=A0=A0= =A0 <div>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Solve by factoring: =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <br/><br/>
=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 <am>
<math title=3D"3/12"><mstyle displaystyle=3D"true" fontfami= ly=3D"serif"><= ;mfrac><mn= >3</mn><mn>12</mn></mfrac></mstyle></math>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </am>

=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 <br/><br/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Give = <i>either</i> of the two solutions.
=A0=A0=A0=A0=A0=A0=A0 &l= t;/div>
=A0=A0=A0 </div>
</document>

Then I ha= ve the tex file to generate the pdf say generate.tex

\usemodule[mathml]

\setupbodyfont[palatino]

\startxmlsetu= ps xml:testsetups
=A0=A0=A0 \xmlsetsetup{test} {document|b|p|i|br|am}=A0= =A0 {xml:*}
=A0=A0=A0 \xmlsetsetup{test} {p[@class=3D'tips']}=A0= =A0=A0=A0=A0=A0 {xml:tips}
=A0=A0=A0 \xmlsetsetup{test} {br[tag(1)=3D'br']}=A0=A0=A0=A0=A0=A0= =A0 {xml:brbr}
=A0=A0=A0 \xmlsetsetup{test} {div}=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 {xml:div}
=A0=A0=A0 \xmlsetsetup{te= st} {input}=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 {xml:input}<= br>=A0=A0=A0 \xmlsetsetup{test} {input[@type=3D'text']}=A0=A0=A0 {x= ml:inputtext}
=A0=A0=A0 \xmlsetsetup{test} {script|span}=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= {xml:skip}
=A0=A0=A0 \xmlsetsetup{test} {div[@class=3D'question'= ;]} {xml:question}
=A0=A0=A0 \xmlsetsetup{test} {div[@class=3D'revie= w']}=A0=A0 {xml:review}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:document=A0=A0=A0 \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:skip=
=A0=A0=A0 \removeunwantedspaces\ignorespaces
\stopxmlsetups

\= startxmlsetups xml:input
\stopxmlsetups

\startxmlsetups xml:inputtext
=A0=A0=A0 \blank
= %=A0=A0=A0=A0 \dontleavehmode\strut\blackrule[height=3D1pt,depth=3D0pt,widt= h=3D\textwidth]
=A0=A0=A0 \dontleavehmode\underbar{\strut\char0\hskip\te= xtwidth\strut}
=A0=A0=A0 \blank
\stopxmlsetups

\startxmlsetups xml:div
=A0=A0=A0 \blank
=A0=A0= =A0 \xmlflush{#1}
=A0=A0=A0 \blank
\stopxmlsetups

\newcount\Qu= estionCounter

\startxmlsetups xml:question
=A0=A0=A0 \blank
= =A0=A0=A0 \global\advance\QuestionCounter\plusone
=A0=A0=A0 \margintitle{\the\QuestionCounter}
=A0=A0=A0 \xmlflush{#1}
= =A0=A0=A0 \blank
\stopxmlsetups

\startxmlsetups xml:review
%= =A0=A0=A0=A0 \blank
%=A0=A0=A0=A0 \xmlflush{#1}
%=A0=A0=A0=A0 \blank<= br>\stopxmlsetups

\startxmlsetups xml:am
=A0=A0 \xmlprocessdata{}{
<math xmlns=3D'http://www.w3.org/1998/Math/MathML'>
= =A0<mrow>
=A0 <msup> <mi>x</mi><mn>2</m= n> </msup>
=A0 <mo>+</mo>
=A0 <mrow>
=A0=A0=A0 <mn>4<= /mn><mi>x</mi>
=A0 </mrow>
=A0 <mo>+</m= o>
=A0 <mn>4</mn>
=A0</mrow>
</math>}{}
\stopxmlsetups

\startxmlsetups xml:br
=A0=A0=A0 \par
\stopxmlsetups

\= startxmlsetups xml:p
=A0=A0=A0 \par
\stopxmlsetups

\startxmlse= tups xml:tips
=A0=A0=A0 \blank
=A0=A0=A0 \bgroup\bf Tips: \egroup\xml= flush{#1}
=A0=A0=A0 \blank
\stopxmlsetups

\startxmlsetups xml:brbr
=A0=A0=A0 \blank
\stop= xmlsetups

\startxmlsetups xml:i
=A0=A0=A0 \bgroup\it\xmlflush{#1}= \egroup
\stopxmlsetups

\startxmlsetups xml:b
=A0=A0=A0 \bgroup= \it\xmlflush{#1}\egroup
\stopxmlsetups

\starttext
=A0=A0=A0 \xmlprocessfile{test}{whateve= r-011.xml}{}
\stoptext

\stop


now, I need your help to = use <am></am> value from input.xml and use it in \sta= rtxmlsetups xml:am \xmlprocessdataas parameter.

Thanks
Anand




On Tue, D= ec 21, 2010 at 5:03 PM, luigi scarso <luigi.scarso@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border= -left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On Tue, Dec 21, 2010 at 10:01 AM, Hans Hagen <pragma@wxs.nl> wrote:
> On 21-12-2010 8:04, Anand Raj wrote:
>>
>> Hi,
>>
>> how to map svg tags from xml and tex file.?
>
> Dump the svg blob in a file (say image-1.svg) and then use
> \extenalfigure[image-1.svg] to place it. Conversion to pdf will happen=
> automatically then
if you have inkscape installed


--
luigi
__________________________________= _________________________________________________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" target=3D"_blank"= >http://www.ntg.nl/mailman/listinfo/ntg-context
webpage =A0: http://= www.pragma-ade.nl / http://tex.aanhet.net
archive =A0: http://foundry.supelec.fr/projects/contextrev/
wiki =A0 =A0 : http:= //contextgarden.net
___________________________________________________________________________= ________

--20cf3054a45720677c0497e874af-- --===============0215430221== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0215430221==--