Closed tobiasBora closed 4 months ago
See also my discussion here, hopefully we will find some clean solution for this: https://tex.stackexchange.com/questions/709973/latex3-efficient-way-to-remove-spaces-in-front-of-a-command?noredirect=1#comment1765765_709973
Solved in c9aae9fd84adf2acecba5cfd17ed2c99f895bc58
Can confirm, it is working and the errors are shown properly despite the indention :) Good work, thank you!
This is not true for the PlaceholderFromCode
environment. If I insert indention there, python does not work.
Yes, indeed, the problem in that case is that when creating a placeholder this way, I don't know yet how this placeholder will be used (maybe indentation is important?), as it is independent of any preset. For now, you can either add in your preset options something like:
placeholder remove leading spaces={__TMP__}
or right after the \end{PlaceholderFromCode}
you can run \placeholderRemoveLeadingSpaces{__TMP__}
. I will think to see if it makes sense to apply it by default on any such placeholders.
This is fixed in v2.7, now published in CTAN. This should even be part of Texlive 2024 as the froze is tonight.
Great work as ever, thank you very much!
If we indent the python code like in:
then this will work… but this is by pure chance (and it is not even doing what we expect it to do). The reason is that it is inserted inside another function:
but the output will be different depending on the number of spaces in front of the file which is not what we expect.
For now, the user is supposed to remove the spaces in front of the text… but it is not very convenient and easy to forget. It would be better instead to automatically trim the spaces.