Questions tagged [latex3]

Please do not use this tag for general LaTeX questions. {latex3} is about the new material being developed by the LaTeX3 project. This includes the expl3 programming language along with higher-level concepts such as xparse and xtemplate.

Filter by
Sorted by
Tagged with
2 votes
1 answer
193 views

Why is LaTeX3 method not working with token list argument, contrary to documentation?

I have the following code in which I try to check whether a letter exists in a string: \documentclass{article} \ExplSyntaxOn \begin{document} \str_gset:Nn \ABCstring {ABC} % Setting the test string ...
user avatar
1 vote
1 answer
27 views

Cs_show doesn't trigger

I am a beginner in Latex3. The test MWE is: \documentclass{article} \usepackage{amsmath} \usepackage{xparse} % loads expl3 \begin{document} \ExplSyntaxOn \cs_set:Npn \my_mod:nn #1#2 { % store #1//#2 ...
user avatar
1 vote
2 answers
83 views

Boolean version of `\str_if_in:nnTF` — expl3

How can I use \str_if_in:nnTF as a boolean function i.e without TF arguments so that I could use it inside \bool_lazy_and:nnTF { \str_if_in:nn {abc} {a} } { ... } { true code ...
user avatar
  • 1,799
4 votes
1 answer
125 views

Function return — expl3

How can I stop function from running rest of the code if some conditions are met in latex3? Now I have to build nested conditions and have a couple of default cases duplicated. Code readability gets ...
user avatar
  • 1,799
0 votes
0 answers
22 views

cannot generate variant of a function, deprecation error — expl3

Look at two seemingly similar codes \tl_set:Nx \first_token { \tl_head:n {\langle\rangle} } \exp_last_unbraced:Nx \token_if_eq_meaning:NNTF \first_token \langle {Tr}{Fl} \tl_set:Nx \first_token { \...
user avatar
  • 1,799
0 votes
0 answers
41 views

texlive 2022 failed to install

I installed texlive 2021 iso several times in windows 10 and no problems. but when I try to install texlive 2022 iso I found the following : Installing to: C:/texlive/2022 Installing [1/6, time/total: ...
user avatar
2 votes
2 answers
40 views

Save unbraced token into variable — expl3

I want to use \token_if_eq_meaning:NN that compares meaning of just two tokens. I have such a token list {\langle\rangle} that's saved via \tl_set:Nn \my_tokens_list {\langle\rangle} How can I ...
user avatar
  • 1,799
2 votes
1 answer
113 views

Detect delimiter

Is it possible to check whether a token is a delimiter, i.e (, ), |, \vert, \langle, \rangle, etc without directly checking each of them in a condition? The structure of delimiter is well described ...
user avatar
  • 1,799
0 votes
1 answer
38 views

Expand argument before using it

This question is my attempt to solve the main problem (MWE there). I realized that using macro \newcommand{\veca}{|_{\vec{a}}} next to \bigg is being treated as a single token, so those two queries ...
user avatar
  • 1,799
0 votes
1 answer
59 views

Framework for interactive graphics in LaTeX documents

I've written a prototype LaTeX package and associated viewing framework to allow LaTeX documents to be viewed in an environment that allows for interaction with figures. The figure might have points ...
user avatar
4 votes
2 answers
222 views

Why is there no \ProvideCommandCopy?

When we look at xparse package documentation there are four related commands \NewDocumentCommand \RenewDocumentCommand \ProvideDocumentCommand \DeclareDocumentCommand Similarly there are four ...
user avatar
  • 145
0 votes
0 answers
51 views

Setting the height of a tikzpicture using LaTeX3

This is a follow-up to How to specify tikz drawing size without scaling it. The advice given there works, but the picture still doesn't have a fixed size. In some way, the height depends on how the ...
user avatar
3 votes
2 answers
75 views

list of macros as arguments to another macro

I would like to use some macros as arguments with xparse. I need it because I use siunitx. Here is a simplified code which compiles: \documentclass[a4paper]{article} \usepackage{xparse} \usepackage{...
user avatar
0 votes
0 answers
16 views

xsim file suffixes [duplicate]

The behavior of the example below is very odd. Every file name suffix I've tried works -- except for .js! I've tested this on Windows, but not Linux. The behavior is the same whether run under ...
user avatar
1 vote
1 answer
76 views

What does ✩ (not ⋆) mean in interface3.pdf?

See the LaTeX 3 programming layer doc here: https://mirror.math.princeton.edu/pub/CTAN/macros/latex/contrib/l3kernel/interface3.pdf ⋆ seems to indicate whether a macro is expandable; e.g.: \...
user avatar
2 votes
0 answers
41 views

\ifpdf vs \sys_if_output_pdf:TF

I've got a document that I want to be engine-agnostic (to be used by lecturers in mathematics department). I'd been using \ifpdf (from iftex) and separately \ifPDFTeX and \IfXeTeX &c. The point is ...
user avatar
10 votes
1 answer
115 views

\NewDocumentEnvironment eats the first non-letter token when used for verbatim environment

I was messing around with creating verbatim environment saving its contents to a file like the one described in verbatim package documentation (end of section 2.2), but using latex3 features. It ...
user avatar
  • 145
2 votes
2 answers
120 views

L3 programming: \text_titlecase only seems to map properly when sequence is explicitly declared

I'm trying to perform the following conversion using the l3 interface: my_figure_title -> My Figure Title After some trial and error with sequences and strings, here's what I came up with: \...
user avatar
  • 1,372
10 votes
2 answers
278 views

LaTeX3 not enforcing argument types for user-defined control sequences, why?

From a previous question, @egreg's states: The argument types N and n are the most common. The former means that the argument must be an unbraced single token, the latter means that the argument must ...
user avatar
  • 1,372
2 votes
2 answers
90 views

Can't output the value of uppercased string with expl3

I'm trying to get to grips with how to do basic string manipulation using expl3. Here's what I have so far: \documentclass{article} \begin{document} \ExplSyntaxOn \str_set_eq:NN \l_tmpa_str \...
user avatar
  • 1,372
25 votes
1 answer
4k views

Why are ConTeXt and LaTeX two different typesetting systems instead of joining forces?

I've spent quite a bit of time over the last few days getting up to speed with current developments in the TeX world. Like all of us here I sometimes get frustrated with the clunky and outdated nature ...
user avatar
  • 1,372
2 votes
0 answers
50 views

Would like to experiment with specific aspect of the so-called L3 programming layer

One of the goals of the LaTeX3 project, as stated here are as follows: [The new version] will provide a straightforward style-designer interface to support both the specification of a wide variety of ...
user avatar
  • 1,372
3 votes
1 answer
73 views

How can I parse a clist into a keyval prop?

I'm trying to store a comma-separated list into a key-value property to use it later, but I can't get it to work properly. I don't really understand how latex parses a keyval parameter but my guess is ...
user avatar
  • 35
0 votes
0 answers
47 views

When is LaTeX3? [duplicate]

I think that exposing the L3 programming later through the LaTeX2e format was the best thing for the project in a decade, but I don’t fully understand what the roadmap is now. Is the new plan that ...
user avatar
1 vote
1 answer
30 views

Calling an environment using token contcats (expl3) makes some internal contents show up at the end of document

I need to dynamically apply an environment (or possibly a series of nested environments)on some text using expl3 (latex3) commands. However, the environment behaves differently when concatenate a ...
user avatar
  • 365
5 votes
3 answers
315 views

LaTeX3 - Expand nested argument

MWE: \tl_set:Nn \l_tmpa_tl {a} \tl_set:Nn \l_tmpb_tl {\mathbf{\l_tmpa_tl}} \tl_set:Nn \l_tmpa_tl {b} \(\l_tmpb_tl\) The code snippet above actually produce \(\mathbf{b}\). What I want to achieve is ...
user avatar
0 votes
1 answer
36 views

difference between clist_map_inline and variable

I want to new some commands which have similar syntax. So I used the clist_map_ command in latex3, but I found that inline and variable behaved differently. I make a minimal working example. \...
user avatar
  • 1,099
4 votes
2 answers
106 views

How do I use l3skip as an argument to setlength?

How do I recover send l3skip expressions to setlength? Or: How do I convert length + stretch - shrink to length plus stretch minus shrink\relax? \ExplSyntaxOn \skip_const:Nn \c__par_skip { 1ex +0....
user avatar
3 votes
1 answer
62 views

Using math commands inside \ExplSyntaxOn

I am trying to define new commands using xparse package. To be specific I am trying to abbreviate integrals from this \int\limits_{a}^{b}\ f(x)\ \mathrm{d}x to a more reader friendly \dint[a,b]{f(x)}{...
user avatar
  • 33
0 votes
0 answers
65 views

How can I search-and-replace balanced group in token list?

Let's say, I want to replace all occurrences of \A{ <balanced text> } in my token list with \B{ \A{ <the same content> } }. e.g. \process{\A{123}} % -> \processresult = \B{\A{123}} \...
user avatar
  • 1,414
1 vote
1 answer
34 views

Distinguish between number and length [duplicate]

In my job, I need a macro to distinguish between number and length. Length here means, for example: (1) \textwidth, \parindent, etc (2) \newdimen\mylena \mylena=10cm (3) \def\mylenb{2in} (4) 5.2in I ...
user avatar
  • 11
0 votes
1 answer
38 views

Search for a word inside a macro using expl3

The title of this question refers to words in a general sense but in my particular case I'm searching for numbers inside a previously defined macro. In that macro I have only numbers separated by ...
user avatar
1 vote
1 answer
62 views

LaTeX3 Text/String Comparison Replacement for xstring

Trying to update my college's LaTeX thesis class (for fun while I wait for the actual degree to show up). It hasn't been touched in a few years. Anyways, one of the commands it has is below: % TODO: ...
user avatar
  • 77
1 vote
1 answer
59 views

LaTeX3 expansion in a coffin box

I am stranded with my attempts to set up a coffin box, which expands some variables, which are typeset in it. EDIT Background info: I am trying to write a package, which will allow the user to write, ...
user avatar
  • 5,050
1 vote
1 answer
60 views

Upper-case programmatic data with expl3 in TeX Live 2019

I use the following expl3 code to upper-case the first character of a programmatic string. The code is from the body of a control sequence definition and is not supposed to be fully expandable. \...
user avatar
  • 1,017
3 votes
1 answer
77 views

How to implement biblatex's \cites command with LaTeX3?

I'm the author of zepinglee/citeproc-lua and which already exists \cite[⟨prenote⟩][⟨postnote⟩]{⟨key⟩} that takes optional ⟨prenote⟩ and ⟨postnote⟩ for a single cite item. I'm planning to implement a ...
user avatar
1 vote
2 answers
74 views

Getting the absolute page number with zref and latex3

Within a larger project, I want to set a string equal to the current absolute page number, like this \documentclass[10pt]{article} \usepackage{zref-abspage} \usepackage{zref-user} \ExplSyntaxOn \...
user avatar
1 vote
1 answer
46 views

How to share the date and version number in dtx when developing LaTeX3 package?

When using the syntax of LaTeX2e, we can share information such as date, version number and description in the following way, so that the document and package use the same version number and date, and ...
user avatar
  • 409
2 votes
2 answers
137 views

Something went wrong when using `\declaretheoremstyle` and `\declaretheorem` in LaTeX 3

I want to remove the . after the head, i.e., make headpunct = {}, but the key headpunct is only available in \declaretheoremstyle, so I used it to create a new style without ., but something goes ...
user avatar
  • 419
1 vote
1 answer
53 views

Separate declaration and placement of listings, figures, etc. Capturing and storing verbatim content in a token list

I'm trying to separate the definition and placement of figures, tables, listings, etc. I find them highly disruptive when editing the prose of my document. They often take up a large number of lines ...
user avatar
0 votes
1 answer
109 views

How does \tl_if_in:NnT work exactly?

I am trying to implement the insertion of Turkish epenthesis. If the input starts with one of in, ın, un, ün it's prepended with n. If not, then we look at the first letter. This time we prepend y if ...
user avatar
0 votes
0 answers
27 views

Property List Misused with \cs_set ... but not with \NewDocumentCommand?

In working to understand expl3 a bit better, I came across a property list was misused error that I don't understand. Code concept: Create a macro (\MarkAndSave) that will add a visual mark (\S here) ...
user avatar
  • 6,285
6 votes
1 answer
85 views

\bool_set:Nn setting variable to itself gives error

I have a (recursive) function that accepts a bool as an argument and first copies this to some local boolean variable (using grouping so the value is restored after the function call). When making the ...
user avatar
5 votes
1 answer
91 views

How to stop the process of \int_step_inline in LaTeX3?

Here is a MWE: \documentclass{article} \begin{document} \ExplSyntaxOn \int_step_inline:nn { 5 } { #1 \int_compare:nNnT {#1} > {3} { % I want to stop for this case } ...
user avatar
  • 419
0 votes
1 answer
76 views

LaTeX3 Error: Command '\sc' already defined!

Please can someone explain to me why I'm getting the following compiling error LaTeX3 Error: Command '\sc' already defined! \documentclass[10pt]{book} \NewDocumentCommand{\ch}{om}{ \...
user avatar
0 votes
2 answers
34 views

Nomenclature Indentation for an Additional Column

I am listing some nomenclature with the following part of code: \documentclass[12pt]{article} \newlength{\nomenlabelindent} \setlength{\nomenlabelindent}{4em} \newenvironment{nomenclature}{% \...
user avatar
  • 147
6 votes
1 answer
182 views

Is a latex3 function without a (hollow) star expandable?

In interface3.pdf sec 1.2, it says the function with a star can be fully expandable in x, e, f, and the function with a hollow star can be fully exandable in x and e, and cannot be fully expanded ...
user avatar
  • 1,099
6 votes
2 answers
259 views

Latest user-level manuals for LaTeX 3 (follow up to Ivo Welch)

This is not a duplicate but a follow up spurred on by Ivo Welch's question Is there a LaTeX 3 transition guide for users (not gurus)? where he asked if there was a LaTeX 3 transition guide for users. ...
user avatar
  • 25.2k
1 vote
2 answers
82 views

Saving the body of an environment to a file verbatim using xparse

Variations of this question have been asked before, but those answers don't seem to work when used within \NewDocumentEnvironment from xparse. For example, see Write environment body verbatim to a ...
user avatar
42 votes
2 answers
2k views

Is there a LaTeX 3 transition guide for users (not gurus)?

To my eternal horror – reading a remark by egreg to some other post – I discovered that LaTeX 3 has been incorporated in the standard LaTeX kernel since 2020. I had missed it completely. Blame the ...
user avatar
  • 3,261

1
2 3 4 5
16