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.
1,128 questions
4
votes
1
answer
230
views
Latex3 matrix determinant
In the following MWE I have a function for defining a matrix, printing it and calculating it's determinant using Gaussian elimination. The given matrix is supposed to have det(A)=4 but I think that ...
1
vote
0
answers
54
views
How to know if a token is a math delimiter in unicode-math? [duplicate]
This issue is very similar to How to know if a token is a maths delimiter?, but specifically considers the scenario where the unicode-math package is loaded. I've written some code to determine ...
6
votes
1
answer
304
views
Latex3 matrix addition error
I cant fix the error in the following code. It seems the error is in the line
\fp_add:Nn \l_matrix_current_sum_fp { \MatrixGetItem{#1}{###1}{##1} }
Any suggestions?
\documentclass{article}
\...
6
votes
2
answers
180
views
How to elegantly handle key–value options with spaces in LaTeX3?
In LaTeX2e, I can write TikZ or tcolorbox options with spaces in key–value pairs without any issues, e.g.:
% in LaTeX2e
\begin{tikzpicture}[remember picture, overlay, line width=2pt, every node/.style=...
7
votes
1
answer
118
views
ltcmd: the c type argument grabs optional arguments of an environment
MWE:
\documentclass{book}
\usepackage{xcolor}
\NewDocumentEnvironment{foo}{ D(){} O{} m }{start \fbox{#1, #2, #3}}{ end}
\begin{document}
\chapter{Example}
\begin{foo}(optional parenthesised argument)
...
9
votes
3
answers
282
views
Defining a verbatim environment as a pair of commands (e.g., using c argspec), with optional argument
I'm wondering if it's possible to use the new c arg spec (or any other method) in LaTeX to define a verbatim environment as a pair of commands. I also want the starting command to take an optional ...
5
votes
2
answers
203
views
Optimization of a function that recursively splits a sequence of tokens
I currently have the following code to recursively split and access a sequence according to a list of separators:
%% -------------------------------- PREAMBLE -------------------------------- %%
\...
3
votes
1
answer
73
views
Provide extra constant arguments to a mapped function
Consider the following code:
\documentclass[10pt]{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\split}{m m}{
\seq_set_split:Nnn \l_tmpa_seq{#2}{#1}
\seq_map_indexed_function:...
10
votes
2
answers
259
views
Can I print \ShowCommand's output to the document?
In classic TeX, there are two commands for inspecting the definition of a macro
\show prints the macro name and definition to the .log file (and the interactive console).
\meaning outputs the macro ...
2
votes
1
answer
112
views
How to use counter in labels with expl3 syntax?
I am writing a expl3 package, and I have to re-create the behavior \refstepcounter, in particular my goals are to:
create a counter,
increment the counter and print his value,
create an automatic ...
2
votes
1
answer
124
views
Media Boxes need to set in LuaTeX
Changing a template from XeLaTeX to LuaLaTeX. We unable to set media boxes in LuaTeX. Can you please suggest how to set media box (Crop, bleed, trim, art boxes) in LuaLaTeX
7
votes
2
answers
351
views
when is it sensible to use names for expl3 variables with non-spec type suffixes?
Snippet from fontspec's documentation:
Semi-colon-lists Not a real data structure but sensible to name accordingly.
163 \tl_new:N \g_@@_rawfeatures_sclist
164 \tl_new:N \l_@@_pre_feat_sclist
Is it1? ...
4
votes
1
answer
133
views
Command for computing binomial coefficients
Consider the following MWE:
\documentclass{article}
\newcommand*\binomCoef[2]{\fpeval{fact(#1)/(fact(#2)*fact(#1-#2))}}
\begin{document}
\binomCoef{5}{2}
\end{document}
The above example does ...
4
votes
2
answers
170
views
How can one circumvent the "\unexpanded" condition imposed by LaTeX3 clist module?
I am in the process of learning how to use the LaTeX3 clist module. I am interested in accessing the values in a clist comma-separated list directly. However, I am not able to do so. The MWE given ...
3
votes
1
answer
74
views
Set pdftitle/pdfauthor to the value of a custom expl3 command
I'm trying create a package where one can add authors using \addauthor{Firstname}{Lastname}{...}{...}. Then later in the document use \printauthorslist to print a list of all authors sorted by their ...