2

This is my second post in latex-SE. Here is a very (I think) basic question, but I could'nt find a precise answer yet:

What exactly does the command \documentclass[spanish]{article} and what sets it apart from the command: \usepackage[spanish]{babel}?

Thanks, in advance, for your kindly answer(s).

  • 1
    When you pass the option to \usepackage, that option will affect that specific package only. Other packages that happen to have an option named spanish will not (generally) know that you used that option. If you pass the option to \documentclass then the option becomes global and all packages that happen to have an spanish option will use it. (I'm pretty sure there is a duplicate of this, I just can't find it now) – Phelype Oleinik Apr 19 '19 at 23:43
  • Hello Phelype Oleinik. Now it is clear for me, Thanks! – Patone Apr 19 '19 at 23:48
1

When you pass the option to \usepackage, that option will affect that specific package only. Other packages that happen to have an option named spanish will not (generally) know that you used that option. If you pass the option to \documentclass then the option becomes global and all packages that happen to have an spanish option will use it.

The relevant bits of documentation can be found, in “LaTeX2ε for authors”, section 2.2 Class and package options:

enter image description here

and in the “The LaTeX2ε Sources”, section 67 user interface (note especially the last paragraph):

enter image description here

| improve this answer | |
  • Now it's very clear. I compose my documents using LyX, in spanish language. Now I see why LyX puts the line \documentclass[spanish]{article} at the very beginning of any exported file. Thanks, a lot, Phelype! – Patone Apr 20 '19 at 0:29
  • 1
    @Patone You're welcome :-) – Phelype Oleinik Apr 20 '19 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.