tes.innerHTML = originalFootnotes.innerHTML;

                // Optionally, remove the original footnotes
                originalFootnotes.remove();
              }
            });
          </script>
<script>
document.addEventListener("DOMContentLoaded", function () {
  // Function to convert string to title case
  function toTitleCase(str) {
    return str.replace(/\w\S*/g, function(txt){
      return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
    });
  }

  // Function to generate TOC
 