LTeX Language Server: LSP language server for LanguageTool :mag::heavy_check_mark: with support for LaTeX :mortar_board:, Markdown :pencil:, and others
Is your feature request related to a problem? Please describe.
The way ltex prefers to set the language for latex is to define it as a babel option.
There is also a way to do with \selectlanguage or that like, but this is more with multi-language documents.
For single language documents where \selectlanguage is not natural.
Documentation of babel itself suggests to specify language via \documentclass
as described in the headline because that way, language like german is set for related packages simultaneously.
In my special case, I have a header file which shall be uniform and so I load babel without language option to keep generality.
But exactly the form \documentclass[german]{article} preferred by babel is not recognized by ltex.
My workaround is to specify \selectlanguage{german} in addition to \documentclass[german]{article},
which is against single source principle and may introduce inconsistencies.
Describe the solution you'd like
I would like ltex to recognize language options in \documentclass and switch language accordingly.
For details see the documentation of babel.
Describe alternatives you've considered
There is not much alternative.
Maybe an addition: \PassOptionsToPackage{german}{babel} which preceeds \documentclass should work as well.
Additional context
I think no further context is needed.
Is your feature request related to a problem? Please describe. The way ltex prefers to set the language for latex is to define it as a babel option. There is also a way to do with
\selectlanguage
or that like, but this is more with multi-language documents. For single language documents where\selectlanguage
is not natural. Documentation ofbabel
itself suggests to specify language via\documentclass
as described in the headline because that way, language likegerman
is set for related packages simultaneously. In my special case, I have a header file which shall be uniform and so I loadbabel
without language option to keep generality. But exactly the form\documentclass[german]{article}
preferred bybabel
is not recognized byltex
.My workaround is to specify
\selectlanguage{german}
in addition to\documentclass[german]{article}
, which is against single source principle and may introduce inconsistencies.Describe the solution you'd like I would like ltex to recognize language options in
\documentclass
and switch language accordingly. For details see the documentation ofbabel
.Describe alternatives you've considered There is not much alternative. Maybe an addition: \PassOptionsToPackage{german}{babel} which preceeds
\documentclass
should work as well.Additional context I think no further context is needed.