• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

LeoColomb/generator-latex: Yeoman Generator for LaTeX up-to-date documents

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

LeoColomb/generator-latex

开源软件地址(OpenSource Url):

https://github.com/LeoColomb/generator-latex

开源编程语言(OpenSource Language):

JavaScript 86.8%

开源软件介绍(OpenSource Introduction):

LaTeX

Generator LaTeX

Yeoman Generator for LaTeX up-to-date documents Edit

Node.js Package Latest Release Yeoman

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:

$ grunt

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:

$ npm install -g generator-latex

Usage

New project

$ yo latex

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:

$ yo latex:chapter

or directly to bypass questions:

$ yo latex:chapter 1 Introduction

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:

project/
├── Gruntfile.js            # → The compilator tasks file
├── main.tex                # → The project-root file
├── package.json            # → Preparator dependencies
│
├── src/
│   ├── glossary.tex        # → The glossary file
│   ├── references.bib      # → The reference file
│   ├── ...
│   │
│   ├── 1/
│   │   ├── main.tex        # → First chapter global file
│   │   └── ...
│   │
│   ├── 2/
│   │   ├── main.tex        # → Second chapter global file
│   │   └── ...
│   │
│   ├── assets/
│   │   ├── figures.svg     # → Optionnal figures files
│   │   └── ...
│   │
│   └── ...
│
└── dist/
    ├── [PROJECT].pdf       # → The final PDF file output
    └── ...                 # → Files generated during the compilation

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.

$ makeglossaries

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:

\gls{computer}

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.

$ grunt execute:figs

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

\begin{figure}[h]
  \centering
  \includegraphics{src/assets/figure.pdf}
  \caption{Figure example of an imported pdf generated from an svg file (drawn with inkscape)}
  \label{figure_example}
\end{figure}

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:

\cite{Perrin}.

License

MIT © Léo Colombaro




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap