ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Struggling with ConTeXt
@ 2012-08-02 15:29 Olivier Binda
  2012-08-02 15:43 ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Olivier Binda @ 2012-08-02 15:29 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 2904 bytes --]

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


[-- Attachment #1.2: Type: text/html, Size: 5609 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-08-22 10:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-02 15:29 Struggling with ConTeXt Olivier Binda
2012-08-02 15:43 ` Aditya Mahajan
2012-08-02 15:47   ` Aditya Mahajan
2012-08-03  6:35   ` Olivier Binda
2012-08-03 10:10     ` Hans Hagen
2012-08-03 14:50       ` Sietse Brouwer
2012-08-03 16:14         ` Hans Hagen
2012-08-05  9:35         ` Thomas A. Schmitz
2012-08-20 22:27   ` Olivier Binda
2012-08-22  4:54     ` Aditya Mahajan
2012-08-22  8:21       ` Olivier Binda
2012-08-22  8:42         ` Aditya Mahajan
2012-08-22 10:31           ` Olivier Binda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).