Moving generic methods from EdgeWeight to LaTeXTool.