SJTUBeamer 现在已经开放插件接口,存放于根目录的 contrib/ 文件夹中。如果您实现了自己的主题模板,或者是基于 SJTUBeamer API 的插件,可以考虑通过下面的步骤向本存储库发 PR:
- fork 仓库,克隆自己的仓库到本地。
- 向你的电脑安装当前版本的 SJTUBeamer,
cd src && l3build install,在 TeX 发布版中刷新文件名数据库,便于插件文档的编写。 - 使用
l3build add-contrib <theme>命令在contrib文件夹中新建一个插件文件夹<theme>,在文件夹中至少应该有下面两个文件:- 插件入口
contrib/<theme>/sjtubeamertheme<theme>.ltx - 插件文档
contrib/<theme>/<theme>.tex
- 插件入口
- 如果在插件中需要使用相对于该插件目录的文件,请使用下面的 API:
\getcontribdir{<theme>}返回插件目录contrib/<theme>\getcontribpath{<theme>}{<filepath>}返回插件文件contrib/<theme>/<filepath>
- 发 PR 时,使用
contrib: <theme>作为标题,并向维护者发出代码审查请求。 - 之后在根目录的主文件中就可以在
\usetheme{sjtubeamer}(如果是子主题需要指定my参数)后使用\usesjtutheme{<theme>}调用你的插件。
更多信息,请参阅开发文档。
SJTUBeamer is available for receiving plugins, which are stored in contrib/ folder. If you want to contribute your own theme template or plugin based on SJTUBeamer API, you could make a pull request to this repo by the following steps:
- Fork this repository and clone your own version to the machine.
- Install the current version of
SJTUBeamerto your computer for the convenience of writing documentation.cd src && l3build install, then refresh the database of filenames in your TeX distribution. - Use command
l3build add-contrib <theme>. Create a new plugin folder<theme>incontrib. At least two files should be implemented in the folder:- Plugin entry point.
contrib/<theme>/sjtubeamertheme<theme>.ltx - Plugin documentation.
contrib/<theme>/<theme>.tex
- Plugin entry point.
- If you want to use the file in your plugin directory, use the following API:
\getcontribdir{<theme>}returns the plugin directorycontrib/<theme>\getcontribpath{<theme>}{<filepath>}returns plugin file pathcontrib/<theme>/<filepath>
- Pull request to this repo naming
contrib: <theme>, request a review from one of the collaborators. - Now, you could call your plugin by using
\usesjtutheme{<theme>}(specifymyoption if it is a sub-theme) after\usetheme{sjtubeamer}.
For more information, please refer to the development guide.