pages/_includes/scripts.liquid
Doğaç Eldenk e6542e3f4b
fix tikzjax (#3477)
Fixes #3216 – TikZJax not working.

1. Changing SHA simply doesn't work, `window.tikzjax` is undefined and
it doesn't render anything.
2. I switched to the JS distributed by
[benrbray/tikzjax](https://github.com/benrbray/tikzjax/tree/develop),
added under `assets.js` to prevent future issues.
3. Documents now require to start with `\begin{document}`, should be a
simple fix.

<img width="789" height="341" alt="Screenshot 2026-01-24 at 1 10 39 PM"
src="https://github.com/user-attachments/assets/8272471d-df94-4118-a726-00ed09dcf1e8"
/>
<img width="780" height="380" alt="Screenshot 2026-01-24 at 1 06 13 PM"
src="https://github.com/user-attachments/assets/11284661-de15-4d57-a1d9-4959f562f826"
/>
2026-01-30 22:07:24 -03:00

328 lines
11 KiB
Plaintext

<!-- jQuery -->
<script
src="{{ site.third_party_libraries.jquery.url.js }}"
integrity="{{ site.third_party_libraries.jquery.integrity.js }}"
crossorigin="anonymous"
></script>
<!-- Bootsrap & MDB scripts -->
<script src="{{ '/assets/js/bootstrap.bundle.min.js' | relative_url }}"></script>
<script
src="{{ site.third_party_libraries.mdb.url.js }}"
integrity="{{ site.third_party_libraries.mdb.integrity.js }}"
crossorigin="anonymous"
></script>
{% if site.enable_masonry %}
<!-- Masonry & imagesLoaded -->
<script
defer
src="{{ site.third_party_libraries.masonry.url.js }}"
integrity="{{ site.third_party_libraries.masonry.integrity.js }}"
crossorigin="anonymous"
></script>
<script
defer
src="{{ site.third_party_libraries.imagesloaded.url.js }}"
integrity="{{ site.third_party_libraries.imagesloaded.integrity.js }}"
crossorigin="anonymous"
></script>
<script defer src="{{ '/assets/js/masonry.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% if page.mermaid and page.mermaid.enabled %}
<!-- Mermaid and D3 -->
<script
defer
src="{{ site.third_party_libraries.mermaid.url.js }}"
integrity="{{ site.third_party_libraries.mermaid.integrity.js }}"
crossorigin="anonymous"
></script>
{% if page.mermaid.zoomable %}
<script
defer
src="{{ site.third_party_libraries.d3.url.js }}"
integrity="{{ site.third_party_libraries.d3.integrity.js }}"
crossorigin="anonymous"
></script>
{% endif %}
<script defer src="{{ '/assets/js/mermaid-setup.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% if page.code_diff %}
<!-- Diff2HTML -->
<!-- diff2html doesn't go well with Bootstrap Table -->
<script
src="{{ site.third_party_libraries.diff2html.url.js }}"
integrity="{{ site.third_party_libraries.diff2html.integrity.js }}"
crossorigin="anonymous"
></script>
<script defer src="{{ '/assets/js/diff2html-setup.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% if page.map %}
<!-- Leaflet -->
<script
src="{{ site.third_party_libraries.leaflet.url.js }}"
integrity="{{ site.third_party_libraries.leaflet.integrity.js }}"
crossorigin="anonymous"
></script>
<script defer src="{{ '/assets/js/leaflet-setup.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% if page.chart and page.chart.chartjs %}
<!-- Chart.js -->
<script
defer
src="{{ site.third_party_libraries.chartjs.url.js }}"
integrity="{{ site.third_party_libraries.chartjs.integrity.js }}"
crossorigin="anonymous"
></script>
<script defer src="{{ '/assets/js/chartjs-setup.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% if page.chart and page.chart.echarts %}
<!-- ECharts -->
<script
src="{{ site.third_party_libraries.echarts.url.js.library }}"
integrity="{{ site.third_party_libraries.echarts.integrity.js.library }}"
crossorigin="anonymous"
></script>
{% if site.enable_darkmode %}
<script
src="{{ site.third_party_libraries.echarts.url.js.dark_theme }}"
integrity="{{ site.third_party_libraries.echarts.integrity.js.dark_theme }}"
crossorigin="anonymous"
></script>
{% endif %}
<script defer src="{{ '/assets/js/echarts-setup.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% if page.calendar %}
<!-- Calendar setup -->
<script defer src="{{ '/assets/js/calendar-setup.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% if page.chart and page.chart.plotly %}
<!-- Plotly -->
<script
defer
src="{{ site.third_party_libraries.plotly.url.js }}"
integrity="{{ site.third_party_libraries.plotly.integrity.js }}"
crossorigin="anonymous"
></script>
<script defer src="{{ '/assets/js/plotly-setup.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% if page.chart and page.chart.vega_lite %}
<!-- Vega -->
<script
defer
src="{{ site.third_party_libraries.vega.url.js }}"
integrity="{{ site.third_party_libraries.vega.integrity.js }}"
crossorigin="anonymous"
></script>
<script
defer
src="{{ site.third_party_libraries.vega-lite.url.js }}"
integrity="{{ site.third_party_libraries.vega-lite.integrity.js }}"
crossorigin="anonymous"
></script>
<script
defer
src="{{ site.third_party_libraries.vega-embed.url.js }}"
integrity="{{ site.third_party_libraries.vega-embed.integrity.js }}"
crossorigin="anonymous"
></script>
<script defer src="{{ '/assets/js/vega-setup.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% if page.tikzjax %}
<!-- Tikzjax -->
<script defer src="{{ '/assets/js/tikzjax.min.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% if page.typograms %}
<!-- Typograms -->
<script src="{{ '/assets/js/typograms.js' | relative_url | bust_file_cache }}"></script>
{% endif %}
{% if site.enable_tooltips %}
<!-- Tooltips -->
<script src="{{ '/assets/js/tooltips-setup.js' | relative_url | bust_file_cache }}"></script>
{% endif %}
{% if site.enable_medium_zoom %}
<!-- Medium Zoom JS -->
<script
defer
src="{{ site.third_party_libraries.medium_zoom.url.js }}"
integrity="{{ site.third_party_libraries.medium_zoom.integrity.js }}"
crossorigin="anonymous"
></script>
<script defer src="{{ '/assets/js/zoom.js' | relative_url | bust_file_cache }}"></script>
{% endif %}
{% if page.toc and page.toc.sidebar %}
<!-- Sidebar Table of Contents -->
<script defer src="{{ '/assets/js/bootstrap-toc.min.js' | relative_url | bust_file_cache }}"></script>
{% endif %}
{% if page.pretty_table %}
<!-- Bootstrap Table -->
<!-- Bootstrap Table doesn't go well with diff2html -->
<script
defer
src="{{ site.third_party_libraries.bootstrap-table.url.js }}"
integrity="{{ site.third_party_libraries.bootstrap-table.integrity.js }}"
crossorigin="anonymous"
></script>
{% endif %}
<!-- Load Common JS -->
<script src="{{ '/assets/js/no_defer.js' | relative_url | bust_file_cache }}"></script>
<script defer src="{{ '/assets/js/common.js' | relative_url | bust_file_cache }}"></script>
<script defer src="{{ '/assets/js/copy_code.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
<!-- Jupyter Open External Links New Tab -->
<script defer src="{{ '/assets/js/jupyter_new_tab.js' | relative_url | bust_file_cache }}"></script>
<!-- Badges -->
{% if site.enable_publication_badges.altmetric %}
<script async src="https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js"></script>
{% endif %}
{% if site.enable_publication_badges.dimensions %}
<script async src="https://badge.dimensions.ai/badge.js"></script>
{% endif %}
{% if site.enable_math %}
<!-- MathJax -->
<script
defer
type="text/javascript"
id="MathJax-script"
src="{{ site.third_party_libraries.mathjax.url.js }}"
integrity="{{ site.third_party_libraries.mathjax.integrity.js }}"
crossorigin="anonymous"
></script>
{% unless page.pseudocode %}
<script src="{{ '/assets/js/mathjax-setup.js' | relative_url | bust_file_cache }}"></script>
<script
defer
src="{{ site.third_party_libraries.polyfill.url.js }}"
crossorigin="anonymous"
></script>
{% else %}
<script src="{{ '/assets/js/pseudocode-setup.js' | relative_url | bust_file_cache }}"></script>
<script
type="text/javascript"
src="{{ site.third_party_libraries.pseudocode.url.js }}"
integrity="{{ site.third_party_libraries.pseudocode.integrity.js }}"
crossorigin="anonymous"
></script>
{% endunless %}
{% endif %}
{% if site.enable_google_analytics %}
<!-- Analytics -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script defer src="{{ '/assets/js/google-analytics-setup.js' | relative_url }}"></script>
{% endif %}
{% if site.enable_cronitor_analytics %}
<!-- Cronitor RUM -->
<script async src="https://rum.cronitor.io/script.js"></script>
<script defer src="{{ '/assets/js/cronitor-analytics-setup.js' | relative_url }}"></script>
{% endif %}
{% if site.enable_pirsch_analytics %}
<script
defer
src="https://api.pirsch.io/pa.js"
id="pianjs"
data-code="{{ site.pirsch_analytics }}"
></script>
{% endif %}
{% if site.enable_openpanel_analytics %}
<script defer src="{{ '/assets/js/open-panel-analytics-setup.js' | relative_url }}"></script>
<script async defer src="https://openpanel.dev/op1.js"></script>
{% endif %}
{% if site.enable_progressbar %}
<!-- Scrolling Progress Bar -->
<script defer src="{{ '/assets/js/progress-bar.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% if page.images %}
<!-- Image Layouts -->
{% if page.images.compare %}
<script
defer
src="{{ site.third_party_libraries.img-comparison-slider.url.js }}"
integrity="{{ site.third_party_libraries.img-comparison-slider.integrity.js }}"
crossorigin="anonymous"
></script>
{% endif %}
{% if page.images.lightbox2 %}
<script
defer
src="{{ site.third_party_libraries.lightbox2.url.js }}"
integrity="{{ site.third_party_libraries.lightbox2.integrity.js }}"
crossorigin="anonymous"
></script>
{% endif %}
{% if page.images.photoswipe %}
<script defer src="{{ '/assets/js/photoswipe-setup.js' | relative_url }}" type="module"></script>
{% endif %}
{% if page.images.slider %}
<script
defer
src="{{ site.third_party_libraries.swiper.url.js }}"
integrity="{{ site.third_party_libraries.swiper.integrity.js }}"
crossorigin="anonymous"
></script>
{% endif %}
{% if page.images.spotlight %}
<script
defer
src="{{ site.third_party_libraries.spotlight.url.js }}"
crossorigin="anonymous"
></script>
{% endif %}
{% if page.images.venobox %}
<script
defer
src="{{ site.third_party_libraries.venobox.url.js }}"
integrity="{{ site.third_party_libraries.venobox.integrity.js }}"
crossorigin="anonymous"
></script>
<script defer src="{{ '/assets/js/venobox-setup.js' | relative_url | bust_file_cache }}" type="text/javascript"></script>
{% endif %}
{% endif %}
{% if page.tabs %}
<!-- Jekyll Tabs -->
<script src="{{ '/assets/js/tabs.min.js' | relative_url | bust_file_cache }}"></script>
{% endif %}
{% if site.back_to_top %}
<!-- Back to Top -->
<script src="{{ '/assets/js/vanilla-back-to-top.min.js' | relative_url | bust_file_cache }}"></script>
<script>
addBackToTop();
</script>
{% endif %}
{% if site.search_enabled %}
<!-- Search -->
<script type="module" src="{{ '/assets/js/search/ninja-keys.min.js' | relative_url | bust_file_cache }}"></script>
<ninja-keys hideBreadcrumbs noAutoLoadMdIcons placeholder="Type to start searching"></ninja-keys>
<script src="{{ '/assets/js/search-setup.js' | relative_url | bust_file_cache }}"></script>
<script src="{{ '/assets/js/search-data.js' | relative_url }}"></script>
<script src="{{ '/assets/js/shortcut-key.js' | relative_url | bust_file_cache }}"></script>
{% endif %}
{% if site.newsletter.enabled %}
<script defer src="{{ '/assets/js/newsletter.js' | relative_url | bust_file_cache }}"></script>
{% endif %}