% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rtf.R
\name{rtf_set_paragraph_style}
\alias{rtf_set_paragraph_style}
\title{Add or replace a paragraph style in an RTF document}
\usage{
rtf_set_paragraph_style(
  x,
  style_id,
  style_name = style_id,
  base_on = "Normal",
  fp_p = fp_par(),
  fp_t = NULL,
  outline_level = NULL
)
}
\arguments{
\item{x}{an rtf object created by \code{\link[=rtf_doc]{rtf_doc()}}.}

\item{style_id}{user-facing identifier used as the key when a paragraph
references the style (\code{rtf_add(..., style = style_id)}).}

\item{style_name}{display label of the style as it appears in Word's style
menu. Defaults to \code{style_id}.}

\item{base_on}{the \code{style_id} of the parent style. Properties not defined
in the new style are inherited from the parent. Defaults to \code{"Normal"}.}

\item{fp_p}{paragraph formatting properties, see \code{\link[=fp_par]{fp_par()}}.}

\item{fp_t}{text formatting properties, see \code{\link[=fp_text]{fp_text()}}. If \code{NULL} the
paragraph inherits text properties from the parent style.}

\item{outline_level}{integer between 1 and 9, or \code{NULL}. Sets the outline
level (\verb{\\\\outlinelevel}) so paragraphs using the style feed Word's
navigation pane and TOC field. Level 1 is the topmost (used by Heading 1).}
}
\value{
the rtf object with the style added or updated.
}
\description{
Add or replace a paragraph style in the document stylesheet
so that subsequent paragraphs can reference it via the \code{style} argument of
\code{\link[=rtf_add]{rtf_add()}}. The function mirrors \code{\link[=docx_set_paragraph_style]{docx_set_paragraph_style()}} for Word.
}
\examples{
doc <- rtf_doc()
doc <- rtf_set_paragraph_style(
  doc,
  style_id = "Callout",
  fp_p = fp_par(text.align = "center", padding = 6),
  fp_t = fp_text_lite(bold = TRUE, color = "#1F4E79")
)
doc <- rtf_add(doc, "Heads up", style = "Callout")
print(doc, target = tempfile(fileext = ".rtf"))
}
\seealso{
\code{\link[=docx_set_paragraph_style]{docx_set_paragraph_style()}}, \code{\link[=rtf_doc]{rtf_doc()}}, \code{\link[=rtf_add]{rtf_add()}}
}
