惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
C
Cisco Blogs
The Hacker News
The Hacker News
T
Tor Project blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The Register - Security
The Register - Security
云风的 BLOG
云风的 BLOG
Simon Willison's Weblog
Simon Willison's Weblog
P
Palo Alto Networks Blog
Vercel News
Vercel News
C
CERT Recently Published Vulnerability Notes
I
InfoQ
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
I
Intezer
aimingoo的专栏
aimingoo的专栏
U
Unit 42
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
Microsoft Security Blog
Microsoft Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
P
Proofpoint News Feed
P
Proofpoint News Feed
B
Blog
T
Threat Research - Cisco Blogs
博客园 - 叶小钗
Recorded Future
Recorded Future
Last Week in AI
Last Week in AI
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Know Your Adversary
Know Your Adversary
Engineering at Meta
Engineering at Meta
G
Google Developers Blog
PCI Perspectives
PCI Perspectives
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Schneier on Security
Schneier on Security
N
News | PayPal Newsroom
C
Cybersecurity and Infrastructure Security Agency CISA
H
Help Net Security
博客园 - 聂微东
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
GRAHAM CLULEY

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN Mintty Tips and Configurations Generating Table of Contents for Markdown with Tagbar Convert Python Script to Exe on Windows with Pyinstaller Ubuntu on Windows Missing after Windows Update 使用代理加速 Mac 终端下载速度 My Experience with Several Zsh Plugin Managers 深圳租房小记 How to Install zplug inside Docker Container Why don't settings inside bashrc or bash_profile take effect? Setting Up Locale in Linux 谷歌 Adsense 申请及在 Hugo 中的配置 How to Write Algorithm Pseudo Code in LaTeX Nifty Nvim Techniques That Make My Life Easier -- Series 4 A Few Grammar Questions in Writing How to Read and Write Images with Unicode Paths in OpenCV Creating A Professional Table in LaTeX with booktabs How to Create Proper Folding for Vim/Nvim Configuration Linux Tips and Tricks -- s1 JPEG Image Orientation and Exif How Do I Show the Current File Path In Neovim? JPEG Image Quality in PIL Difference between view, reshape, transpose and permute in PyTorch Convert PIL or OpenCV Image to Bytes without Saving to Disk Fast Movement and Navigation Inside Vim or Neovim Unintuitive Behaviour of Case Sensitivity in Python glob Binding Keys in Zsh 几把机械键盘试用体验 Nvim Autocompletion with Deoplete Converting Markdown to Beautiful PDF with Pandoc Exclusive and Inclusive Motion in Neovim/Vim Nifty Nvim Techniques Which Make My Life Easier -- Series 3 Why Doesn't Jedi Autocompletion Work for Some Methods Vim-like Editing inside Browser Markdown 生成 HTML 时汉字之间出现多余空格问题 小米 9 安装谷歌商店(Google Play Store)与相关配置 Create Mappings That Take A Count in Neovim Spell Checking in Nvim English Words Completion inside Neovim/Vim How to Use Python Inside Vim Script with Neovim Nifty Little Nvim Techniques to Make My Life Easier -- Series 2 Setting up Ultisnips for Neovim Mac 上罗技 M590 鼠标设置 Nifty Little Nvim Techniques to Make My Life Easier -- Series 1 A Complete Guide on Writing LaTeX with Vimtex in Neovim Manipulating Images with Alpha Channels in Pillow Sublime Text Regular Expression Cheat Sheet Cropping Rotated Rectangles from Image with OpenCV Boosting Your Productivity on Terminal with Zsh and Plugins 最新版 Rime 输入法使用 (2022 更新) Display Image with Pillow inside Ubuntu on Windows Faster Directory Navigation with z.lua Cmder Advanced Configurations Nvim-qt Settings on Windows 10 Tmux Plugin Install and Management How to Debug Python Code in Terminal Markdown Writing and Previewing in Neovim -- A Complete Guide Line Number Settings for More Efficient Movement in Neovim 两个大规模中文语料库介绍以及处理 Windows 系统下几款程序员不可不用的神器 我的 2018 阅读清单 A Complete Guide to Neovim Configuration for Python Development How Is Newline Handled in Python and Various Editors? Two Issues Related to ImageFont Module in PIL 在 Listary 中调用 GoldenDict 或欧路词典查单词 Reading and Writing Text Files on Windows The Mathematics behind Font Shapes --- Bézier Curves and More 快速识别图片字体:字体识别工具介绍 Deoplete Failed to Load at Startup after Updating Python neovim Package What Is The Difference between pip, pip3 and pip3.6 Shipped with Anaconda3? Windows 10 系统下 Neovim 安装与配置
Windows 下 LaTeX 手动安装宏包(package)以及生成帮助文档整套流程
2015-09-23 · via jdhao's digital space

