GitbookIO / gitbook

The open source frontend for GitBook doc sites
https://www.gitbook.com
GNU General Public License v3.0
26.87k stars 3.84k forks source link

LaTeX support #151

Closed maxheld83 closed 5 months ago

maxheld83 commented 10 years ago

As I mentioned in #134 I (and I think a lot of other scholars) have been waiting for something like gitbook to come along for a very long time. This might just be one of the missing pieces to the puzzle of online scientific publishing. PDFs, no matter how well structured and meta-data-ed always felt a little awkard online, with people having to download them and all.

Still, academic publishing as over decades (nay, centuries) developed many helpful conventions (theorem numbering, glossaries, acronyms, – you name it) that don't sit easily with markdown.

Fortunately, we have one markup language that has implemented all of these things already: LaTeX. Of course, much of the typesetting genius (and baggage) of TeX becomes redundant once you publish to a static website. But still, the conventions have all been implemented, and people know who to write in this markup (not to mention legacy projects).

So here's my (long-winded) question: any chance gitbook might evolve to be a front-end to LaTeX, too? Maybe via Pandoc?

Am I making sense?

yonkeltron commented 10 years ago

I thought I had been following what you were saying until you mentioned gitbook becoming a front-end for LaTeX. Do you mean the graphical editor?

I would love if we could get LaTeX support in gitbook! Can you even imagine the ability to swap out Markdown files for .tex files!? Total game changer. I wonder if we could somehow tap into luatex and get an intermediate format suitable for feeding through some processor to get less terrible HTML output (not that I don't have a historically-soft spot in my heart for the likes of tth). Does this constitute part of a larger discussion?

In any case, +1 for LaTeX support of some sort in gitbook.

maxheld83 commented 10 years ago

@yonkeltron sorry I wasn't being clear (I'm not a developer and sometimes a bit hazy about terminology); no I didn't mean as a graphical editor (I think the various editors out there are doing a fine job) – I meant as a way to publish a LaTeX source online.

znmeb commented 9 years ago

There are already WYSIWYG front-ends for LaTeX, LyX and TeXmacs. I personally use LyX. LyX can export XHTML, which you can probably push into Pandoc to get Markdown, though I haven't tried it.

There is also the RStudio/RMarkdown/knitr/pandoc toolchain for making HTML and PDFs; it can render to Markdown in just about all of the dialects via Pandoc options.

So there are lots of hacks that might work, but I'd try LyX export to XHTML first if you want to publish LaTeX to the web.

aepstein commented 9 years ago

Pandoc + HTML is good, but AsciiDoc + docbook seems like a much better route to generate high quality books (richer feature set, orientation towards publication). By using Asciidoc for the gitbook, I was able to compile a nice LaTeX-based PDF this way and the results looked very good for my needs:

#!/bin/bash
perl -p -e 's/\d+\.\s+link:(.+).adoc\[.+\]/$1.adoc/g' SUMMARY.adoc > summary
echo "" > compiled.adoc;
for file in $(cat summary);
do cat "$file" >> compiled.adoc;
printf "\n\n" >> compiled.adoc;
done;
asciidoctor -b docbook compiled.adoc -d book;
dblatex compiled.xml --param toc.section.depth=1 \
  --param insert.xref.page.number=yes \
  --param table.in.float=0;

Any thoughts about that?

qinix commented 7 years ago

+1 for LaTeX support

znmeb commented 7 years ago

The good folks at RStudio now have Bookdown ... you write in R Markdown and get a website in a GitBook-like styling, Bootstrap styling or their own "Tufte HTML" styling. PDFs are done via pandoc and the system LaTeX, although for best results you want to use XeLaTeX.

urosjarc commented 7 years ago

gitbook-plugin-build


npm release Travis Coverage Status Dependency Status Codebeat badge Docs Status Join the chat

Extends gitbook build system with pandoc converter.

Patreon User Twitter User


Description

GPP (gitbook-plugin-build) extends gitbook build system with pandoc converter. Pandoc is your swiss-army knife when it comes to coverting files. GPP use pandoc build system to convert and compile your book in variety of formats:

Writing books with this plugin will be peace of cake. And here cake is not a lie!


Homepage

For more informations please visit projects official homepage.

https://urosjarc.github.io/gitbook-plugin-build


License

Copyright © 2016 Uroš Jarc

MIT License