[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: no-op brace command not starting a paragraph for mixing with raw out
From: |
Patrice Dumas |
Subject: |
Re: no-op brace command not starting a paragraph for mixing with raw output |
Date: |
Wed, 21 Dec 2022 16:17:09 +0100 |
On Tue, Dec 20, 2022 at 05:30:22PM +0000, Gavin Smith wrote:
> On Tue, Dec 20, 2022 at 12:02:30AM +0100, Patrice Dumas wrote:
>
> It can be done if there are no special characters in the title:
Actually, I completely forgot that @-commands are expanded in output
format raw blocks. This solves most of this specific issue. There
could still be some cases where the code is not inline, yet using a
block is not practical, for instance if it happens on a line, but it
should be fairly unusual.
> @ifdocbook
> @macro cartouchetitle {title}
> @docbook
> <title>\title\</title>
> @end docbook
> @end macro
> @end ifdocbook
>
> This may break if any special characters occur in the title:
Indeed, the text in a raw/rawpreformatted type in which special
characters are not escaped. This is problematic in that specific case,
but I still think that it is better than the other possibility, ie
considering that it is normal text.
> This may not be a problem as long as the user avoids using characters
> in titles that are special in any output format. Otherwise the user
> would have to take care of escaping the characters for each output format.
It could be possible to use a user defined @macro for the escapable
characters and expand something protected in docbook as it appears in a
raw @docbook block and not in the other formats. This looks the best
here for me.
> Adding a new @-command is a possibility here although I'm not sure if it
> would be necessary or how well it could work.
It could solve the specific issue about < not protected, but I do not
think that it is needed, having @-commands expanded is good enough in my
opinion.
> What happens when the
> character needs to be escaped in different ways depending on the context
> in the output format? For example, in LaTeX output, special characters
> may be escaped differently in math mode, \ being \textbackslash{} in
> text mode and \mathtt{\backslash{}} in math mode.
It is a quite theoretical case, considering that it is normal text
context would probably work in most cases.
In any case, I propose postponing until there is a clearer use case that
needs mixing output format, @-commands and protected text not in a
paragraph.
--
Pat