-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes: #3 #5
base: main
Are you sure you want to change the base?
Fixes: #3 #5
Conversation
I don't know how one makes up .lvt type of validating file. new file: testfiles/t003.lvt
}% \tabu@collectbody@forscan | ||
|long|def|tabu@pushbegins@forscan #1\begin#2{|ifx|relax#2|else b|expandafter|tabu@pushbegins@forscan|fi}% | ||
|catcode`|\ |z@ | ||
\catcode`\| 12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not check the catcode setting and resetting of the package, so i hope it is fine to set this here with no further ado.
tabu.sty
Outdated
|tabu@collectbody@forscan@b | ||
}% | ||
|def|tabu@collectbody@forscan@aa #1{% | ||
|expandafter|tabu@collectbody@forscan@next|expandafter{|tabu@collectbody@forscan@partial\end#1}% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I document it now before I forget: here we had some \endfoo
, thus it was started by some \foo
. Hence there is no associated \begin
. Good thing LaTeX does not have \beginfoo
syntax... Thus the balancing done via \tabu@pushbegins@forscan
isn't offset, and the loop terminates correctly after tabu body is collected. Definitely this won't work with \endtabu
, but original surely did not either as it is checking for \end
token.
Use \scantokens directly as it needs now no extra preliminaries.
MEMO: we can't have environment spread across multiple lines inside alltt-type Verbatim as fancyvrb scopes each input line
…-use \tabu@rescan in source code But \tabu@rescan is now \let to \scantokens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added code for collecting body fails if body contains #
. Will have to be fixed. Original does not crash on such input (but produces "wrong" output, see #6)
This does not fix tabu-issues-for-future-maintainer#6, but only corrects an error in this series of using macros to store partially corrected data. Switching to \toks2 also allows to avoid \unexpanded\expandafter formulation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready for review.
Thanks for the PR, note the current priority is fixing tabu to get back to the extent of working as it did before the latest round of fixes to array/colortbl/longtable, in particular I'm hesitant to make further changes, not least as we haven't been able to contact Florent Chervet who will hopefully pick up this again. That said, having the PR with improvements and tests in this public repository is a good thing and will be available if anyone who has some more bandwidth to allocate to tabu maintenance can pick it up on a more permanent basis. |
Indeed, \tabu@collectbody is called also from \tabu@quick and \tabu@nestedmeasure, hence unconditionally removing from it some code executed under \iftabuscantokens regime was possibly a bad idea. Untested.
@davidcarlisle I understand, anyway my PR is here for people to use it if needed. If some more official repo is set-up I will transplant it over there. About contacting the author, I don't think you tried on fr.comp.text.tex, where I believe (except if I have long made a mistake on who is who) the author makes some appearances from time to time. I wlil post a message there. |
I have not looked entirety of codebase, I made this patch until I could my test file compile without error. I have not checked if it breaks something else.
In particular, I wish I could build the documentation but I see that previous patches were done only on sty file, so after having worked on dtx I had to cherry-pick to modify only the sty file.
Again, this is a bit WIP, it works on test file. Not tested on anything serious (I am not tabu user to start with... so I have nil experience).
The method implements the "catcode 12" idea. Difficulty is when input contains
\endfoo
for example. Besides I tested that multi-line environmentsdo not work in Verbatim already outside of tabu, (edit of course, as each input line is scoped by fancyvrb) so I did not worry about this. But
\begin{foo}aaa\end{foo}
is now allowed in the alltt-type Verbatim inside tabu cell.While working on this I got the fleeting feeling original code could cause some brace removal, I did not stop to ponder too much. (and I do not understand fully all branches of original (the thing with
#3
empty at one location); I took out some conditional material because that is now the matter of my added code, but in what is left there might now some unneeded thing now for same reason).Again, once trivial bugs in my draft were fixed, I decided to post this without not much testing as I have no test files to start with apart the one I am contributing.
Fixes: #3