本文简单介绍如何手动安装一个 LaTeX 宏包。

一般来说,下载的 TeX 发行版已经自带了很多宏包,可以满足绝大部分需求,但是偶尔我们也可能碰到需要使用的宏包碰巧没有安装的情况,这时我们就需要自己下载安装宏包了。

下载 package 可以从 CTAN(Comprehensive TeX Archive Network)下载。下载下来的宏包,有的直接包含 .sty 文件(.sty 文件就是 package 的最终形式);有的下载下来只包含了 .ins, .dtx,以及一个 readme 文件,这时需要自己编译生成 .sty 文件,以及生成相应的 manual。下面详细介绍生成 sty 文件以及帮助文档的步骤。

以下步骤的前提是你已经安装好了 TeX 发行版,本文以 MikTeX 为例,请确保 MikTeX 的可执行程序已经加入了系统的环境变量中(PATH)。另外我的系统的 Win 8.1,win 7 应该也是一样的。

第一步:下载宏包,解压,不赘述,下载地址 https://www.ctan.org/pkg,我下载的一个宏包名称是 qrcode,是用来生成二维码的,以这个宏包的编译为例来讲解。

第二步:找到宏包解压后安装包地址,在我的电脑上是 E:\LaTeX_package\qrcode, 然后打开电脑的命令提示符界面,把当前的路径改到这个 package 所在的文件夹,也就是 E:\LaTeX_package\qrcode

第三步:生成 qrcode.sty,在命令提示符界面输入 latex qrcode.ins, 经过一段时间编译,qrcode.sty 就生成了;然后接着生成帮助文档 manual, 在命令提示符界面输入 latex qrcode.dtx,编译完成以后,会生成一个叫做 qrcode.dvi 的文件,这个文件也可以用 ctex 自带的 yap 程序打开,不过不是很方便,所以最好还是把它转为 PDF,需要两步操作,先输入 dvips qrcode.dvi,生成 qrcode.ps 文件,再输入 ps2pdf qrcode.ps,最终就生成了 qrcode.pdf的帮助文档,帮助文档包含这个 package 的基本用法,命令的格式等。最终完成的样子如下

第四步:生成 qrcode.sty 文件以后还需要把这个文件放到 LaTeX 能够识别的路径下,在 ctex 下,以我的电脑为例,这个路径是 D:\Program Files\CTEX\MiKTeX\tex\latex,你可以在这个路径下建立一个文件夹,譬如 qrcode,然后把 qrcode.sty 放到这里。接着在你的电脑里找到 MikTeX 的 settings 这个程序,settings 有两个,选择后面括号里有 admin 的那个,打开以后,在 general 选项卡下有 Refresh FNDB 按钮,点击,过一会,这个 package 就会被加入 MikTeX 的路径中,然后在你的 tex 文件中就可以使用这个 package 了。

使用#

利用这个宏包,最后可以生成文本对应的二维码,代码如下:

\documentclass{article}
\usepackage{qrcode}
\begin{document}
This is a qrcode for Google HK.
\qrcode{https://www.google.com.hk/}
\end{document}

最后生成的二维码如下图:

其他宏包如果要手动安装,都是类似操作的。Happy TeXing!

如果不想如此麻烦,可以选择使用 TeX Live,完整版已经预装了大多数你要使用的 package。

参考#