Skip to main content
11 events
when toggle format what by license comment
Jun 22, 2019 at 0:38 comment added Phelype Oleinik @siracusa Oh, yes, that one really comes in handy when debugging things with catcode changes. Glad it helped :-) Sorry it doesn't answer your question, but I don't think there's much that can be done. The space after the | can be added with a ~ circumventing the lack of space in expl3 syntax. The space after the control sequences is a harder problem, because when TeX reads the token list it inserts those spaces, but when it makes `` a letter it doesn't know it has to remove that space. I think you'd need some kind of post-processing in this case...
Jun 22, 2019 at 0:23 comment added siracusa @PhelypeOleinik Nah, no need to feel stupid. I've already learned something new from your (now deleted) solution, e.g. I didn't know about the very useful \tl_analysis_show:N function. :)
Jun 21, 2019 at 13:11 history edited Phelype Oleinik CC BY-SA 4.0
deleted 2309 characters in body
Jun 21, 2019 at 13:09 comment added Phelype Oleinik @siracusa Hm... Obviously. I feel kind of stupid now. I'll delete that part of the answer. Thanks :-)
Jun 21, 2019 at 0:28 comment added siracusa @PhelypeOleinik Thanks for the implementation. expl3 should definitely have some basic support for handling verbatim material like in your wrapper, IMHO. The thing is, if you do all the catcode setting yourself, you don't need \tl_set_rescan:Nnn anymore. Actually, replacing it by \tl_set:Nn #1 {#3} in your implementation gives the same result.
Jun 20, 2019 at 11:00 history edited Phelype Oleinik CC BY-SA 4.0
added 2311 characters in body
Jun 20, 2019 at 9:55 comment added Phelype Oleinik @siracusa If I'm not mistaken I read it somewhere that to support a consistent API, the expl3 functions, by design, don't do catcode changes while grabbing an argument precisely to avoid unexpected behaviour of a function. Which makes sense: you use a function without the need to worry that this one or that one will grab its contents verbatim or under some peculiar catcode regime. Of course, if you do need that, then you have to work yourself around this feature to get the catcodes right.
Jun 19, 2019 at 22:58 comment added siracusa @PhelypeOleinik I should have read the "TeXhackers note" for \tl_set_rescan:Nnn more carefully, as it implies the second argument is read in before the new catcodes are applied. The documentation before reads as if it would be absorbed under the new catcode regime to me. So those functions seem to be useless when dealing with verbatim code then.
Jun 19, 2019 at 11:46 comment added Phelype Oleinik @PabloGonzálezL Give me a minute to try to understand the problem in your question...
Jun 19, 2019 at 11:28 comment added Pablo González L I could look (tex.stackexchange.com/a/496258/7832), hence the original query, I think the problem is related to the use \newlinechar before and after using \tl_set_rescan:Nnn(which internally assigns other values to \newlinechar).
Jun 19, 2019 at 11:13 history answered Phelype Oleinik CC BY-SA 4.0