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

argument of type v errors if the argument contains a tab #762

Open
u-fischer opened this issue Jun 28, 2020 · 6 comments
Open

argument of type v errors if the argument contains a tab #762

u-fischer opened this issue Jun 28, 2020 · 6 comments
Assignees
Labels
bug Something isn't working xparse Historical: see latex3/latex2e

Comments

@u-fischer
Copy link
Member

The following document which contains a tabulator (09) errors:

\documentclass{article}
\begin{document}
\NewDocumentCommand { \myverb } { v  }{}

\myverb|a  	 b|
\end{document}

errors with

! LaTeX3 Error: The verbatim command '\myverb' cannot be used inside an
(LaTeX3)        argument.

For immediate help type H <return>.
 ...                                              
                                                  
l.15 \myverb{a  	
                  b}
? 
@PhelypeOleinik
Copy link
Member

A tab is usually catcode 10, and space tokens are used to indicate premature tokenisation of the argument, thus the error. Adding a tab to \dospecials makes the error go away:

\documentclass{article}
\begin{document}
\ExplSyntaxOn
\tl_gput_right:Nn \dospecials { \do \^^I }
\ExplSyntaxOff
\NewDocumentCommand { \myverb } { v } { #1 }

\myverb|a 	 b|
\end{document}

but then you get a Ψ b in the typeset output. One option would be to make \^^I active and make it expand to a space. But perhaps it should be left as it is (without the error, I mean) and let the macro writer decide what to do with tabs: sometimes one wants to make it a space, and sometimes it should be a tab indeed. Seems like the solution to this issue will be the same as for #756...

@PhelypeOleinik PhelypeOleinik added the xparse Historical: see latex3/latex2e label Jun 29, 2020
@blefloch
Copy link
Member

blefloch commented Jun 29, 2020 via email

@pablgonz
Copy link
Contributor

pablgonz commented Jul 1, 2020

Just as a comment, some time ago I came across this Keyboard TAB character in argument v (xparse)
. I didn't report it because the explanation given by (@Ulrich-Diez), might be a good idea to document the behavior of TAB in xparse.

@blefloch
Copy link
Member

blefloch commented Jul 2, 2020 via email

@Ulrich-Diez
Copy link

Ulrich-Diez commented Jul 8, 2020 via email

@car222222
Copy link
Contributor

Lots of ideas here, @Ulrich-Diez.

There are indeed many types and uses of so-called ‘verbatim in TeX’, all with somewhat or very different requirements.

@blefloch blefloch added the bug Something isn't working label May 13, 2021
@blefloch blefloch self-assigned this May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working xparse Historical: see latex3/latex2e
Projects
None yet
Development

No branches or pull requests

6 participants