fix latex test
add TimedLog for debugging
fix latex generation caused by bug in patch