Felix Wiemann | 1 Jan 2005 16:12
Picon

Re: How to add a tex-math role?

Alan G Isaac wrote:

> i. Are numbered and unnumbered equations to be supported?

Only unnumbered.  There's no point in numbering equations as long as
there is no way to reference them.

> iii. Are numbered split equations to be supported?  And
> related to this, is it reasonable for the LaTeX writer
> to require the amsmath package?  (I vote 'yes'.)

Sure.  If it's needed (i.e. useful) and it's contained in teTeX, it can
safely be required, IMO.

--

-- 
When replying to my email address, please ensure
that the mail header contains 'Felix Wiemann'.

http://www.ososo.de/

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
Felix Wiemann | 1 Jan 2005 16:51
Picon

Re: Partially rendered DOM / document body

Felix Wiemann wrote:

> Brian Beck wrote:
>
>> I'd like to use reSTX for what seems to be a common use of the first
>> STX in Zope -- rendering articles or pages that are still part of a
>> larger hierarchy (they aren't necessarily the whole page).  Thusly,
>> I'd only want the HTML encapsulated in the _body_ tag of the rendered
>> document.
>
> I recommend you use docutils.core.publish_parts, which returns a
> dictionary.

And now I just encountered the following issue:

>>> from docutils import examples
>>> examples.html_parts('Title\n=====\n\nParagraph 1.')['body']
u'<p>Paragraph 1.</p>\n'
>>> 

That's not what you'd expect from "body".  It's rather "fragment" (which
has the same output).  Is that a bug?

Are the parts documented anywhere, by the way?

--

-- 
When replying to my email address, please ensure
that the mail header contains 'Felix Wiemann'.

http://www.ososo.de/
(Continue reading)

Alan G Isaac | 1 Jan 2005 17:19
Picon
Favicon

Re: Re: How to add a tex-math role?

> Alan G Isaac wrote: 
>> i. Are numbered and unnumbered equations to be supported?

On Sat, 01 Jan 2005, Felix Wiemann apparently wrote:
> Only unnumbered.  There's no point in numbering equations as long as
> there is no way to reference them.

Numbered references are awfully useful.

Alternative 1:
--------------

Could substitution be used for numbering?
Something along the lines of

.. latex-math::
   :tag: |thiseq|

   f(x) = e^{x}

I want to refer to (|thiseq|).
Note how the reference is understandable in the text.

.. |thiseq| replace:: 1

The numbers can be forced with the LaTeX \tag command.
The initial implementation could rely on manual numbering,
and a later implementation could automagically number
tagged equations before writing them.

(Continue reading)

David Goodger | 1 Jan 2005 22:45
Favicon

Re: Re: Partially rendered DOM / document body

[Felix Wiemann]
 > And now I just encountered the following issue:
 >
 >>>> from docutils import examples
 >>>> examples.html_parts('Title\n=====\n\nParagraph 1.')['body']
 > u'<p>Paragraph 1.</p>\n'
 >>>>
 >
 > That's not what you'd expect from "body".  It's rather "fragment"
 > (which has the same output).

It's "body" as in "document body", not "HTML <body>".  Look at the
other parts available:

['body', 'subtitle', 'title', 'fragment', 'footer', 'header',
'stylesheet', 'meta', 'whole', 'docinfo']

You can assemble the entire document or whatever portion you want from
all the other parts.  Just wrap with <div>s as suits your application.

parts['body'] used to differ from parts['fragment']; parts['body']
used to contain <div class="document">.  But we moved the <div
class="document"> element to contain <h1 class="title"> etc.  Now they
seem to be the same.  So be it.

 > Is that a bug?

I don't think so.

 > Are the parts documented anywhere, by the way?
(Continue reading)

Beni Cherniavsky | 2 Jan 2005 01:23
Gravatar

Re: Re: How to add a tex-math role?

Alan G Isaac wrote:
>>Alan G Isaac wrote: 
>>
>>>i. Are numbered and unnumbered equations to be supported?
> 
> On Sat, 01 Jan 2005, Felix Wiemann apparently wrote:
> 
>>Only unnumbered.  There's no point in numbering equations as long as
>>there is no way to reference them.
> 
> Numbered references are awfully useful.
> 
> Alternative 1:
> --------------
> 
> Could substitution be used for numbering?
> Something along the lines of
> 
> .. latex-math::
>    :tag: |thiseq|
> 
I would call it ``:number:``!

