Please review this package.
An example can be found at https://git-st.inf.tu-dresden.de/johannes.mey/relragtest1