Comments (7)
[deleted comment]
from thinkstats.
[deleted comment]
from thinkstats.
Ok, I've got a lead on this. The problem is actually in plasTeX. Tralics
generates <mfenced> tags with appropriate attributes. I had to modify
tree_cleaner to make sure the attributes survived my post-processing of the
output from tralics.
I'm pretty sure that is working now, but the attributes are still not appearing
in the DocBook output.
Here's what the plasTeX representation looks like after the tree_cleaner:
<informalequation id="a0000000057">
<mmlmath id="a0000000058">
<plastex:arg name="mode">display</plastex:arg>
<mmlmfenced id="a0000000059">
<plastex:arg name="close">]</plastex:arg>
<plastex:arg name="open">[</plastex:arg>
<plastex:arg name="separators"></plastex:arg>
<mmlmo id="a0000000060">
-</mmlmo><mmlmfrac id="a0000000061">
<mmlmn id="a0000000062">
1</mmlmn><mmlmn id="a0000000063">
2</mmlmn></mmlmfrac><mmlmsup id="a0000000064">
<mmlmfenced id="a0000000065">
<plastex:arg name="close">)</plastex:arg>
<plastex:arg name="open">(</plastex:arg>
<plastex:arg name="separators"></plastex:arg>
<mmlmfrac id="a0000000066">
<mmlmrow id="a0000000067">
<mmlmi id="a0000000068">
x</mmlmi><mmlmo id="a0000000069">
-</mmlmo><mmlmi id="a0000000070">
μ</mmlmi></mmlmrow><mmlmi id="a0000000071">
σ</mmlmi></mmlmfrac></mmlmfenced><mmlmn id="a0000000072">
2</mmlmn></mmlmsup></mmlmfenced></mmlmath></informalequation>
So at this point the tags have the appropriate attributes. But here's the
DocBook:
<informalequation><mml:math overflow="scroll" xmln
s:mml="http://www.w3.org/1998/Math/MathML"><mml:mfenced><mml:mo>-</mml:mo><mml:m
frac><mml:mn>1</mml:mn><mml:mn>2</mml:mn></mml:mfrac><mml:msup><mml:mfenced><mml
:mfrac><mml:mrow><mml:mi>x</mml:mi><mml:mo>-</mml:mo><mml:mi>μ</mml:mi></mml:mr
o
w><mml:mi>σ</mml:mi></mml:mfrac></mml:mfenced><mml:mn>2</mml:mn></mml:msup></mm
l
:mfenced></mml:math></informalequation>
No attributes.
I am looking at Renderers/DocBook/Math.zpts, which contains this:
name: mmlmfenced
<mml:mfenced tal:content="self"></mml:mfenced>
So I wonder if I am confused about this template. Tim, can you shed any light
on this?
Original comment by [email protected]
on 3 Jul 2013 at 8:51
from thinkstats.
So the element should look like this, right?
<mml: mfenced open="[" close="]">
I think the template should be:
<mml:mfenced tal:attributes="open self/attributes/open
close;self/attributes/close" tal:content="self"></mml:mfenced>
Original comment by [email protected]
on 3 Jul 2013 at 9:38
from thinkstats.
oops. <mml:mfenced tal:attributes="open self/attributes/open; close
self/attributes/close" tal:content="self"></mml:mfenced>
Original comment by [email protected]
on 3 Jul 2013 at 9:39
from thinkstats.
Yes, that worked. Thanks again, Tim!
I found a few more attributes that were not getting rendered in the MathML, and
updated the templates. I also added code that detects other attributes that
are not yet rendered and issues a warning if they get used.
Original comment by [email protected]
on 5 Jul 2013 at 6:21
from thinkstats.
Original comment by [email protected]
on 5 Jul 2013 at 6:21
- Changed state: Fixed
from thinkstats.
Related Issues (16)
- Broken link in the book HOT 3
- Remove sort side effect in thinkstats.Trim HOT 1
- Links have strange formatting, like this "❤tt♣✿✴✴❤♣✷✵✶✵" HOT 1
- Patch for /trunk/thinkbayes/book.tex HOT 1
- thinkbayes DocBook: definition of exercise environment appears in the text HOT 1
- thinkbayes DocBook: display math is too small and looks terrible HOT 8
- thinkbayes DocBook: \p{} command yields huge inline formulas HOT 3
- thinkbayes DocBook: paintball figure has dark background HOT 2
- thinkbayes DocBook: emphasis role=math does not yield italics HOT 3
- thinkbayes DocBook: tables don't have lines HOT 1
- thinkbayes DocBook: some display equations have spurious {{ HOT 2
- thinkbayes DocBook: cross references are redundant HOT 2
- thinkbayes DocBook: exercises should be labelled as exercises HOT 2
- thinkbayes DocBook: ensuremath seems to fail for inline formulas HOT 3
- thinkbayes DocBook: <bar> tag has no effect HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thinkstats.