* Units and XML
@ 2006-04-07 6:36 Johannes Graumann
2006-04-07 7:36 ` Hans Hagen
0 siblings, 1 reply; 14+ messages in thread
From: Johannes Graumann @ 2006-04-07 6:36 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-07 6:36 Units and XML Johannes Graumann
@ 2006-04-07 7:36 ` Hans Hagen
2006-04-07 17:10 ` Johannes Graumann
0 siblings, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2006-04-07 7:36 UTC (permalink / raw)
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
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-07 7:36 ` Hans Hagen
@ 2006-04-07 17:10 ` Johannes Graumann
2006-04-07 17:24 ` Johannes Graumann
2006-04-08 8:52 ` Hans Hagen
0 siblings, 2 replies; 14+ messages in thread
From: Johannes Graumann @ 2006-04-07 17:10 UTC (permalink / raw)
<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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-07 17:10 ` Johannes Graumann
@ 2006-04-07 17:24 ` Johannes Graumann
2006-04-11 21:21 ` Hans Hagen
2006-04-08 8:52 ` Hans Hagen
1 sibling, 1 reply; 14+ messages in thread
From: Johannes Graumann @ 2006-04-07 17:24 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-07 17:10 ` Johannes Graumann
2006-04-07 17:24 ` Johannes Graumann
@ 2006-04-08 8:52 ` Hans Hagen
2006-04-09 18:02 ` Johannes Graumann
1 sibling, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2006-04-08 8:52 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-08 8:52 ` Hans Hagen
@ 2006-04-09 18:02 ` Johannes Graumann
2006-04-09 20:11 ` Hans Hagen
0 siblings, 1 reply; 14+ messages in thread
From: Johannes Graumann @ 2006-04-09 18:02 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-09 18:02 ` Johannes Graumann
@ 2006-04-09 20:11 ` Hans Hagen
2006-04-09 20:36 ` Johannes Graumann
0 siblings, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2006-04-09 20:11 UTC (permalink / raw)
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
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-09 20:11 ` Hans Hagen
@ 2006-04-09 20:36 ` Johannes Graumann
2006-04-10 17:45 ` Hans Hagen
0 siblings, 1 reply; 14+ messages in thread
From: Johannes Graumann @ 2006-04-09 20:36 UTC (permalink / raw)
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
> -----------------------------------------------------------------
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-09 20:36 ` Johannes Graumann
@ 2006-04-10 17:45 ` Hans Hagen
2006-04-10 21:26 ` Johannes Graumann
0 siblings, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2006-04-10 17:45 UTC (permalink / raw)
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
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-10 17:45 ` Hans Hagen
@ 2006-04-10 21:26 ` Johannes Graumann
2006-04-10 22:10 ` Hans Hagen
0 siblings, 1 reply; 14+ messages in thread
From: Johannes Graumann @ 2006-04-10 21:26 UTC (permalink / raw)
Hans Hagen wrote:
> what you need is a full switch: style=smallbodyfont (or as command
> \smallbodyfont)
\setupcaptions[style=smallbodyfont,width=\textwidth]
did it. Thanks.
> ... wikify ...
Thesis first than this ;0)
How would I add singlespacedness to the command above?
Joh
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-10 21:26 ` Johannes Graumann
@ 2006-04-10 22:10 ` Hans Hagen
2006-04-10 22:14 ` Johannes Graumann
0 siblings, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2006-04-10 22:10 UTC (permalink / raw)
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
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-10 22:10 ` Hans Hagen
@ 2006-04-10 22:14 ` Johannes Graumann
2006-04-10 22:38 ` Hans Hagen
0 siblings, 1 reply; 14+ messages in thread
From: Johannes Graumann @ 2006-04-10 22:14 UTC (permalink / raw)
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 ...
Joh
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-10 22:14 ` Johannes Graumann
@ 2006-04-10 22:38 ` Hans Hagen
0 siblings, 0 replies; 14+ messages in thread
From: Hans Hagen @ 2006-04-10 22:38 UTC (permalink / raw)
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
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Units and XML
2006-04-07 17:24 ` Johannes Graumann
@ 2006-04-11 21:21 ` Hans Hagen
0 siblings, 0 replies; 14+ messages in thread
From: Hans Hagen @ 2006-04-11 21:21 UTC (permalink / raw)
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
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2006-04-11 21:21 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-07 6:36 Units and XML Johannes Graumann
2006-04-07 7:36 ` Hans Hagen
2006-04-07 17:10 ` Johannes Graumann
2006-04-07 17:24 ` Johannes Graumann
2006-04-11 21:21 ` Hans Hagen
2006-04-08 8:52 ` Hans Hagen
2006-04-09 18:02 ` Johannes Graumann
2006-04-09 20:11 ` Hans Hagen
2006-04-09 20:36 ` Johannes Graumann
2006-04-10 17:45 ` Hans Hagen
2006-04-10 21:26 ` Johannes Graumann
2006-04-10 22:10 ` Hans Hagen
2006-04-10 22:14 ` Johannes Graumann
2006-04-10 22:38 ` Hans Hagen
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).