latex input to html and pdf output - html

Is there a ruby gem that can parse latex formatted string to html string and pdf binary string including bibtex bibliography?
I'm using textile (redcloth) right now in my rails app to get formated html, but I'd like to use latex to do it. I also would like to use *.bib file for references. And having latex it should also be easy to build a pdf file, in order to provide a pdf version of the same article (nice to have)...
I also could do it with the system call and e.g. texlive, but then I've to save the user input to file and manage these files and put it back to database and that all would take some time. I don't like this approach...
Is there a nice way to do it?

You could try runtex, although I do not know if it will do exactly what you want, I have not tested it.

Related

Angular 5 : How to integrate html data (which is a formatted text) in a .docx file?

I'm still a bit newbie in the code game, and i would like some advices from senpai.
Context :
I'm making a angular 5 app which has a form, which is using also QuillJS, a rich text editor for only one question (the previous questions are simple input field for strings or numbers). My goal is to allow my users to download the form and the text from QuillJS they completed, on a .docx file (Word). And of course i'm doing this because i want to keep the formatted text from QuillJs, otherwise i would have just get a good ol' string.
Issue :
The point is, i'm already building a docx file for the first questions of the form and the only method i found for now to put my html string from QuillJs in a Word readable data type, is to use html-docx-js library.
This post even explain how. But, BUT, i don't want to use saveAs function (see the post), that create a file and put the content in it. I want to put the content in the docx file i'm already creating.
So here is my question, how would you, senpai, do it ?
The thing is that i've got a Blob file (cf post), but i don't know how to put it in my docx file. I tried to see if FileReader function could do the job, but well... i don't get how to integrate this special Blob file type (which is : application/vnd.openxmlformats-officedocument.wordprocessingml.document) in the docx file.
Maybe there is another way, i'm open to any suggestions, i don't mind at all to change my way of doing.
Thank you. Save internet, give me a tip.
The official documentation for html-docx-js does not state any other options than the asBlob method. I suggest two options:
Decoding the DOCX:
The Blob filetype is not special. The blob is just binary representation of the docx. I found in SE question that the docs in fact zipped XML document. You could unzip it using JSZip or other JS solution, then read it using FileReader and try to deal with it in a DOM manner. I'm not qualified to go into details how that could work.
Adding HTML to the user input first and then outputting it as a whole
This is changing the way you want to do it. In this way, I would first create formatted HTML with the data you collected in other parts of the questionnaire. Then you append the rich data from the rich editor. At last you take this HTML data and save it into single file using the asBlob function.
The second solution will maybe strip some customization from your original approach, but it seems much faster to implement.

Load a CSV template and write data to it via java

I have a CSV template file, say, having 10 columns.
I would like to load this CSV file template, and then write data to the relevant cells(say only to 5 of the 10 cells) through a java program.
I went through JSAPAR, SuperCSV etc, but am not sure whether these libraries have the "stuff" what exactly I need.
Is there any framework supporting this kind of operations?
Checkout freemarker: http://freemarker.org/
Open your text file.
Enter freemarker paramerters for required cells.
Your template file may look something like below:
"Templatetext1","text2","text4", "${myVal4}",${myVal5}","text6", ${myVal7}",${myVal8}",${myVal9}","textInCell10"
Pass in the values, you have your csv from template.
If you want to pass for multiple rows you can use other elements like <#list> etc.
OpenCSV is generally considered the best CSV toolkit for Java. It's a very lightweight library that makes working with CSV dead simple. I would recommend looking at it since it's not among the list of things you've tried yet.

CK Editor JSON file creation for inserting images

I am using CK Editor on my web site and have built a simple uploader script in php to add images to my server. I am using the image browser plugin to enable the inclusion of images into my text. The image browser seems to work using a JSON file which must list all images in the image folder.
I am completely new to JSON and to get around learning how to build a JSON file I created a PHP file which simply reads the names of my images from a database and includes them in the JSON file.
This, as a workaround seems to be perfectly functional, however it is reliant on my upload script having to add the image names to the database (an unnecessary step) and it is also bad practice.
I am looking for a good tutorial or explanation on how to make a very simple JSON file which lists the images in my uploads folder in the correct format for CK Editor so that I can free myself from my image names database and program like a big boy.
Any and all help would be apreciated.

How do I download contents of an html table generated by play 1.2.7 backend on java in xls

I've generated a table using play's #{list} tag and get pretty decent results. Now I need to be able to generate and download an xls version of the table and have no idea what to do. Any pointers at all will be much appreciated
Well you have various options.
Excel will open HTML files. So instead of rendering your table as HTML you can it to stream it to the browser and set the content type as XLS.
While Excel will open it this it will still be an HTML file rather than an XLS(X) document.
You can generate as CSV from your data model and stream this to the browser. Again this will be a CSV rather than a proper XLS(X) document.
There also seem to be some solutions around which can do it using Javscript. See as a starting point: Generate excel sheet from html tables using jquery
Finally you can can use something like Apache POI or JXLS to generate a 'proper' xls(x) document and stream this to the browser. I have some code here that will export HTML to 'proper' xlsx file if this is the route you wish to go. Workflow is then to create some HTML from your data model and use this to convert to Excel rather than having to programmatically build the Excel document using POI. https://github.com/alanhay/html-exporter

Generate single-file HTML code documentation

How can I use Doxygen to create the HTML documentation as a single, very long file? I want something like the RTF output, but as HTML.
The reason: I need my API published as a single, printable, document. Something that can be loaded into Word, converted to PDF, etc.
I think you can use HTMLDOC to convert the generated html files to a single html file. (I did not try it myself)
The manual includes the following example to generate a html from two source html files:
htmldoc --book -f output.html file1.html file2.html
But there is also a gui.
I don't think there's an option that will produce the output as a single HTML file, but the RTF output may be suitable if you need an editable output format (I haven't tried this myself so I don't know how well this works).
If you want good quality printable output, then Doxygen can output LaTeX format (set GENERATE_LATEX to YES in your doxygen configuration file). This can then be converted to PDF, although you'll need to install a LaTeX distribution such as MiKTeX.