An InDesign script that generates mathematically precise modular and baseline grids based on proportional ratios, ensuring alignment between typographic leading and spatial divisions.
This script automates the creation of modular grid systems in Adobe InDesign, calculating page dimensions and guide placements that maintain both proportional relationships and baseline grid alignment. Unlike manual grid construction, this approach ensures that horizontal leading units align precisely with vertical spatial divisions, creating a unified system for both typography and layout.
- Proportional Ratio System: Choose from six classic ratios (Golden Section, Root 2, Root 3, 4:3, 3:2, 16:9) or define custom proportions
- Grid Division Control: Specify any number of divisions to create modular units across the page
- Baseline Grid Integration: Automatically calculates page height to ensure baseline grid aligns with modular divisions
- Dual Margin Systems:
- Van de Graaf canon (classical book proportions)
- Single grid unit (contemporary symmetric margins)
- Paragraph Style Generation: Optional creation of six hierarchical text styles sized proportionally to grid width
- Master Spread Setup: Generates reusable master pages with complete guide systems
- Download
ModularGridMaker-Complete_3.jsx - Place the file in your InDesign Scripts folder:
- macOS:
~/Library/Preferences/Adobe InDesign/[Version]/[Language]/Scripts/Scripts Panel/ - Windows:
C:\Users\[Username]\AppData\Roaming\Adobe\InDesign\[Version]\[Language]\Scripts\Scripts Panel\
- macOS:
- Restart InDesign or refresh the Scripts panel
- Open InDesign (or have a document open)
- Open the Scripts panel (Window > Utilities > Scripts)
- Double-click
ModularGridMaker-Complete_3.jsx - Configure the dialog options:
- Ratio: Select preset or enter custom value
- Max Height: Maximum page height in points (script will find largest aligned dimension below this)
- Grid Divisions: Number of horizontal and vertical modules
- Baseline Leading: Leading value in points for baseline grid
- Margin Setup: Choose Van de Graaf canon or single grid unit
- Create Paragraph Styles: Optional generation of six text styles
- Click OK
The script will:
- Calculate optimal page dimensions
- Create a named master spread
- Generate horizontal and vertical guides
- Set up baseline grid at half the leading value
- Apply margins according to selected system
- Create paragraph styles (if selected)
The script solves a common problem in modular grid design: aligning typographic baseline grids with spatial divisions. Traditional modular grids often create tension between horizontal leading units and vertical spatial rhythms.
This script calculates page height by:
- Determining space needed for gutters (leading × grid divisions - 1)
- Finding available space for modules (max height - gutter space)
- Calculating how many complete leading units fit per module
- Setting final height to maintain alignment
This ensures that every horizontal guide position corresponds to a multiple of the baseline leading, creating a unified system where typography and spatial layout share the same underlying rhythm.
Guides are placed using a symmetric offset system:
- For each division line, guides are placed above and below
- Offset distances increase proportionally from center
- This creates nested spatial relationships within each module
Vertical guides follow the same logic, using leading scaled by the proportional ratio to maintain consistent spatial relationships in both dimensions.
When paragraph style generation is enabled, the script creates six styles based on the grid system:
- Header: Two ratio steps above body (e.g., body × 1.618²)
- Subhead: One ratio step above body (e.g., body × 1.618)
- Body: Calculated as text width ÷ 30
- Caption: One ratio step below body (e.g., body ÷ 1.618)
- Notes: Same as caption
- Folio: One ratio step below notes
All sizes are rounded to whole point values, and leading is calculated as the smallest multiple of half the baseline grid that exceeds the text size. This maintains baseline grid alignment while providing appropriate spacing for each size.
Classical book proportion system based on ninefold division:
- Inner margin: 1 unit
- Top margin: 1 unit
- Outer margin: 2 units
- Bottom margin: 2 units
For grids with 4 or fewer divisions, margins are set to zero to maximize usable space.
Contemporary symmetric system:
- All margins: 1 grid module + 1 leading unit
- Measurement units are set to points for precision
- Ruler origin is set to page origin for consistent measurements
- Baseline grid is set to half the leading value for finer typographic control
- The script works with existing documents or creates new ones
- Master spreads are automatically applied to all pages
Standard Book Layout
- Ratio: Golden Section (1.618)
- Max Height: 792 pts (11 inches)
- Grid: 9 divisions
- Leading: 12 pts
- Margins: Van de Graaf canon
Poster Grid
- Ratio: Root 2 (1.414)
- Max Height: 1008 pts (14 inches)
- Grid: 6 divisions
- Leading: 18 pts
- Margins: One grid unit
Custom Academic Paper
- Ratio: Custom (1.5)
- Max Height: 660 pts
- Grid: 12 divisions
- Leading: 11 pts
- Margins: One grid unit
- Adobe InDesign CS6 or later
- Basic understanding of modular grid systems
- Recommended: familiarity with master pages and paragraph styles
Christopher Swift
Assistant Professor, Department of Art & Design
Binghamton University (SUNY)
MIT License - feel free to use, modify, and distribute as needed.
This script emerged from research into systematic approaches to page design and the relationship between mathematical proportions and typographic rhythm. The alignment algorithm addresses a practical challenge in implementing Josef Müller-Brockmann's modular grid principles while maintaining Jan Tschichold's attention to baseline grid consistency.