Previous step: “More TeXML

Better layout

This example demonstrates how to tune the layout of a generated LaTeX code. The result can be made indistinguishable from code written by a human.

On the previous step, we got the following LaTeX document:

\documentclass[a4paper]{article} ....
Hello, {\it{}World}!

A better code layout is:

Hello, {\it World}!

The source TeXML code uses the attributes nl2 and gr to tune the layout:

  <cmd name="documentclass" nl2="1">
  <env name="document">
    Hello, <group><cmd name="it" gr="0"/>World</group>!

Next step: “PDF literal strings

This page: http://getfo.org/texml/tour_better.html