On 08/11/2016 07:43 AM, Bernt Lie wrote:
>
> Preliminaries: I use Windows 10 with LyX 2.2.1.
>
>  
>
> I need to have some symbol to close Examples. Here is what I do:
>
> ·         I change the first paragraph in an example from Standard to
> Example. This allows me to number the example, and I can insert a
> marker/label so that I can refer to the example.
>
> ·         I choose to let the subsequent paragraphs within the example
> be standard paragraphs, so that I am not limited by the layout
> constraints within theorem-like elements.
>

What is the problem here?

> ·         I then need some symbol to indicate the end of an example (I
> would need that anyway, because LyX seems to typeset example “body
> text” in roman font, contrary to the default of “old LaTeX” –
> personally, I welcome this, because example text is often lengthy, and
> it looks bad with a lengthy text in italic...)
>
> ·         OK – the symbol I have chosen to close the example is:
> “Horizontal fill” + math symbol “\blacktriangle”. This will push a
> black (upward pointing) triangle to the right margin. The triangle is
> supposed to point into the example...
>
> ·         Is there a way that I can give a **name** to this
> combination of “Horizontal fill” + “black triangle”, so that I can
> easily insert it? I’d like to call it “endex” (end-of-example), or
> something like that. How can I insert this “user defined” combination
> (“fragment”) into the LyX document with a simple keyboard short-cut?
>

Two answers.

To do this the way you describe, simply do it the way you could do it in
LaTeX:
    \newcommand\endex{\hfill$\blacktriangle$}
Then put "\endex" in TeX code where you need it.

A better way to do it would be to define your own environment, one that
ended this way. To do so, I'd suggest mimicking or modifying the proof
environment. There's an issue about how the closing symbol is handled
when the line is long, one you'll likely see if you do this the first
way. The proof environment contains code to handle that, which you can
simply adapt.

Obviously, that means getting yourself into the LaTeX code, but that's
inevitable if you want to do this kind of customization.

Richard

PS It's possible there are LaTeX packages that would help with this. You
might try asking at stack exchange.

Reply via email to