12

I have this line in a file which I use at the same time for my phd thesis and for a paper.

\setlist*[enumerate,1]{label=\it{\arabic*)}}

For the paper which is

\documentclass[letterpaper, 10 pt, conference]{ieeeconf}  % Comment this line out

it does not give me any error.

But for the thesis which is something like:

\documentclass[english,11pt, a4paper, twoside, openright]{memoir}

It gives me the error:

! Class memoir Error: Font command \it is not supported.
See the memoir class documentation for explanation.

I understand that the class memoir does not allow the use of old commands like \it but how can I have the file still existing and tell it:

if a memoir is calling you then do not take this line into account

else take it into account

Something like that.

Thanks for the precious help.

Mico
  • 506,678
desmond13
  • 1,024
  • 2
    use \itshape instead of \it: label=\itshape\arabic*) –  Sep 21 '17 at 18:06
  • Have a look here https://tex.stackexchange.com/questions/16199/test-if-a-package-or-package-option-is-loaded then you can use \gdef\it#1{#1} for the true fork, when memoir is loaded. –  Sep 21 '17 at 18:15
  • 1
    \it never took an argument so \it{\arabic*} looks wrong anyway, the argument form is \textit{\arabic*} and that is defined in the latex format so will work here. – David Carlisle Sep 21 '17 at 18:32

2 Answers2

15

The Plain-TeX font-switching commands -- \rm, \sf, \tt, \bf, \it, \sc and \sl -- are not defined in the LaTeX kernel, and they are considered badly deprecated in LaTeX documents. One should use \rmfamily, \sffamily, \ttfamily, \bfseries, \itshape, \scshape, and \slshape instead.

Some, but definitely not all, LaTeX document classes do define the Plain-TeX font-switching commands. As you've noticed and report correctly, ieeeconf is such a document class. In contrast, memoir does not define these commands -- unless you provide the document class option oldfontcommands:

\documentclass[english, 11pt, a4paper, twoside, openright, oldfontcommands]{memoir}

Even then, memoir will issue warning messages whenever one of the deprecated commands is encountered.

Incidentally, neither \it nor \itshape take an argument -- they are switches. Hence, it's not entirely correct (syntactically speaking) to write

\setlist*[enumerate,1]{label=\it{\arabic*)}}

Instead, do get used to writing

\setlist*[enumerate,1]{label={\itshape\arabic*)}}

This'll work "out of the box" with all document classes, not just ieeeconf.

Mico
  • 506,678
6

Use the oldfontcommands class option:

\documentclass[...,oldfontcommands]{memoir}
Peter Wilson
  • 28,066