Skip to content
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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

jfbu
Copy link

@jfbu jfbu commented Jan 22, 2019

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 environments

\begin{foo}
 aaa
\end{foo}

do 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

I don't know how one makes up .lvt type of validating file.

	new file:   testfiles/t003.lvt
tabu.sty Outdated Show resolved Hide resolved
}% \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
Copy link
Author

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 Show resolved Hide resolved
testfiles/t003.lvt Outdated Show resolved Hide resolved
tabu.sty Outdated Show resolved Hide resolved
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}%
Copy link
Author

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.

tabu.sty Outdated Show resolved Hide resolved
tabu.sty Outdated Show resolved Hide resolved
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
Copy link
Author

@jfbu jfbu left a 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)

tabu.sty Outdated Show resolved Hide resolved
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.
@jfbu jfbu changed the title Fixes: #3 (view it as a draft) Fixes: #3 Jan 23, 2019
Copy link
Author

@jfbu jfbu left a 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.

@davidcarlisle
Copy link
Member

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 testfiles/sx471000b.lvt is failing.

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.
@jfbu
Copy link
Author

jfbu commented Jan 24, 2019

@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.

Base automatically changed from master to main March 21, 2021 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tabu* does not work with alltt-type usage of Verbatim
2 participants