Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib: minted #87

Merged
merged 16 commits into from
Mar 10, 2022
Merged

contrib: minted #87

merged 16 commits into from
Mar 10, 2022

Conversation

LogCreative
Copy link
Contributor

@LogCreative LogCreative commented Mar 9, 2022

minted 插件

本插件提供了使用 minted 高亮代码的方式,相较于 listings,可以很好地支持中文,并且可以更方便地高亮代码行。
但是安装 minted 也相对复杂,并且需要使用 -shell-escape 参数编译,故作为可选插件为熟悉 LaTeX 的人准备。

\usetheme{sjtubeamer}
\usemytheme{minted} % 提供 draft 选项用于加快速度

将会提供

\codeblockinputminted[minted 选项]{标题}{语言}{文件}

以输入外部文件抄录代码。
还会提供 codeblockminted 环境用于使用 minted 引擎。

\begin{codeblockminted}[minted 选项]{标题}{语言}

\end{codeblockminted}

杂项

  • 基本层也对应的增加了 \codeblockinput[listings 选项]{标题}{文件} 命令。
  • 启用了贡献 ci 中的 -shell-escape 选项。
  • 更新了高亮代码的颜色。
  • 尚未修复 ci 中 github 获取作者信息的方法。

@LogCreative LogCreative added the contrib Contribute a sub theme label Mar 9, 2022
@LogCreative LogCreative requested a review from skyzh March 9, 2022 14:29
@LogCreative LogCreative requested review from skyzh and removed request for skyzh March 9, 2022 14:42
@LogCreative LogCreative temporarily deployed to IMGUR March 9, 2022 14:42 Inactive
@github-actions

This comment was marked as outdated.

@LogCreative LogCreative removed the request for review from skyzh March 9, 2022 16:10
@LogCreative
Copy link
Contributor Author

  • LuaLaTeX 中 tcolorbox + minted 之后的 minted language 参数不能含有宏,而 xelatex 可以,所以这一部分重新实现。
  • minted 在构建的时候 latexmk 不能使用 --outdir 参数,否则将无法自动找到临时文件位置。escape-shell not working for minted jgm/pandoc#4721 (comment)

@LogCreative LogCreative requested a review from skyzh March 9, 2022 16:23
@LogCreative LogCreative temporarily deployed to IMGUR March 9, 2022 16:23 Inactive
@github-actions

This comment was marked as outdated.

@LogCreative LogCreative merged commit 527c09a into main Mar 10, 2022
@LogCreative LogCreative deleted the logcreative-codeblock branch March 10, 2022 04:18
@LogCreative LogCreative restored the logcreative-codeblock branch March 10, 2022 04:25
LogCreative added a commit that referenced this pull request Mar 10, 2022
@LogCreative LogCreative deleted the logcreative-codeblock branch March 10, 2022 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contrib Contribute a sub theme
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants