Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese打印
Print files on Mac or Linux using the command with sensible defaults.
lp在Mac或Linux系统上使用命令打印文件,预设合理默认参数。
lpPrinting Markdown
打印Markdown文件
To print a markdown file, first convert it to PDF using the skill:
/md-to-pdfbash
~/.claude/skills/md-to-pdf/scripts/md-to-pdf.mjs doc.md
~/.claude/skills/print/scripts/print doc.pdf
rm doc.pdf # Delete if PDF was just for printingThe skill handles Mermaid diagrams, syntax highlighting, and page numbers.
/md-to-pdf要打印Markdown文件,需先使用技能将其转换为PDF:
/md-to-pdfbash
~/.claude/skills/md-to-pdf/scripts/md-to-pdf.mjs doc.md
~/.claude/skills/print/scripts/print doc.pdf
rm doc.pdf # 若PDF仅用于打印可删除/md-to-pdfDefaults
默认参数
| Setting | Default | Rationale |
|---|---|---|
| Duplex | Double-sided (long-edge) | Save paper |
| Color | Black & white | Save toner on color printers |
These defaults can be overridden per-request.
| 设置 | 默认值 | 理由 |
|---|---|---|
| 双面打印 | 长边装订双面打印 | 节省纸张 |
| 颜色模式 | 黑白 | 节省彩色打印机墨粉 |
这些默认参数可根据单次打印请求进行覆盖。
Usage
使用方法
Quick Print (uses system default printer)
快速打印(使用系统默认打印机)
bash
undefinedbash
undefinedPrint a file with defaults (double-sided, b&w)
使用默认参数打印文件(双面、黑白)
lp -o sides=two-sided-long-edge -o ColorModel=Gray <file>
lp -o sides=two-sided-long-edge -o ColorModel=Gray <file>
Or use the helper script
或使用辅助脚本
~/.claude/skills/print/scripts/print <file>
undefined~/.claude/skills/print/scripts/print <file>
undefinedCommon Options
常见选项
| Option | Flag | Example |
|---|---|---|
| Printer | | |
| Copies | | |
| Pages | | |
| Single-sided | | Override duplex |
| Color | | Override b&w |
| Landscape | | Rotate 90° |
| Fit to page | | Scale to fit |
| 选项 | 标记 | 示例 |
|---|---|---|
| 指定打印机 | | |
| 打印份数 | | |
| 页码范围 | | |
| 单面打印 | | 覆盖双面打印默认设置 |
| 彩色打印 | | 覆盖黑白默认设置 |
| 横向打印 | | 旋转90° |
| 适配页面 | | 缩放至适配页面 |
List Available Printers
列出可用打印机
bash
lpstat -p -dShows all printers and the system default (marked with ).
system default destination:bash
lpstat -p -d显示所有打印机及系统默认打印机(标记为)。
system default destination:Check Print Queue
查看打印队列
bash
lpstat -o # Show pending jobs
lpstat -W completed # Show completed jobsbash
lpstat -o # 显示待处理任务
lpstat -W completed # 显示已完成任务Cancel a Job
取消打印任务
bash
cancel <job-id> # e.g., cancel HP_LaserJet_4001-852
cancel -a # Cancel all jobsbash
cancel <任务ID> # 示例:cancel HP_LaserJet_4001-852
cancel -a # 取消所有任务Helper Script
辅助脚本
The script at wraps with the defaults:
print~/.claude/skills/print/scripts/printlpbash
undefined位于的脚本封装了命令并应用默认参数:
~/.claude/skills/print/scripts/printprintlpbash
undefinedBasic usage
基础用法
print document.pdf
print document.pdf
Specify printer
指定打印机
print document.pdf -d Brother_HL_L3280CDW_series
print document.pdf -d Brother_HL_L3280CDW_series
Multiple copies
多份打印
print document.pdf -n 3
print document.pdf -n 3
Single-sided color
单面彩色打印
print document.pdf --single-sided --color
print document.pdf --single-sided --color
Page range
指定页码范围
print document.pdf -P 1-5
Run `print --help` for all options.print document.pdf -P 1-5
运行`print --help`查看所有选项。Printer-Specific Notes
打印机特定说明
HP LaserJet 4001
HP LaserJet 4001
- Supports duplex
- Monochrome only (no color option needed)
- Steve's default printer
- 支持双面打印
- 仅黑白打印(无需彩色选项)
- Steve的默认打印机
Brother HL-L3280CDW
Brother HL-L3280CDW
- Color laser
- Supports duplex
- Use to override b&w default
--color
- 彩色激光打印机
- 支持双面打印
- 使用参数可覆盖黑白默认设置
--color
Brother DCP-L2550DW
Brother DCP-L2550DW
- Monochrome
- Supports duplex
- 黑白打印机
- 支持双面打印
Troubleshooting
故障排查
"No such file or directory"
"No such file or directory"(找不到文件或目录)
The printer name has changed. Run to see current names.
lpstat -p打印机名称已更改。运行查看当前打印机名称。
lpstat -pJob stuck in queue
任务卡在队列中
bash
lpstat -o # Check status
cancel <job-id> # Cancel stuck job
cupsenable <printer-name> # Re-enable if disabledbash
lpstat -o # 查看状态
cancel <任务ID> # 取消卡住的任务
cupsenable <打印机名称> # 若打印机被禁用则重新启用Duplex not working
双面打印不生效
Not all printers support duplex. Check printer capabilities:
bash
lpoptions -p <printer-name> -l | grep -i sides并非所有打印机都支持双面打印。检查打印机功能:
bash
lpoptions -p <打印机名称> -l | grep -i sides