

An API for typesetting LaTeX onboard your iOS device - steeleduncan
https://github.com/vallettaventures/Texpad-API/blob/master/Readme.md

======
sp00nman
I've been looking for something like this, but I'm curious - how does it
transfer the data?

~~~
peterkelly
It uses a combination of UIApplication's openURL method to trigger Texpad, and
UIPasteboard to transfer the data.

Basically you create a request object and add one or more LaTeX files (plus
images, BibTeX files, and anything else that's necessary), and then pass that
to the API. It puts the data in a named pasteboard, and uses openURL to invoke
Texpad.

iOS then switches across to Texpad, which takes the data you gave it and
produces a PDF file. Texpad sends the PDF file back to your own application
(via a return URL you provided it with), and you receive the file via
UIApplicationDelegate's handleOpenURL method.

I've been working with the developers of Texpad to get this integration
working with my own app (UX Write), and found that it's a very smooth process.

The only downsides are that the user sees their device switch from your app to
Texpad and back (which may be a bit confusing if they don't know what's going
on), and since iOS can potentially kill background apps at any time, you have
to save any necessary state so that if you _are_ terminated, you can restore
that state and pick up where you left off once you're re-activated with the
received PDF file. But this is relatively easy to solve, and given the lack of
(custom) shared libraries on iOS I think overall it works pretty well.

~~~
unwind
No idea if you're part of the project, but the second-to-last headline on the
page needs editing. Just noticed and thought I'd point that out.

