On Sunday 16 November 2008 03:43:04 pm rgheck wrote:
> Nick Bell wrote:
> > Dear LyXians,
> >
> > Despite doing my best looking through the wiki and email archives, I'm
> > stumped, and I think I'd better ask for help.
> >
> > I'd like to use \textsuperscript{} and \textsubscript{} (available in
> > the KOMA-script classes) to generate 'true' super- and sub-scripts. I
> > can do this with ERT of course, but it looks ugly and interrupts the
> > flow of reading.
> >
> > Is there a way in which I can add a new style (?char style ?inset) so
> > that all I see of the \textsuperscript{XYZ} is the parameter, i.e. XYZ
> > (perhaps in some particular font).
> >
> > I think I need to be creating a new InsetLayout, but I don't know
> > exactly what to put in the file or where to save it for it to be
> > accessible as a module.
>
> Yes, that's what you need. Try something like this:
>
> #\DeclareLyXModule{TextSuperSub}
> #DescriptionBegin
> #Adds an endnote inset, in addition to footnotes. You will need to add
> #\theendnotes in ERT where you want the endnotes to appear.
> #DescriptionEnd
>
> Format 11
>
> InsetLayout Custom:Superscript
> LyXType custom
> LatexName textsuperscript
> LatexType command
> Decoration classic
> Font
> Size Small
> EndFont
> MultiPar false
> LabelString super
> End
>
> and something similar for subscripts. Save it to textsupersub.module in
> your LyX layouts directory and reconfigure. You can tweak it as you wish.
>
> Documentation is in the Customization manual, section 5.3.6. Look at
> endnotes.module and the other modules for more ideas.
>
> FYI, if you add something to the preamble so this can be used with
> non-Koma classes, e.g.:
> \ifx\textsuperscript\undefined{
> \newcommand\textsuperscript{...}
> \fi
> this could be included in 1.6.x. Often requested.
>
> rh
In addition, if Nick needs this type of thing for several different uses
(superscript for quantities of atoms in a molecule vs. superscript for (R)),
then he should have one of these things for each one. That way, if he later
wants to make atom quantities bigger or smaller or bold but leave (R) alone,
he can do so.
SteveT
Steve Litt
Recession Relief Package
http://www.recession-relief.US