![]() |
#1 |
Enthusiast
![]() Posts: 28
Karma: 10
Join Date: Jul 2017
Location: Austin TX USA
Device: Kindle Paperwhite Gen 11, Likebook Mars & TCL NxtPaper 11
|
MathML namespace declaration in .css not "sticking"
I'm editing a equation-heavy epub and I'm using a lot of MathML markups. I'd like for the text to be as economical as possible, so I'd like to avoid this kind of tag:
Code:
<math xmlns="http://www.w3.org/1998/Math/MathML"> ... </math> Code:
@namespace math url(http://www.w3.org/1998/Math/MathML); Code:
<math> ... </math> What am I doing wrong? Thanks in advance for any help. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
namespace declarations in CSS do not change the namespace of tags in html. They just allow css tag based selectors to use namespaces.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() Posts: 28
Karma: 10
Join Date: Jul 2017
Location: Austin TX USA
Device: Kindle Paperwhite Gen 11, Likebook Mars & TCL NxtPaper 11
|
|
![]() |
![]() |
![]() |
#4 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,149
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Have you tried modifying the <html> tag at the start of each XHTML file to read:
Code:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:math="http://www.w3.org/1998/Math/MathML"> The attached file seems to display happily in Sigil but not in calibre's ebook-editor. Last edited by DNSB; 03-04-2025 at 06:43 PM. |
![]() |
![]() |
![]() |
#5 | |
Enthusiast
![]() Posts: 28
Karma: 10
Join Date: Jul 2017
Location: Austin TX USA
Device: Kindle Paperwhite Gen 11, Likebook Mars & TCL NxtPaper 11
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,149
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Sounds like a job for a clip.
|
![]() |
![]() |
![]() |
#7 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,759
Karma: 5706256
Join Date: Nov 2009
Device: many
|
That Sigil ignores that namespace makes no sense. Adding the mathml namespace prefix "math" to the html tag and then using that prefix "math" for each math tag in the file (ie. each tag becomes math:math) should work. That is what namespace prefixes are for.
More importantly though math tags do NOT need a prefix at all under the html5 xhtml variant used for epub3 according to the spec. The math tag and its contents is autorecognized as a foreign tag (just like the svg tag) and modern parsers should understand it just fine without the need for declaring any namespace prefix for it. Have you tried without any specific namespace prefix defined for mathml at all? I wonder if this is a limitation of Qt6's webengine's new built in mathml support in some way? Update: It is not. To test with Sigil I opened an epub full of mathml and did a global find and replace to remove all of the math tag namespace declarations that said no prefix needed: ie: xmlns="http://www.w3.org/1998/Math/MathML" and made sure no mathml prefix namespace was defined on the html tag. And sure enough no parsing errors or problems at all. All equations looked as expected. So no math namespace prefix need be defined and no xmlns="http://www.w3.org/1998/Math/MathML" need be added to math tags as it is properly namespaced by the parser under the html5 xhtml variant used by epubs and by browser engines. Not sure what problems you are seeing under Sigil. Last edited by KevinH; 03-07-2025 at 06:31 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre 6.11: "Remove CSS Rules" and "Check Book" Conflicts | enuddleyarbl | Editor | 10 | 01-08-2023 08:33 AM |
In DTD declaration, language other than "EN" will generate warning message. | guidaq | Sigil | 3 | 04-07-2016 10:48 PM |
Touch "sticking" page turn button | GreenMonkey | Barnes & Noble NOOK | 2 | 10-15-2011 06:23 PM |
attribute "scheme" from namespace error in epubcheck 1.0.5 | thunderune | ePub | 15 | 06-30-2011 10:57 AM |
Namespace declaration | ChrisI | Sigil | 1 | 08-22-2010 06:02 AM |