LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Content-Type:
text/plain; charset=us-ascii
Date:
Tue, 19 Aug 2014 19:00:51 +0200
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Subject:
MIME-Version:
1.0
Message-ID:
Content-Transfer-Encoding:
7bit
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
From:
Stephan Hennig <[log in to unmask]>
Parts/Attachments:
text/plain (226 lines)
Hi,

I'm observing differences in the handling of \directlua between LaTeX2e
and LaTeX3 (in LaTeX2e).  Compiling this example

\listfiles
\documentclass{article}
\usepackage{expl3}
\newcommand*{\mymacro}{Hello World!}
\directlua{
  local myarg = '\mymacro'
  texio.write_nl('l2: argument is ' .. tostring(myarg))
}
\ExplSyntaxOn
\directlua{
  local myarg = '\mymacro'
  texio.write_nl('l3: argument is ' .. tostring(myarg))
}
\ExplSyntaxOff
\begin{document}
\end{document}

with lualatex, the output is

    l2: argument is Hello World!
    l3:argumentisnil

First, spaces are gone in Lua code.  Though, spaces are significant in Lua.

Second, variable myarg is nil with \ExplSyntaxOn.  (I don't understand why.)

An external Lua file would work around the spaces issue, but then how do
you pass arguments from LaTeX to Lua code?  What is the preferred way to
handle Lua code in LaTeX3?

Best regards,
Stephan Hennig


> This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/W32TeX) (rev 4971)  (format=lualatex 2014.7.9)  19 AUG 2014 18:56
>  restricted \write18 enabled.
> **test_luamacros.tex
> (./test_luamacros.tex
> LaTeX2e <2014/05/01>
> Babel <3.9k> and hyphenation patterns for 55 languages loaded.
> (c:/texlive/2014/texmf-dist/tex/latex/base/article.cls
> Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
> (c:/texlive/2014/texmf-dist/tex/latex/base/size10.clo
> File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
> )
> \c@part=\count79
> \c@section=\count80
> \c@subsection=\count81
> \c@subsubsection=\count82
> \c@paragraph=\count83
> \c@subparagraph=\count84
> \c@figure=\count85
> \c@table=\count86
> \abovecaptionskip=\skip41
> \belowcaptionskip=\skip42
> \bibindent=\dimen102
> )
> (c:/texlive/2014/texmf-dist/tex/latex/l3kernel/expl3.sty
> Package: expl3 2014/07/20 v5241 L3 programming layer (loader) 
> 
> (c:/texlive/2014/texmf-dist/tex/latex/l3kernel/expl3-code.tex
> Package: expl3 2014/07/20 v5241 L3 programming layer (code) 
> L3 Module: l3bootstrap 2014/05/26 v4889 L3 Bootstrap code
> 
> (c:/texlive/2014/texmf-dist/tex/latex/etex-pkg/etex.sty
> Package: etex 1998/03/26 v2.0 eTeX basic definition package (PEB)
> \et@xins=\count87
> )
> L3 Module: l3names 2014/06/02 v4993 L3 Namespace for primitives
> L3 Module: l3basics 2014/07/09 v5187 L3 Basic definitions
> L3 Module: l3expan 2014/06/16 v5146 L3 Argument expansion
> L3 Module: l3tl 2014/07/17 v5214 L3 Token lists
> L3 Module: l3str 2014/06/19 v5158 L3 Strings
> L3 Module: l3seq 2014/07/18 v5232 L3 Sequences and stacks
> L3 Module: l3int 2014/07/11 v5197 L3 Integers
> \c_max_int=\count88
> \l_tmpa_int=\count89
> \l_tmpb_int=\count90
> \g_tmpa_int=\count91
> \g_tmpb_int=\count92
> L3 Module: l3quark 2014/05/26 v4889 L3 Quarks
> L3 Module: l3prg 2014/05/04 v4728 L3 Control structures
> \g__prg_map_int=\count93
> L3 Module: l3clist 2014/07/19 v5237 L3 Comma separated lists
> L3 Module: l3token 2014/05/26 v4889 L3 Experimental token manipulation
> L3 Module: l3prop 2014/07/17 v5215 L3 Property lists
> L3 Module: l3msg 2014/05/30 v4943 L3 Messages
> L3 Module: l3file 2014/07/09 v5188 L3 File and I/O operations
> \l_iow_line_count_int=\count94
> \l__iow_target_count_int=\count95
> \l__iow_current_line_int=\count96
> \l__iow_current_word_int=\count97
> \l__iow_current_indentation_int=\count98
> L3 Module: l3skip 2014/07/17 v5211 L3 Dimensions and skips
> \c_zero_dim=\dimen103
> \c_max_dim=\dimen104
> \l_tmpa_dim=\dimen105
> \l_tmpb_dim=\dimen106
> \g_tmpa_dim=\dimen107
> \g_tmpb_dim=\dimen108
> \c_zero_skip=\skip43
> \c_max_skip=\skip44
> \l_tmpa_skip=\skip45
> \l_tmpb_skip=\skip46
> \g_tmpa_skip=\skip47
> \g_tmpb_skip=\skip48
> \c_zero_muskip=\muskip10
> \c_max_muskip=\muskip11
> \l_tmpa_muskip=\muskip12
> \l_tmpb_muskip=\muskip13
> \g_tmpa_muskip=\muskip14
> \g_tmpb_muskip=\muskip15
> L3 Module: l3keys 2014/06/12 v5121 L3 Key-value interfaces
> \g__keyval_level_int=\count99
> \l_keys_choice_int=\count100
> L3 Module: l3fp 2014/07/18 v5223 L3 Floating points
> \c__fp_leading_shift_int=\count101
> \c__fp_middle_shift_int=\count102
> \c__fp_trailing_shift_int=\count103
> \c__fp_big_leading_shift_int=\count104
> \c__fp_big_middle_shift_int=\count105
> \c__fp_big_trailing_shift_int=\count106
> \c__fp_Bigg_leading_shift_int=\count107
> \c__fp_Bigg_middle_shift_int=\count108
> \c__fp_Bigg_trailing_shift_int=\count109
> L3 Module: l3box 2014/05/31 v4974 L3 Experimental boxes
> \c_empty_box=\box26
> \l_tmpa_box=\box27
> \l_tmpb_box=\box28
> \g_tmpa_box=\box29
> \g_tmpb_box=\box30
> L3 Module: l3coffins 2014/05/28 v4899 L3 Coffin code layer
> \l__coffin_internal_box=\box31
> \l__coffin_internal_dim=\dimen109
> \l__coffin_offset_x_dim=\dimen110
> \l__coffin_offset_y_dim=\dimen111
> \l__coffin_x_dim=\dimen112
> \l__coffin_y_dim=\dimen113
> \l__coffin_x_prime_dim=\dimen114
> \l__coffin_y_prime_dim=\dimen115
> \c_empty_coffin=\box32
> \l__coffin_aligned_coffin=\box33
> \l__coffin_aligned_internal_coffin=\box34
> \l_tmpa_coffin=\box35
> \l_tmpb_coffin=\box36
> \l__coffin_display_coffin=\box37
> \l__coffin_display_coord_coffin=\box38
> \l__coffin_display_pole_coffin=\box39
> \l__coffin_display_offset_dim=\dimen116
> \l__coffin_display_x_dim=\dimen117
> \l__coffin_display_y_dim=\dimen118
> L3 Module: l3color 2014/04/30 v4712 L3 Experimental color support
> L3 Module: l3candidates 2014/07/18 v5232 L3 Experimental additions to l3kernel
> \l__box_top_dim=\dimen119
> \l__box_bottom_dim=\dimen120
> \l__box_left_dim=\dimen121
> \l__box_right_dim=\dimen122
> \l__box_top_new_dim=\dimen123
> \l__box_bottom_new_dim=\dimen124
> \l__box_left_new_dim=\dimen125
> \l__box_right_new_dim=\dimen126
> \l__box_internal_box=\box40
> \l__coffin_bounding_shift_dim=\dimen127
> \l__coffin_left_corner_dim=\dimen128
> \l__coffin_right_corner_dim=\dimen129
> \l__coffin_bottom_corner_dim=\dimen130
> \l__coffin_top_corner_dim=\dimen131
> \l__coffin_scaled_total_height_dim=\dimen132
> \l__coffin_scaled_width_dim=\dimen133
> )
> (c:/texlive/2014/texmf-dist/tex/latex/l3kernel/l3unicode-data.def
> File: l3unicode-data.def 2014/06/30 v5166 L3 Unicode data
> )
> (c:/texlive/2014/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
> File: l3pdfmode.def 2014/07/18 v5232 L3 Experimental driver: PDF mode
> \l__driver_color_stack_int=\count110
> ))
> l2: argument is Hello World!
> l3:argumentisnil (./test_luamacros.aux)
> LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 15.
> LaTeX Font Info:    ... okay on input line 15.
> LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 15.
> LaTeX Font Info:    ... okay on input line 15.
> LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 15.
> LaTeX Font Info:    ... okay on input line 15.
> LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 15.
> LaTeX Font Info:    ... okay on input line 15.
> LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 15.
> LaTeX Font Info:    ... okay on input line 15.
> LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 15.
> LaTeX Font Info:    ... okay on input line 15.
>  (./test_luamacros.aux)
> 
>  *File List*
>  article.cls    2007/10/19 v1.4h Standard LaTeX document class
>   size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
>    expl3.sty    2014/07/20 v5241 L3 programming layer (loader) 
> expl3-code.tex    2014/07/20 v5241 L3 programming layer 
>     etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
> l3unicode-data.def    2014/06/30 v5166 L3 Unicode data
> l3pdfmode.def    2014/07/18 v5232 L3 Experimental driver: PDF mode
>  ***********
> 
> )
> 
> Here is how much of LuaTeX's memory you used:
>  5590 strings out of 494726
>  100000,154059 words of node,token memory allocated
>  279 words of node memory still in use:
>    3 hlist, 1 vlist, 1 rule, 2 glue, 41 glue_spec, 2 write nodes
>    avail lists: 2:12,3:1,6:3,7:1,9:1
>  9334 multiletter control sequences out of 65536+600000
>  15 fonts using 431615 bytes
>  27i,1n,36p,402b,109s stack positions out of 5000i,500n,10000p,200000b,100000s
> No pages of output.
> 
> PDF statistics: 0 PDF objects out of 1000 (max. 8388607)
>  0 named destinations out of 1000 (max. 131072)
>  1 words of extra memory for PDF output out of 10000 (max. 10000000)
> 

ATOM RSS1 RSS2