Giter VIP home page Giter VIP logo

cnlogo's Introduction

cnlogo

pre-commit.ci status github/workflow

github/downloads github/downloads/latest github/issues github/issues-closed github/issues-pr github/issues-pr-closed github/discussions github/milestones github/forks github/stars github/watchers github/contributors github/commit-activity github/last-commit github/release-date

github/license github/languages github/languages/top github/directory-file-count github/code-size github/repo-size github/v

本宏包利用 tikz 绘制国内高校的校徽,借助学校本身提供的 pdf 高清矢量图通过 inkscape 转化为 tikz 代码。

目前支持:安徽大学 (ahu), 北京航空航天大学 (bhu), 北京交通大学 (bjtu), 北京邮电大学 (bjydu), 北京师范大学 (bnu), 长安大学 (chu), **矿业大学 (ckyu), 中南大学 (csu), **地质大学 (cug), **政法大学 (cupsl), 东北财经大学 (dbcju), 大连理工大学 (dllgu), 复旦大学 (fdu), 贵阳师范大学 (gnu), 广东外语外贸大学 (gufs), 湖北大学 (hbu), 华东师范大学 (hdsfu), 华东政法大学 (hdzfu), 合肥工业大学 (hgyu), 河海大学 (hhu), 哈尔滨工业大学 (hit), 华南理工大学 (hnlgu), 湖南师范大学 (hnnu), 湖南大学 (hnu), 华中科技大学 (hustc), 华中师范大学 (hznu), 吉林大学 (jlu), 暨南大学 (jnu), 江南大学 (ju), 兰州大学 (lzu), **民族大学 (muc), 南昌大学 (ncu), 东北大学 (neu), 南京大学 (nju), 南京理工大学 (njust), 南开大学 (nku), 北京大学 (pku), **人民大学 (ruc), 四川大学 (scu), 山东财经大学 (sdcju), 山东大学 (sdu), 上海大学 (shu), 上海交通大学 (stju), 南方科技大学 (sustc), 西南农业大学 (swau), 西南师范大学 (swcnu), 中山大学 (sysu), 深圳大学 (szu), 清华大学 (thu), 同济大学 (tju), 天津大学 (tjuu), 北京科技大学 (ustb), **科学技术大学 (ustc), 武汉理工大学 (whlgu), 武汉大学 (whu), 温州大学 (wzu), 西北农林科技大学 (xbnlkju), 西安电子科技大学 (xdu), 西安交通大学 (xjtu), 厦门大学 (xmu), 扬州大学 (yzu), **传媒大学 (zcmu), **海洋大学 (zhyu), 浙江大学 (zju), **科学院大学 (zky), **农业大学 (znyu), 郑州大学 (zzu)。

📦 安装

🚚 用包管理器

tlmgr install cnlogo

🔨 手动下载源代码编译并安装

git clone --depth=1 https://github.com/yuxtech/cnlogo
cd cnlogo
l3build install

注意,编译包括编译宏包 cnlogo.sty 和文档 cnlogo.pdf 。后者因为含有所有学校的校徽图片编译极慢,在我的电脑上共需要编译 7 分钟。 建议从包管理器安装或手动下载编译好的安装包。如果你一定要从源代码编译,你可以只编译 cnlogo.sty 并参照下一节手动安装。

lualatex cnlogo.ins  # 编译宏包 `cnlogo.sty`
lualatex cnlogo.dtx  # 编译文档 `cnlogo.pdf`

⬇️ 手动下载编译好的安装包安装

Release 下载 cnlogo.tds.zip 。通过 unzip 解压缩到正确的路径并用texhash 刷新。

$ gh release list -Ryuxtech/cnlogo
0.0.1                   Latest  (0.0.1)   about 24 minutes ago
...
$ gh release download 0.0.1 -Ryuxtech/cnlogo
$ ls
 cnlogo-ctan.zip   cnlogo.tds.zip
$ mkdir -p $(kpsewhich --var-value TEXMFHOME)
$ mv cnlogo.tds.zip $(kpsewhich --var-value TEXMFHOME)
$ unzip cnlogo.tds.zip
Archive:  cnlogo.tds.zip
inflating: doc/latex/cnlogo/README.md
inflating: doc/latex/cnlogo/cnlogo.pdf
inflating: tex/latex/cnlogo/cnlogo.sty
inflating: source/latex/cnlogo/cnlogo.ins
inflating: source/latex/cnlogo/cnlogo.dtx
$ texhash
texhash: /etc/texmf: directory not writable. Skipping...
texhash: /usr/local/share/texmf: directory not writable. Skipping...
texhash: /usr/share/texmf: directory not writable. Skipping...
texhash: /usr/share/texmf-dist: directory not writable. Skipping...
texhash: /var/lib/texmf: directory not writable. Skipping...
texhash: Done.

✅ 确保你已经安装成功

$ kpsewhere cnlogo.sty
/home/your_name/texmf/tex/latex/cnlogo/cnlogo.sty

🎨 用法

texdoc cnlogo

帮助文档

🔧 开发

🚀 构建

git clone --depth=1 https://github.com/yuxtech/cnlogo  # 下载源代码
cd cnlogo
vi cnlogo/学校的缩写.tex  # 新建文件,可以参考别的学校
cat cnlogo/学校的缩写.tex  # 显示文件内容
% 学校的缩写
% 学校的网址
% 你的姓名 <你的邮箱>  % 方便 logo 有问题的时候你的学弟学妹可以联系到你
% 其他注意事项
% 例如 logo 的原始 pdf 文件来源,以便确认没有版权问题或者出现争议时方便查找

% 定义颜色
\definecolor{学校的缩写}{RGB}{0,0,0}
% 定义命令,命令参考上一节的帮助文档
\NewDocumentCommand\学校的缩写logo{O{学校的缩写}O{1}}{
... % 生成学校 logo 的 tikz 代码,参见下一节
}
...
l3build tag  # 自动更新文档和源代码,不要手动编辑它们!
l3build doc  # 确认能否成功构建帮助文档
xdg-open *.pdf  # 浏览帮助文档检查图标是否正确
git commit -m ':sparkles: Support 学校的名字'
gh pr create  # 发送代码合并请求

✨ 从 logo 的 pdf 文件得到生成 logo 的 tikz 代码

pdf 文件难以修改颜色,所以该项目使用 tikz 代码存储 logo 。

安装任意一个 svgtikz 的插件:

  1. 使用 Inkscape 打开 pdf 后另存为 svg
  2. Extensions > Export > Export to tikz
  3. 编辑生成的代码得到 cnlogo/学校的缩写.tex

🚧 TODO

  1. 为所有学校都添加一个指向学校网址的超链接
  2. 将学校的 logo 统一修改为相同尺寸,目前定为能使以下代码中校徽的圆能与侧边栏正切的尺寸
\documentclass{beamer}
\usepackage[ustc]{cnlogo}
\logo{\ustclogo[ustc][0.1]}
\usetheme{Berkeley}
\usecolortheme{spruce}
\begin{document}

\maketitle

\end{document}

cnlogo's People

Contributors

yuxtech avatar freed-wu avatar matnoble avatar pre-commit-ci[bot] avatar

Stargazers

 avatar Ruizhe Wang avatar Cyclic avatar Gavin Gao avatar Sicun Li avatar  avatar  avatar Hunter avatar Cheney avatar  avatar chengzhou avatar Haozhe Jiang avatar  avatar  avatar  avatar RedJACK avatar kenleo avatar lukas_wq avatar BPY avatar Jyun-Syu Wang avatar  avatar  avatar tangyumeng avatar GRUNK avatar  avatar Sun Zhonghao avatar  avatar  avatar TomBen avatar Jiezhe Wang avatar  avatar  avatar

cnlogo's Issues

无法安装

在命令行里使用 tlmgr install cnlogo 安装失败,报错信息为:
package cnlogo not present in repository.
package没有被CTAN的仓库收录。

华中科技大学英文缺少of

向老师,您好
华中科技大学中Huazhong University Science and Technology缺少of. 请问如何/能否添加上去呢?

正确应该是Huazhong University of Science and Technology.

谢谢 🙏

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.