From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/77711 Path: news.gmane.org!not-for-mail From: Olivier Binda Newsgroups: gmane.comp.tex.context Subject: Struggling with ConTeXt Date: Thu, 02 Aug 2012 17:29:15 +0200 Message-ID: <501A9CCB.1010400@wanadoo.fr> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1274529426==" X-Trace: dough.gmane.org 1343921373 15907 80.91.229.3 (2 Aug 2012 15:29:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 2 Aug 2012 15:29:33 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 02 17:29:32 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 1SwxL8-0004zY-7b for gctc-ntg-context-518@m.gmane.org; Thu, 02 Aug 2012 17:29:30 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 38AF8101FD; Thu, 2 Aug 2012 17:29:29 +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 0CI9CfvyDSvL; Thu, 2 Aug 2012 17:29:26 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id EA1DD101F2; Thu, 2 Aug 2012 17:29:25 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B45C3101F2 for ; Thu, 2 Aug 2012 17:29:23 +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 2BQEXTPxwHmb for ; Thu, 2 Aug 2012 17:29:18 +0200 (CEST) Original-Received: from filter2-utr.mf.surf.net (filter2-utr.mf.surf.net [195.169.124.153]) by balder.ntg.nl (Postfix) with ESMTP id B6A29101EE for ; Thu, 2 Aug 2012 17:29:18 +0200 (CEST) Original-Received: from smtp.smtpout.orange.fr (smtp08.smtpout.orange.fr [80.12.242.130]) by filter2-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q72FTGcH003553 for ; Thu, 2 Aug 2012 17:29:17 +0200 Original-Received: from [192.168.0.11] ([88.166.223.223]) by mwinf5d68 with ME id hrVF1j00R4pomkg03rVGAJ; Thu, 02 Aug 2012 17:29:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 X-Bayes-Prob: 0.9999 (Score 4.7, tokens from: @@RPTN) X-CanIt-Geo: ip=80.12.242.130; country=FR; latitude=46.0000; longitude=2.0000; http://maps.google.com/maps?q=46.0000,2.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 04HFPth9j - a3cb5eb91f98 - 20120802 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.153 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:77711 Archived-At: This is a multi-part message in MIME format. --===============1274529426== Content-Type: multipart/alternative; boundary="------------090208070608040401090202" This is a multi-part message in MIME format. --------------090208070608040401090202 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello I'm trying to port a big 300+ pages math course full of macros from plain XeTEX to ConTeXt mark IV (ubuntu 12.04+ stand alone beta) and I'm having some difficulties, could you please help ? My questions : 1) does lxml.att("#1","some tag") really work ? the next snipet doesn't work for me: \startluacode function set(node) p = lxml.att(node,"p") -- or p = lxml.att(lxml.id(node),"p") end \stopluacode \startxmlsetups xml:section \ctxlua{set("#1")} \stopxmlsetups it looks like it returns the p attribute of the node before #1 the following snipet works though (which is strange because I looked in the context source and it gives \def\xmlatt#1#2{\ctxlua{lxml.att("#1","#2")}}...) \startxmlsetups xml:section \ctxlua{p = \xmlatt{"#1","p"}} \stopxmlsetups 2) I'm trying to export to xml and have set \setupbackend[export=yes, xhtml=yes, css=mkiv-export.css] But a) my Metafun/Tikz pictures aren't exported to svg :/ b) the exported xml has namespaces problems (like error on line 63 at column 20: Namespace prefix m on math is not defined error on line 64 at column 22: Namespace prefix m on mrow is not defined) What am I doing wrong ? (I'm compiling with "context mydoc.tex") Is there some \csname tex4ht\endcsname command or some other directive that I should use to get my xml export right ? Am I missing some namespace commands (there are lots of m:math and m:mrow mathml tags int the exported xml source, this smells like a tex4ht issue) 3) I have defined some framed text with metafun overlays (like in the Context manual) and I'm trying to type something like \inmargin{some label} \startMyFramedText...\stopMyFramedText Yet, the text in the margin is after the framed text :( (fiddling with the "location" setting (low, ..) doesn't allow me to have the in margin text right next the top of the framed text I somehow found a dirty workaround with typing a blank space \defineframedtext[Property][frame=off,background=OverlayProperty,before={}] and \inmargin{some label}\noindent\startMyFramedText...\stopMyFramedText but it's not really satisfying. (hate to lose vertical space with wandering blank spaces) Is there a better way ? 4) I'm trying to port the following TeX code to ConTeXt $$\eqalign{x&=1\cr y&=2\cr}\qquad \hbox{haha}$$ it looks like \startformula\startalign.. doesn't allow me to do that I somehow managed to have it by typing \startformula \vcenter{\starttabular[|rM|lM|] \NC x \NC =1\NC\NR \NC y \NC =2\NC\NR \stoptabular}\qquad\text{haha} \stopformula the pdf export is fine, but the xml export is awfull (because of \vcenter I guess) a) Is there a way to use tables inside math mode alongside other stuff (would be handy) ? b) what is the correct way to type the previous text, so the pdf and xml are fine in Context ? Best regards Olivier... really enjoying utf, xml, lua inside TeX as well as other nice ConTeXt features --------------090208070608040401090202 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello

I'm trying to port a big 300+ pages math course full of macros from plain XeTEX to ConTeXt mark IV (ubuntu 12.04+ stand alone beta)
and I'm having some difficulties, could you please help ?

My questions :

1) does lxml.att("#1","some tag")  really work ? 


the next snipet doesn't work for me:

\startluacode
function set(node)
p = lxml.att(node,"p") -- or p = lxml.att(lxml.id(node),"p")
end
\stopluacode

\startxmlsetups xml:section
\ctxlua{set("#1")}
\stopxmlsetups

it looks like it returns the p attribute of the node before #1

the following snipet works though (which is strange because I looked in the context source and it gives \def\xmlatt#1#2{\ctxlua{lxml.att("#1","#2")}}...)

\startxmlsetups xml:section
\ctxlua{p = \xmlatt{"#1","p"}}
\stopxmlsetups

2) I'm trying to export to xml and have set
 
\setupbackend[export=yes, xhtml=yes, css=mkiv-export.css]

But
a) my Metafun/Tikz  pictures aren't exported to svg :/
b) the exported xml has namespaces problems (like error on line 63 at column 20: Namespace prefix m on math is not defined error on line 64 at column 22: Namespace prefix m on mrow is not defined)

What am I doing wrong ? (I'm compiling with "context mydoc.tex")
Is there some \csname tex4ht\endcsname command or some other directive that I should use to get my xml export right ?
Am I missing some namespace commands (there are lots of m:math and m:mrow mathml tags int the exported xml source, this smells like a tex4ht issue)


3) I have defined some framed text with metafun overlays (like in the Context manual)
and I'm trying to type something like

\inmargin{some label}
\startMyFramedText...\stopMyFramedText

Yet, the text in the margin is after the framed text :(
(fiddling with the "location" setting (low, ..) doesn't allow me to have the in margin text right next the top of the framed text

I somehow found a dirty workaround with typing a blank space

\defineframedtext[Property][frame=off,background=OverlayProperty,before={}]

and
\inmargin{some label}\noindent\startMyFramedText...\stopMyFramedText

but it's not really satisfying. (hate to lose vertical space with wandering blank spaces)

Is there a better way ?

4) I'm trying to port the following TeX code to ConTeXt

$$\eqalign{x&=1\cr y&=2\cr}\qquad \hbox{haha}$$

it looks like \startformula\startalign.. doesn't allow me to do that
I somehow managed to have it by typing

\startformula
\vcenter{\starttabular[|rM|lM|]
\NC x \NC =1\NC\NR
\NC y \NC =2\NC\NR
\stoptabular}\qquad\text{haha}
\stopformula

the pdf export is fine, but the xml export is awfull (because of \vcenter I guess)


a) Is there a way to use tables inside math mode alongside other stuff (would be handy) ?
b) what is the correct way to type the previous text, so the pdf and xml are fine in Context ?

Best regards
Olivier... really enjoying utf, xml, lua inside TeX as well as other nice ConTeXt features

--------------090208070608040401090202-- --===============1274529426== 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 ___________________________________________________________________________________ --===============1274529426==--