Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Support greek lambda character #214

@dbrakenhoff

Description

@dbrakenhoff

First off, thanks for this great package! I'm not sure if this would qualify as a bug or a feature, but it would be great to get access to the $\lambda$ character using latexify.

Environment

  • OS: Ubuntu 24.04
  • Python: 3.12
  • Package manager: pip 24.2.1
  • Latexify version: latest (54dc869)

Description

I would like to use the $\lambda$ symbol in my formulas but currently that raises an error.

Reproduction

import latexify

@latexify.function(identifiers={"foo": "f", "lambda_": "lambda"}, use_math_symbols=True)
def foo(lambda_):
    return lambda_ + 1

foo

This gives me a `ValueError: 'lambda' is not an identifier name.`.

Expected behavior

I would expect to be allowed to use the lambda symbol in LaTeX.

If I comment out these two lines, e.g. it does not throw an error when lambda is used. Obviously those line are probably there for a reason, so I'm not sure what the consequences are when they are removed, but perhaps the restrictions on the value side of the identifiers could be a bit more lenient...?

if not str.isidentifier(v) or keyword.iskeyword(v):
raise ValueError(f"'{v}' is not an identifier name.")

Screenshot of the output when those lines are commented out.

Image

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions