josephwright / siunitx

A comprehensive (SI) units package for LaTeX
LaTeX Project Public License v1.3c
350 stars 25 forks source link

local Per mode setting is ignored in align environment #722

Closed dflvunoooooo closed 4 months ago

dflvunoooooo commented 4 months ago

If I set the per-mode inside a align environment, it gets ignored, if the setting bevore was symbol. Here is an example

Screenshot_20240306_215326

Here is the code

\documentclass{scrartcl}

\usepackage{siunitx}
\usepackage{amsmath}    
\sisetup{
    per-mode = symbol,
}

\begin{document}
\qty{504.4667}{\per\second}
\begin{equation}
    \sisetup{per-mode=fraction}
    K_\mathrm{Zufällig} =\qty{504.4667}{\per\second}\\
     = \qty{1}{\volt\per\ampere}
\end{equation}

\begin{align}
    \sisetup{per-mode=fraction}
    K_\mathrm{Zufällig} &=\qty{504.4667}{\per\second}\\
     &= \qty{1}{\volt\per\ampere}
\end{align}

\end{document}

I don't know if it is related to #103.

josephwright commented 4 months ago

Table cells are groups in TeX: this is entirely normal behaviour.