>Oh, well done. I was actually reading your post from yesterday when this one
>arrived ;-)
>
>Looking at the code:
>
>+InsetList::iterator Paragraph::shortTitleInset() const
>+{
>+       // Find the entry.
>+       InsetList::iterator it = insetlist.begin();
>+       InsetList::iterator end = insetlist.end();
>+       for (; it != end; ++it) {
>+               if (it.getInset()->lyxCode() == Inset::SHORTTITLE_CODE) {
>+                       return it;
>+               }
>+       }
>+       return 0;
>+}
>
>shouldn't this be
>        InsetShortTitle * Paragraph::shortTitleInset() const
>ie, I'm not interested in where it is, just in it itself.

Yes of course. It isn't just an address but a typed variable.

>Semanticly, (InsetList::iterator it == 0) is BAD.
>        
>> Problems still:
>>
>> - Can be inserted anywhere, not only in sectioning headers. Will give
>>   latexing error then.
>
>Well, you should ultimately remove your LFUN (or hide it from public view and
>just use it privately). Then the Section, Caption etc environment code (I'm
>ignorant here) will use it and nothing else.
>
>Something like:
>* Choose Title-d environment
>        code inserts an InsertShortTitle at the start of the paragraph.
>* Revert to Standard
>        "export" the contents of the InsetShortTitle to the paragraph.
>
>"Title-d environment" means Section, Subsection and probably Caption also?

Precisely.

> It looks to me like it should just work.

Famous last words :-(

>This is really, really the time where you could do with some help from
>someone who understands how this stuff works. Scream louder !

Actually I wonder if anyone *really* understands this as well as I right
now. I have an idea similar to the one above: to understand it, you
should know that it now works as follows:

For all 'LaTeX command' type paragraphs, what is output is

1)
        \command{<paragraph content>} 

if there is no shorttitle inset in it (which the above method tests
for), and

2)
        \command[<par content containing shorttitle inset>}

where the shorttitle inset outputs

        <inset content i.e. short title text>]{

As you can see, this works only by careful co-ordination. Now, if you
make the mistake of inserting a shorttitleinset into an ordinary
paragraph, say, you will end up with a lonely ]{ embedded in the LaTeX
output, giving a mysterious-looking error.

I was thinking of somehow testing for the type of the paragraph
containing the inset *from within* the inset (can this be done?) and 
suppressing the ]{ output if it is not the kind that may contain a 
short title. The inset will still be there, but 'defanged' from 
LaTeX viewpoint. What do you think?

(It's rather obvious for someone that understands what this button marked
'short' does, where inserting it makes sense and where not... but we 
should prevent people from painting themselves into corners they 
cannot easily get themselves out of. I think this proposal does that
reasonably well and is easy to implement.)

Having the section etc. itself insert an inset at the start I have
tried, and found it seriously nontrivial to do :-(

>> - No user interface yet, just M-x shorttitle-insert <RET>.
>>
>> - Captions???
>>
>> but IT WORKS!
>>
>> Martin
>>
>> PS I'm going off-line now because of power cuts. Dunno when back.
>
>Well if you will live in a 3rd world country with a fantastic standard of
>living...

Huh. I don't even have a Nokia. By design... the standard of living here 
is the forest and the lakeside, and swimming in the Baltic.

>Incidentally, why do the Scandanavian countries have such high suicide rates?
>They are fantastic places to live. I can't square that circle. No daylight in
>winter?

Hmmm yes. The suicides are irrational, Finns have a streak of morosity. 
Just listen to Sibelius. The dark winters play a role certainly, but in 
return we have these fantastic long, hot summer days, when everybody goes 
crazy. You have to see it to believe it.

Perhaps it is something about this protestant ethic of personal
responsability, the uncompromising voice of conscience. You cannot get 
rid of it by confession, but you can try to drown (dissolve?) it in 
alcohol. And the climate forces people to work hard and work together, 
and keep their promises. Something like that.

There is a beautiful article by Andrew Leonard of Salon... Doesn't give 
all the answers, but some.

http://dir.salon.com/tech/fsp/2000/04/20/chapter_six_part_1/index.html

>Angus

Martin, painfully unplugged



Reply via email to