arxiv html beautify

Beautify arxiv. 美化arxiv html版,修改字体等,沉浸式阅读,学术必备好帮手

  1. // ==UserScript==
  2. // @name arxiv html beautify
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.161
  5. // @description Beautify arxiv. 美化arxiv html版,修改字体等,沉浸式阅读,学术必备好帮手
  6. // @author dlutor
  7. // @match https://arxiv.org/html/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=arxiv.org
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. window.onload=function(){
  17. const header = document.querySelector("body > header.desktop_header");
  18. if (header) header.remove();
  19. const alertBtn = document.querySelector("#main > div > div.package-alerts.ltx_document > button > span");
  20. if (alertBtn) alertBtn.click();
  21. const style = document.createElement('style');
  22. style.innerHTML = `.ltx_p, .ltx_abstract .ltx_p{ font-family: 'STIX Two Math';}
  23. .ltx_transformed_inner>.ltx_p{ font-family: auto;}
  24. .ltx_text.ltx_ref_title {display: flex;}
  25. .ltx_tocentry_section>.ltx_ref>.ltx_ref_title>.ltx_tag {margin-right: 0rem;}
  26. body:after {content: ""; position: inherit;}
  27. nav.ltx_TOC {padding-top: 15px;}
  28. .ltx_page_main > .ltx_page_content {margin: 10px 1em 3.5em 1em;}`;
  29. document.head.appendChild(style);
  30. document.querySelector("#openForm").remove();
  31. }
  32.  
  33. // Your code here...
  34. })();