{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.

learn more… | top users | synonyms

0
votes
1answer
1k views

Siunitx installation: I can't find file l3docstrip.tex

I have some problem trying to compile siunitx. When I do latex siunitx.dtx, I get the following message: ! I can't find file `l3docstrip.tex'. l.77 \input l3docstrip.tex Where am I supposed to find ...
14
votes
1answer
345 views

Is there a LaTeX3 approach to \ignorespaces?

The following code works as I would like it to: Given the state of the boolean, certain content is to be printed or not. If it's not printed, then I run the risk of creating extraneous whitespace. ...
26
votes
3answers
888 views

Always use \NewDocumentCommand instead of \newcommand?

Are compelling reasons to stick with \newcommand or should one always use \NewDocumentCommand instead, even when not using any of the additional features offered by xparse? In addition and more ...
7
votes
2answers
363 views

A macro for optimization problems

This question is an extension of Using an array environment inside an xparse command. I was advised to make a separate question for the extension. I would like to thank egreg very much for his help. I ...
6
votes
2answers
147 views

How do you signal an error from within an expandable function?

I would like to do some error checking from within an expandable function. But my attempts at signalling an error are not processed correctly, but rather returned to the input stream---contrary to my ...
2
votes
1answer
92 views

Unexpected hung latex compilation with property list retrieval

This is very closely related to a previous question of mine. From the comments to this previous question, I understand that my approach here is completely wrong headed. So why bother post a ...
4
votes
1answer
106 views

key values getting improperly passed through a property list getter function

I'm creating rather complicated diagram and would like to put all the controls all in one easy to find location and not scattered throughout the document. To do this, I've created setter and getter ...
15
votes
1answer
409 views

Guidelines: when is LaTeX3 too much LaTeX3?

This morning I found myself writing a document where essentially the same text is repeated several times. Because I've been mucking around a lot recently learning LaTeX3, it took absolutely no ...
6
votes
1answer
363 views

Learning LaTeX3

In my attempt to venture in the realm of LaTeX3 coding, I was wondering if a list of answers, in LaTeX3, can be made? That is, a list of links to answer in which users here at TeX.SX have used such ...
2
votes
1answer
216 views

LaTeX complaining about illegal parameter number

Inspired by a question yesterday, I thought I'd try my hand at a LaTeX3 solution which would show how to convert base 10 numbers into any other base of the user's choice. Yesterday I wrote a nice ...
8
votes
1answer
133 views

printing the value of a boolean to terminal without stopping latex

I'm trying to debug some LaTeX3 code. To do so I would like to write the value of an internally generated boolean to the terminal, but I don't want to stop the work-flow of the LaTeX run. For the ...
25
votes
3answers
648 views

A guide to understanding expandability: when to write protected functions and when not to

I'm having difficulty understanding (and appreciating) the concept of expandability. I'm very murky about understanding when and how expandability impacts me in writing code for my documents. I've ...
6
votes
1answer
97 views

Conflict between xparse and pstricks: pstricks doesn't believe xparse function is defined

I want to create a pspicture with a variety of parameters which are interdependent. I'm using expl3 for the interface. But I get an error when I try to use \getr Error: /undefined in \getr Operand ...
4
votes
1answer
122 views

key-value is not being read as expected

I'm trying to write some code that allows me to reveal in stages the content of a pre-existing file (a pspicture showing a geometric construction). I'm trying to write this using LaTeX3. I've got ...
8
votes
1answer
115 views

Missing space when replacing with \regex_replace_all:nnN

How can I make \regex_replace_all:nnN not remove the space between x y? \documentclass{article} \usepackage{l3regex} \ExplSyntaxOn \cs_new:Npn \replace #1#2#3 { \tl_set:Nn \l_tmpa_tl {#3} ...
11
votes
2answers
253 views

aliasing vs variants — preferred practices?

This is somewhat related to a question I asked earlier here. I'm trying to split a token using a delimiter. However, the delimiter is stored in a token. Looking at the most recent documentation, I ...
5
votes
2answers
174 views

Splitting delimited token list argument

I wrote a little piece of code (function \getfirst:w) that splits its delimited argument at the first embedded :. The code works well if used standalone, but I am unable to place it into the .code:n ...
4
votes
1answer
68 views

testing whether a variable or control seq. is a box in LaTeX3

Is there a way, in LaTeX3, to find out whether a given control sequence or variable is a box register (created with \box_new:(cN))?
4
votes
1answer
137 views

Commands from xparse inside functions created by \cs_new:Npn?

Is it okay to put commands from xparse inside functions created by \cs_new:Npn instead of \NewDocumentCommand? Would that be a confusion of programming levels? The example below works but I was ...
5
votes
2answers
435 views

latex3 complaining about Undefined control sequence. But it is defined!

I've tried pairing this down, but each time I do that I'm either correcting my mistake or something. So here's a slightly unwieldy MWE. In a nutshell, what I'm trying to do is.... I'm writing a ...
6
votes
1answer
86 views

latex3: errors I don't understand

I have the following code: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \cs_new:Nn \__test_current_choice_against_version: { I'm working } \seq_new:N \g__user_defined_choice_seq ...
3
votes
1answer
189 views

How to map optional arguments to functions?

What is the right way to map each optional argument to a function that applies a specific style to it? In the example below, optional arguments are typeset in bold face preceded by a colon. But I ...
3
votes
0answers
80 views

Is there a gentle introduction to learning expl3 syntax [duplicate]

Possible Duplicate: Programming with LaTeX3 I was going to post a question about creating a switch within a command to determine formatting for a command and came across the following link ...
14
votes
2answers
149 views

writing to \jobname.aux using LaTeX3

In LaTeX2e, one can write to the standard auxiliary file via the \@auxout file handle. Are there dedicated LaTeX3 functions (planned) that facilitate writing to \jobname.aux or is there an equivalent ...
10
votes
2answers
201 views

How to make the last word in a sequence the first?

I am looking for a macro that would take a string (better to say -- a sequence of words) and output the last word at the fist place before remaning part of the sequence. I want to put this macro into ...
4
votes
2answers
151 views

Automatically run a LaTeX3 function on the document environment

Is it possible to define a package so that it will automatically run a LaTeX3 function on the entirety of the document environment? If I define a function similar to the following: \cs_new:Npn \demo ...
16
votes
1answer
370 views

Defining a find and replace algorithm using LaTeX3's l3regex

I've been trying to work out the mechanics of LaTeX3's regular expression system as implemented in l3regex, but am having some difficulty understanding how/why it is acting as it is. If I use as an ...
5
votes
1answer
111 views

Is a command with an argument before and after the command possible?

I'm trying to create a LaTeX3 command that works the same whether its argument comes before or after the command. For example, I'd like to define \squared to be used as either \m\squared or \squared\m ...
24
votes
1answer
574 views

Programming with LaTeX3

What is the best way to learn to programming in LaTeX3, and where can I get the best information in your opinion. I know that does not sound like a specific question, but I want to deepen on LaTeX and ...
7
votes
3answers
604 views

parse variable length comma separated list into command

I've been trying to modify the solution here into a LaTeX3 command that takes a variable length comma separated list of numbers and an optional argument (a unit) and prints the square root of the sum ...
2
votes
0answers
494 views

When will LaTeX3 be released? [closed]

I'm surprised how difficult it was to google the answer to this question, so now I'm asking in here: When is LaTeX3 likely to be released? How far is development at this moment? And what is currently ...
17
votes
1answer
216 views

Is there a right way to do combined conditionals in LaTeX3?

I have some LaTeX3 code and I want to add a new feature. This will involve choosing between various actions at a particular point. There are two choices to be made, and these choices are ...
4
votes
2answers
183 views

xparse verbatim with newline

I'm trying to define a simple command using xparse and it's verbatim argument: \DeclareDocumentCommand\macro{v}{#1} but see ! LaTeX error: "xparse/verbatim-newline" ! ! Verbatim argument of ...
11
votes
2answers
1k views

Iterative method to solve nonlinear equations

I am trying to solve the following equation (coming from fluid dynamics) using TeX. 1/sqrt(lambda) = 2 * log(Re * sqrt(lambda)) - 0.8 where lambda is the unknown, sqrt means "square root", the log ...
5
votes
1answer
428 views

7-2012 l3kernel & l3packages updates | 'broken'?

After installing recent updates to l3kernel and packages (both packaged 2012-07-19) on my MikTeX 2.9 system, several things seem to have broken: docs relying on unicode-math no longer compile ...
3
votes
1answer
1k views

Installation of siunitx and LaTeX 3

I am interested in using the package siunitx. However, it appears that I need to be running LaTeX 3 in order to do this. The installation information on CTAN seems somewhat cryptic, and I am ...
4
votes
1answer
216 views

Change \baselinestretch using xparse in TeX Live 2012

Is there a preferred way to change \baselinestretch using the xparse package included in TeX Live 2012? (I believe this is xparse version 3570, dated 2012/04/23.) If I run latex -output-format pdf ...
6
votes
1answer
352 views

LaTeX 3 read/write to file like toc

I tried to reimplement some kind of a toc facility. I write wouts argument into a file and try to reinclude this. So the Problem is, that \ior_str_gto:NN seems to stop at linebreaks. Please consider ...
44
votes
4answers
3k views

Abandon LaTeX2e for LaTeX3 or LuaTeX

I think my question is: Should I abandon pdflatex, possibly for xetex or context, and a TeX/LaTeX based macro writing approach, possibly for a LuaTeX or LaTeX3 based approach? Possibly relevant to ...
5
votes
1answer
392 views

LaTeX3: Double number sign (##) [duplicate]

Possible Duplicate: What is the meaning of double pound symbol (##1) in an argument? I see some LaTeX3 code with ##1 instead of #1 for parameters. What are the rules for this? This answer ...
18
votes
4answers
505 views

How do I get a value out of a group?

I've just recovered from my first real foray into LaTeX3 programming. It was ... an experience. Not a completely unpleasant one and once I'd gotten used to the syntax then I found it a lot easier ...
33
votes
3answers
563 views

Will LaTeX3 improve freedom of package ordering and reduce “options clash”?

A prefatory afterthought: you may think this question better asked on the LaTeX3 mailing list, but I believe there may be a more general interest in the rather Byzantine rules for package load order. ...
5
votes
2answers
174 views

Latex3 input/output and expansion of macros

I have a package that formats a course outline and have a macro that reads a formatted user file and turns it into a section. \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \tl_new:N ...
12
votes
1answer
1k views

Update / Install the newest version of LaTeX3

The developing of LaTeX3 goes on. However some feature will be improved or added. The LaTeX3 team can't upload every day a new version to CTAN. How can I install the newest version LaTeX3?
6
votes
1answer
120 views

What is the proper way to pass user input to package commands?

I'm wondering if someone can fill me on the proper technique for passing parameters from a document to the underlying package. The user would interface via a document like this: ...
7
votes
1answer
311 views

LaTeX3 from Package Options to Class Options

Howdy please consider the following expample: \RequirePackage{ expl3 , xparse , l3keys2e , xfrac } \ProvidesExplPackage {somewhat} {2012/04/29} {1} {descrr} ...
4
votes
1answer
189 views

Parse a file with a regexp and return first match

I need to write a command that searches a file for a string that matches a certain regexp, and inserts that string. I know how to parse a string of text using a regex with \usepackage{l3regex} ...
13
votes
1answer
600 views

Subscripts and superscripts

In LaTeX2 a_1, a_{123} and a^1, a^{123} used to produce subscripts and superscripts respectively. In LaTeX3 superscripts still work the same way, but what happened to subscripts? I suspect the ...
6
votes
1answer
176 views

Apply command list to argument correctly

I have a clist filled with values I want to use as commands and apply them all successively e.g. \cmda{\cmdb{\cmdc{arg}}} to the argument of the \apply function. I added an example but it doesn't ...
5
votes
2answers
209 views

regexp capturing issue

The following regexp code gives the result \documentclass[11pt]{book} % use larger type; default would be 10pt \usepackage{pgffor} \usepackage{l3regex,xparse} \usepackage{etextools} ...