Skip to content

convert TeX style math ($math$ and $$aligned math$$) to amsmath style: \(math\) and \[aligned math\]

License

Notifications You must be signed in to change notification settings

eike-fokken/dollar2math

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dollar2math

converts TeX style math ( $ math $ and $$ aligned math $$) to amsmath style: \(math\) and \[aligned math\] takes exactly one filename as input and outputs the transformed file contents to std::out.

Written in C++17 (for the filesystem library).

Seems to work (tested only on my linux machine) with clang++ and g++ on the test.tex file provided. No other compilers were tested.

This probably only works with utf-8 or ascii encoded files. Differently encoded file contents may be corrupted during transformation (of course the files themselves are not modified, as output is only sent to std::cout).

So please check the output before blindly removing your old file.

Installation

Run

cmake -DCMAKE_BUILD_TYPE=Release -S . -B build

followed by

cmake --build build

and find the binary under ./build/dollar2math.

Usage

Call like

dollar2math oldstyle.tex

to get output in the terminal.

On UNIX shells call like

dollar2math oldstyle.tex > newstyle.tex

to get a file with the amsmath style.

About

convert TeX style math ($math$ and $$aligned math$$) to amsmath style: \(math\) and \[aligned math\]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published