- debug selector for
ph_remove()
(see #625) that was not working for rvg outputs.
- remove old visual tests
- store paddings as numeric values and not integer values.
- remove_fields in
docx_summary()
now also removes "w:fldData" nodes. - complete the manual of
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 toFALSE
, 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.- class
dir_collection
: Files are now added to a container in the order of their trailing numeric index (#596). For example,slideLayout2.xml
will now preceedslideLayout10.xml
. Before, alphabetical sorting was used, whereslideLayout10.xml
comes beforeslideLayout2.xml
. layout_properties()
now returns all placeholders in case of multiple master (#597). Also, the internalxfrmize()
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 theid
for atype
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 forlabels= FALSE
(#604)layout_properties()
gains atype_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()
: newtype_idx
arg replaces the deprecatedid
arg (#606).- Add
ph_location_id()
as a new member to theph_location_*
family. It references a placeholder via its unique id (#606). plot_layout_properties()
: Now accepts the layout index (seelayout_summary()
) as an alternative to the layout name. Gains an argumentlegend
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).- add
layout_dedupe_ph_labels()
to handle duplicate placeholder labels (#589). By default, it will only detect duplicate labels, but apply no changes. Withaction = "rename"
, it auto-renames duplicate labels andaction = "delete"
deletes duplicates, only keeping their first occurrence. - new convenience functions
body_replace_gg_at_bkm()
andbody_replace_plot_at_bkm()
to replace text content enclosed in a bookmark with a ggplot or a base plot. - add
unit
(in, cm, mm) argument in functionpage_size()
.
- Fix.
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 columnrun
, where each element is a dataframe with rows corresponding to a single run and columns containing the information on formatting properties.- Fix. Add alt text to ggplot's added to a pptx with ph_with.gg. Closes #556.
- embedded image in PPT can now be associated with an hyperlink
- add a check to
block_pour_docx()
to avoid working with file paths containing '&'.
- add coverage to rtf, contributions from Davide Garolini at roche.
cursor_reach()
gains new argumentfixed
to enable exact matching. It defaults to FALSE for backward compatibility.remove_slide()
gains new argumentrm_images
to enable images deletion from ppt/media.- new function
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.
- new function
fp_tabs()
to enable tabulation marks settings with flextable (for Word and RTF).
- let the package be used with R < 4 by not using
\(x)
syntax
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.
- the dataframe returned by
docx_comments()
gains a list columnpara_id
containing the id(s) of the parent paragraph(s). A possible breaking change is that thecommented_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.
- Fix. Refactor
docx_comments()
to (properly) account for comments spanning multiple paragraphs, multiple comments in the same paragraph and replies. Closes #541. - Check and stop if
fp_text_lite()
is using a shading.color but no color. - Check used style in
body_add_caption()
. - fix
ph_remove()
,ph_slidelink()
andph_hyperlink()
that were not working since the latest refactoring. - Use fake attribute
stlname
if available indocx_summary()
. - calls to
file.copy(from = "template/*.xml")
are now done with argumentcopy.mode = FALSE
for compatibility with 'nix'.
- new function
run_comment()
to create a run with a comment. - new function
docx_comments()
to read comments in a Word document as a data.frame. - Add pptx support for invalid pptx files downloaded from https://slides.new.
- Internal function
is_doc_open()
replacesis_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. - Add option
preserve
to preserve cell line breaks todocx_summary()
. - fix
ph_hyperlink()
when several hyperlinks are inside one slide and refactoredph_remove()
.
- encode char to rtf from 128 instead of 256
- force 'firstLineChars' to 0 so that Chinese users don't get unwanted first indentation.
- avoid segfaults with SVG images by using the function
image_read_svg()
when source is SVG inexternal_img()
.
- add support for flextable in
block_list()
. - add RTF support for
run_autonum()
andrun_reference()
, this enables captions support for flextable.
- 'ragg' is used instead of base png because it manages any fonts.
- defunct
slip_in_footnote()
.
- fix for
to_wml.block_caption()
- add RTF support, see
rtf_doc()
andrtf_add()
.
- provides
image_to_base64()
anduuid_generate()
as a tool for other 'officeverse' packages. - styles are now injected as is and updated with
process_stylenames()
, this allow to depend on a reference doc.
- if magick is available and argument
guess_size=TRUE
, image size is read and do not need to be provided.
- fix images and links in sections headers and footer.
- fix
body_add()
content order. - fix issue with properties in 'Office' documents.
- check arguments of
run_autonum()
and add tests. - update only officer sections
- remove
$get_at_cursor()
- manage also even/first/default sections not defined with officer (indicate there is even/first/default parts).
- fix behavior regression with headers and footers replace_text_at_bkm. The previous behavior "don't trigger an error if a bookmark is missing" is back.
- force Word default continuous section if no type is specified and first page footer/header if it is seen.
- drop "Compatibility Mode" from Word documents.
- Change license to MIT.
- drop internal
get_at_cursor()
- use images sha1 value for filename with package 'openssl'. This should fix issues with duplicated images basenames, or non utf names, etc.
- export
shape_properties_tags()
for pptx extentions.
- new function
docx_set_character_style()
to add or replace a Word character style. - new function
docx_set_paragraph_style()
to add or replace a Word paragraph style. - new function
run_wordtext()
to add a chunk of text associated with a Word character style. potx
anddotx
files are now supported.- SVG images are now supported
- Word sections can now have headers and footers. See
prop_section()
. - function
cursor_reach_test()
to test if an expression has a match in the document. - add function
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.
- close 'Slide Master View' automatically.
- more careful reading of document properties
- fix cursor behavior, when
pos='before'
, cursor is now set on element added 'before'. Internals about cursors have been refactored.
- function
slip_in_footnote()
is deprecated. Userun_footnote()
instead.
fp_par()
now have argumentword_style
- add support for
ln
forexternal_img
provided by Angus Moore - add word_title and word_description to table properties (
prop_table()
). These values can be used as alternative text for Word tables. These values can also be set as "knitr" chunk options.
- fix for
is_office_doc_edited()
provided by Andrew Tungate. tab.lp
is no more set to null with usual rmarkdown outputs- autofit was never used when outputting prop_table to xml
- Function
opts_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.- Adding support for fields (e.g. auto slide number) in Powerpoint (#429),
see
empty_content()
. - add functionality to set shape geometry and outline,
see
ph_location(geam=...)
.
- drop shortcuts$slip_in_tableref() and shortcuts$slip_in_plotref()
- defunct slip_in_column_break() and slip_in_xml()
- defunct slip_in_text()
- remove defunct functions
slip_in_img()
,ph_add_fpar()
,ph_add_par()
andph_add_text()
- new as.matrix method for pptx to automatically extract one or all matrices from the file.
- simple ([character()] and [block_list()]) speaker notes can now be added to a pptx presentation
- deprecate slip_in_column_break and slip_in_text
- doc: use 'title case' for the titles of function manuals
- closing issues tab, opening discussion
- fix a bug in
ph_with.external_img()
that could be seen whenalt_text
was null - change default value for
tab.cap.sep
from ":" to ": " - fix an issue with
body_end_section_columns()
that is expected as 'continuous'.
- new parameter
scale
added toph_with.gg
,body_add_gg
andbody_add.gg
to set the scale of ggplot outputs (like in ggsave). - new function
set_autonum_bookmark()
to recycle an object made byrun_autonum()
by changing the bookmark value. - add
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 supportslevel_list
< 1 which will be interpreted as 'no bullet'.- add support to knitr table options
tab.cap.fp_text
to let format caption prefix in functionopts_current_table()
.
- deprecate almost all
slip_in*()
andph_add*()
functions. Functionsftext()
and related used withfpar()
are to be used as replacement.
- new function
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. Functionfp_text()
has also been adapted, it now supports NA meaning to not write the attributes as infp_text_lite()
. - new function
run_footnote
to add footnotes in a Word document (it also makes possible to deprecate totally slip_in* functions).
- fix a bug when creating the XML of table properties for Word documents
- On Windows, the pptx file will not be overwritten if it is edited.
run_autonum
gained new argument start_at.tab.topcaption
is now supported byopts_current_table()
- fix issue with document properties that are null
- angle was not always preserved in PowerPoint
- fix pptx scrapping for grouped object containing a table
- fix invalid hyperlinks in docx and pptx
- fix issue with duplicated images basenames
- internal
get_reference_value
- fix - if reference_data is not an existing file, it is appened toopts_knit$get("output.dir")
.
The sections are now corrected as follow, each section will be completed with the values of the default section if the value is missing. This should solve issue that lot of users have with page breaks when using sections. Now page breaks should disappear.
- alt-text for images
- On Windows, the docx file will not be overwritten if it is edited.
fp_text
gained arguments to specify different fonts when mixing CJK and latin characters:cs.family
,eastasia.family
,hansi.family
.
- fix issue with document properties where values have to be html-escaped
- new chunk function
hyperlink_ftext()
.
- drop cairo usage and let user settings do the job
- fix annotate_base that was not presenting the correct informatons (thanks to John Harrold).
- new function
body_add_plot()
andbody_add_caption()
- new function
run_bookmark()
to create a run with a bookmark. - new function
body_set_default_section()
that changes default section properties of a Word document.
- fix #333: issue with &, <, > in
to_wml.block_table
. - fix davidgohel/officedown#41: when a space was in the path, pandoc send the short path format
instead of the real path name, it needed to be transformed with
normalizePath
.
- The documentation has been rewritten and can now be found at the following URL: https://ardata-fr.github.io/officeverse/.
run_word_field
will supersedrun_seqfield
.- argument
prop
offtext()
now default to NULL
- revert PR#319 that introduced a major issue with repeated images in Word document.
- remove defunct functions (ph_with_*at) and set deprecated as defunct (other ph_with_*at)
- fix sections issue with page margin (it effected also officedown).
- fix issue #320 (with URL encoding in .rel files).
- fix encoding issue with ftext
- explicit coding of bold, italic and uunderline attributes
- ftext with a name for chunk style is fixed
- change_styles - support for run/character, paragraph and table styles.
- new function
table_stylenames()
to define columns stylenames to be used in tables, it benefits toblock_table
andbody_add_table
. - line spacing is now a feature of
fp_par
- run_autonum, run_seqfield and run_reference can now be formatted with
an object of class
fp_text
.
- added
body_end_block_section
andbody_add.block_section
so that users are free to add any section they want
- Use pandoc.exe when platform is windows
- pandoc availability is now checked (for solaris and CRAN policy)
- new argument
level_list
in functionph_with.block_list
; you can now format block_list as lists in PowerPoint. - functions
body_add_table
,ph_with.data.frame
,body_add.data.frame
get new argumentalignment
for column alignments.
- run_reference now bookmarks only the number.
- fix issues with invisible images when using ph_location_fullsize and a blank layout
- Embedded files in initial Word document were lost when they were read and printed
- fix run_reference issue with characters '-', '_'.
- enrich table blocks (
block_table()
) with table parameters such as width, layout. Seeprop_table()
. - new function
plot_layout_properties()
to help identifying placeholders on layouts
- fix border issues with word paragraphs
- reverse changes to
body_add_blocks
andbody_add_gg
as it generated issues with cursor - let pptx template have an empty master slide
- internals ; drop digest from dependencies
- new function
get_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.- new experimental function
body_add
and associated methods
- internals ; drop Rcpp and htmltools dependencies
- fix ph_with.external_img #265 (placeholder properties were not used)
- fix ph_add_text when paragraph was empty and no content was rendered
- support now for template generated from google docs thanks to Adam Lyon
- ph_location results can now be assigned and used as normal objetcs (and not only as quosures).
id_chr
is now depreacted in favor ofid
in functionph_remove
,ph_slidelink
,ph_hyperlink
,ph_add_text
,ph_add_par
,ph_add_fpar
.
- fix ph_with.xml_document so that placeholders' labels are not forgotten (for rvg, flextable, etc.)
- fix underline text issue when used with powerpoint (#229).
- fix slip_in_text issue by escaping HTML entities (#234).
- fix issue with move_slide (#223).
- new method
ph_with.xml_document
that will replaceph_with
andph_with_at
.
- fix properties inheritance with
ph_with
function.
- new function
sanitize_images
to avoid file size inflation when replacing images - svg support (will require rsvg package)
- fix
external_img
size issue with methodph_with
. - fix bg inheritance when using `ph_with functions.
- new generic function
ph_with()
and functionph_location*()
to ease insertion of elements. - new function
slide_size()
provide size of slides.
- fix issue with fonts when east asian characters are used in Word.
- new function
change_styles()
to change paragraph styles in a Word document. - new function
move_slide()
: move a slide in a presentation. - fix body_add_docx examples
- fix issue with text underlined and justified paragraphs in Word.
- skip errored test on macOS that can be read on CRAN check page.
- all examples are now generated in
tempdir()
.
- fix function
body_add_fpar()
when argumentstyle
was used. slide_summary
was using a bad xpath query.- fixed character encoding issue for filename whith windows OS
- function cursor_bookmark now let set the cursor in a text box thanks to Noam Ross. cursor_forward and cursor_backward can now fail if cursor is on a textbox but an error message will explain it to the user.
- Word documents support now footnotes.
- Word section functions have been refactored.
- New functions for replacement in headers and footers in Word documents.
See functions
headers_replace*
andfooters_replace*
- PowerPoint processing optimisation when generating more than few slides.
- fix an issue with
layout_properties
when master layout is empty.
- rdocx objects support external docx insertion
- Word margins can be modified now (thanks to Jonathan Cooper)
- New function
ph_fpars_at()
to add several formated paragraphs in a new shape. - Function annotate_base will generate a slide to identify the placeholder indexes, master names and indexes.
- fix issue with duplicated lines in layout_properties(#103)
- new argument par_default in ph_add_fpar so fpar par. properties can be kept as is.
- fix issue with images when duplicated
basename()
s
- fix issue #97 with function
pptx_summary()
- new function
body_replace_all_text()
to replace any text in a Word document - new functions for xlsx files (experimental).
- new functions
ph_with_gg()
andph_with_gg_at()
to make easier production of ggplot objects in PowerPoint - new functions
ph_with_ul()
to make easier production of unordered lists of text in PowerPoint
- an error is raised when adding an image with blank(s) in its basename (i.e. /home/user/bla bla.png).
- decrease execution time necessary to add elements into big slide deck
- fix encoding issue in function "*_add_table"
- fix an issue with complex slide layouts (there is still an issue left but don't know how to manage it for now)
- Functions slide_summary and layout_properties now return inches.
- new function
body_replace_at
to replace text inside bookmark - argument header for
body_add_table
andph_with_table
. layout_properties
now returns placeholder id when available.
- an error is now occurring when an incorrect index is used with ph_with_* functions.
- function
ph_empty_at
can now make new shapes inherit properties from template
- drop gdtools dependency
- new function
body_default_section
- fp_border supports width in double precision
- characters <, > and & are now html encoded
- on_slide index is now the correct slide number id.
- drop dplyr deprecated verbs from code
- rename
break_column
tobreak_column_before
.
body_end_section
is supposed to only work with cursor on a paragraph, an error is raised now if ending a section on something else than a paragraph.
- read_pptx run faster than in previous version thanks to some code refactoring
- new function media_extract to extract a media file from a document object. This function can be used to access images stored in a PowerPoint file.
- drop magick dependence
- new functions
docx_summary
andpptx_summary
to import content of an Office document into a tidy data.frame. - new function
docx_dim()
is returning current page dimensions. - new functions
set_doc_properties
anddoc_properties
to let you modify/access metadata of Word and PowerPoint documents. - cursor can now reach paragraphs with a bookmark (functions
body_bookmark
andcursor_bookmark
). - Content can be inserted at any arbitrary location in PowerPoint (functions
ph_empty_at
,ph_with_img_at
andph_with_table_at
).
- cast all columns of data.frame as character when using ph_with_table and body_add_table
- fix pptx when more than 9 slides
- argument
style
of functionsbody_add*
andslip_in*
now will use docx default style if not specified - new function body_add_gg to add ggplots to Word documents
- new function test_zip for diagnostic purpose
- classes
docx
andpptx
have been renamedrdocx
andpptx
to avoid conflict with package ReporteRs.