doc.packages.append(Package('adjustbox')) # Include the package doc.append(NoEscape(r'egin{adjustbox}{width=1 extwidth}')) table.append(NoEscape(df.to_latex(escape=False))) # Your df.to_latex() code here doc.append(NoEscape(r'end{adjustbox}'))