  Let $\pi$ be a cuspidal, cohomological automorphic representation of an inner
form $G$ of $\mathrm{PGL}_2$ over a number field $F$ of arbitrary signature.
Further, let $\mathfrak{p}$ be a prime of $F$ such that $G$ is split at
$\mathfrak{p}$ and the local component $\pi_\mathfrak{p}$ of $\pi$ at
$\mathfrak{p}$ is the Steinberg representation. Assuming that the
representation is non-critical at $\mathfrak{p}$ we construct automorphic
$\mathcal{L}$-invariants for the representation $\pi$. If the number field $F$
is totally real, we show that these automorphic $\mathcal{L}$-invariants agree
with the Fontaine-Mazur $\mathcal{L}$-invariant of the associated $p$-adic
Galois representation. This generalizes a recent result of Spiess respectively
Rosso and the first named author from the case of parallel weight $2$ to
arbitrary cohomological weights.
