MATLAB Results to HTML - matlab

Is there a really awesome way to organize results in MATLAB and create a set of HTML pages of the data?
I want to take a bunch of different runs and visualize the data and results in a way that is easy for people to flip through but I was hoping to do better than starting from scratch and writing raw HTML/XML code to disk.

You might like to take a look at the publish-to-HTML functionality in MATLAB. It's extremely easy: you just add some mark-up to the comments in a MATLAB script, click the publish button or use the publish command, and you get a nice HTML (or Word, PowerPoint or LaTeX) file containing the code and output of the script, with your marked up comments converted to nice paragraphs of explanatory text. Here are some links to the documentation:
Publishing MATLAB Code
Publishing Code from the Editor (video)
and to a blog article containing three enhancements to publishing, which display data as HTML tables in your published HTML:
HTML tables
Hope that helps!

Related

Any solutions for publishing docx/latex or latex on github.io/gitbook?

I have write some document, it include lots of formulas, pictures. I want to publish them on github.io, for reading online.
I have tried markdown, but it doesn't support math formula. Raw html is too complicated for document writing. Translate docx/latex to png/jpeg cost too much storage on github.
Are there any good solutions for document publishing on github.io or gitbook ?
Try using the website https://stackedit.io/
If you experiment with the export functions, you may be able to obtain raw HTML that resembles the formatting and style of Github, although it may not be exactly what you're seeking.

PDF generation from templated Word documents

I have a Word document(some template format) where it containing some placeholders for the data to be filled in and there are several Word documents like this which lies in some directory. When data comes I will be choosing different templates (based on some criteria) and fill the data and the documents have to be converted to PDF format.
I have been investigating Apache POI for this. If anyone has a good suggestion, it would be much appreciated.
As mbeckish mentioned you should indicate how you are going to run/automate this. For example is it one-off, run by hand or part of another program (and if so what programming languages do you use)?
If you are trying to automate it JODReports and Docmosis are tools that can use templates like you require and can produce PDF. JODReports is free. Docmosis is not but has several APIs. Please note I work for the company that develops Docmosis.
Hope that helps.
I've just uploaded this presentation, which presents three approaches for doing this.
Why not use any of existing PDF virtual printers?

Converting large amounts of text and dynamic data into PDF

I have a three page Word document that needs to be converted into PDF. This Word document was given to me as a template to show me what the PDF output should look like. I tried converting this document into PDF, created a PDF form and used iTextSharp to open the form, populate it with data and return it back to the client. This is all great but due to large amounts of data stored, the placeholders were insufficient and the text would be truncated or hidden.
My second attempt was to create an MVC 2 View without master page, pass the model to the view, take the HTML representation of the View, pass it over to iTextSharp and render the PDF. The problem here was that iTextSharp failed on some tags (one of them was <hr> tag). I managed to get rid of the problematic tag, but then tables were not rendered properly. Namely, the border attribute was ignored so I ended up with borderless tables. That attempt failed.
I need a suggestion or advice on the most efficient way to create a PDF document in MVC 2 which would be maintainable in the long run. I really don't want my actions to be 200+ lines long. Working directly with the Word document is not the best solution as I have never worked with VSTO so I don't quite know what it would look like to open Word and manipulate text inside of it and add dynamic data and then convert that dynamically into PDF.
Any suggestion is highly welcome.
Best regards!
One thing that I've done in the past is to save the Word file as a DOCX and unzip it since DOCX is just a renamed zip file. Within the archive open up /word/document.xml and you'll see your document. There's a lot of weird XML tags in there but overall you should get a pretty good idea of where your content is. Then just add placeholder text like {FIRST_NAME}, save the file and re-zip.
Then from code you can just perform the same steps, unzipping with something like SharpZipLib or DotNetZip, swapping placeholder copy, re-zipping and then using very simple Word automation to Save-As a PDF.
The other route is to fully utilize iTextSharp and actually write Paragraphs and PdfPTable and everything else. It takes a lot longer to setup but would give you the most control.
Q: you say "... but due to large amounts of data stored, the placeholders were insufficient and the text would be truncated or hidden"
How do you end up having to much data ? If the word template can "hold" the data in 3 pages, they should fit in 3 PDF pages.
I used to use iTextSharp to create my PDF's, but I also almost always ended up building the PDF document from scratch myself.(not really a <200 line solution) Have you considerate another library, I recently switched to MigraDoc's PDFSharp.Way simpler to use then iText, lotsa examples / docus
Just my two cents
Word documents object model is quite easy to understand. It will either contain series of Paragraphs or Tables. Using the Open XML SDK, you can iterate through each paragraph/table in the word document and retrieve it's content and styles. Then you can generate PDF document on the fly using those retrieved information. This will work under MVC too.
But if your word document contains complex elements, then it will take some more time for you to implement based on this approach. Also, this approach would only work with (Word 2007 and 2010) files.
Also, HTML to PDF options currently available in the ITextSharp library would work with only known set of tags, as far as I know.
Another suggestion is to make use of commercially available .NET components. There are lot of good solution available. For ex: Syncfusion

Is there currently a way to get Emacs muse-mode to output rtf,odt or doc format?

Muse is a special mode in emacs that can be used as a wiki. It has multiple output formats like static HTML pages, LaTeX, PDF etc.
But sometimes I need to output something that less tech-savvy people can edit/correct and send back to me.
I think either RTF, ODT or DOC would do the trick.
My problem is that muse only supports HTML, LaTeX, TexInfo and XML out of the box.
Implementing an own output format is currently not an option as I cannot program in elisp and learning it would take too much time.
I searched for a way to convert to or use markdown as pandoc can convert to RTF. But I found only the following discussion that does not solve my problem.
My last resort would be to convert to HTML and then to RTF, ODT or DOC but AFAIK the results are far from great.
It would appreciate a solution that can be automated (with custom scripts).
I think, that importing of HTML into MS Word (or compatible processor) should work. As I remember, OpenOffice had some scripting support, so you can launch it, and perform some commands inside it.
Another way - writing RTF export backend, it shouldn't be too complicated, although it could be too much details to be taken into account. If you'll go this way, please write to muse mailing list, and I'll try to help you

Printed documentation from Sandcastle

We're using Sandcastle for conceptual documentation and have clients that we would like to give documentation to in a non-CHM or HTML form, i.e printed. It could be Word or PDF, something simple to attach to an email. The use case usually involves someone wanting to send along a topic.
The best we've been able to do is to print from the CHM viewer or to PDF from Chrome when viewing the HTML. These have issues in that they remove anchor element clicks, turn images black and white, etc.
There's a thread on the SHFB discussions on Codeplex stating that there isn't any known alternative - http://shfb.codeplex.com/discussions/260489. I'm re-posting the question here in hopes to get more input and visibility.
I had the same need some time ago and came to the conclusion that using a CHM to PDF converter is the best recourse. I could not find one that was open-source though many have trial versions available, and I only needed to convert one document so that served my needs at the time. Note that trial/demo versions typically add a watermark or a label blazoned across the page saying "unregistered version" or some such.
A general web search reveals quite a number of candidates: while I cannot vouch for any, here are a few that seem reputable: Universal Document Converter, Theta CHM To PDF Converter, Softany CHM to PDF Converter.
2014.07.16 Update
Per #J0e3gan's comment, here is a different online converter (limited to 100MB CHM input) that looks quite promising, though I have not yet had occasion to try it.