23

Now we need to make some choices between TeX, LaTeX2e, LaTeX 3, ConTeXt(LuaTeX), LuaLaTeX, XeTeX, XeLaTeX and...

I don't specially like the syntax of L3 but recently I was impressed by very convincing examples with L3 and Lua so syntax or not it's perhaps a good thing to learn how to use L3 and how to program with Lua. But if I introduce some L3 code in my packages, I might create some problems for some users. Is it possible to mix L3 and Latex2e? Lua is a very big step... but lualatex seems to be very promising.

We need to use options in a package, we need to use keys... What are the packages that are recommended with each method?

I think that immobility is not a good thing and I must choose a direction, so my question is to ask what are the advantages and disadvantages of the different methods? (Sorry if my English is very rough!)

pluton
  • 16,421
Alain Matthes
  • 95,075
  • 1
    Several years ago, I made some choices : utf8 instead of latin 1 or 9 and pdf instead of dvips and actually I'm happy with that. – Alain Matthes May 11 '16 at 12:22
  • 1
    As it stands, this feels very opinion-based to me. At the very least I think you need to tighten up the criteria. For example, are you talking about writing LaTeX packages, generic (plain/LaTeX/ConTeXt/...) code, plain code, etc. Also, what sort of functionality are you using: some stuff can only be done using LuaTeX which will then dictate your choice. – Joseph Wright May 11 '16 at 12:46
  • 1
    On keys, see http://tex.stackexchange.com/questions/26771/a-big-list-of-every-keyval-package (there's one new package to add there, I think, at the time of writing). – Joseph Wright May 11 '16 at 12:47
  • 6
    "is it possible to mix L3 and latex2e" the only version of L3 that is installed by default is expl3 which is a latex2e (and plain) package designed to run in an existing format, there is no pure latex3 code available from CTAN. But asking whether to use latex2e or context is like asking whether to use english or german, it's not a question that has an answer, it depends on who you want to interact with as much as choices that you can make on your own. – David Carlisle May 11 '16 at 12:56
  • @JosephWright The question is not only for me but in my case the problem is the mix between "L3 and latex2e" and if it's possible to know if there are some side effects ... – Alain Matthes May 11 '16 at 13:01
  • @AlainMatthes That is much more answerable: 'no issues' (expl3 defines very few commands outside of its own namespace and we quite deliberately don't load the risky stuff such as l3galley). – Joseph Wright May 11 '16 at 13:04
  • @DavidCarlisle Thanks for the comment about "L3 and latex2e". Perhaps it's interesting for a new user/programmer to help him to make a choice between "english or german" ! – Alain Matthes May 11 '16 at 13:06
  • @DavidCarlisle: Of course, the choice should be German :-P –  May 11 '16 at 19:51
  • @ChristianHupfer Wie Sie wissen, ich bin mit jeder Sprache glücklich. – David Carlisle May 11 '16 at 19:53
  • @DavidCarlisle Camddeubarthiadm yw'r dewis rhwng Saesneg a'r Almaeneg, yn sicr! – cfr May 11 '16 at 20:17

2 Answers2

10

Best ways will provoke opinion based answers...

Well, here is my opinion:

At the first glance, I found expl3 syntax terrible, but meanwhile I have transformed my first package from L2 to expl3, extending it's facilities tremendously.

'Currently' I will use expl3 to rewrite the other packages as well, as for the future ones ('some plans I have -- written the packages be must' master Yoda would say ;-))

I don't say, that L3 syntax is the best one -- I like it, meanwhile. But the truth is that there are still some legacies of L2 which has not been attacked so far to be provided by the L3 - team.

Concerning the options: User A prefers keyvalue package Z, the next one prefers package Y.

As long as you know what you're doing writing should be possible with any setup, regardless, whether it's plain TeX, LuaLaTeX, L2 or L3.

Perhaps the mixture will be the future (concerning L2 and L3 it's a mixture so far, since there's no \use_package:n {classicthesis} ;-))

(I can't say anything about ConTeXt, since I have not really used it so far beyond some minor testing, so nothing productive was generated by me -- but that's my fault ;-))

Barbara Beeton made some important notes about the publishers etc.

