6

I am just discovering the LaTeX3 Programming Layer (expl3) and am pleased by the very elegant solutions that it provides. Considering that it exists for quite a while now, but still is in development (Is there some final 'stable' release planned, or is this just some smooth transition?), would there be any reason not to use LaTeX3 by now for everything (possible)?

E.g. I write some smaller packages for my own use, and LaTeX3 greatly simplifies this, but I am not sure whether to commit to this fully yet.

3
  • 1
    well expl3 is in the kernel so yes, you can use it. LaTeX itself uses it. See also tex.stackexchange.com/a/572177/2388 Jan 10, 2022 at 18:20
  • 3
    If you need compatibility with other formats expl3 can be a problem. In principle it should run on Plain TeX and ConTeXt as well, but it requires e-TeX so no compatibility with Knuth TeX and god knows whether it works with LuaMetaTeX. Jan 10, 2022 at 18:51
  • 3
    Another consideration is when you are specifically targeting only LuaTeX, then it might be even more advantageous to write complicated algorithms in Lua rather than in expl3. Jan 10, 2022 at 18:52

2 Answers 2

13

Please note that the code formerly distributed as expl3 is now part of the LaTeX format (under the name L3 programming layer). It is nevertheless (and will remain so) possible to say \usepackage{expl3} but it isn't necessary since 2020 unless you want to pass certain debugging options.

There are very good reasons to use the L3 programming layer. The layer is fully supported and the LaTeX project team will gradually move code over from legacy 2e to use the L3 programming layer. All new code, for example the Hook management system (which was introduced in 2020), is already fully build on the L3 programming layer.

The concern raised in the other post needs qualification: the list may appear to be long but if you look at the removal dates (which are a year or 2 after a function was deprecated) then they are essentially all from the time when the L3 programming layer was still separate from the LaTeX format and (while essentially stable then) was distributed as a separate "experimental" package called expl3. We may even in the future deprecate a function because it turned out that the interface needed improving or the name was badly chosen, but as Joseph said in his reply, we have decided that in the future we will not remove such deprecated interfaces from the kernel.

