Skip to content

Commit

Permalink
Added example.typ
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew15-5 committed Jul 3, 2023
1 parent f6a0922 commit c6b8405
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ If you don't want automatically wrap text with delimiter:
#let ruby = get_ruby(auto_spacing: false)
```

See also <https://github.com/rinmyo/ruby-typ/blob/main/manual.pdf>.
See also <https://github.com/rinmyo/ruby-typ/blob/main/manual.pdf> and `example.typ`.

## Notes

Expand Down
58 changes: 58 additions & 0 deletions example.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#set text(
font: ("Liberation Sans", "Noto Sans CJK JP")
) // Optional

#import "@preview/rubby:0.8.0": get_ruby
#let ruby = get_ruby()

```typst
#let ruby = get_ruby() // (1) Adds missing delimiter around every content/string
// or
#let ruby = get_ruby(auto_spacing: false) // (2) Logic from original project
```

#ruby[ふりがな][振り仮名]

#ruby[とう|きょう|こう|ぎょう|だい|がく][東|京|工|業|大|学]

#ruby[とうきょうこうぎょうだいがく][東京工業大学]

Next 2 lines look the same with (1) (default):

#let ruby = get_ruby()

#ruby[|きょうりょく|][|協力|]

#ruby[きょうりょく][協力]

But lines are being typeset differently if (2) is used:

#let ruby = get_ruby(auto_spacing: false)

#ruby[|きょうりょく|][|協力|]

#ruby[きょうりょく][協力] // Page boundaries are not honored

First 3 lines out of 4 look the same way with (1):

#let ruby = get_ruby()

#ruby[きゅう][九]#ruby[じゅう][十]

#ruby[きゅう|][九|]#ruby[|じゅう][|十]

#ruby[きゅう|じゅう][九|十]

#ruby[きゅうじゅう][九十]

Only 2nd and 3rd lines look the same way with (2):

#let ruby = get_ruby(auto_spacing: false)

#ruby[きゅう][九]#ruby[じゅう][十]

#ruby[きゅう|][九|]#ruby[|じゅう][|十]

#ruby[きゅう|じゅう][九|十]

#ruby[きゅうじゅう][九十]

0 comments on commit c6b8405

Please sign in to comment.