In earlier work, the first named author generalized the construction of Darmon-style $\mathcal {L}$-invariants to cuspidal automorphic representations of semisimple groups of higher rank, which are cohomological with respect to the trivial coefficient system and Steinberg at a fixed prime. In this paper, assuming that the Archimedean component of the group has discrete series we show that these automorphic $\mathcal {L}$-invariants can be computed in terms of derivatives of Hecke eigenvalues in $p$-adic families. Our proof is novel even in the case of modular forms, which was established by Bertolini, Darmon and Iovita. The main new technical ingredient is the Koszul resolution of locally analytic principal series representations by Kohlhaase and Schraen. As an application of our results we settle a conjecture of Spieß: we show that automorphic $\mathcal {L}$-invariants of Hilbert modular forms of parallel weight $2$ are independent of the sign character used to define them. Moreover, we show that they are invariant under Jacquet–Langlands transfer and, in fact, equal to the Fontaine–Mazur $\mathcal {L}$-invariant of the associated Galois representation. Under mild assumptions, we also prove the equality of automorphic and Fontaine–Mazur $\mathcal {L}$-invariants for representations of definite unitary groups of arbitrary rank. Finally, we study the case of Bianchi modular forms to show how our methods, given precise results on eigenvarieties, can also work in the absence of discrete series representations.