Using the listings package. I am curious as to why the LaTeX language
has to be loaded and used as [LaTeX]TeX, but a language or dialect I
define myself can be both loaded and used by simple name alone.
Am 28.02.2024 um 01:58 schrieb Peter Flynn:
Using the listings package. I am curious as to why the LaTeX
language has to be loaded and used as [LaTeX]TeX, but a language or
dialect I define myself can be both loaded and used by simple name
alone.
Maybe I don't get your point,
As far as I understand the manual there are single languages and
languages with one or more dialects. In the former case you can load
the language by using its name. For languages with dialects you need
to specify which dialect you want to use. But it is possible to
define a default dialect for a language. In that case you can load
the language with that dialect by simply using the language name.
According to the manual for TeX the default dialect is plain. So just
loading TeX as language would invoke plain TeX.
In your example below you define a new language called LaTeXe based
on [LaTeX]{TeX}. Now LaTeXe is a language without dialects and can be
loaded without specifying one.
If I understand you correctly you would like to load [LaTeX]{TeX} by
just specifying LaTeX. Which doesn't work.
Now I tried something which presumably doesn't make sense, but it
works.
\lstdefinelanguage[Peter]{MyHTML}[]{HTML}{...} \lstdefinelanguage[Peter]{MyXML}[]{XML}{...}
You can define several languages with the same dialect name. So
specifying just the dialect is not distinct.
I hope this helps a bit.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 483 |
Nodes: | 16 (2 / 14) |
Uptime: | 84:31:10 |
Calls: | 9,576 |
Calls today: | 7 |
Files: | 13,666 |
Messages: | 6,143,358 |
Posted today: | 2 |