Skip to content

Converts copied Word document fragments to LaTeX in the clipboard

Notifications You must be signed in to change notification settings

engideer-tech/Word2LaTeX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Word2LaTeX

Quick and dirty Word to LaTeX snippet in-clipboard converter. Requires Windows 10+, Powershell 7+, and Node 14.20+.

Usage

  1. Copy a text fragment from a Word document
  2. Run RunMe.ps1 (useful to create a shortcut for quick access)
  3. Paste into a LaTeX editor

Features

  • Supports italics, bold, and unordered lists
  • Translates Word new-line (Shift+Enter) to LaTeX new-line (\\)
  • Makes paragraphs with font sizes 18, 16, 14, 12 into chapters, sections, subsections, and subsubsections respectively
    • If a section is numbered (e.g., "1.1 Introduction"), the number is set as the section's \label{}
  • Replaces Word en–dashes with LaTeX em—dashes and [citation] with \cite{citation}
  • Text with the font set to Consolas becomes monospace \texttt{text}
  • Links to figures: "figure a.jpg and b.png" becomes figure \ref{fig:a.jpg} and \ref{fig:b.png} (must include extension)
  • Links to sections: "section 1.1" becomes section \ref{1.1}
  • Links to listings: "listing foo-bar" becomes listing \ref{listing:foo-bar}
  • Supports footnotes
    • Only simple text and links inside footnote content is parsed

About

Converts copied Word document fragments to LaTeX in the clipboard

Topics

Resources

Stars

Watchers

Forks