-
Notifications
You must be signed in to change notification settings - Fork 10
EN:Textbox
谢耳朵 edited this page Mar 12, 2026
·
5 revisions
[English Version] | 中文版
luatex-cn provides powerful vertical text box capabilities with grid alignment.
The \TextBox (or \文本框) command creates an independent vertical text area.
\TextBox[options]{Content}| Key | Description | Default |
|---|---|---|
height |
Height in grid units. 0 for auto-extension. | 0 |
n-cols |
Number of columns. | 0 |
border |
Show border. | false |
background-color |
Background color. | None |
floating |
Enable floating mode (needs x, y). | false |
-
Auto-Extension: If
heightis 0, the box extends naturally. -
Compression (Flat Text): If
heightis fixed and content is too long, text is vertically compressed (v0.1.5). - Independent Indentation (v0.2.2+): Textbox content no longer inherits paragraph indentation from main text, ensuring layout independence (fix #37).
Quick commands for adding borders and/or inverted (white-on-black) effects to inline labels. Size is automatically calculated based on content.
| Command | English | Traditional | Effect |
|---|---|---|---|
\墨围{text} |
\bordered |
\墨圍 |
Rectangular black border |
\反白{text} |
\inverted |
— | White text on black (no border) |
\墨围反白{text} |
\borderedInverted |
\墨圍反白 |
Rectangular border + inverted |
\八角墨围{text} |
\octagonBordered |
\八角墨圍 |
Octagonal border |
\八角墨围反白{text} |
\octagonBorderedInverted |
\八角墨圍反白 |
Octagonal border + inverted |
\带圈{text} |
\circled |
\帶圈 |
Circular border |
\墨围{集解}裴駰曰……
\反白{正義}張守節曰……
\八角墨围{校勘}此字疑誤……
\带圈{一}Use border-margin-x / border-margin-y for separate horizontal and vertical padding:
| Parameter | Description | Default |
|---|---|---|
border-margin |
Unified border padding | 0pt |
border-margin-x |
Horizontal border padding | (follows border-margin) |
border-margin-y |
Vertical border padding | (follows border-margin) |
outer-margin |
External textbox margin | 0pt |
\FillTextBox (or \填充文本框) is a variant of \TextBox with default fill alignment.
\FillTextBox[height=10]{Content}👉 Next: Features.
📜 LuaTeX-CN | Licensed under Apache License 2.0