GithubHelp home page GithubHelp logo

mynameiscosmo / fontawesome-latex Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 747 KB

Python utility to download and create FontAwesome LaTeX mappings

Python 81.25% Makefile 3.27% TeX 15.48%
tex latex font-awesome fontawesome5

fontawesome-latex's Introduction

Fontawesome 5 LaTeX Generator

This repo houses the ability to map FontAwesome font variants to a respective TeX binding.
This was built to run on a Linux-based OS. Feel free to submit a PR for Windows + OSx support.

This ONLY supports FontAwesome releases 5.0 and up.

Now supporting FontAwesome 5 Pro!*

Current bindings:

Binding Supported Reason
Xelatex Yes -
Lualatex No Need templates
PDFLatex No Need templates
Sharelatex No Need templates
  • I really only tested xelatex. The others might work.

Releases

Check out the Releases for pre-built FontAwesome 5.0.13 mappings.

Usage

Simply download the latest release and extract the archive.

Check out the examples directory for a pre-built PDF, .sty, and .tex.

Pro

Currently for Pro, you will need to run this script to generate Pro mappings until #11 is fixed.

See Advanced Usage below.

Nomenclature

These mappings try to follow Font Awesome's Prefixes
You can use icons in the generated mappings with the following calls:

\faThumbsUp % generates a regular Thumbs Up
\faThumbsUpSolid % generates a solid Thumbs Up
\faThumbsUpLight % generates a light Thumbs Up (pro)
\textbf\faThumbsUp % generates a solid Thumbs Up
\textit\faThumbsUp % generates a light Thumbs Up (pro)

Building

This utility will download a FontAwesome release zip, unzip it, locate metadata, and generate a TeX mapping using Jinja templates.

The following set of commands will create a virtualenv, run the python script, generate the pdfs, display them, then package them into a release.zip.

make env
source .env/bin/activate
make
make pdf
make display
make release

Advanced Usage

The script will automagically detect if you're using FontAwesome Free or Pro, and build the templates accordingly.

  • Using a local zip archive:
    python3 fontawesome-latex.py --local-file tmp/fontawesome-pro-5.0.13.zip
  • Using a local extracted zip folder:
    python3 fontawesome-latex.py --zipped-dir tmp/fontawesome-pro-5.0.13
  • For more usage details, check out:
    python3 fontawesome-latex.py --help

Why?

I wanted the most recent FontAwesome icons in my resume... ๐Ÿค–
There are other tools out there, but they weren't quite as automated as one would hope.
Some of the tools even strip out many icons.

With FontAwesome 5 including metadata, it's super easy to read an icon list from the metadata file, find their respective font style (free/pro, regular/solid/light), and map them to a template.

Contributing

Check out the existing issues and check out any help_wanted or enhancement tags.

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.