CTAN Comprehensive TeX Archive Network

Directory macros/latex/contrib/crefthe

README.md

crefthe - cross referencing with proper definite articles

"crefthe" is a package aimed at helping \cref addressing the definite articles properly (especially for the article contractions in many European languages).

Motivation

By default, when using cleveref's \cref to reference theorem-like environments, the names do not contain definite articles. This may be acceptable for English, but certainly not good enough for languages such as French, Italian, Portuguese, Spanish, etc. – in these cases there shall be grammatical errors and would give you a strong feeling that it is machine-generated.

As an example, if we define the French names to be:

\crefname{theorem}{le théorème}{les théorèmes}
\crefname{proposition}{la proposition}{les propositions}

Then when one writes (which means "We can deduce this from ..."):

On peut le déduire de \cref{thm1,thm2,prop3}.

the result would be:

On peut le déduire de les théorèmes 1 et 2 et la proposition 3.

which is wrong, as the correct result should be:

On peut le déduire des théorèmes 1 et 2 et de la proposition 3.

\cref would not be able to handle such cases correctly.

The solution

Thus, it would be better to have a new command \crefthe[<prep>]{<labels>}, and to use it like

\crefthe[de]{thm1,thm2,prop3}

in order to get "des théorèmes 1 et 2 et de la proposition 3".

Usage

Simply load the package with:

\usepackage{crefthe}
"crefthe" uses "cleveref" internally, thus it should usually be placed at the last of your preamble.

Before everything, you need to define the names, which can be done with \crefthename. Its syntax is similar to \crefname, but now you can specify the definite articles, for example:

\crefthename{theorem}[le]{théorème}[les]{théorèmes}

Then you can use the command \crefthe as follows:

  • \crefthe[<prep>]{<labels>}
    • This will pass the preposition <prep> to the definite articles that follows. Its behavior depends on the current language (for example, in Spanish, <prep> is passed only to the first definite article, while in French it is passed to everyone).
  • \crefthe-[<prep>]{<labels>} and \crefthe+[<prep>]{<labels>}
    • In case the automatic version does not meet your needs, here are two manual ones. The - version passes the preposition <prep> only to the first definite article, while the + version passes <prep> to every definite article.
There is also a stared version \crefthe* for generating the same text but without hyperlinks.

For more information, please refer to its documentation.

License

This work is released under the Project Public License, v1.3c or later.

Download the contents of this package in one zip archive (64.9k).

crefthe – Cross referencing with proper definite articles

By default, when using cleveref’s \cref to reference theorem-like environments, the names do not contain definite articles. In languages such as French, Italian, Portuguese, Spanish, etc. this results in incorrect grammar. For this purpose, the current package offers \crefthe, which handles the definite articles properly (especially for the article contractions in many European languages).

Packagecrefthe
Repositoryhttps://github.com/Jinwen-XU/crefthe
Version 2022-09-24
LicensesThe Project Public License 1.3c
Copyright2021–2022 Jinwen XU
MaintainerJinwen XU
Contained inTeX Live as crefthe
MiKTeX as crefthe
TopicsLabel and References
Experimental 3
...
Guest Book Sitemap Contact Contact Author