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.


Privacy
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.
Support
Contact me on Twitter or email me.
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.
DeTeXt uses a MobileNet_V2 PyTorch model trained on the Detexify training data, which was then translated to CoreML using coremltools.
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.
FAQ
-
Why doesn’t the app recognize my drawings correctly sometimes?
The classification model could always use some improvement, so do contact me if you find bugs or have any feedback to offer. You can DM me on Twitter or file an issue on the GitHub repo
-
Where is the app available?
The iOS app is currently available on the App Store for iPhones and iPads running iOS 14 or later. The Mac app is available on the Mac App Store and requires macOS 11.0 or later.
-
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?
No.
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.
Credits
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.
Release Notes
1.2.3
- Updated screenshots.
1.2.2
- Fixed small font sizes of text elements (command name, confidence score) on macOS.
1.2.1
- Drag and Drop support added for iPadOS and macOS.
- Menu command and keyboard shortcut (Cmd+R) added for clearing canvas on macOS.
1.2
- 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.
1.1.3
- Minor changes in layout and algorithm.
1.1.2
- 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
1.1.0
- 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.
1.0.3
- 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.
1.0.2
- 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).
- Created a separate ‘About’ tab item that gives details on how to give feedback, as well as the above privacy policy, details on how the app works and credits.
1.0.1
- Added support for iPad multitasking.
1.0.0
- Initial Release.