# Tag Info

111

Will has written a couple of short answers, I'll add a bit of detail. There are several things that are wrong with LaTeX2e. Most obviously to end users, the kernel is rather inflexible. As a result, to get what you want you almost always need to load quite a number of packages, or do some low-level hacks of the kernel. That is not really ideal: I think ...

71

As I have tried to explain in answer to the question "LaTeX3 versus pure lua" my vision of LaTeX3 is really a system with multiple layers that provide interfaces for different kind of roles. These layers are the underlying engine (some TeX variant) the programming layer (the core language, i.e., expl3) the typesetting foundation layer (providing ...

65

(I guess I could be called a member of one of the teams ;-) this is my view) I thought of staying out of this debate, but perhaps some words of clarification or, let's say, some thoughts are in order after all. LaTeX3 versus pure Lua First of all this is the wrong question imho: LaTeX3 has different goals to LuaTeX and those goals may well be still a ...

49

I would recommend if you serious about learning about LaTeX and TeX to consider the learning stages of La(TeX), which I will describe in detail below, rather than just a selection of books. It is rather long and please excuse me if you find it boring, but by the end you will know why LaTeX3 will take a long time, before it becomes a standard! The rookie@ ...

47

LaTeX2e is the latest stable release of LaTeX. When people say LaTeX they usually mean LaTeX2e, not an earlier version. LaTeX3 is a massive refactoring of the LaTeX2e code base, which is currently in development. Some of the developers are frequent contributors here and will probably chime in. The difference to end users between LaTeX2e and LaTeX3 will ...

46

