Code Monkey home page Code Monkey logo

blogtex's Introduction

BlOgTeX

A blog that compiles LaTeX documents to HTML and creates an index in reverse-chronological order

Dependencies

  • pandoc

How To Use

Edit the variables at the top of the script to point to your source .tex files, then where you want to output the final compiled blog. Note that the destination directory WILL BE WIPED UPON INVOKING THE SCRIPT. This is for cleanliness purposes.

You will need to have a header.html file in your $SOURCE directory. This is so when the script gets run and it gets the title, date, and filename of each file and creates an index, there is actually something doing things like creating a title for the page. Take a look at my example header.html so you can see what is required.

You will also need a header.xml file in your $SOURCE directory. This should include everything that makes up the RSS feed aside from the actual contents. Once again, you can take a look at my example header.xml.

From there, all you need to do is populate the $SOURCE directory with .tex articles, then run ./compile.sh. I've included a template file at example.tex.

Formatting .tex files

The only thing to keep in mind is that you need to use MM/DD/YYYY format for dates in the .tex files. When outputted to the RSS, they turn into Day, DD Mon YYYY for compatibility. If you have any issues with this, make an Issue and I'll make some sort of flag to change between formats.

Things That Are Supported

  • Links
  • Bold and Italic text
  • Images
    • Resize using \includegraphics[height=50px,keepaspectratio]{image} You can use either cm or px for the height. You can also use width, but I hate using it and do not recommend it.
  • Math
    • The math is generated using latex.codecogs.com which by default makes all of the math black. You can work around this by importing \usepackage{xcolor}, then using the \color{} tag (make sure to put a color between those {curly brackets}) to change it to a color that is readable. This was releavnt to me because the background of my blog is black, which made the math impossible to read.
    • Also, the reason that the math is done through CodeCogs is because a lot of the rendering of math simply cannot be done with plain HTML (see: fractions, sqrt, etc.) but CodeCogs provides a super quick way to do it that is automatically handled by the script, so your math equations will just werk.
  • Sections, subsections, etc.
  • Code syntax highlighting with \usepackage{minted}

To-do

  • Fix sorting by date in index
  • Add RSS feed functionality

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.