Novice, Paragon, Master

# npm

Miss any of our Open RFC calls?Watch the recordings here! »

## generator-latex

1.4.2 • Public • Published

# Generator LaTeX

Yeoman Generator for LaTeX up-to-date documents Edit

## Why

• Grunt engine, for easy tasks running and managing.
• Complete and structured generation process.
• Automatic compilation at file changes.
• Full and automatic PDF view in your browser.

After generation, keeping your work up-to-date during your writting require only one command:

That's it! ✨

## Install

Yeoman travels light. He didn't pack any generators when he moved in. You can think of a generator like a plug-in. You get to choose what type of application you wish to create, such as a Backbone application or even a Chrome extension.

To install generator-latex from npm, run:

## Usage

### New chapter

Adding a chapter is a repetitive task. To keep them organized, the Chapter Sub-Generator creates a chapters directory, and lets you create sub-directories for each chapter.

To run it:

or directly to bypass questions:

Will create src/1/main.tex.
The title of this chapter will be Introduction.

It also adds to ./main.tex, inserting an \include just before it sees % End of chapter files listing.

## Getting Started

### What is Yeoman?

Trick question. It's not a thing. It's this guy! Take a look at yeoman.io.

### What will be created?

This generator is designed to cover any type of LaTeX document. It helps you to create a solid structure of your project.

Take a look at this final structure:

### Regarding glossary

In order for the glossary generation to work, you need to ensure the makeglossaries command is available system-wide.

A quick way to check if the command is available is to invoke it from any terminal.

On Windows, it is mandatory to add the folder C:\\...\MiKteX X.X\miktex\bin to the PATH, otherwise the command will not be available.

Latex code sample to insert a glossary entry:

### Regarding graphics

Figures in svg format can be automatically converted to pdf upon changes. This provides a robust and easy way to import vector graphics in latex.

A specific grunt task can be run to refresh all figures, although the grunt command will start by regenerating all figures.

Latex code sample to insert a .pdf graphic generated from .svg:

### Regarding bibliography

When the bibliography is modified, it is properly reflected in the document two refresh later. This is due to how latex and bibtex interact. If you see some undefined references (displayed as [??]), simply let grunt perform a second refresh by modifying and saving any .tex file.

Latex code sample to insert a reference:

## Keywords

### Install

npm i generator-latex

2

1.4.2

MIT

### Repository

github.com/LeoColomb/generator-latex