Skip to content

[Request] Support plain text in chemical formulas #32

@github-young

Description

@github-young

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. You may mention other issues here.

  1. For some chemicals with plain text in the formula (subscript/superscript, and hyphen), it is difficult or impossible to typeset with typsium.
  2. The font in chemical formula representing non-numerical meanings should be upright. It is default in LaTeX, but seems that they are italic in Typst.
    For example:
  • The mixture of CuO and $Cu_2O$ should be $Cu_xO$:
#ce("Cu_x O")
  • The hyohen in "He-Ne" (referring to a kind of laser):
#ce("He-Ne")

Describe the solution you'd like
A clear and concise description of what you want.

Probably use the mhchem convention, where a pair of {} is used for these plain text in the chemical formula:

% \usepackage[version=4]{mhchem}
\ce{Cu_{x}O}

corresponds to:

#ce("Cu_(x)O")

but I don't know if the brackets are legal here in Typst.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions