npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mmp-build

v0.2.0

Published

Convert markdown-formatted documents to TeX.

Readme

MMP

npm-image lic-image

MMP 的全称是 Mimi Markdown Paper,旨在通过简单的命令将 Markdown 文件转为 TeX,再通过 xelatex 编译为 pdf。据研究表明,这可以将写文章的效率提升 1400%。

依赖

使用前请务必安装并配置好 LaTeX 环境,确保 xelatexbibtex 可以被正确执行。
同时还需要安装 nodenpm

安装

size-image dm-image dt-image

执行

npm install mmp-build -g

使用

准备

你的项目需要有一个名字,我们就叫他 $name 好了。你需要准备一个名为 $name.md 的文档;如果有参考文献的话,在同一目录下还需要存在名为 $name.bib 的 BiBTeX 文件。
接下来介绍 $name.md 文档应包含的内容。我们采用了一个称为 Front Matter 的部分,它看起来像这样:

---
title: Introduction to MMP
author: Mimi
date: 1984-01-24
abstract: How to use MMP
keywords: Markdown, TeX
packages:
bibfile:
  style: ieeetr
  name:
---

Front Matter 包含了文章的元信息。在它之后就是文章的内容,需要符合 Markdown 的语法,并且可以包含 LaTeX 的语法。

命令

当然,创建文件的部分不一定需要你来手动完成。你可以通过 mmp 的子命令执行。下面是全部用法:

init 命令

  • 在当前目录新建 $name.md
    mmp init $name
  • 在当前目录新建 $name.md$name.bib
    mmp init $name --bib
    mmp init $name -b

build 命令

  • 在当前目录编译 $name.md$name.tex,再编译为 $name.pdf
    mmp build $name
    如果在 Markdown 文件的 From Matter 中设置了 bibfile,程序会自动执行多次 xelatex
  • 与前面相同,但在执行 xelatex 时使用静默模式,减少输出(报错信息也不会显示)
    mmp build $name --quiet
    mmp build $name -q
  • 在当前目录编译 $name.md$name.tex,不进行其他操作
    mmp build $name --tex
    mmp build $name -t
  • 在当前目录编译 $name.md$name.html,不进行其他操作
    mmp build $name --html
    mmp build $name -h

clean 命令

  • 在当前目录清除与 $name.md 有关的编译缓存,只留下(如果存在)$name.md$name.tex$name.bib$name.pdf
    mmp clean $name

鸣谢

在 Markdown 文件中使用 Front Matter 存储元信息是一种极为方便的做法,本项目使用的代码来源于静态博客框架 Hexo。
Marked 是一个将 Markdown 文档转为 html 的 Node.js 模块。在此基础上开发了 Markdown 转 TeX 的核心。

https://liam.page/2020/03/30/writing-manuscript-in-Markdown-and-typesetting-with-LaTeX/

License

Released under the GNU General Public License v3
http://www.gnu.org/licenses/gpl-3.0.html

Known Issues

marked 会强制将 &<>"' 这些字符转码(目的是防止污染 html)。由于这对于 TeX 而言是不必要的,本项目使用了极为不优美的方法把这些字符换回来。

https://github.com/markedjs/marked/blob/v1.0.0/src/helpers.js#L1-L28

有关 Front Matter 的仓库

https://github.com/hexojs/hexo-front-matter
https://github.com/jxson/front-matter

TODO

  • [x] Windows support
  • [ ] Plugins support
  • [x] Pangu.js support
  • [x] Table alignment