3
votes
2answers
302 views

Extract first letter of each word in a sentence

I don't know if already exists a question like this, but after 20 minutes I haven't found one. There are similar ones, like How to define a command that bolds the first letter of each word in the ...
6
votes
1answer
96 views

Expanding a macro as many times as possible without error

I'd like compute cosets using the permute package. Here's what I have so far: \documentclass{article} \usepackage{expl3,xparse,permute} \ExplSyntaxOn % Create a new command to compute the right ...
4
votes
1answer
111 views

I need a fully expandable function to expand in an “f” type argument

I really hope that I'm asking the correct question. What I'm actually working on if far more convoluted than what's happening in the MWE here. I think I've narrowed down things to real problem. I ...
6
votes
1answer
188 views

Macro to calculate \baselineskip for given font

I want to write a macro that returns the \baselineskip multiplied with a fixed value for a given font spec. That seems to be harder than I would imagine... after some fiddling I came up with this: ...
16
votes
0answers
514 views

A flexible derivative macro with LaTeX3

In an earlier post I asked a question about writing a flexible derivative macro, and someone suggested that a LaTeX3 version might be easier to understand, so I decided to try my hand at writing one. ...
6
votes
1answer
143 views

listings package and latex3 variable

I'm trying to change a custom environment from a lot of optional parameters to a ;-separated list (using this answer as a template and writing its main functionality as a latex3 macro). The macro ...
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
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 ...
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 ...
8
votes
2answers
2k views

xparse: Define new command with multiple optional parameters

I'd like to define a new command with optional parameters using the xparse package. Please consider the following example: \documentclass{minimal} \usepackage{xparse} ...
11
votes
1answer
834 views

A LaTeX3 macro to typeset chemical compounds?

Out of curiosity I wonder how would a macro coded in expl3 that does the basics of mhchem (as in section basics in mhchem manual) looks like? I have found examples in TeX and LuaTeX in ...