At present, the 'usable' bits of LaTeX3 are: The expl3 language. This provides a much more 'programming-like' language than using TeX primitives plus LaTeX internals. The language is still fluid (I have some changes I'm pushing, but the rest of the team are not so sure), but the general shape is there. The idea is to continue to extend expl3 to add more ...

41

The LaTeX3 coding language, expl3, uses : and _ as 'letters' in function and variable names. This allows use of expl3 code-level material in a document \cs_new:Npn .... % fails: command \cs followed by characters '_', 'n', 'e', 'w', etc. \ExplSyntaxOn \cs_new:Npn .... % works here: command name \cs_new:Npn The \ExplSyntaxOn command activates this, and ...

40

Full example In the first implementation of the template ideas there has been a full example that tried to work through the underlying ideas. On can still find the documentation of template.dtx on the web, e.g., here. This is for a different implementation but the basic concepts haven't changed so it might be helpful still. Somehow during the ...

40

When Don Knuth wrote TeX he wanted to create "just a typesetting language" but in response to user demand the macro language grew and grew. He also said that, if at the time he wrote TeX there was "a universal simple interpretive language that was common to other systems, naturally I would have latched onto that right away". The future in my view is to use ...

38

For programming packages that implement new functionality for LaTeX2e what you mainly need is the programming layer of LaTeX3. xparse additionally offers you some help for defining user interfaces in 2e style with optional arguments or star forms etc, but you can think of this as the syntactic sugar on top of the functionality your package provides. And in ...

38

A full answer here has several parts. First, at the time of writing it's important to bear in mind that ConTeXt is not only available but works well, while LaTeX3 is a concept which is being developed. That means that it's not even 100% clear what shape LaTeX3 will take. It's also not clear that LaTeX3 will deliver, but for the purposes of answering the ...

36

If you want to publish in academic journals, you need to be sensitive to what new TeX related goodies their setup can handle. For instance, I've had to regress from BibLaTeX to BibTeX because a journal couldn't handle it. Likewise, I'd expect that LuaTeX or ConTeXt might not fit well into the workflow of a journal. I'm sure there are people here who know ...

35

As a member of the LaTeX3 Project, my advice would be to totally ignore LaTeX3 when looking at books on LaTeX at the moment. There are two reasons. First, none of the books I know of cover anything about the new work of the LaTeX3 Project. Secondly, and really much more importantly, the 'user level' experience of LaTeX is not likely to change substantially ...

35

The history of that name (as I remember it at least) goes way back to a stroll in some town in the UK sometime in the last century, probably 1997 (may have been Nottingham, but I don't remember) with David Carlisle and Chris Rowley and perhaps a few others on which we discussed those ideas about boxes with handles and somehow somebody came up with "rather ...

33

I don't think syntax highlighting should be done purely in Tex for following reasons: Languages are complicated (context sensitive) and to proper highlight the syntax, you have to implement a full compiler front-end. As an example, here is some simple C++ code: struct foo; // foo is the name of a data type void f(foo param); // function f, taking a foo ...

32

Both Patrick and Frank have provided good answers: I'd like to add a few complementary points which seem too long for comments. One aspect of expl3 that is important is that it can be used now to program LaTeX2e packages (the 'l3in2e' approach). That is seen for example in my own siunitx package, which I would not want to make LuaTeX-only. A particularly ...

31

The degree to which something is 'stable enough' will depend on your requirements. I'll answer by taking this situation in roughly the order of stability as I see it. If you want 'will never change again', then plain TeX is probably your best bet. Knuth does still fix bugs periodically, but most things are now likely to be regarded as 'features' rather than ...

31

Here is a flat LaTeX2e implementation. \documentclass{article} \usepackage{amsmath} \newcount{\numerator} \newcount{\denominator} \newcount{\gcd} % compute \gcd and returns reduced \numerator and \denominator \newcommand{\reduce}[2]% #1=numerator, #2=denominator {\numerator=#1\relax \denominator=#2\relax \loop \ifnum\numerator<\denominator ...

30

Although these issues were discussed earlier here are some pointers, from someone that has been using TeX/LaTeX since the middle 80s. The knowledge you build with TeX/LaTeX and friends is additive. What you have used as plain TeX commands, your \defs and similar can be used today with all of the above variants. Similarly for all the LaTeX commands and yes ...

30

I think the author having written a very nice book in LaTeX, is entitled to his views and has some valid points. I agree with some of them but disagree with most of them. He has valid points on ease of use and the lack of a GUI. However, he misses the point that to incorporate the 100s if not thousands of commands available to a user via the basic TeX ...

30

Complete Highlighting Scheme for WinEdt This is a highlighting scheme for expl3 in WinEdt 8. New: It is now available as an add-on: LaTeX3 Highlighting LaTeX3 guards in .dtx files Add the following lines in Switches.ini just before the switch SWITCH="DTX Single Guard" SWITCH="DTX LaTeX3 Guard" ENABLED=1 MODE_FILTER="DTX" START="DTX %" ...

28

Currently, we don't have a Programming in LaTeX3 book, and even if we did there would be lots of gaps. So there is no 'complete' solution. However, there are some resources. First, I'd point to the introduction to LaTeX3 ideas which gives a broad-brush overview of the concepts. I have written a short series of blog posts on the topic: I've summarised the ...

27


27

Yes, you can, and pretty easily too. \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\computesum}{mmm} {% pass control to an internal function \svend_compute_sum:nnn { #1 } { #2 } { #3 } } % a variable for storing the partial sums \fp_new:N \l_svend_partial_sum_fp \cs_new_protected:Npn \svend_compute_sum:nnn #1 #2 #3 { ...

26

Developments in Lua and LaTeX3 are separate, but there is some convergence in the sense that both address issues for LaTeX programmers. It's also the case that the benefits you will see from these developments depend on the nature of your documents. LuaTeX adds to TeX functionality which is not available any other way, but also makes general programming a ...

26

The two modules share a lot of features, and at there are many tasks which can in principle be tackled using either. To understand the reason for the existence of both, I'll first highlight what seq can do that clist cannot. A comma-separated list looks something like a,b,c,d,, which means that most obviously the items cannot contain a comma (without ...

26

If you are not bound to expl3 (in which case you “just” need to implement the algorithm): \documentclass{scrartcl} \usepackage{xintgcd,xintfrac} \newcommand*\reducedfrac[2] {\begingroup \edef\gcd{\xintGCD{#1}{#2}}% \frac{\xintNum{\xintDiv{#1}{\gcd}}}{\xintNum{\xintDiv{#2}{\gcd}}}% \endgroup} \begin{document} \[ \frac{278922}{74088} = ...

25

An option using Lua+LaTeX. Made small improvement. Made a Lua function to be called as a LaTeX command, with the numerator and denominator passed as arguments, instead of hardcoding the values in as before. The command is \simplify{a}{b}: \documentclass{article} \usepackage{luacode} \usepackage{amsmath} %------------------------ \begin{luacode} ...

25

Limitations of l3regex On page 12 of the documentation, under "The following features of PCRE or Perl will deﬁnitely not be implemented": Recursion: this is a non-regular feature. Back-references: non-regular feature, this requires backtracking, which is prohibitively slow. So it doesn't look like you will be able to track matched/unmatched parentheses ...

24

For the record, here's my font-lock settings for Emacs with LaTeX3. To make use of these, I define a latex3-mode which is derived from the inbuild latex-mode. (Note: I don't use AucTeX, I use the simple TeX modes.) The idea of the font-locking is similar to Joseph's in that it adds more matches for highlighting. I've added a specials for core functions ...

Only top voted, non community-wiki answers of a minimum length are eligible