melmothx / text-amuse

Text::Amuse parser
http://www.amusewiki.org
5 stars 2 forks source link

Short title form for ToC #57

Closed melmothx closed 4 years ago

melmothx commented 4 years ago

While using Text::Amuse I'm encountering the problem that it's desirable to have an alternate (usually shorter) version of a chapter/section title different than the one typeset in the body.

The problem is well known and LaTeX macros have support for it. The problem how to add it to Muse in a decent form. I was thinking about this:

** Very long chapter [[Long chapter]]

Where the double square brackets instead of the link (which is not parsed as such anyway) it's considered the alternate version.

So short form would go after the title, in the same block, between double square brackets.

@link2xt Comments? Ideas?

link2xt commented 4 years ago

I would rather place short title first, because long title can be multi-line in Text::Amuse. And I am not sure about square brackets: what happens if some text goes after them? In LaTeX it makes sense because it is how optional arguments for macros work, but here I do not see the need to mark the end of title and deal in parser with the case when it is terminated incorrectly.

Maybe something like this:

 ** Short title | Very long
chapter title

We can reuse | because there can be no tables in the title anyway.

melmothx commented 4 years ago

@link2xt Ok, agreed on the syntax, it makes sense.

melmothx commented 4 years ago

Done and released on CPAN and packages.amusewiki.org