@@ -365,6 +365,7 @@ def _create_yaml_header(self) -> str:
365365 r .ReportType .PDF : """
366366 pdf:
367367 toc: false
368+ fig-align: center
368369 margin:
369370 - bottom=40mm
370371 include-in-header:
@@ -568,7 +569,7 @@ def _generate_plot_content(self, plot) -> List[str]:
568569 try :
569570 if plot .plot_type == r .PlotType .STATIC :
570571 plot_content .append (
571- self ._generate_image_content (plot .file_path , width = 950 )
572+ self ._generate_image_content (plot .file_path , width = "95%" )
572573 )
573574 elif plot .plot_type == r .PlotType .PLOTLY :
574575 plot_content .append (self ._generate_plot_code (plot ))
@@ -901,7 +902,7 @@ def _generate_html_content(self, html) -> List[str]:
901902 return html_content
902903
903904 def _generate_image_content (
904- self , image_path : str , alt_text : str = "" , width : int = 650 , height : int = 400
905+ self , image_path : str , alt_text : str = "" , width : str = "95%"
905906 ) -> str :
906907 """
907908 Adds an image to the content list in an HTML format with a specified width and height.
@@ -927,7 +928,7 @@ def _generate_image_content(
927928 else :
928929 src = get_relative_file_path (image_path , base_path = ".." ).as_posix ()
929930
930- return f"""{{fig-alt={ alt_text } width={ width } height= { height } }}\n """
931+ return f"""{{fig-alt={ alt_text } width={ width } }}\n """
931932
932933 def _generate_component_imports (self , component : r .Component ) -> List [str ]:
933934 """
0 commit comments