Am Montag, dem 07.04.2025 um 20:01 +0300 schrieb Ethan: > For the past day I've been struggling with an issue regarding the > `siunitx` package. I've tried using the `\unit` command to format > some units, but I kept getting an error message saying it can't > operate while the `units` package is loaded. I did some digging (read > the "LaTeX Configuration" file and compiled my file to TeX and read > it), and figured out that the problem was that Lyx was automatically > inserting a `\usepackage{units}` command when I used the `\unit` > command in math mode (when using it in ERT it does not > \usepackage{units}` does not get inserted). I've somewhat gotten > around the problem by creating an empty `units.sty` file in my > `texmf` directory, which allows the file to compile correctly, but I > still get the error from `siunitx`. > I request a toggleable option for the `units` package, or to just > stop using it, as it has been superseded by `siunitx`. I attach below > a minimal LyX example and its compilation to LaTeX, in plain text (as > I don't know if this email can receive files). I've only kept the > line `\sisetup{inter-unit-product=\ensuremath{{\cdot}}}` in the > preamble to show the package `siunitx` does work with my hack but > doesn't without it. > System information: Windows 11 Version 24H2, AMD64, LyX 2.4.3 (2025- > 01-09), Qt Version (run&compile-time): 6.8.1
Having an option to control this in Document > Settings > Math Options would be good, yes. For the time being, insert to Document > Settings > Local Layout: Provides units 1 HTH, -- Jürgen -- lyx-devel mailing list lyx-devel@lists.lyx.org https://lists.lyx.org/mailman/listinfo/lyx-devel