Remove special \verb space handling now that space is in Typewriter-Regular (#1258)

* Remove special \verb space handling now that space is in Typewriter-Regular

* Fix screenshots
This commit is contained in:
Erik Demaine
2018-05-07 21:07:53 -04:00
committed by Kevin Barabash
parent b74b2374e2
commit ba24d2073b
5 changed files with 3 additions and 13 deletions

View File

@@ -25,18 +25,8 @@ defineFunction({
// \verb enters text mode and therefore is sized like \textstyle
const newOptions = options.havingStyle(options.style.text());
for (let i = 0; i < text.length; i++) {
if (text[i] === '\xA0') { // spaces appear as nonbreaking space
// The space character isn't in the Typewriter-Regular font,
// so we implement it as a kern of the same size as a character.
// 0.525 is the width of a texttt character in LaTeX.
// It automatically gets scaled by the font size.
const rule = buildCommon.makeSpan(["mord", "rule"], [], newOptions);
rule.style.marginLeft = "0.525em";
body.push(rule);
} else {
body.push(buildCommon.makeSymbol(text[i], "Typewriter-Regular",
group.mode, newOptions, ["mathtt"]));
}
body.push(buildCommon.makeSymbol(text[i], "Typewriter-Regular",
group.mode, newOptions, ["mord", "texttt"]));
}
buildCommon.tryCombineChars(body);
return buildCommon.makeSpan(
@@ -46,7 +36,7 @@ defineFunction({
mathmlBuilder(group, options) {
const text = new mathMLTree.TextNode(buildCommon.makeVerb(group, options));
const node = new mathMLTree.MathNode("mtext", [text]);
node.setAttribute("mathvariant", buildCommon.fontMap["mathtt"].variant);
node.setAttribute("mathvariant", "monospace");
return node;
},
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB