在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):shikijs/shiki-latex开源软件地址(OpenSource Url):https://github.com/shikijs/shiki-latex开源编程语言(OpenSource Language):TypeScript 68.2%开源软件介绍(OpenSource Introduction):Shiki LaTeXShiki renderer for LaTeX. Compatible with minted, replacing Pygments.AComparison
InstallationInstall Node.js and run: $ npm install shiki-latex Using with minted\usepackage{minted}
\renewcommand{\MintedPygmentize}{node_modules/.bin/shiki-minted} ThemesChoose a theme with the You may refer to a built-in Shiki theme by name, for example: \usemintedstyle{nord} You may refer to a theme file that you download and put next to your LaTeX source (don’t put it under a folder because minted doesn’t support it); for example, to use the SynthWave '84 theme, download \usemintedstyle{synthwave-color-theme.json} Note: Some themes may not look as good on a PDF as they do on a webpage. It’s part of the game: LaTeX renders things differently from a browser. It’s a hit-and-miss situation. Using Programmaticallyimport { getHighlighter } from "shiki";
import { renderToLaTeX } from "shiki-latex";
(async () => {
const highlighter = await getHighlighter({ theme: "light_plus" });
const lines = highlighter.codeToThemedTokens(
`const name = "Leandro Facchinetti";`,
"ts"
);
console.log(renderToLaTeX(lines));
})(); The package comes with type definitions for TypeScript. OptionsThe renderToLaTeX(lines, { defaultColor: "#FF0000" }); The available options are the following:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论