28,282 reputation
283159
bio website users.aims.ac.za/~bruno
location France
age 24
visits member for 3 years, 10 months
seen 1 hour ago

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.


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.
Sep
2
answered Workaround for open lualatex bug in \scantokens?
Sep
2
comment How do I expand a macro into a tabular head?
I haven't tested, but I'd expect \expand\mypream{something} to work.
Sep
2
comment Workaround for open lualatex bug in \scantokens?
@ChristianFeuersänger Better than [==[\code@temp]==] is to use "\luaescapestring{\code@temp}" (perhaps LuaLaTeX renames that primitive). Also, you might have some luck using \scantokens after setting \newlinechar to -1.
Aug
30
comment how can I align limits at “lim”?
@StevenB.Segletes Thanks! it does.
Aug
30
accepted Vertically align at operator, but keep default horizontal spacing
Aug
30
comment Vertically align at operator, but keep default horizontal spacing
I'm sorry, I should have mentioned why \mathclap doesn't cut it for me: the limits are too long. In this simplified example, you are right that it is nicer looking to place the limits above and below \prod, but that cannot be done in complicated cases. I am looking for more automatic methods, which do not require fiddling with spacing, such as with \; in your first line. I picked a bad example.
Aug
30
comment Vertically align at operator, but keep default horizontal spacing
Nice approach. I think the \hphantom construction should go before any of the &. Replacing all -n \leq k \leq n-1 by \rule{100pt}{5pt} shows that more clearly. My understanding is that the width of the alignment will be off by half of the width of \prod. Is that correct?
Aug
30
comment Vertically align at operator, but keep default horizontal spacing
I have to say I like this approach, as it is not intrusive and as far as I can tell uses the default spacing.