print

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Print

打印

Print files on Mac or Linux using the
lp
command with sensible defaults.
在Mac或Linux系统上使用
lp
命令打印文件,预设合理默认参数。

Printing Markdown

打印Markdown文件

To print a markdown file, first convert it to PDF using the
/md-to-pdf
skill:
bash
~/.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 printing
The
/md-to-pdf
skill handles Mermaid diagrams, syntax highlighting, and page numbers.
要打印Markdown文件,需先使用
/md-to-pdf
技能将其转换为PDF:
bash
~/.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-pdf
技能支持Mermaid图表、语法高亮和页码添加。

Defaults

默认参数

SettingDefaultRationale
DuplexDouble-sided (long-edge)Save paper
ColorBlack & whiteSave toner on color printers
These defaults can be overridden per-request.
设置默认值理由
双面打印长边装订双面打印节省纸张
颜色模式黑白节省彩色打印机墨粉
这些默认参数可根据单次打印请求进行覆盖。

Usage

使用方法

Quick Print (uses system default printer)

快速打印(使用系统默认打印机)

bash
undefined
bash
undefined

Print 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>
undefined

Common Options

常见选项

OptionFlagExample
Printer
-d <name>
-d HP_LaserJet_4001
Copies
-n <count>
-n 3
Pages
-P <range>
-P 1-5
or
-P 1,3,7
Single-sided
-o sides=one-sided
Override duplex
Color
-o ColorModel=Color
Override b&w
Landscape
-o landscape
Rotate 90°
Fit to page
-o fit-to-page
Scale to fit
选项标记示例
指定打印机
-d <名称>
-d HP_LaserJet_4001
打印份数
-n <数量>
-n 3
页码范围
-P <范围>
-P 1-5
-P 1,3,7
单面打印
-o sides=one-sided
覆盖双面打印默认设置
彩色打印
-o ColorModel=Color
覆盖黑白默认设置
横向打印
-o landscape
旋转90°
适配页面
-o fit-to-page
缩放至适配页面

List Available Printers

列出可用打印机

bash
lpstat -p -d
Shows 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 jobs
bash
lpstat -o          # 显示待处理任务
lpstat -W completed # 显示已完成任务

Cancel a Job

取消打印任务

bash
cancel <job-id>    # e.g., cancel HP_LaserJet_4001-852
cancel -a          # Cancel all jobs
bash
cancel <任务ID>    # 示例:cancel HP_LaserJet_4001-852
cancel -a          # 取消所有任务

Helper Script

辅助脚本

The
print
script at
~/.claude/skills/print/scripts/print
wraps
lp
with the defaults:
bash
undefined
位于
~/.claude/skills/print/scripts/print
print
脚本封装了
lp
命令并应用默认参数:
bash
undefined

Basic 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
    --color
    to override b&w default
  • 彩色激光打印机
  • 支持双面打印
  • 使用
    --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
lpstat -p
to see current names.
打印机名称已更改。运行
lpstat -p
查看当前打印机名称。

Job stuck in queue

任务卡在队列中

bash
lpstat -o                    # Check status
cancel <job-id>              # Cancel stuck job
cupsenable <printer-name>    # Re-enable if disabled
bash
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