🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

htex

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htex

Academic writing for the 21st century

latest
Source
npmnpm
Version
0.0.8
Version published
Weekly downloads
4
Maintainers
2
Weekly downloads
 
Created
Source

hTex /eɪtʃtɛx/

A collection of markdown-it and eleventy plugins for hassle-free academic writing. Largely compatible with the Pandoc Markdown syntax. All plugins are enabled by default but can be disabled individiually, by passing in false for the corresponding option. They can also be configured by passing a settings object.

Installation

npm i htex

As 11ty plugin

import htex from 'htex/eleventy';
eleventyConfig.use(htex, { /* options */ });

Just the markdown-it plugins

If you don’t use 11ty, you can still use the markdown-it plugins. There are two ways to do that: if you don’t already have a markdown instance, you can simply get one back from hTex:

import htex from "htex/markdown-it";

let md = htex({ /* options */ });

If you already have a markdown-it instance, you can add the plugins to it:

import htex from "htex/markdown-it";
htex(md, { /* options */ });

or:

import htex from "htex/markdown-it";
htex({
	instance: md,
	/* options */
});

Plugins

Eleventy

PluginOptionDescription
eleventy-plugin-citationscitationsCitations and bibliographies.
eleventy-plugin-outlineoutlineSection & figure numbers, tables of content, heading anchors, and many more.
TodostodosPicks up todos from HTML comments, formats them nicely, and summarizes them in a separate file, by priority or by file.
Image dimensionsimageDimensionsAdds CSS custom properties for images' intrinsic width and height.

Markdown plugins

You can just add the Markdown plugins by using the htex/markdown export.

PluginOptionDescription
markdown-it-attrsattrsAdd classes, IDs, and attributes to elements.
markdown-it-prismcodeHighlightSyntax highlighting (using PrismJS)
markdown-it-mathjax3mathMath rendering (using MathJax 3).
markdown-it-deflistdefinitionListsDefinition lists.
markdown-it-table-captionstableCaptionsTable captions.
markdown-it-footnotefootnoteFootnotes. Comes with an optional footnotes.css for styling footnotes with a separator line and proper spacing.
markdown-it-bracketed-spansspansConcise bracketed spans.
markdown-it-supsupSuperscripts using ^.
markdown-it-subsubSubscripts using ~.

Styling

Footnotes

To style footnotes, you can import the included CSS file:

@import "htex/markdown-it/footnotes.css";

This provides a clean layout for footnotes with:

  • Superscript footnote references
  • A separator line before the footnotes section
  • Proper spacing and alignment
  • Customizable separator length and thickness via CSS custom properties:
    • --footnotes-separator-length (default: 15ch)
    • --footnotes-separator-thickness (default: 1px)

Keywords

Markdown

FAQs

Package last updated on 21 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts