https://github.com/DaveJarvis/KeenType Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} DaveJarvis / KeenType Public forked from jamespfennell/new-typesetting-system * Notifications * Fork 3 * Star 50 Pure Java typesetting system License View license 50 stars 3 forks Star Notifications * Code * Issues 5 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights DaveJarvis/KeenType This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 1 tag Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/D] Use Git or checkout with SVN using the web URL. [gh repo clone DaveJa] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. This branch is 194 commits ahead of jamespfennell:main. Latest commit Dave Jarvis and Dave Jarvis Add links to libraries and apps ... 2fa53c6 Jan 23, 2023 Add links to libraries and apps 2fa53c6 Git stats * 206 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time app Default no scaling Jan 23, 2023 bim Add scaling factor for scalable vector graphics Jan 23, 2023 docs Add sample output Jan 23, 2023 dvi Build JAR files having unique file names Jan 22, 2023 fonts Remove unused fonts from project resources Jan 21, 2023 lib Remove unused API Jan 23, 2023 log Build JAR files having unique file names Jan 22, 2023 svg Default no scaling Jan 23, 2023 tex Remove unnecessary unit test Jan 23, 2023 .gitattributes Move fonts, add missing build files Jan 12, 2023 .gitignore Fix DVI output filename Jan 21, 2023 LICENSE.txt Add missing files Jan 17, 2023 README.md Add links to libraries and apps Jan 23, 2023 settings.gradle Update root project name Jan 22, 2023 View code [ ] KeenType Requirements Build Application Library Rendering Output Organization License Changes README.md KeenType KeenType is a modernized version of a Java-based implementation of the New Typesetting System, which was heavily based on Donald E. Knuth's original TeX. This implementation provides a 100% pure Java library that can produce scalable vector graphics of mathematical expressions. All required fonts, font metrics, glyph mappings, and plain TeX files are included. Requirements Building software requires: * JDK 19 * Gradle 7.6 Build After cloning this repository, build the application as follows: gradle clean jar The compiled artifact is app/build/libs/keentype.jar. Application Run the application using any of the following commands: java -jar app/build/libs/keentype.jar docs/examples/sample.tex java -jar app/build/libs/keentype.jar docs/examples/equations.tex Open the resulting SVG file in an SVG editor to see the results. Library To use KeenType as a library: 1. Build the project. 2. Copy keentype-lib.jar into your application. Typeset an equation to SVG as follows: final var str = "$\\sigma=\\sqrt{\\sum\\limits_{i=1}^{k} p_i(x_i-\\mu)^2}$"; final var typesetter = new KeenType(); final var svg = typesetter.toSvg( str ); The svg string contains an SVG document. Note that instantiating KeenType will load and parse Knuth's plain.tex into memory. This is an expensive operation that will significantly reduce performance if executed in a critical loop. Preferably, the instance is reused until no longer needed. For example: final var typesetter = new KeenType(); for( int i = 0; i < 1000; i++ ) { System.out.println( typesetter.toSvg( equation[ i ] ) ); } Be sure to wrap TeX-based equations in $ or $$ prior to typesetting. Rendering The EchoSVG library is a modern fork of Apache Batik that can rasterize SVG documents. Output The following image shows various equations and mathematics being typeset in the Java-based desktop Markdown editor, KeenWrite: KeenType screeshot Organization The code is organized as follows: * app -- The main application launched when running the JAR file. * docs -- Information about changes and source code history. * dvi -- Typesets into the device independent format. * fonts -- Unused fonts. * lib -- Library for converting equations to renderable SVG documents. * log -- Logs information to the console. * svg -- Typesets into the scalable vector format. * tex -- Implements the typesetting system (fails the TRIPTEST). License See LICENSE for details. Changes See CHANGELOG.md for details about the modifications from the original implementation. About Pure Java typesetting system Resources Readme License View license Stars 50 stars Watchers 1 watching Forks 3 forks Releases 1 1.0.0 Latest Jan 23, 2023 Packages 0 No packages published Languages * Java 95.8% * TeX 4.2% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.