]> git.lyx.org Git - features.git/commit
Fix bug #8305: ^ symbol does not render into upward arrow when using mhchem
authorEnrico Forestieri <forenr@lyx.org>
Mon, 20 Aug 2012 23:30:51 +0000 (01:30 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 20 Sep 2012 11:39:37 +0000 (13:39 +0200)
commit0e33060337266bbc49a1af348913e57ae0e8ef86
treed83357535e390f32f50b8769bfb04cadd66abd7b
parent17177aaf3ff383ed944c177ddc98186f74998ce2
Fix bug #8305: ^ symbol does not render into upward arrow when using mhchem

The mhchem package treats the caret both as a shorthand for \uparrow or
as a superscript operator according to whether it is surrounded by
spaces or not. The \ce and \cf insets allow inserting spaces but there
is no provision for inserting a space after the caret, which is always
considered by LyX as a superscript operator. The solution here is to
insert a space after the caret if the superscript is empty or an empty
brace inset.

Mathed does not allow empty superscripts, so an empty brace has to be
inserted when working in LyX. On the other hand, when importing latex
code, an empty superscript is retained.

This has no effect whatsoever for normal latex code, as a space after
the caret is ignored. In any case, the output is only changed if an
empty brace inset is used as superscript. Specifically, the output is
changed from "^{{}}" to "^ {}".

(cherry picked from commit f251e0189279147cbf20c4b4ad4ba4256396fd44)
src/mathed/InsetMathScript.cpp
status.20x