Co-Authored-By: Brian Gough <brian.gough@overleaf.com> (cherry-picked from commit 67674b83efb452ece05cdc39525ee3a5eeb8a4d7)