28,452 reputation
283161
bio website users.aims.ac.za/~bruno
location France
age 24
visits member for 3 years, 11 months
seen Dec 14 at 9:42

I've been using LaTeX more and more in the past nine years, initially typesetting solutions to maths problems, later taking notes in class for more than a year.

A few months back I had some ideas about writing a package. I was (un?)fortunate enough to find a copy of the TeXbook in my school's library. Since then, I have been hooked by the strange style of programming that TeX macros provide.

This has led me to become a member of the LaTeX3 team in May 2011. This was an exciting time to join the project: the team improved consistency of the expl3 language provided by l3kernel considerably, and we have seen people starting to code in the language. I have focussed in making the l3kernel code as fast and bullet-proof as possible (two often conflicting aims).

Current LaTeX projects:

  • Get l3fp to reach full IEEE-754 (2008) compliance. This module, which I am quite proud of, lets us parse expandably floating point expressions, in a way similar to eTeX's \the\numexpr...\relax for integers. The main missing parts are signalling NaNs and subnormal numbers, as well as providing functions to control the rounding mode.

  • Enrich l3fp with more functions, such as atan.

  • Clean up l3regex, the LaTeX3 regular expression engine, marking it as stable. In particular, add functions to act on a file, sed-like.

  • Write a PEG parser operating on strings. This could in principle be done expandably, but I am not yet sure whether it is necessarily useful.

  • Write a C compiler (this is not for LaTeX3, mostly to learn how compilers work). Having a full C-to-TeX compiler would immediately provide access to many other languages from TeX, since many compilers are written in C. Of course, the code would run rather slowly, and much slower than using LuaTeX.

  • Enable TeX to produce text output instead of pdf. This could be done either by using LuaTeX, or by modifying an engine, or by emulating TeX within TeX (which I have partly done).

  • Help with debugging macros either by providing a graphical interface to visualize expansion, or (easier, and partly done) by performing steps of expansion or assignments one by one and showing partial results with \typeout within TeX.

  • Understand how to best generalize LaTeX3's \tl_expandable_lowercase:n to do more general token-list transformations expandably. This might combine with the idea of a parser.

  • Perform partial macro expansion in a file, which would distinguish between user-defined macros and macros defined in a package.

  • Write an os-independent Makefile-like Lua program.

  • A few dormant packages, including the one that brought me to the TeX path two years ago.


Nov
29
comment How to implement a macro for normal ordering of operators?
Ah, you're right, and without spaces, the notation would be confusing (e.g. in :φ::φ:=:φ²:+…). Your implementation gives better results. I don't have a textbook at hand right now, sorry. (well, I do, but no scanner)
Nov
29
comment What are expl3 equivalents for various macros useful to debugging and a building private packages
Backslash-space is an alternative to ~ within any text that is wrapped, and can be useful when wanting to produce several spaces in a row.
Nov
28
comment How to implement a macro for normal ordering of operators?
Not sure. Perhaps \mathopen{:}\mathinner{#1}\mathclose{:} if that makes sense? Basically, it should be the same as what you would suggest for brackets, and my typographical sense is lacking.
Nov
28
comment How to implement a macro for normal ordering of operators?
@egreg Despite being called "ordering", normal ordering is not a relation. I'd say the colons behave more like brackets (say, \lfloor and \rfloor). I have to admit though that I don't know what to suggest as the best choice of spacing.
Nov
20
awarded  Nice Answer
Nov
18
comment Safe test for an empty expanded macro argument?
This answer is wrong, as it will consider 0 to be empty. See egreg's answer for a correct use of \romannumeral in this context (sorry David).
Nov
18
comment How to use sage recursively (term reusage)?
Am I understanding correctly that you want to be able to do \sage{1/11*(\sage{14-2}+9+12+10)} (well, hidden inside macros, but that doesn't change anything), and that you tried to use \pgfmathparse{\sage{14-2}}\pgfmathresult instead of just \sage{14-2} but that didn't work better?
Nov
4
awarded  Popular Question
Sep
30
awarded  Explainer
Sep
5
comment Is there a way to define a newcommand that can evaluate mathematical expressions
@egreg: In this simple case it is not too hard to provide a solution which avoids l3regex and just uses expl3, which should work in journals (at least arXiv appears to have TeXLive 2011). Basically loop trough the input with \cs_set_eq:NN\my_eval:n\int_eval:n\tl_map_inline:nn{#1}{\tl_if_in:nnF{012345678‌​9+-*()}{##1}{\cs_set_eq:NN\my_eval:n\use:n}}\my_eval:n{#1}. Do you want to add that to your answer, or should I provide a separate one?
Sep
4
comment Luatex Pattern matching %b
@HeikoOberdiek: You are right.
Sep
3
comment Workaround for open lualatex bug in \scantokens?
For the record, I've replied to Christian's question there.
Sep
3
comment Luatex Pattern matching %b
It is worth noting that \string\% is an easier way to get a percent character in a Lua string (it will be escaped by a backslash), so \swapgsubargs could be replaced by "(\string\%b())(\string\%b())","\string\%2\string\%1", avoiding any catcode change.
Sep
3
answered luatex and starting TeX macros which handle new line characters
Sep
3
comment A command which concatenates a string an arbitrary number of times
@egreg I took the liberty to fix your last edit (you made the wrong command expandable). I think what Manuel meant is that it is much faster to set \concathere in one x-expanding assignment rather than appending to it multiple times. The correct way is \tl_set:Nx \concathere { \prg_replicate:nn {#1} { \exp_not:n {#2} } }.
Sep
3
revised A command which concatenates a string an arbitrary number of times
Last edit made the wrong command expandable
Sep
3
comment How do I expand a macro into a tabular head?
@JosephWright has answered in details, and you have given a better way to proceed in your case, so I'll abstain :-).
Sep
3
comment Expand a macro with parameters in tabular head
putting \expand\romannumeral-`0 just before \repeatstring also works (well, except that \repeatstring was not defined). Admittedly, that's hardly something to recommend :-).
Sep
3
comment How do I expand a macro into a tabular head?
@HendrikVogt No, but it is easier to do \expandafter\test\expandafter{\X} than \expandafter\newcolumntype\expandafter{\expandafter L\expandafter}\expandafter{\X}. However, perhaps I misunderstood Yiannis.
Sep
3
comment How do I expand a macro into a tabular head?
It does. To test, I just replaced the definition of \mypream by \def\mypream#1{#1|*{2}{#1|||}} and replaced c\expand\mypream cc by c\expand\mypream{c}cc, and got the correct tabular.