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
@@ -25,18 +25,8 @@ defineFunction({
|
|||||||
// \verb enters text mode and therefore is sized like \textstyle
|
// \verb enters text mode and therefore is sized like \textstyle
|
||||||
const newOptions = options.havingStyle(options.style.text());
|
const newOptions = options.havingStyle(options.style.text());
|
||||||
for (let i = 0; i < text.length; i++) {
|
for (let i = 0; i < text.length; i++) {
|
||||||
if (text[i] === '\xA0') { // spaces appear as nonbreaking space
|
body.push(buildCommon.makeSymbol(text[i], "Typewriter-Regular",
|
||||||
// The space character isn't in the Typewriter-Regular font,
|
group.mode, newOptions, ["mord", "texttt"]));
|
||||||
// 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"]));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
buildCommon.tryCombineChars(body);
|
buildCommon.tryCombineChars(body);
|
||||||
return buildCommon.makeSpan(
|
return buildCommon.makeSpan(
|
||||||
@@ -46,7 +36,7 @@ defineFunction({
|
|||||||
mathmlBuilder(group, options) {
|
mathmlBuilder(group, options) {
|
||||||
const text = new mathMLTree.TextNode(buildCommon.makeVerb(group, options));
|
const text = new mathMLTree.TextNode(buildCommon.makeVerb(group, options));
|
||||||
const node = new mathMLTree.MathNode("mtext", [text]);
|
const node = new mathMLTree.MathNode("mtext", [text]);
|
||||||
node.setAttribute("mathvariant", buildCommon.fontMap["mathtt"].variant);
|
node.setAttribute("mathvariant", "monospace");
|
||||||
return node;
|
return node;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |