Skip to content
forked from dxddxx/TeXicode

TeX Terminal Renderer, a TeX renderer in the terminal that renders TeX into your terminal by rendering the TeX

License

Notifications You must be signed in to change notification settings

cjccjj/TeXicode

 
 

Repository files navigation

TeXicode, short for TeX to Unicode, a CLI that turns TeX math expressions into Unicode art.

TeXicode in Reddit code blocks

  1. Visit the TeXicode website, copy output to clipboard
  2. Make a new line in Reddit text field (check line spacing, if there is no line spacing above and below the cursor, it means Reddit does not see it as a separate line) Reddit1.png
  3. Add code block Reddit2.png
  4. Paste Reddit3.png If the output from TeXicode is a single line, can be placed inline using Code instead of Code Block

CLI

Install

with pipx (recommended)

pipx install TeXicode

or with pip

pip install TeXicode

Basic Usage

  • txc '\LaTeX' to output Unicode art
    • replace your own TeX equation inside quotes
    • use single quotes
    • if expression contains single quotes like f'(x), replace with f\'(x)
    • \[ \], \( \), $ $, $$ $$, \begin{...} \end{...} is optional
  • Add -c at the end of the command to output in color (black on white)
  • Unsupported commands will be rendered as ?, or raise an error. If you see these or other rendering flaws, please post an issue, most can be easily fixed.

Rendering Math in Markdown

  • txc -f filename.md to replace latex expressions in markdown files with Unicode art in text blocks.
  • Pipe into a markdown renderer like glow for ultimate markdown previewing:

Here is example.md rendered with txc -f example.md -c | glow, using the JuliaMono font.

Screenshot

Features

  • Supports most LaTeX math commands
  • Uses Unicode
    • Not limited to ASCII characters
    • Unicode italic glyphs are used to differentiate functions from letters, similar to LaTeX
  • Works with any good terminal font
    • Does not use any legacy glyphs
    • Go to src/arts.py, comment/uncomment some parts if your font support legacy glyphs to get even better symbols

About

TeX Terminal Renderer, a TeX renderer in the terminal that renders TeX into your terminal by rendering the TeX

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Python 99.0%
  • Shell 1.0%