*! version 3.8.7 10Sep2025

Title

regtex -- Export regression results to publication-ready LaTeX tables

Syntax

regtex model_list [if] [in], SAVing(filename)
[DECimal(#)
STARLevels(numlist)
REPLace
VCE(vcetype)
Title(string)
threeline
LANDscape
modelnames("name1" "name2" ...) ]

Description

regtex exports regression results from multiple models to a publication-ready LaTeX table.
It automatically handles coefficient formatting, significance stars, standard errors, and model statistics.
The output is a complete .tex file with proper LaTeX document structure.

Key features:

- Supports multiple regression models in one table

- Formats coefficients and standard errors with significance stars

- Auto-removes trailing zeros in decimals

- Includes landscape mode and three-line table formatting

- Generates full LaTeX document with required packages

- Custom model names with support for spaces (use quotes)

Comparison with reg2tex:

- regtex outputs LaTeX code for basic OLS regression model tables and can be compiled into PDF documents with one-click

- regtex supports limited regression types compared to reg2tex

- When inserting into thesis frameworks generated by art2tex.ado, the preamble needs to be manually deleted

- reg2tex is based on esttab.ado and supports various regression models compatible with esttab

- reg2tex outputs LaTeX-compliant tables that can be directly inserted into art2tex thesis frameworks

- These are two independent ado files - users can choose according to their needs

Options

Required

saving(filename) specifies the output .tex file path.

Main

decimal(#) sets decimal places for numbers (default: 3).

starlevels(numlist) sets p-value thresholds for stars (default: 0.10 0.05 0.01).

replace overwrites existing file.

vce(vcetype) specifies variance-covariance estimator (e.g., vce(robust)).

Formatting

title(string) adds table caption.

threeline adds three-part table with significance note.

landscape orients table in landscape mode.

modelnames("name1" "name2" ...) provides custom model names. Names must be quoted and separated by spaces.
Number of names must match number of models. Names may contain spaces if enclosed in quotes (e.g., modelnames("Baseline" "Full Model")).

Examples

Basic usage with two models

. sysuse auto, clear

. regtex "price weight" "price weight mpg", saving("table1.tex") replace

Advanced options with custom formatting

. regtex "price weight" "price weight mpg", ///

saving("table2.tex") replace ///

decimal(2) ///

starlevels(0.05 0.01) ///

vce(robust) ///

title("Auto Price Regressions") ///

threeline ///

landscape ///

modelnames("Simple Model" "Extended")

Authors

Wu Lianghai

School of Business, Anhui University of Technology(AHUT), Ma'anshan, China

agd2010@yeah.net

Wu Hanyan

School of Economics and Management, Nanjing University of Aeronautics and Astronautics(NUAA), China

2325476320@qq.com

Wu Xinzhuo

University of Bristol(UB), UK

2957833979@qq.com

Please report issues and suggestions to the authors.

Acknowledgment

We sincerely appreciate Kit Baum and Christopher F. Baum for their prompt guidance and revision suggestions!

Version

regtex version 3.8.7 - 10 September 2025

Updates:

- Added comparison section with reg2tex

- Added acknowledgment section

- Fixed modelnames() option to support quoted names with spaces

- Added model name count validation

- Improved error handling for model specification