Page MenuHomePhabricator

texhtml needs nowrap
Closed, DeclinedPublic

Description

Author: giecrilj

Description:
Please add this definition:
span.texhtml { white-space: nowrap }
It is needed because PNG formulae do not wrap, so neither should they in HTML.


Version: unspecified
Severity: enhancement

Details

Reference
bz10438

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:49 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz10438.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

On consideration, reverted in r24692. Isn't the correct behavior for inline LaTeX to wrap normally? I'm almost certain that's the case.

giecrilj wrote:

  1. MediaWiki need not obey LaTeX conventions to the point. LaTeX is for typesetting high-quality articles; MediaWiki is for looking up knowledge. The browser space is not as limited as the paper space is (especially in scientific periodicals).
  1. TeX normally wraps inline mathematics but only inside blocks. If you insist, you can follow this convention exactly by means of the following rule:

    span.html span { white-space:nowrap }

Please reconsider.

ayg wrote:

What do you mean by "only inside blocks"? What elements is that selector meant to select? (Did you mean span.texhtml?)

giecrilj wrote:

My latest comment contains two mistakes, of course.
TeX wraps only *outside* of any TeX block in math mode.
The rule
span.texhtml span { white-space:nowrap }
inhibits breaking lines within spans inside formulas, to match the TeX behaviour to the point.
The rule
span.texhtml { white-space:nowrap }
inhibits breaking formulas anywhere.

ayg wrote:

What's an example of where this would make a difference again?

giecrilj wrote:

<?xml version="1.0"
?><!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" [

<!ENTITY sample
"<br />Consider the following equation:
<span class='texhtml'

0 = <span >0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0</span ></span >" >

]><html xmlns="http://www.w3.org/1999/xhtml"

<head
<title >Illustration to MediaWiki Bug 10438</title
<style type="text/css" >

.texhtml { background: yellow; }
.nowrap .texhtml { white-space: nowrap }
.outerwrap .texhtml span { white-space: nowrap }
</style ></head

<body
<p
The following list shows the effect of various style declarations

on how inline formulae are rendered.
Play with the window width to make the equations wrap.</p

<p >default: &sample;</p ><p class="nowrap" >texvc: &sample;</p
<p class="outerwrap" >TeX: &sample;</p ></body ></html >

giecrilj wrote:

Of course the outermost classes are artificial to put all formula presentation modes into the same document.
I am also asking for the rule
span.texhtml span.composite { word-spacing: -.1ex }
for typesetting things like "arc sin <var >x</var >".
See http://en.wikipedia.org/wiki/Template:Macomp.

giecrilj wrote:

And Microsoft Internet Explorer needs
span.texhtml { font-family: Cambria, serif }
because "serif" resolves to Times New Roman which does not have combining diacritical marks (only precomposed characters).

giecrilj wrote:

Actually Microsoft Internet Explorer needs
span.texhtml { font-family: "Cambria Math", serif }
/* otherwise it cannot display &lang; and &rang; */
span.texhtml var, span.texhtml i { font-family: Cambria, serif }
/*
because Cambria Math does not have an italic version
and Times New Roman does not have combining diacritical marks */