Also try to copy all versions of an included reference.
The example is the search for CV-image in Modern_CV.lyx.
The two file (CV-image.eps and CV-image.png) have to be copied while
keeping the same base name.
Thanks to \origin, #8643 is fixed (also in stable). Included paths are
thus correctly updated and point to the systemdir.
This only works if LyX is installed, though, since \origin is only set
on install.
Attempt to save the template in the appropriate language subfolder of
the user template directory (and propose to create it if it doesn't exist
yet).
That way, user-generated templates (1.) get the correct language attribution
in the lyxfiles dialog and (2.) users can easily generate different
language versions of a template.
Several changes are needed to get things right:
* nested supersripts only work with inheritFonts=true.
* to get caret position right, it is necessary to remember the outside
font of the inset before computing metrics.
* to get the size right at insertion time, it is necessary to trigger
a metrics computation just after inset insertion.
While math style (scriptstyle,...) is not really something that can be
set, it is useful for text subscripts and superscripts and therefore
it makes sense to handle it in some places.
With this change, style is still not a first class feature, but good
enough for now. In particular, it is taken into account in update().
* "platex" fails with "inputencoding default", if there is text in other languages.
"jis-platex" works fine, "jis-utf8" fails with German Umlauts (maybe more).
* The expert setting "inputencoding default" switches the inpute encoding
with language switches without marking this in the LaTeX source.
It is rarely required (if ever) and makes documents easy to break.
It is not required for AMS Books, Simple CV, ... (probabely a tex2lyx issue).
"utf8" and "auto" work fine.