-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
r2rtf provides rtf_rich_text() function for inline text formatting within table cells. This allows mixing different text styles (bold, italic, etc.) within a single cell.
Expected functionality
# r2rtf example
rtf_rich_text("Normal text {b Bold text} and {i italic text}")Proposed Python equivalent
# Proposed rtflite implementation
rtf.rich_text("Normal text {b Bold text} and {i italic text}")Minimal example
import rtflite as rtf
import polars as pl
df = pl.DataFrame({
"Treatment": ["Placebo", "Drug A"],
"Response": [
rtf.rich_text("n=50 {b (75%)}"),
rtf.rich_text("n=48 {b (92%)}")
]
})
doc = rtf.RTFDocument(df=df)
doc.write_rtf("rich_text_example.rtf")Use case
Clinical reports often need mixed formatting within cells (e.g., "n=50 {b (75%)}" where the percentage is bold).
References
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request