NEWS.md
location
arg in ph_with_*
functions (#623). Instead of a location
object created by the ph_location_*
function family, ph_with_*
functions now resolves certain short form input into corresponding location
objects. For example, instead of using ph_location_label("<label>")
you can now simply pass the "<label>"
to the location
arg. The functionn will convert the string into the corresponding location object automatically. Other examples are "body [1]"
for ph_location_type(type = "body", type_idx = 1)
, or the integer 1
for ph_location_id(id = 1)
slide_visible()
to get and set the visibility of slides (#622).ph_remove()
(see #625) that was not working for rvg outputs.phs_with
: filling multiple placeholders on one or more slides at once using key-value pair syntax (#639).add_slide
: new args ...
and .dots
, both passed to phs_with
to create slide and fill placeholders in one step (#639).docx_summary()
now also removes “w:fldData” nodes.body_add_docx()
with a note about the file basename that can not contain ’ ’ and trigger an error if it contains a ’ ’.plot_layout_properties()
gains a ‘title’ parameter, which will add the layout name as the plot title. Defaults to FALSE
, to not alter the old behavior. Also, the slide width and height are now correctly displayed in the plot. Before, a box was drawn around the plot area. However, the plot area var with device size, not slide size.dir_collection
: Files are now added to a container in the order of their trailing numeric index (#596). For example, slideLayout2.xml
will now preceed slideLayout10.xml
. Before, alphabetical sorting was used, where slideLayout10.xml
comes before slideLayout2.xml
.layout_properties()
now returns all placeholders in case of multiple master (#597). Also, the internal xfrmize()
now sorts the resulting data by placeholder position. This yields an intuitive order, with placeholders sorted from top to bottom and left to right.ph_location_type()
now throws an error if the id
for a type
is out of range (#602) and a more informative error message if the type is not present in layout (#601).plot_layout_properties()
assignment order fixed for labels= FALSE
(#604)layout_properties()
gains a type_idx
column to index phs of the same type on a layout. Indexing is performed based on ph position, following a top-to-bottom, left-to-right order (#606).plot_layout_properties()
plots more information by default now: layout name, ph label, ph id, ph type + index by default (#606).ph_location_type()
: new type_idx
arg replaces the deprecated id
arg (#606).ph_location_id()
as a new member to the ph_location_*
family. It references a placeholder via its unique id (#606).plot_layout_properties()
: Now accepts the layout index (see layout_summary()
) as an alternative to the layout name. Gains an argument legend
to add a legend to the plot. Also prints the current slide’s layout by default now, if not layout name is provided explicitly (#595).layout_rename_ph_labels()
to rename ph labels (#610).layout_dedupe_ph_labels()
to handle duplicate placeholder labels (#589). By default, it will only detect duplicate labels, but apply no changes. With action = "rename"
, it auto-renames duplicate labels and action = "delete"
deletes duplicates, only keeping their first occurrence.body_replace_gg_at_bkm()
and body_replace_plot_at_bkm()
to replace text content enclosed in a bookmark with a ggplot or a base plot.unit
(in, cm, mm) argument in function page_size()
.docx_summary
preserves non-breaking hyphens. Non-breaking hyphens are replaced with a hyphen-minus (Unicode character 002D). Closes #573.docx_summary()
gains parameter ‘detailed’ which allows to get a detailed summary including formatting properties of runs in a paragraph. Formatting properties are stored in a list column run
, where each element is a dataframe with rows corresponding to a single run and columns containing the information on formatting properties.block_pour_docx()
to avoid working with file paths containing ‘&’.cursor_reach()
gains new argument fixed
to enable exact matching. It defaults to FALSE for backward compatibility.remove_slide()
gains new argument rm_images
to enable images deletion from ppt/media.body_comment()
adds a comment on an existing paragraph at the cursor position.docx_summary()
gains parameter ‘remove_field’ to prevent field codes from appearing in the returned data.frame.fp_tabs()
to enable tabulation marks settings with flextable (for Word and RTF).fp_border()
gains support for all line border styles listed in ECMA-376 § 17.18.2 and allowed CSS border styles. Closes #165 and #443.docx_comments()
gains a list column para_id
containing the id(s) of the parent paragraph(s). A possible breaking change is that the commented_text
is now returned as a list column to account for comments spanning multiple runs. The docs gain a description of the columns of the returned dataframe.opts_current_table()
now ignore ‘Quarto’ setting.docx_comments()
to (properly) account for comments spanning multiple paragraphs, multiple comments in the same paragraph and replies. Closes #541.fp_text_lite()
is using a shading.color but no color.body_add_caption()
.ph_remove()
, ph_slidelink()
and ph_hyperlink()
that were not working since the latest refactoring.stlname
if available in docx_summary()
.file.copy(from = "template/*.xml")
are now done with argument copy.mode = FALSE
for compatibility with ‘nix’.run_comment()
to create a run with a comment.docx_comments()
to read comments in a Word document as a data.frame.is_doc_open()
replaces is_office_doc_edited()
to check if a document is open on Windows. This solves the issue where RStudio crashed while trying to write to an open Office document.preserve
to preserve cell line breaks to docx_summary()
.ph_hyperlink()
when several hyperlinks are inside one slide and refactored ph_remove()
.image_read_svg()
when source is SVG in external_img()
.block_list()
.run_autonum()
and run_reference()
, this enables captions support for flextable.slip_in_footnote()
.image_to_base64()
and uuid_generate()
as a tool for other ‘officeverse’ packages.process_stylenames()
, this allow to depend on a reference doc.guess_size=TRUE
, image size is read and do not need to be provided.body_add()
content order.run_autonum()
and add tests.get_at_cursor()
shape_properties_tags()
for pptx extentions.docx_set_character_style()
to add or replace a Word character style.docx_set_paragraph_style()
to add or replace a Word paragraph style.run_wordtext()
to add a chunk of text associated with a Word character style.potx
and dotx
files are now supported.prop_section()
.cursor_reach_test()
to test if an expression has a match in the document.docx_current_block_xml()
to let developpers access the xml content where the cursor is.ph_with.xml_document
now manages images paths in slide and treats them in the relevant documents.pos='before'
, cursor is now set on element added ‘before’. Internals about cursors have been refactored.slip_in_footnote()
is deprecated. Use run_footnote()
instead.fp_par()
now have argument word_style
ln
for external_img
provided by Angus Mooreprop_table()
). These values can be used as alternative text for Word tables. These values can also be set as “knitr” chunk options.is_office_doc_edited()
provided by Andrew Tungate.tab.lp
is no more set to null with usual rmarkdown outputsopts_current_table()
read some Quarto values related to captions in order to reuse them later.set_doc_properties()
now supports any character property. It provides an easy way to insert arbitrary fields. Given the challenges that can be encountered with find-and-replace in word with officer, the use of document fields and quick text fields provides a much more robust approach to automatic document generation from R.empty_content()
.ph_location(geam=...)
.ph_with.external_img()
that could be seen when alt_text
was nulltab.cap.sep
from “:” to “:”body_end_section_columns()
that is expected as ‘continuous’.scale
added to ph_with.gg
, body_add_gg
and body_add.gg
to set the scale of ggplot outputs (like in ggsave).set_autonum_bookmark()
to recycle an object made by run_autonum()
by changing the bookmark value.tnd
argument to prefix a autonumber with the title number (i.e. 4.3-2 for figure 2 of chapter 4.3).unordered_list()
now supports level_list
< 1 which will be interpreted as ‘no bullet’.tab.cap.fp_text
to let format caption prefix in function opts_current_table()
.fp_text_lite()
that do not force to provide a value for each properties - if a value is not provided, its attribute will not be written and as a result, the default properties will be applied. Function fp_text()
has also been adapted, it now supports NA meaning to not write the attributes as in fp_text_lite()
.run_footnote
to add footnotes in a Word document (it also makes possible to deprecate totally slip_in* functions).run_autonum
gained new argument start_at.tab.topcaption
is now supported by opts_current_table()
get_reference_value
- fix - if reference_data is not an existing file, it is appened to opts_knit$get("output.dir")
.hyperlink_ftext()
.body_add_plot()
and body_add_caption()
run_bookmark()
to create a run with a bookmark.body_set_default_section()
that changes default section properties of a Word document.to_wml.block_table
.normalizePath
.run_word_field
will supersed run_seqfield
.prop
of ftext()
now default to NULLtable_stylenames()
to define columns stylenames to be used in tables, it benefits to block_table
and body_add_table
.fp_par
fp_text
.block_table()
) with table parameters such as width, layout. See prop_table()
.plot_layout_properties()
to help identifying placeholders on layouts # officer 0.3.8get_reference_value
to read reference template used by R Markdown.fp_par
now have an argument “keep_with_next” that specifies that the paragraph (or at least part of it) should be rendered on the same page as the next paragraph when possible.body_add
and associated methodsph_with()
and function ph_location*()
to ease insertion of elements.slide_size()
provide size of slides.change_styles()
to change paragraph styles in a Word document.move_slide()
: move a slide in a presentation.tempdir()
.body_add_fpar()
when argument style
was used.slide_summary
was using a bad xpath query.headers_replace*
and footers_replace*
ph_fpars_at()
to add several formated paragraphs in a new shape.basename()
spptx_summary()
body_replace_all_text()
to replace any text in a Word documentph_with_gg()
and ph_with_gg_at()
to make easier production of ggplot objects in PowerPointph_with_ul()
to make easier production of unordered lists of text in PowerPointdocx_summary
and pptx_summary
to import content of an Office document into a tidy data.frame.docx_dim()
is returning current page dimensions.set_doc_properties
and doc_properties
to let you modify/access metadata of Word and PowerPoint documents.body_bookmark
and cursor_bookmark
).ph_empty_at
, ph_with_img_at
and ph_with_table_at
).