16

I'm wondering if there is a list of deprecated LaTeX commands and suggestions for commands that are to be used instead.

egreg
  • 1,121,712

1 Answers1

16

Short answer: Run texdoc l2tabuen in the OS prompt.

Long answer: Although may be are not officially deprecated LaTeX2e commands, as David said, novices often fall in old documentation, examples and templates, taking obsolete or not well understood practices, as writing the non-deprecated \'{a} when with minimal settings in the preamble and a suitable keyboard you can simply write "á", or using the deprecated {\bf ... } of LaTeX2.0, that do not use the new font selection scheme (NFSS) of LaTeX2e, instead of \textbf{...} or {\bfseries ...}, or using obsolete packages (as anysize to set up document margins instead of the ge­om­e­try pack­age) and even obsolete fonts and classes.

One should mention also inputenc, in no way an obsolete package, but since utf8 is actually the gold standard encoding, use of \usepackage[utf8]{inputenc} with pdflatex is obsolete at least in standard classes because is now the default, but the novice will see this command in thousands of examples anywhere. It will take time to forget it!

Others, not so novices tend to use TeX commands instead of the LaTeX syntax (often my fault), as \parindent1em instead of \setlength{\parindent}{1em} or \def\foo{...} instead of \newcommand\foo{..}. In my defense I will say that this is fine while you understand the risks.

Many of these common pitfalls are covered by the l2tabu german document (note that there are an English version as well as in some other languages).

Fran
  • 80,769
  • On your note about inputenc: It's not actually deprecated, but since April 2018 the file utf8.def (loaded by \usepackage[utf8]{inputenc}) is included in LaTeX by default, so including \usepackage[utf8]{inputenc} in releases later than April 2018 will simply do nothing. And since this is in the LaTeX kernel, it affects any document class, not only the standard ones :) – Phelype Oleinik Jan 13 '19 at 20:25
  • @PhelypeOleinik I did not say that is a deprecated package, just the contrary ("in no way an obsolete package"). With respect a non standard class, I just created the xxx.cls custom class that is \LoadClass{article} \usepackage[latin1]{inputenc} and therefore utf8 is no longer the default encoding of any document class. :) – Fran Jan 13 '19 at 21:34
  • Ooh, yes, if the class forces an encoding, then it's another story :) – Phelype Oleinik Jan 13 '19 at 21:37
  • For what it’s worth, I still put ``inputenc` in my PDFTeX examples here, because people sometimes still use old software. I add a comment that it’s been the default since 2018. – Davislor May 01 '20 at 11:28