DeTeXt — Find the LaTeX Command You Want
Finding the symbol you want to use in LaTeX can be hard since you can’t memorize all the commands and packages for every symbol. DeTeXt tries to solve this problem by giving you two ways to find the command you want:
Draw the symbol you want and DeTeXt’s neural image classification engine will identify what it thinks are the 20 most likely LaTeX commands that will generate a symbol closest to the one you drew. DeTeXt supports Apple Pencil drawings on the iPad.
Search the entire symbol set of 1098 symbols from packages like tipa, amsmath, amssymb, textcomp and more, in addition to the default mathematical symbols.
DeTeXt does not collect or store any personal data or information. All processing of drawings to find the corresponding symbol happens on your device.
DeTeXt does not display any advertisements, use any trackers or analytics, or send any data to any server.
How does it work?
Inspired by Detexify, I wanted to make a native iOS app for translating hand-drawn symbols to their corresponding LaTeX commands that was fast, efficient, and light. DeTeXt is the result.
The symbol images are generated by converting PDF files containing each symbol (made with LaTeX) to SVG files. All symbols are typeset in their default font.
Why doesn’t the app recognize my drawings correctly sometimes?
Where is the app available?
Will there be an Apple Watch app?
Maybe. It’s one of the top things I want to do, but I haven’t figured out yet how. My app requires the PencilKit API, which watchOS doesn’t support.
Will there be a native Mac-assed Mac app?
I would love to make a Mac-assed Mac app, but that will take time.PKCanvasView, which my app depends on, is only supported on Macs via Mac Catalyst. Unless Apple releases new APIs or port the existing ones to Macs (which I doubt, that’s why Catalyst exists), a native Mac app might not be possible.
Will there be a Web app/Android app?
Detexify is a great web app that you can use to find the command corresponding to a LaTeX symbol. My classification engine is based on the Detexify’s training data, which they’ve made publicly available.
I will not be making this app for Android. I built this app in any free time I can get away from graduate school, and it was primarily a means for me to learn CoreML, SwiftUI and Combine. I don’t have the time nor expertise to learn new APIs to build this app for Android (nor have I ever used Android), so I will focus on updating the iOS app.
Can I see the source code?
Yes. The source code for my app is available under the MIT License.
Thanks to Daniel Kirsch and the team at Detexify for their cool open-source web app that inspired me to make DeTeXt, and for providing the training data and prompt responses to my questions.
Thanks to Will Bishop for helping me figure out a tricky problem I had with the PencilKit APIs.
A big thanks to Hans for beta testing new features and giving valuable feedback.
Finally a big thanks to all the folks on the NetNewsWire Slack for being supportive and inspiring me to build my own iOS app.
- Under-the-hood changes that makes DeTeXt feel at home on iOS & iPadOS 15.
- Menu Command ‘Clear Canvas’ added on iPad with keyboard shortcut(Cmd-R).
- Simplified layout. About screen moved to popover.
- email link added in about screen.
- Updated screenshots.
- Fixed small font sizes of text elements (command name, confidence score) on macOS.
- Drag and Drop support added for iPadOS and macOS.
- Menu command and keyboard shortcut (Cmd+R) added for clearing canvas on macOS.
- macOS Catalyst app available. This is an initial release, and I will be working towards making it more polished and stable.
- UI overhaul.
- There is a known bug on iPad when long pressing in the search view to copy commands - it switches to the main drawing view.
- There is a known bug on macOS Catalyst where the canvas is cleared when switching between the drawing view and the search view.
- Minor changes in layout and algorithm.
- Fixed a bug where the bug would crash with images that were too big.
- Full coreML model is used for classification instead of quantised model. Accuracy of symbol classification should be slightly improved.
- Added tip to clear canvas by double tapping Apple Pencil(2nd generation).
- Symbols tab is renamed to search for consistency
- The list of symbols in search tab is now sorted by package name. You can also search by package name or command name. Searching by package name will show all commands from that package
- Minor visual improvements
- New icon
- Fixed the bug where drawings that were either too small or too big confused the model. The model is much more accurate over a wider range of drawing styles and sizes.
- You can copy commands to clipboard by long-pressing on a command and tapping Copy Command from the context menu.
- Accessibility labels throughout the app for images and text are much improved.
- Added feedback and tips sections in About tab.
- Fixed issue with some symbol images appearing squished or stretched.
- Changed size of symbol images to largetitle, which now means image sizes respond to Dynamic Type and are more accessible. Also added a divider between symbol image and command in drawing view.
- Added support for double tap to clear canvas with 2nd generation Apple Pencil
- Added subtle haptic feedback when detecting symbols and clearing canvas. Only works on modern iPhones (iPhone 7 and later).
- Added support for iPad multitasking.
- Initial Release.