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

l3skip: view the dimension of LaTeX2e macro #417

Closed
stone-zeng opened this issue Nov 24, 2017 · 5 comments
Closed

l3skip: view the dimension of LaTeX2e macro #417

stone-zeng opened this issue Nov 24, 2017 · 5 comments
Labels
enhancement New feature or request

Comments

@stone-zeng
Copy link
Contributor

Try the following code:

\documentclass{article}
\usepackage{expl3}

\begin{document}
\ExplSyntaxOn
\tl_const:Nn \c__foo_test_tl { 1cm }
\dim_set:Nn \rightskip { \c__foo_test_tl }
\dim_show:N \rightskip
\dim_show:N \rightskip
\ExplSyntaxOff
\end{document}

Only the second \dim_show:N gives the right value:

> \rightskip=0.0pt.
<recently read> }
                 
l.8 \dim_show:N \rightskip
                          
? 
> \rightskip=28.45274pt.
<recently read> }
                 
l.9 \dim_show:N \rightskip
                          
? x

If try this

\dim_set:Nn \rightskip { \c__foo_test_tl }
\cs_show:N \dim_show:N  % something else
\dim_show:N \rightskip

The result of \dim_show:N is also correct.

Of course, when using the "appropriate way" as \skip_set:Nn \rightskip { \c__foo_test_tl } instead, both results is OK then.

LaTeX3 version: 2017/11/14.

@josephwright
Copy link
Member

You are using \dim_set:Nn on something that is a skip: I'm not sure that anything other than 'trouble' can arise ...

@FrankMittelbach
Copy link
Member

FrankMittelbach commented Nov 24, 2017 via email

@josephwright
Copy link
Member

@FrankMittelbach There is a \__dim_eval_end: = \scan_stop: there: I guess you mean you need two to catch this situation?

@FrankMittelbach
Copy link
Member

FrankMittelbach commented Nov 24, 2017 via email

@car222222
Copy link
Contributor

car222222 commented Nov 24, 2017 via email

blefloch pushed a commit that referenced this issue Nov 29, 2017
Some past commit only added \scan_stop: to \dim_set:Nn, but there is also
\dim_add:Nn, \dim_set_eq:NN, \dim_zero:N and friends.
@josephwright josephwright added expl3 enhancement New feature or request labels Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants