math(jax) in epub for ipad - epub

dear experts: we would like to publish a magazine in epub format, so that it can be read on iPads. (our creation system is now multimarkdown -> specialized post-processor -> calibre .) the problem is that our magazine needs math. this is not a problem on the epub viewer in ubuntu, as invoked by calibre. it invokes mathjax just fine. however, transfering the epub to a (net-connected) ipad (open in ibook) does not execute mathjax to display the equation. eventually, I also want this to work in android tablets, but for now, ipads are our only target. (iphones are too small for us, anyway.)
I do not want to graphically render the content, because I have never seen this look nice.
is there any way to create an ebook with mathjax for an ipad? the best choice would be if there were a way to get ibooks to execute javascript? if not, is there a tool that makes an app with ebook-reader-like functionality from html5 (incl javascript)? (does the javascript need to be local, or can it be web-connected?) if not, then what?
sincerely, /iaw

You can use MathJax in iBooks if you include a (slimmed down) MathJax installation within the ebook itself. This is not a great solution, but it can be made to work. See this article for some tips on how to do it. It is a little out of date, but I think it should still work.
In terms of preprocessing, which I know you don't want to do, you could use MathJax to generate SVG versions of the mathematics, which look pretty good on iOS, and should render on other platforms as well, so that might be a viable option for you.

I have posted a short script in
https://tex.stackexchange.com/questions/154644/eqnarray-math-to-svg?noredirect=1#comment353540_154644
that is a start for converting inline mathjax into inline svg. this should work in any epub and remove the mathjax dependency. it still has baseline problems, but it's a start. it rescales. hopefully someone else will pick it up and make it more robust.

Related

Any good PDF export filter that works with Fast Report?

I recently discovered that the PDFs exported by the Fast Report's PDF export filter aren't displayed correctly in Mac OSX, iOS and Android devices.
Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.
I also tried to use the Gnostice export filter, but their demo installer didn't work in Delphi XE and when I contacted them, they took 15 days to send me some attached dcus which also didn't work. So I'm searching for another option.
If you know or use a PDF export filter which works with Fast Report, please let me know.
November 2015: Fast Report now have PDF/A support, with this option enabled the PDFs are fine on all platforms.
October 2014 - Fast Report 5 still seems to generate "Windows-only" PDF. A production-ready solution for this problem would be a benefit for cross-platform developers, given that Fast Report is the report generator bundled with Delphi.
Here is a fresh example generated with the Fast Report 5 demo, displayed with Adobe Reader 11 on Android 4.4:
And on Windows:
Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.
I'm not sure that should be taken literally, considering PDF is supposed to be a cross platform format. It more likely means they don't actually have the time, equipment or expertise to test with those platforms. The PDF export filter that I'm using is the one built into Fast Report! It surely has some bugs, but I managed to work around them. And I think that might also work for you: Start with a simple document that does export properly, start adding features until it brakes, then you know what brakes it and you'll know how to work around the problem.
From my experience, here's what got me into trouble:
Rounded corners in the PDF document didn't look like the ones in the Fast Report preview. My fix: Found a combination of settings that made the exported PDF look exactly like the preview document. For me rounded corners were just a cosmetic feature, and with cosmetics there's no "One Look"; The alternative worked just fine. This might actually be fixed in the most recent version, but I didn't bother changing the document to test.
Transparency issues and outline issues. When working with the Fast Report editor (and when looking at it's previews) it's easy to overlap objects. You don't see this because of the object opacity. When exporting to PDF overlapped objects somehow managed to "print" outlines, and it obviously looked ugly. My fix: pay closer attention to those objects, make sure they don't overlap or make sure they don't generate outlines if no outlines are supposed to be seen.
Also make sure you test using ADOBE Reader, on any of the given platforms. If it works with the Adobe reader but doesn't work with other readers, there might be a bug in the 3rd party reader!
Edit: Here (link) is a sample PDF document generated by my Fast Reports application. I have no idea what kinds of documents you generate, but in my book that's a mighty complex document. Notice the diagonal line that starts where the table data ends, notice the embedded images (bar code, stamp, signature).
I opened that document on the following mobile devices:
iPad, running iOS: The document renders 90% ok. Images are not rendered at all, but they're not important to my document (and that's very likely a problem with the iOS reader). All the fancy colored lines and rounded corners are properly rendered. Some text is not properly rendered, and I'm pretty sure that didn't render because the "box" that contains it is too small for the contents. That most likely happens because I didn't embed the TTF fonts into the PDF and the Apple font on iOS didn't perfectly match the Microsoft font that was used on Windows.
Samsung Galaxy S2, running Android 2.3: The document renders 100% correctly.
Samsung Something(??), running Windows Mobile 6.5 and the FoxReader: The document is totally gibberish: pictures showed up but the spacing between letters was messed so bad it's impossible to read. I blame the reader, it's not Acrobat and it probably wanted to be "smart". And it broke it's teeth in my text encoding, because my text is not English.
About the PDF format: A document is "PDF" if it conforms to the standard, here's some Wikipedia info on that. In theory a PDF document should render exactly the same way any way you look at it, but there are forces at play that might work against this:
Not all readers are "Adobe Acrobat". In theory they're all compatible, in practice they're most like not 100% compatible.
PDFs that don't embed fonts depend on the fonts available on the host system. If they're not the exact same fonts there's trouble ahead, because they might have slightly differing sizes. Since we're talking about PDF's that were generated on Windows and opened on iOS or Android, those are obviously different platforms and they're guaranteed to use different fonts (because fonts are licensed, and I doubt Microsoft will licence it's fonts to Apple. I also doubt Apple would want Microsoft fonts). One possible solution is embedding fonts, but that makes your PDF files significantly larger.
AFAIK you can export your Fast Report pages as metafiles (i.e. vectorial Windows format, which is in fact a raw serialization of GDI commands).
Then you could be able to render those metafiles into PDF using our Open Source SynPDF library. It works from Delphi 5 up to XE, is Unicode ready, can embed true type fonts, and even create PDF/A files.
It is also able to export metafiles included in reports as vectorial pictures (and not bitmaps), and could therefore highly increase the pdf quality and at the same time shrink its size.
See for instance how it can be used for QuickReport. A similar technical should be used with Fast Report.
The Gnostice support answered my e-mail which I reported that their trial installer didn't work and send me some tips about which could be the problem and I was able to install it.
The company I work for already bought me a license and I already replaced the Fast Report Export Filter, which was a task as simple as droping 2 components on the same Form as the frxReport Object and setting 2 or 3 properties.
Also, to export the report programatically was also 2 lines of code and the information was easily found in their FAQ.
In the end, based on the recomendations and after looking for other options just to find abandoned components which doesn't have any updates for years, the Gnostice eDocEngine was the best solution.
Just hope they make their installer a little more "Programmer Friendly" as if it had complained about the lack of Fast Report's units in the search path I would've been able to at least have an idea of what was going on, instead of just getting an error and blaming them for having a trial installer which didn't work.
After replacing the filter and generating the PDF's using the eDocEngine component, the PDFs now work the same in iOS, OSX and Android.
Here is my workaround solution. It's not an universal one, but helped me in my case.
The main idea: use in report font with small file size (I've found Arial-like font with cyrillic charset with size 57kb). So the exported files can be 100-200 kb.
Details is here:
http://dev-doc.blogspot.com/2013/03/fastreport-4-font-reading-and-huge-file.html
I use wPDF from WPcubed components, it's really a great product, good value for money
You can always install one of the PDF printers. These are in fact PDF convertors that install as windows printer. They work from any application including FastReprt components - just print on them.

Online programming editor

For a school project i need to write or use a online programming editor. It is a part of a bigger project. I thought of a java application, php/html/javascript or flash.
I have a couple of things i could do:
Find a good working application and edit it so it works with the rest of the project
Find good parts for a editor and make it working my self (syntax highlighter, auto-indent, autocompletion, etc.)
Combination of those two
Does anybody know a good editor or have tips for this project or a editor?
Thanks for reading,
Leon
For the syntax highlighting and basic editing part, check out my recent question Textarea that can do syntax highlighting on the fly?
Solutions presented there:
CodeMirror
Bespin (Mozilla only, but great)
For the rest - autocompletion etc. - ... Check out the Wikipedia article Comparison of JavaScript-based source code editors
Interested to see what other suggestions come up.
Bespin comes to mind. Though it might be too bleeding edge, depending on how the rest of the project is built/meant to be used (but hey, programmers love bleeding edge).
If you decide to use PHP/HTML/CSS/JavaScript, see GeSHi for syntax highlighting.
I have a side project developed with ACE.
It connects to your server through SFTP and allows you to create new files,read and edit all from your browser with your file tree at sidebar.
Demo at TePe
Code at Github Repo
I found Cobalah Editor it's also built on CodeMirror but with some customization. There are some themes available we can set, increase or decrease font size.

Texlipse: How do you configure it to show a real time preview?

I'm running on an Ubuntu and I hope it doesn't matter. Either than the preview it's a great latex editor
Considering the Texlipse man page mentions building and previewing, I do not think it can make a real-time preview, especially when the previewing relies on external tool.
But you could associate that Texlipse editor with other tools able to read the same LaTeX definition file and make a real time preview, like in this question:
Real-Time LaTeX
I think you're looking for the "Previewing" section on this manual page. When I glanced over it though, it didn't look like there is necessarily a way to do a live preview. It is an open source project, so if you really need to scratch that itch there's a way. :)

Cross-platform editing for LaTeX documents?

What solutions are there for working on a LaTeX document on both Windows and Linux?
It's a large document, and I will be working daily on both platforms so compatibility is essential if it's two different pieces of software.
Bonus points for a solution that includes easy previewing.
Writing text is not very different from writing software. Similar management techniques apply when scaling up.
Modularity: Split the document to smaller pieces e.g. a separate .tex file for each chapter. I also like to keep the preamble and other LaTeX set-up separate from the body text. My chapter files themselves just have the body text with some markup but do not define any new commands.
Source control: Keep all the source files in a version control tool such as subversion. Transfer files between systems using the tool.
Builds: Have a Makefile or similar to control the build process: it should be consistent and repeatable. Build regularly and fix build problems as soon as possible. If you want easy previews, you can set up a Makefile rule to launch e.g. a PDF viewer after the target PDF has been compiled.
Editing: Use whatever you're compatible with. It does not matter that much, though some good advice has been given by other answerers.
Communication: If there's more than one person working on the same stuff, no tool is a substitute for interpersonal communication.
TeXworks is a new cross-platform TeX editor with a built-in PDF preview that has source-output synchronisation. Click in the source to go to the matching part in the output, and vice versa. It's not the most feature-rich editor, by design, but the simplicity/power trade-off is just right, in my opinion.
I've used Emacs and its AucTeX mode, which is great for editing, as it has a set of very consistent shortcuts to insert many common commands and environments. There are also preview modes that display maths graphically in the Emacs window but I haven't used them.
As with VIM, there's a learning curve of course.
Unlike Legoolas, I'd advise for direct-to-PDF compilation using pdfTeX, but maybe Windows/Linux doesn't have a PDF viewer that automatically reloads the file? I'd be surprised if so (I use Skim on Mac). Check if your viewer supports synctex, as it's quite handy to navigate from PDF to source and back, without the cons of pdfsync.
To compile, my tool of choice is latexmk which is included in TeXlive. It completely automates the build, and can watch the .tex source to rebuild automatically.
Try LyX – The Document Processor, a "What You See Is What You Mean" editor for LaTeX.
Eclipse with its TeXlipse plugin should solve the IDE problem. More important are, however, issues like using only fonts that are available or installable on both platforms.
For previewing I am using Emacs with its Preview Latex feature in the AucTeX package.
For windows, you can use the TeXnicCenter, that is one of the best IDE for windows.
For Linux, you can use simply use Kile (it is possible to use kile with KDE on CygWin, but it is not the perfect solution).
There is no problem to switch from one IDE to another one (since you just save the .tex file and nothing else)
It also exists some cross-platform IDE, but I do not know them:
TeXmaker
TeXmakerX: a fork from TeXmaker
Since you'll probably not want to change text editor from whatever you usually use just for editing LaTeX docs (unless you use an editor which can't do syntax highlighting for LaTeX as well as whatever else you code/write in it), I'd recommend the simple following set of tools:
Whatever text editor you are used to, as long as it can highlight LaTeX markup. If it can't, then find a better editor for using with everything you do!.
Install MikTeX or TeXLive and just use the DVI viewer which comes with them by double-clicking on your DVI file. This will automatically update whenever the dvi file is changed by your editing of the latex file and re-creating the output.
I use Emacs as my text editor of choice, on both Linux and Windows. Setting up some scripts or makefiles to build the latex document when I hit a key is pretty easy, and fits in with everything else I use Emacs for nicely.
Other cross-platform options (many of which have already been mentioned by others in this thread):
LyX
TeXlispse for Eclipse
I've used VIM, combined with the VIM-LaTeX plugin, with great success. It does have a bit of a learning curve though.
Gummi is the best LaTeX editor. It is a free, open source, program written in python, featuring a live preview pane.
http://gummi.midnightcoding.org/
e4 http://gummi.midnightcoding.org/wp-content/uploads/20091012-1large(1).png
Get your work in some kind of version control system, then when you move from computer to computer you just update from a central server and its just like you left it.
It doesn't matter about the IDE, as you are saving just the .tex file, as noted above. If you want to use the same editor though, for the sake of coherency, use texmaker.
I use version control, and just use MikTex/WinEDT on Windows and TexShop on the mac.
IF your document doesn't compile on both, you're probably forgetting to keep the two directories synchronized or use funky commands, I like the sanity checks of knowing that it "compiles" cleanly on two platforms.
I use some text editor, and then I have a cron job that does a compile hourly from my source control.
Tex files are just text. I would recommend using a version control system (you should be using that anyway) to keep the source in sync. You can then use any (or different) editors on each system, e.g. Kile for linux and winEdt for windows. Both com with nice viewrs.
For a simple solution for the source control that just works with minimum knowledge and hassle, consider dropbox.
Revisiting my own question after quite a few years, I thought I'd add
https://www.writelatex.com/
not strictly what I had in mind, but have used it for collaborative writing
An excellent multiplatform LaTeX IDE is Texmaker.
For Debian or Ubuntu, I made a tutorial easy to follow: Install LaTeX on Ubuntu or Debian. This tutorial explains how to install LaTeX on Debian or Ubuntu and how to create your first PDF.

view pdf in program(delphi) by use free library(not activeX)

Is there are any open source or free-ware library to display PDF file in my Delphi program?
I had looked for one, but most of them are commercial or not fully functional.
PS: this solution need to be cross platform by using wine.
One possible solution might be to include the open source SumatraPDF viewer with your program and use it to display the pdf's.
http://blog.kowalczyk.info/software/sumatrapdf/index.html
One nice thing about SumatraPDF, other than it being open source, is that it doesn't require an install. It consists solely of a single .exe, so you could just stick the .exe in your app's folder and call it to display pdf's. SumatraPDF is a pretty bare-bones viewer, so it may be one of the ones you've already looked at and rejected as "not fully functional", but I'm not sure whether you're going to find any perfect open source solution.
As others brought up in the similar thread that was linked from this one, you might consider using the Gnostice library or the WPCubed wpdfviewer component. You have to purchase a developer's license for those, but then can incorporate them in your app and deploy as many as you want with no runtime licensing fees.
My answer to this question discusses the Adobe API.
I missed the PS. Some other answers to the same question may help.

Resources