When I insert superscript or subscript formatting using the Insert>Formatting menu in Lyx, it leaves a large gap between the sub/super-scripted text and the preceding text. This does not happen when using math mode for sub/superscipting - only when using the formatting menu commands ("script-insert superscript" and "script-insert subscript", respectively). Note that this behaviour only affects the onscreen editing display - the rendered pdf output is fine. But it is rather irritating during editing, particularly when working on technical documents with a lot of units that have superscripts and subscripts. Is there any way to fix this behaviour so that the onscreen display in the editor does not insert these gaps? I am using Lyx 2.1.4
An example of this behaviour is shown in the image below:
The described behaviour is caused by setting LeftMargin in the document settings Local Layout.
This is because InsetLayouts (which control the layout of sub/superscripts, among other things) inherit the global margin settings, with no possibility to adjust the margin to their own values (missing feature).
A bug report ticket has been raised at http://www.lyx.org/trac/ticket/10177 to the effect that LeftMargin and RightMargin, when specified on top level, should only apply to the main text.