>    f(x) = e^{x}
> 
> I want to refer to (|thiseq|).
> Note how the reference is understandable in the text.
> 
> .. |thiseq| replace:: 1
> 
(Continue reading)

Alan G Isaac | 1 Jan 2005 17:25
Picon
Favicon

Re: Re: How to add a tex-math role?

> Alan G Isaac wrote:
>> Are numbered split equations to be supported?  And
>> related to this, is it reasonable for the LaTeX writer
>> to require the amsmath package?  (I vote 'yes'.)

On Sat, 01 Jan 2005, Felix Wiemann apparently wrote:
> Sure.  If it's needed (i.e. useful) and it's contained in
> teTeX, it can safely be required, IMO.

That is great, since eqnarray has well publicized problems.
Using a split environment inside the equation (or equation*,
depending on how numbering is resolved) environment
might be the nice way to handle split equations.

fwiw,
Alan Isaac

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
Alan G Isaac | 2 Jan 2005 14:44
Picon
Favicon

Re[2]: Re: How to add a tex-math role?

On Sun, 02 Jan 2005, Beni Cherniavsky apparently wrote:
> I think automatic numbering could be written easily
> enough.  No need for manual numbering.

That would be great.

On Sun, 02 Jan 2005, Beni Cherniavsky apparently wrote:
> The question is, how to generalize it to other numberable
> things: sections, images/figures, etc.

The issues seem dual:
i. how to signal that something should be numbered,
ii. how to refer to the number

For directives like equations and images/figures,
two obvious alternatives are:
i. specify numbering explicitly (e.g.,
   :number: label
where the label is optional) on a per item
basis, so that only the requested items are
numbered
or
ii. specify numbering by the object type
somehow (e.g., say with 
.. number-equations::
directive.) Later equations with the option
   :number: anotherlabel
would then not affect numbering but simply assign
a number to a label.

(Continue reading)

Brian Beck | 3 Jan 2005 08:18
Picon
Gravatar

Re: Partially rendered DOM / document body

Felix Wiemann wrote:
>>>>from docutils import examples
>>>>examples.html_parts('Title\n=====\n\nParagraph 1.')['body']
> 
> u'<p>Paragraph 1.</p>\n'
> 
> 
> That's not what you'd expect from "body".  It's rather "fragment" (which
> has the same output).  Is that a bug?

You just want pass this setting to publish_parts or html_parts:

doctitle_xform: 0

--
Brian Beck
Adventurer of the First Order

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
Jens Jorgen Mortensen | 3 Jan 2005 15:03
Picon
Picon

Re: Re: How to add a tex-math role?

Felix Wiemann wrote:
> You don't have CVS write access, do you?  If you'd like to use CVS for
> working on the math support, please send me your SourceForge.net user
> name and I'll enable write access for you and send you links to all
> relevant documents (how to use SF.net CVS etc.).

I don't have CVS write access.  I don't know what is the best approach. 
  CVS-branch or wait for plugin support?

> Thank you.
> 
> * The MathML rendering is terrible here, but that's because I don't have
>   the necessary fonts installed on my system.  I currently don't have
>   time to learn how fonts work on X11, but I expect to get it working in
>   a week or two.

I look forward to that!  My MathML rendering is also not perfect.

> * The resulting XHTML file isn't valid, because it's using "math:*"
>   elements.  I don't know how to fix that though.

I also don't know how to fix that - there must be someone on this list 
that knows how to do it?

Jens Jørgen

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
(Continue reading)

Jens Jorgen Mortensen | 3 Jan 2005 15:03
Picon
Picon

Re: Re: [Docutils-develop] Re: How to add a tex-math role?

Alan G Isaac wrote:
> On Wed, 22 Dec 2004, Jens Jorgen Mortensen apparently wrote:
> 
>>there are currently only two
>>greek letters: alpha and epsilon.  I haven't had time to add them all.
> 
> 
> Here is the core set, properly formatted.
> Alan Isaac

Thanks!  That saved me a lot of work ;-)

Jens Jørgen

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt

Gmane