Add debug output in latex_tools_replace