LaTeX to InDesign

This script is part of the Type and Text collection. See the full collection here

The ambition of the scripts described here and in the attached PDF is to convert LaTeX documents to InDesign. The scripts attempt to include as many LaTeX features as possible; see the feature list below.

However, there are many LaTeX implementations and hundreds—if not thousands—of packages that add functionality to some or all LaTeX versions. Therefore it’s unlikely that the scripts are able successfully to convert all LaTeX documents. But because of the way the main converter is set up it’s not too complicated to add and/or change functionality. If you notice any glaring gaps you can write to me, see the link at the bottom of this page.

Videos

I recorded some (YouTube) videos to illustrate a few features of the converter:

Installation

Convert a file

Equations

Citations and bibliography

Note: The script’s behaviour can be different in some details from what is shown in the videos because the videos aren’t always updated. The PDF manual is always up to date.

Feature list

What is converted

  • \newcommand (and \renew- and \providecommand and \def) statements are processed.
  • Accented, mathemathical, and Greek characters are processed. Not all math characters are included, but it’s not difficult to add characters to the character maps. The manual explains how to go about that.
  • Many equations are converted. They appear as normal text and can be styled. The original LaTeX code is stored at display equations and can be retrieved easily in case of problems. Equation arrays are not (yet) converted. Apart from that there will be equations that the converter can’t handle. The manual describes what to do when that happens.
  • During the conversion, tables and figures are placed as anchored floats on the pasteboard and can be placed later. Labels (i.e. cross-reference targets) are made visible clearly so that it’s easy to determine where the floats should be placed.
  • Figure scaling (relative and absolute) is supported.
  • Figure and table numbering is handled by InDesign’s paragraph numbering.
  • Cross-references are converted to InDesign cross-references. They update automatically.
  • Various list types (itemise, enumerate, description) are processed and numbered with InDesign’s paragraph numbering. Newtheorem items are processed as well.
  • Instances of tabbing are converted to simple tabbed lists.
  • Footnotes are converted to InDesign footnotes. Footnote marks are converted to footnotes because there is no InDesign equivalent.
  • Margin paragraphs are converted to custom anchored text frames and placed in the outside margin.
  • Index entries are converted to InDesign topics and page references. This is largely unproblematic but page ranges need some attention in the form of a script.
  • If a .bib file is present, the converter processes citations in various formats (numbered, full text) and a bibliography is generated.
  • Hyphenation exceptions are processed. They’re applied in the document or added to the exception dictionary.
  • Comments are moved to anchored text frames on the pasteboard.

And what is not (yet)

Some (maybe all) of the missing items listed here will be implemented later.

  • Not all equations are converted. They are highlighted in the text. Equation arrays are (still) ignored on purpose, and there may be certain equations that the script doesn’t handle. Please report these.
  • Only one parameter of figures is handled: scaling (both percentages and absolute values). Other possibilities (rotation, cropping, etc.) are not (yet) supported.
  • Over- and underlining isn’t handled.
  • The picture environment, used for line drawing, isn’t supported at all.
  • Only one bibliography format is used to generate a document’s bibliography (natbib). The text explains how you can add other styles.

The to-do list

  • Integrate numbering and figure placement. For practical reasons these two are now separate scripts. They could be integrated in the main script.
  • Equation arrays and further work on display equations.
  • The tabbing environment.

Sources

As reference I used Leslie Lamport’s LaTeX: A Document Preparation System. I also consulted Mittelbach and Goossens’s The LaTeX Companion.

My main test bed is a 215-page PhD thesis entitled Terahertz Time-Domain Spectroscopy of Biological Macromolecules, which contains many equations, figures, tables, and other interesting material. The thesis was prepared in MikTeX. (Many thanks to its author (my step-daughter), Kasia Tych, for letting me use it.) I also used a number of (very) different LaTeX files kindly supplied by Laurent Tournier, which use a lot of equations, footnotes, and index entries.


Revision history

8. 28 Apr. 2026

– Added a section on the Radical Pie equation editor.

7. 19 Aug. 2025

– Added a section on fonts, math fonts, and composite fonts.

– Improved handling of math characters.

6. 15 Mar. 2025

– Revised the chapter on Latex2Ind and added (a modified version of) the script to the download.

5. 9 Feb 2025

– Added a chapter on how to use the Latex2Ind script and added (a modified version of) it to the download. Updated the manual in various places. The converter itself didn’t change.

– Added a tip: the converter has no progress bar, but when you open the GREP tab of the Find/Change window you’ll see all the regular expressions flash by that are used by the converter. Makes a good progress indicator because there are zillions of GREP searches and replacements.

– Added a section on InDesign pain points.

– Added a note on line endings.

– Added more elaborate paragraph numbering to section-heading styles and added a section outlining the numbering system.

– Improved the presentation of various lists.

– Added support for the tabbing environment.

– Some more document cleaning added.

– Bug fixes.

4. 22 Jan 2025

– Added \pageref to cross-reference processing.

– Added support for various types of box (mbox, makebox, framebox, fbox).

– Expanded table processing: added support for column spans; included inline tables; improved the processing of column properties such as width and alignment. There is still some work to do on tables.

– The chapter on tables was substantially rewritten.

3. 6 Jan 2025

– Bug fixes.

– Added support for column-spanning figures (figures containing more than one minipage environment).

– Added a script to apply a Math character style to all math symbols that can’t be displayed using the default font.

2. 2 Jan 2025

– Bug fixes.

– Added subscripts for log-like functions.

– Sum, integral, and product are now sensitive to whether they are in a display or an inline equation (position of the arguments).

– Added support for quotes and quotations.

1. 27 Dec. 2024 — first drop.

Peter Kahrel Script Repository
Hosted as a community service, and with deep appreciation, by CreativePro.com


Scripts by Topic | Script Index
Basic Script Installation and Use
How to Modify or Configure These Scripts
Resources for Scripting and Publishing Automation
About This Repository


Repository Home Page


Contact Peter Kahrel


Note to users: You run scripts at your own risk: CreativePro and the author accept no liability for anything that may be caused by any of these scripts. Always take the necessary precautions. We encourage you to save backups and test scripts on copies of your documents.

Bookmark
Please login to bookmark Close

This article was last modified on August 22, 2026

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

Loading comments...