Hello, Has anyone come up with a sense making way of coding units in XML and mapping them onto ConTeXt's 'units' module ... makes a knot in my brain ... Thnaks, Joh
Johannes Graumann wrote:
Hello,
Has anyone come up with a sense making way of coding units in XML and mapping them onto ConTeXt's 'units' module ... makes a knot in my brain ...
there is a manual on the website ... physml the old module: \usemodule[physml] the new one (newmml): \usemodule[newmmu] as in: \usemodule[newmmu] \starttext Quick and dirty in||line units: \startbuffer <phys> <cn> 10 </cn> <cu> <Newton/> <Square/> <Meter/> <Per/> <Sec/> </cu> </phys> \stopbuffer \typebuffer \processXMLbuffer A more \MATHML||like unit application: \startbuffer <phys> <apply> <unit/> <cn> 10 </cn> <csymbol> <Square/> <Meter/> <Per/> <Sec/> </csymbol> </apply> </phys> \stopbuffer \typebuffer \processXMLbuffer A bit more compact: \startbuffer <phys> <apply> <unit/> <cn> 10 </cn> <cu> <Square/> <Meter/> <Per/> <Sec/> </cu> </apply> </phys> \stopbuffer \typebuffer \processXMLbuffer A bit more complicated: \startbuffer <phys> <apply> <unit/> <apply> <divide/> <ci> a </ci> <cn> 10 </cn> </apply> <cu> <Square/> <Meter/> <Per/> <Sec/> </cu> </apply> </phys> \stopbuffer \typebuffer \processXMLbuffer An alternative (equivalent) for \type {</cu>}: \startbuffer <phys> <apply> <unit/> <cn> 10 </cn> <cunseq> <Square/> <Meter/> <Per/> <Sec/> </cunseq> </apply> </phys> \stopbuffer \typebuffer \processXMLbuffer \stoptext 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 -----------------------------------------------------------------
<phys><apply><unit/><cn>4</cn><csymbol><Degrees/><Celsius/></csymbol></apply></phys> works with physml, but not with newmmu. Geee, looks like I'm starting to find things in the guts of this ;0) Joh P.S.: What's your favorite beer/drink? Joh
Something else: How to define a custom unit (basepairs, bp) with physml/units? Joh Johannes Graumann wrote:
<phys><apply><unit/><cn>4</cn><csymbol><Degrees/><Celsius/></csymbol></apply></phys>
works with physml, but not with newmmu.
Geee, looks like I'm starting to find things in the guts of this ;0)
Joh
P.S.: What's your favorite beer/drink?
Joh
Johannes Graumann wrote:
Something else: How to define a custom unit (basepairs, bp) with physml/units?
something \unit [Basepairs] {bp} {Base Pairs} \defineXMLsingular [Basepairs] {\handlePMLunit\Basepairs} ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Johannes Graumann wrote:
<phys><apply><unit/><cn>4</cn><csymbol><Degrees/><Celsius/></csymbol></apply></phys>
works with physml, but not with newmmu.
newmmu is now newpml and works with newmml (the old and new methods cannot be used mixed because they use completely different internals [direct xml handling using stacks versus xml->tex expansion] Hans
Hans Hagen wrote:
newmmu is now newpml and works with newmml (the old and new methods cannot be used mixed because they use completely different internals [direct xml handling using stacks versus xml->tex expansion] system : module newpml not found system : module newmml not found system : module newcml not found
Is the answer to '\usemodule[newpml,newmml,newcml]'. What am I doing wrong? Joh
Johannes Graumann wrote:
Hans Hagen wrote:
newmmu is now newpml and works with newmml (the old and new methods cannot be used mixed because they use completely different internals [direct xml handling using stacks versus xml->tex expansion]
system : module newpml not found system : module newmml not found system : module newcml not found
Is the answer to '\usemodule[newpml,newmml,newcml]'. What am I doing wrong?
newcml is in the making (not that hard, will do that asap) the other x-new* modules will be in the new current i'll upload (i saw that i'd forgotten to included them) 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 -----------------------------------------------------------------
Hans, Since you seem to be working on this: when using inline physml I noticed that <phys><apply><unit/><cn>1</cn><csymbol><Micro/><Gram/><Per/><Milli/><Liter/></csymbol></apply></phys> when used in a figure caption formated like this: \setupcaptions[style=small,width=\textwidth] does not scale properly - it remains at 12pt, since \setupbodyfont[12pt,modern]. Joh Hans Hagen wrote:
Johannes Graumann wrote:
Hans Hagen wrote:
newmmu is now newpml and works with newmml (the old and new methods cannot be used mixed because they use completely different internals [direct xml handling using stacks versus xml->tex expansion]
system : module newpml not found system : module newmml not found system : module newcml not found
Is the answer to '\usemodule[newpml,newmml,newcml]'. What am I doing wrong?
newcml is in the making (not that hard, will do that asap)
the other x-new* modules will be in the new current i'll upload (i saw that i'd forgotten to included them)
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 -----------------------------------------------------------------
Johannes Graumann wrote:
Hans,
Since you seem to be working on this: when using inline physml I noticed that <phys><apply><unit/><cn>1</cn><csymbol><Micro/><Gram/><Per/><Milli/><Liter/></csymbol></apply></phys> when used in a figure caption formated like this: \setupcaptions[style=small,width=\textwidth]
does not scale properly - it remains at 12pt, since \setupbodyfont[12pt,modern].
small == \tfx what you need is a full switch: style=smallbodyfont (or as command \smallbodyfont) ... wikify ... 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 -----------------------------------------------------------------
Johannes Graumann wrote:
How would I add singlespacedness to the command above?
i dunno what that is 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 -----------------------------------------------------------------
How would I add singlespacedness to the command above? i dunno what that is Serves me right ... coming up with my own lingo ... my document is doubly spaced (\setupinterlinespace[line=2\bodyfontsize]) and I was trying to get
Hans Hagen wrote: the float captions singly spaced. Have stuffed commands like '\setupinterlinespace[small]' (which I believe is the ConTeXt default) pretty much anywhere I can think of into '\setupcaptions[style=smallbodyfont,width=\textwidth]', but can't figure it out. Was hoping you could toss me another bone ... Joh
Johannes Graumann wrote:
Hans Hagen wrote:
How would I add singlespacedness to the command above?
i dunno what that is
Serves me right ... coming up with my own lingo ... my document is doubly spaced (\setupinterlinespace[line=2\bodyfontsize]) and I was trying to get the float captions singly spaced. Have stuffed commands like '\setupinterlinespace[small]' (which I believe is the ConTeXt default) pretty much anywhere I can think of into '\setupcaptions[style=smallbodyfont,width=\textwidth]', but can't figure it out. Was hoping you could toss me another bone ...
\starttext \setupinterlinespace[line=4.2ex] \setupcaptions[style={\setupinterlinespace[line=2.8ex]}] \input tufte \placefigure{\input tufte\relax}{} \input tufte \stoptext ----------------------------------------------------------------- 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 -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Johannes Graumann