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

Inline verbatim in tables #66

Closed
vlasakm opened this issue Jul 21, 2021 · 3 comments
Closed

Inline verbatim in tables #66

vlasakm opened this issue Jul 21, 2021 · 3 comments

Comments

@vlasakm
Copy link
Contributor

vlasakm commented Jul 21, 2021

The commit cde08d9 broke the following example:

\fontfam[lm]

\verbchar`

\table{p{20pt\fL}}{
`\0`
}

\bye

The problem is "fixed" by bringing the old defintion of \_tabdeclarep:

\_def\_paramtabdeclarep#1{\_the\_tabiteml
   \_vtop{\_hsize=#1\_relax \_baselineskip=\_normalbaselineskip
   \_lineskiplimit=\_zo \_noindent \_hskip\_zo \_relax ##\_unsskip
   \_ifvmode\_vskip\_dp\_tstrutbox \_else\_lower\_dp\_tstrutbox\_hbox{}\_fi}\_the\_tabitemr}

Is there any possibility to make inline verbatim work again? I am lost.

@olsak
Copy link
Owner

olsak commented Aug 2, 2021

The problem is that the table item (used in \halign primitive) is preprocessed: it is expanded until first non-expandable token and then it is read again in its expanded form after the left template of the table column is processed. See TeXbook page 240 or TeXbook naruby, page 136.
The workaround is to insert \relax at the beginning of the table item by a user. But we want to be more conceptual. There is two ways.
First way: to create all macros (which can be used at beginning of the table item) more robust. I started this and I created more robust \fornum in my lats commit. We can do

\_adef{#1}{\_begingroup \_inlineverb}

in \verbchar macro and define

\_def\_inlineverb{\_setverb \_adef{ }{\_dsp}\_ttfont \_the\_everyintt\_relax \_readverb}

to make inline verbatim more robust in the context of the problem of table items mentioned above. And we must to do something similar with \lipsum macro too.
Second way is to define \_paramtabdeclarep differently. But this macro solves more issues and it will be much more complicated. I tried it in my computer but I am not satisfied with it. I have to think about it more. It will take me more time.

olsak added a commit that referenced this issue Aug 4, 2021
@olsak
Copy link
Owner

olsak commented Aug 4, 2021

I hope that the last commit solves it.

@olsak olsak closed this as completed Aug 4, 2021
@vlasakm
Copy link
Contributor Author

vlasakm commented Aug 4, 2021

I confirm that my use case works now. Thank you very much!

Though I will still study your applied changes and reasoning above.

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

No branches or pull requests

2 participants