Software⏱️ 3 min read📅 2026-06-11

How to Fix: Error exporting PDF file in jupyter notebook: pgfkeys '/tcb/size' error

Error exporting PDF file in Jupyter Notebook: pgfkeys '/tcb/size' error. XeTeX version 3.1415926-2.5-0.9999.3 (TeX Live 2013) restricted \ wite18 enabled.

Quick Answer: The issue is caused by the 'pgfkeys /tcb/size' command in your LaTeX code, which is not compatible with XeTeX. Try replacing it with '\setlength{\tcb@width}{10cm}' or adjust the size to a value that works for you.

Error exporting PDF file in Jupyter Notebook: pgfkeys ‘/tcb/size’ error

This error occurs when attempting to export a Jupyter Notebook as a PDF file, resulting in an error message that prevents the conversion from proceeding.

💡 Why You Are Getting This Error

  • The primary cause of this error is due to the presence of pgfkeys ‘/tcb/size’ in the LaTeX code. This key is used to specify the size of the tcb environment, which is part of the tcolorbox package.
  • An alternative reason for this error could be the version of XeTeX being used, as it may not support certain features required by the Jupyter Notebook's PDF exporter.

🔧 Proven Troubleshooting Steps

Updating XeTeX and removing pgfkeys ‘/tcb/size’

  1. Step 1: Update XeTeX to the latest version available on the system.
  2. Step 2: Remove any instances of pgfkeys ‘/tcb/size’ from the LaTeX code in the Jupyter Notebook.
  3. Step 3: Verify that the updated LaTeX code and XeTeX version resolve the error.

Disabling tcolorbox package

  1. Step 1: Disable the tcolorbox package by commenting out or removing it from the LaTeX preamble.
  2. Step 2: Re-run the nbconvert command to see if the PDF export is successful without the tcolorbox package.

💡 Conclusion

To resolve the error exporting a PDF file in Jupyter Notebook, update XeTeX and remove pgfkeys ‘/tcb/size’ from the LaTeX code. If updating XeTeX is not feasible, disabling the tcolorbox package can be an alternative solution.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions