Skip to content

An editor for math equations for iOS

License

Notifications You must be signed in to change notification settings

lieudd/MathEditor

 
 

Repository files navigation

MathEditor

CI Status Version License Platform

MathEditor is a WYSIWYG editor for math formulas on iOS. It provides a UIView which edits math while it is being rendered. For rendering math it uses the iosMath library to get LaTeX style typesetting.

A math keyboard is included with the editor. However you can supply your own keyboard or use the system default keyboard as well. The math keyboard is optimized to easily enter certain components like fractions, exponents and square roots.

Example

There is a sample app included in this project that shows how to use the math editor as well as code for automatically resizing the editor as the text in it changes. To run the same app, clone the repository, and run pod install from the Example directory first. Then run the MathEditor_Example app.

Requirements

MathEditor works on iOS 8+ and requires ARC to build. It depends on the following Cocoapod:

Additionaly, it depends on the following Apple frameworks:

  • Foundation.framework
  • UIKit.framework

Installation

MathEditor is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "MathEditor"

Usage

The library provides a class MTEditableMathLabel which is a UIView that supports editing math equations. Simply add it to your storyboard or create it programmatically.

#import "MTEditableMathLabel.h"

MTEditableMathLabel* label = [[MTEditableMathLabel alloc] initWithFrame:...]
label.delegate = self;

Keyboard

To use the provided keyboard, set:

label.keyboard = [MTMathKeyboardRootView sharedInstance];

You can set any keyboard you want to use. A keyboard needs to be a UIView and implement the MTMathKeyboard interface.

To use the default system keyboard, set keyboard = nil. (This is the default.)

License

MathEditor is available under the MIT license. See the LICENSE file for more info.

About

An editor for math equations for iOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 98.8%
  • Ruby 1.2%