In my point of view the purpose/goals of the package determine the usage of class or package. A more generic package that could be used widely in huge range of applicable document types should be written in L2 or expl3, since lualatex is not that advanced (as of writting) and not as accepted so far as might be demanded.

  • No problem of compatibility ? I agree with the syntax but some answers are very convincing ! – Alain Matthes May 11 '16 at 12:32
  • @AlainMatthes: Which compatibility do you mean? The fact, that expl3 is not yet a standard? –  May 11 '16 at 12:34
  • Concerning the options : the problem is to know if xkeyval or pgfkeys or ... work fine with lualatex for example. I wrote lualatex because actually I compile pdflatex ... – Alain Matthes May 11 '16 at 12:36
  • @AlainMatthes: We had a question about two weeks ago on the option (well keyval) packages. I was the only one who suggested xkeyval, but I see l3keys as very useful. I never used pgfkeys as programmer so far –  May 11 '16 at 12:38
  • If I introduce some expl3 codes in the packages, old documents are compiled without change. ( with same packages, same engine) – Alain Matthes May 11 '16 at 12:39
  • 2
    @AlainMatthes once you get how the expl3 syntax works you will see that it a) is consistent and logical (you can often guess the name of functions) b) has easy expansion control c) is comprehensive – I can't remember when I last thought it were missing any functionality :) It is definitively worth the effort to learn expl3 d) is easy to read (not at first but once you've got it it is easier to read than traditional LaTeX programming). And as far as usage in 2e is concerned: there are quite a number of 2e packages written in expl3 already: siunitx, chemmacros, acro, xpatch, … – cgnieder May 11 '16 at 13:02
  • @clemens I completely agree except for the claim that it is not missing any functionality, which I believe is just false if you mean, for example, that L3 can replace L2 syntax in any package. (Without, obviously, having to define a bunch of L2 things in L3 just in order to write 'pure' L3.) – cfr May 11 '16 at 13:07
  • @clemens thanks ! and then it's equivalent to compile with pdflatex or lualatex ? – Alain Matthes May 11 '16 at 13:09
  • @AlainMatthes What do you mean? pdflatex and lualatex are not interchangeable. They sometimes are, but they are not equivalent. – cfr May 11 '16 at 13:11
  • @cfr Feedback on required additions always welcome (LaTeX-L mailing list for preference, other routes though also helpful). – Joseph Wright May 11 '16 at 13:17
  • @AlainMatthes In expl3 terms the functionality is more-or-less the same between pdfLaTeX and LuaLaTeX, though the latter is natively UTF-8 which affects a few places. As noted, though, there are significant engine differences that one cannot simply ignore. – Joseph Wright May 11 '16 at 13:19
  • @cfr Not interchangeable and not equivalent but if my memory is correct, pdflatex will be replaced by lualatex, no ? – Alain Matthes May 11 '16 at 13:20
  • @cfr »claim that it is not missing any functionality« that's not exactly what I said ;) I said that I didn't miss anything lately – cgnieder May 11 '16 at 13:21
  • @AlainMatthes No: LuaTeX is not back-compatible with pdfTeX/TeX90 so cannot be used as a direct replacement (unlike the TeX90 => pdfTeX switch made by distros some years ago). – Joseph Wright May 11 '16 at 13:29
  • @JosephWright I work with UTF-8 despite some (little) problems with pdfLaTeX but for a new user/writer the advantage/disadvantages to use UTF-8 is perhaps a good criterion. – Alain Matthes May 11 '16 at 13:29
  • @JosephWright But if a document is compiled by pdflatex I can compile it with lualatex with some minor changes (fonts codages), no ? – Alain Matthes May 11 '16 at 13:35
  • 2
    @AlainMatthes http://tex.stackexchange.com/questions/32295/using-luatex-as-a-replacement-for-pdftex but note that for example hyphenation, line breaking, etc., may be different (a 'drop in' replacement has to do exactly the same for the same input, not 'more-or-less the same'). – Joseph Wright May 11 '16 at 13:38
  • @JosephWright Thanks for the link, very useful question and answer ! – Alain Matthes May 11 '16 at 13:44
  • @clemens 'is comprehensive' I took to mean 'not missing functionality'. Sorry if I misunderstood. – cfr May 11 '16 at 13:57
  • @cfr Ah ok. This was probably misleading. (I probably should add that I meant the programming tools. Of course as far as typesetting is concerned 2e stuff (\leavevmode, \section, \refstepcounter, …) has to be used) – cgnieder May 11 '16 at 14:53
  • @JosephWright I was mostly thinking of font stuff. Perhaps I'm mistaken, but I don't see a way to write font support packages in L3 syntax. (I'm sure some bits could be used here and there, but I don't really see any advantage as most of it would need to be L2 and/or TeX.) Other things I suspect I just haven't worked out. – cfr May 11 '16 at 16:55
9

if you are creating a package that you expect to be used by authors submitting books and papers for publication, you should consider the restrictions set by the likely publishers, and the reasons for those restrictions.

mostly, such restrictions are not arbitrary, but are made on account of requirements of the production and printing processes, and the need for archival stability. (the latter depends on the field; it is very important for math, not so much for chemistry.)

here are some examples.

  • luatex is not yet sufficiently stable to be considered a production tool.

  • context is not readily adaptable to some publishers' requirements.

  • restrictive licenses may be a problem; the lppl is good.

  • "drop dead" code that renders a package unusable/unrunnable after a date specified in the code makes the package unusable for a publisher with an archival requirement that includes support for revised editions or inclusion of articles in "collected works".

pdf(la)tex and xe(la)tex have proved to be stable bases.

  • 1
    (+1) I don't think it is only publishers who should worry about using 'drop dead' packages. – cfr May 11 '16 at 13:03
  • When you wrote luatex, lualatex is also concerned ? – Alain Matthes May 11 '16 at 13:13
  • 1
    @AlainMatthes -- yes, in this sense, lualatex is equivalent to luatex; think of this as three parts: tex (the basic engine) + lua (the engine enhancement) + latex (the user interface). anything including lua is in the same category. (of course, this may change in the future, but it's not yet possible to predict when, at least with the information available to me.) – barbara beeton May 11 '16 at 14:07