Message Boards Message Boards

0
|
10252 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Getting equation numbers upon Exporting as HTML

Posted 10 years ago
Attachments:
POSTED BY: David Reiss
5 Replies

I have slightly updated the notebook attached to my first post.

It now contains two Sections with an explicitly included autonumbering object at the start of each. These both export properly to HTML.

In the second Section there is also a Section cell which has a reference autonumbering object which points to the first Section cell (which has a CellTag for this purpose). It works correctly in the notebook--it displays the number 1 -- but when exported as HTML it displays incorrectly: it displays as 3.

This is a picture of the new notebook:

enter image description here

POSTED BY: David Reiss

David:

I looked at your revised notebook a while ago. I did not post because the sections autonumbering is hard coded on export. So the reference to section 1, increments wrongly and is hard coded to "3". So there is no css to fix, so one would need to fix the HTML export "ConversionRules" for the Cell of style Section. I did not look any further. It would mean digging into Mathematica stylesheets and other functionality; have not done work this area of M in 10 years.

POSTED BY: Hans Michel

Thank you Hans. I did report this as a bug to WRI and it is in their bugs database. So perhaps it will get handled at some point. I don't imagine that this is avery high priority bug though... so we'll see.

POSTED BY: David Reiss
POSTED BY: David Reiss

David: The Wolfram Language Export HTML with MathML will produce an Automatic CSS file in the "HTMLFiles"directory. Since the file you are exporting is called "test.html" the CSS file created will be called "test.css". With the setting you currently have you then just need to modify the CSS file in the following way to go off the "DisplayFormulaNumbered" class generated in the p element MathML wrapper:

<p class="DisplayFormulaNumbered">
  1. In the CSS file after html rule add a body rule to reset the counter variable we'll call equation

html { font-size: 12px; padding: 8px; } body { counter-reset: equation; }

  1. Find the .DisplayFormulaNumbered rule and add the following rule

    .DisplayFormulaNumbered { font-size: 14px; font-family: Arial; color: #333333; margin-left: 66px; padding: 8px; } /* equation counter */
    p.DisplayFormulaNumbered:after { content: "(" counter(equation) ")"; counter-increment: equation; font-size: 14px; font-family: Arial; color: #333333; display: block; float: right; margin-right: 10px; }

Depending on web browser this should work.

POSTED BY: Hans Michel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract