mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-21 21:06:23 +00:00
Fix erroneous whitespace before and after math preview (#13127)
This commit is contained in:
parent
0c004a7566
commit
40dd37089d
@ -258,8 +258,13 @@ def legacy_latex_file(latex_file, fg_color, bg_color):
|
||||
tmp.write(b"""
|
||||
\\usepackage[%s,tightpage]{preview}
|
||||
\\makeatletter
|
||||
\\g@addto@macro\\preview{\\leavevmode\\begingroup\\color{lyxbg}\\special{background \\current@color}\\special{ps::clippath fill}\\color{lyxfg}}
|
||||
\\g@addto@macro\\endpreview{\\endgroup}
|
||||
\\ifdefined\\AddToHook
|
||||
\\AddToHook{env/preview/before}{\\leavevmode\\begingroup\\color{lyxbg}\\special{background \\current@color}\\special{ps::clippath fill}\\color{lyxfg}}
|
||||
\\AddToHook{env/preview/after}{\\endgroup}
|
||||
\\else
|
||||
\\g@addto@macro\\preview{\\leavevmode\\begingroup\\color{lyxbg}\\special{background \\current@color}\\special{ps::clippath fill}\\color{lyxfg}}
|
||||
\\g@addto@macro\\endpreview{\\endgroup}
|
||||
\\fi
|
||||
\\let\\pr@set@pagerightoffset\\@empty
|
||||
\\ifx\\pagerightoffset\\@undefined\\else
|
||||
\\def\\pr@set@pagerightoffset{\\ifnum\\pagedirection=1
|
||||
|
@ -883,7 +883,8 @@ void InsetMathHull::preparePreview(DocIterator const & pos,
|
||||
if (lsize != "normalsize" && !prefixIs(lsize, "error"))
|
||||
setfont += from_ascii("\\" + lsize + '\n');
|
||||
|
||||
docstring const snippet = macro_preamble + setfont + latexString(*this) + endfont;
|
||||
docstring const snippet = macro_preamble + setfont
|
||||
+ trim(latexString(*this), "\n") + endfont;
|
||||
LYXERR(Debug::MACROS, "Preview snippet: " << snippet);
|
||||
preview_->addPreview(snippet, *buffer, forexport);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user