3
  • Is the idea to rewrite LaTeX2e with an underlying LaTeX3 engine, eventually dropping the LaTeX2e definitions altogether? Also, what can L3 do that LuaLaTeX can't?
    – user32882
    Apr 23, 2022 at 13:40
  • 1
    @user32882 no, the idea is to rewrite it in order to integrate new concepts, eg the hook mechanism and improve the internals providing suitable interfaces to the outside world. This will go hand in hand with aligning with public packages the patch into the old code due to a lack of adequate interfaces. That will mean that internal commands may vanish but not those that can reasonably considered general purpose interfaces. E.g., optional argument handling right now is awkward, we might drop \@iminipage \@iiminipage \@iiiminpage in favor of an xparse decl (after checking that they aren't used) Oct 15, 2022 at 23:15
  • 1
    @user32882 what L3 can do that lualatex can't is to work in XeTeX, pdfTeX, upTeX, etc --- and that consistently Oct 15, 2022 at 23:18
7

There is one reason not to use LaTeX3 kernel: nearly every year, some functions and/or variables are removed from LaTeX3. It means your LaTeX3 packages may break in the future if you don't keep up with LaTeX3.

For LaTeX2 packages, your users can still use a rollback release of LaTeX2 kernel, by simply using latexrelease package. But it is impossible for LaTeX3 packages, and that is the reason why I opened this issue some months ago.

The following list of removed functions and variables of LaTeX3 kernel is from l3obsolete.txt and I have sorted it by date.

----------------------------------------------------------
Date removed    Function or variables                                
----------------------------------------------------------
2021-07-07      \vbox_unpack_clear:c                            
2021-07-07      \vbox_unpack_clear:N                            
2021-07-07      \token_get_replacement_spec:N                   
2021-07-07      \token_get_prefix_spec:N                        
2021-07-07      \token_get_arg_spec:N                           
2021-07-07      \tl_set_from_file_x:cnn                         
2021-07-07      \tl_set_from_file_x:Nnn                         
2021-07-07      \tl_set_from_file:cnn                           
2021-07-07      \tl_set_from_file:Nnn                           
2021-07-07      \tl_gset_from_file_x:cnn                        
2021-07-07      \tl_gset_from_file_x:Nnn                        
2021-07-07      \tl_gset_from_file:cnn                          
2021-07-07      \tl_gset_from_file:Nnn                          
2021-07-07      \hbox_unpack_clear:c                            
2021-07-07      \hbox_unpack_clear:N                            
2021-07-07      \c_term_ior                                     
2021-07-07      \box_set_eq_clear:cc                            
2021-07-07      \box_set_eq_clear:cN                            
2021-07-07      \box_set_eq_clear:Nc                            
2021-07-07      \box_set_eq_clear:NN                            
2021-07-07      \box_gset_eq_clear:cc                           
2021-07-07      \box_gset_eq_clear:cN                           
2021-07-07      \box_gset_eq_clear:Nc                           
2021-07-07      \box_gset_eq_clear:NN                           
2020-01-01      \xetex_...:D                                    
2020-01-01      \utex_...:D                                     
2020-01-01      \uptex_...:D                                    
2020-01-01      \tl_show_analysis:n                             
2020-01-01      \tl_show_analysis:N                             
2020-01-01      \str_if_eq_x_p:nn                               
2020-01-01      \str_if_eq_x:nnTF                               
2020-01-01      \str_if_eq_x:nnT                                
2020-01-01      \str_if_eq_x:nnF                                
2020-01-01      \str_case_x:nnTF                                
2020-01-01      \str_case_x:nnT                                 
2020-01-01      \str_case_x:nnF                                 
2020-01-01      \str_case_x:nn                                  
2020-01-01      \ptex_...:D                                     
2020-01-01      \pdftex_...:D                                   
2020-01-01      \msg_term:n                                     
2020-01-01      \msg_log:n                                      
2020-01-01      \msg_interrupt:nn                               
2020-01-01      \luatex_...:D                                   
2020-01-01      \lua_shipout_x:n                                
2020-01-01      \lua_now_x:n                                    
2020-01-01      \lua_escape_x:n                                 
2020-01-01      \etex_....:D                                    
2020-01-01      \c_zero                                         
2020-01-01      \c_two_hundred_fifty_six                        
2020-01-01      \c_two_hundred_fifty_five                       
2020-01-01      \c_two                                          
2020-01-01      \c_twelve                                       
2020-01-01      \c_three                                        
2020-01-01      \c_thirty_two                                   
2020-01-01      \c_thirteen                                     
2020-01-01      \c_ten_thousand                                 
2020-01-01      \c_ten                                          
2020-01-01      \c_sixteen                                      
2020-01-01      \c_six                                          
2020-01-01      \c_seven                                        
2020-01-01      \c_one_thousand                                 
2020-01-01      \c_one_hundred                                  
2020-01-01      \c_one                                          
2020-01-01      \c_nine                                         
2020-01-01      \c_fourteen                                     
2020-01-01      \c_four                                         
2020-01-01      \c_five                                         
2020-01-01      \c_fifteen                                      
2020-01-01      \c_eleven                                       
2020-01-01      \c_eight                                        
2018-12-29      \token_new:Nn                                   
2018-12-27      \sort_reversed:                                 
2018-12-27      \sort_ordered:                                  
2018-12-27      \iow_log_streams:                               
2018-12-27      \iow_list_streams:                              
2018-12-27      \ior_log_streams:                               
2018-12-27      \ior_list_streams:                              
2018-12-27      \g_file_current_name_tl                         
2018-12-27      \file_path_remove:n                             
2018-12-27      \file_path_include:n                            
2018-12-27      \file_list:                                     
2018-12-27      \file_add_path:nN                               
2018-12-27      \c_minus_one                                    
2018-12-27      \box_use_clear:c                                
2018-12-27      \box_use_clear:N                                
2018-12-27      \box_resize:cnn                                 
2018-12-27      \box_resize:Nnn                                 
2018-03-05      \tl_to_uppercase:n                              
2018-03-05      \tl_to_lowercase:n                              
2018-03-05      \ior_get_str:NN                                 
2018-03-05      \file_if_exist_input:nTF                        
2018-03-05      \file_if_exist_input:nT                         
2017-01-01      \xetex_if_engine_p:                             
2017-01-01      \xetex_if_engine:TF                             
2017-01-01      \xetex_if_engine:T                              
2017-01-01      \xetex_if_engine:F                              
2017-01-01      \scan_align_safe_stop:                          
2017-01-01      \pdftex_if_engine_p:                            
2017-01-01      \pdftex_if_engine:TF                            
2017-01-01      \pdftex_if_engine:T                             
2017-01-01      \pdftex_if_engine:F                             
2017-01-01      \luatex_if_engine_p:                            
2017-01-01      \luatex_if_engine:TF                            
2017-01-01      \luatex_if_engine:T                             
2017-01-01      \luatex_if_engine:F                             
2017-01-01      \c_job_name_tl                                  
2016-01-05      \prop_get:cn                                    
2016-01-05      \prop_get:Nn                                    
2016-01-05      \int_to_octal:n                                 
2016-01-05      \int_to_hexadecimal:n                           
2016-01-05      \int_to_binary:n                                
2016-01-05      \int_from_octal:n                               
2016-01-05      \int_from_hexadecimal:n                         
2016-01-05      \int_from_binary:n                              
2015-07-14      \tl_case:cnn                                    
2015-07-14      \tl_case:Nnn                                    
2015-07-14      \str_case_x:nnn                                 
2015-07-14      \str_case:onn                                   
2015-07-14      \str_case:nnn                                   
2015-07-14      \quark_if_recursion_tail_break:n                
2015-07-14      \quark_if_recursion_tail_break:N                
2015-07-14      \int_case:nnn                                   
2015-07-14      \dim_case:nnn                                   
2014-08-09      \vbox_set_inline_end:                           
2014-08-09      \vbox_set_inline_begin:c                        
2014-08-09      \vbox_set_inline_begin:N                        
2014-08-09      \vbox_gset_inline_end:                          
2014-08-09      \vbox_gset_inline_begin:c                       
2014-08-09      \vbox_gset_inline_begin:N                       
2014-08-09      \hbox_set_inline_end:                           
2014-08-09      \hbox_set_inline_begin:c                        
2014-08-09      \hbox_set_inline_begin:N                        
2014-08-09      \hbox_gset_inline_end:                          
2014-08-09      \hbox_gset_inline_begin:c                       
2014-08-09      \hbox_gset_inline_begin:N                       
2014-05-28      \fp_tan:cn                                      
2014-05-28      \fp_tan:Nn                                      
2014-05-28      \fp_sin:cn                                      
2014-05-28      \fp_sin:Nn                                      
2014-05-28      \fp_round_places:cn                             
2014-05-28      \fp_round_places:Nn                             
2014-05-28      \fp_round_figures:cn                            
2014-05-28      \fp_round_figures:Nn                            
2014-05-28      \fp_pow:cn                                      
2014-05-28      \fp_pow:Nn                                      
2014-05-28      \fp_neg:c                                       
2014-05-28      \fp_neg:N                                       
2014-05-28      \fp_mul:cn                                      
2014-05-28      \fp_mul:Nn                                      
2014-05-28      \fp_ln:cn                                       
2014-05-28      \fp_ln:Nn                                       
2014-05-28      \fp_if_zero_p:N                                 
2014-05-28      \fp_if_zero:NTF                                 
2014-05-28      \fp_if_zero:NT                                  
2014-05-28      \fp_if_zero:NF                                  
2014-05-28      \fp_if_undefined_p:N                            
2014-05-28      \fp_if_undefined:NTF                            
2014-05-28      \fp_if_undefined:NT                             
2014-05-28      \fp_if_undefined:NF                             
2014-05-28      \fp_gtan:cn                                     
2014-05-28      \fp_gtan:Nn                                     
2014-05-28      \fp_gsin:cn                                     
2014-05-28      \fp_gsin:Nn                                     
2014-05-28      \fp_ground_places:cn                            
2014-05-28      \fp_ground_places:Nn                            
2014-05-28      \fp_ground_figures:cn                           
2014-05-28      \fp_ground_figures:Nn                           
2014-05-28      \fp_gpow:cn                                     
2014-05-28      \fp_gpow:Nn                                     
2014-05-28      \fp_gneg:c                                      
2014-05-28      \fp_gneg:N                                      
2014-05-28      \fp_gmul:cn                                     
2014-05-28      \fp_gmul:Nn                                     
2014-05-28      \fp_gln:cn                                      
2014-05-28      \fp_gln:Nn                                      
2014-05-28      \fp_gexp:cn                                     
2014-05-28      \fp_gexp:Nn                                     
2014-05-28      \fp_gdiv:cn                                     
2014-05-28      \fp_gdiv:Nn                                     
2014-05-28      \fp_gcos:cn                                     
2014-05-28      \fp_gcos:Nn                                     
2014-05-28      \fp_gabs:c                                      
2014-05-28      \fp_gabs:N                                      
2014-05-28      \fp_exp:cn                                      
2014-05-28      \fp_exp:Nn                                      
2014-05-28      \fp_div:cn                                      
2014-05-28      \fp_div:Nn                                      
2014-05-28      \fp_cos:cn                                      
2014-05-28      \fp_cos:Nn                                      
2014-05-28      \fp_compare:NNNTF                               
2014-05-28      \fp_compare:NNNT                                
2014-05-28      \fp_compare:NNNF                                
2014-05-28      \fp_abs:c                                       
2014-05-28      \fp_abs:N                                       
2014-05-28      \c_undefined_fp                                 
----------------------------------------------------------
1
  • 7
    The team have agreed that no further removals will be made of 'stable' functions from l3kernel
    – Joseph Wright
    Jan 11, 2022 at 22:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .