In case you have not found it yet by yourself: [1] discusses this.
TL;DR you will need some extra circuits (monostable circuit or timer IC NE556) to do this.
And in addition to the StackExchange post you will also need a circuit for the falling edge of the latched switch.
Then you can use the "momentary switch approach" [2]
[1] https://electronics.stackexchange.com/questions/589099/converting-latching-switch-to-momentary-output
[2] https://raspberrypi.stackexchange.com/questions/77905/raspberry-pi-3-model-b-dtoverlay-gpio-shutdown#77918