Commit Graph

589 Commits

Author SHA1 Message Date
Karthik Chikmagalur 2143cf5f09
ox-html: Use org-latex-preview for LaTeX preview images
* lisp/ox-html.el (org-html-latex-image-options,
org-html-prepare-latex-images, org-html-latex-image,
org-html-latex-image--data, org-html-close-tag): Delegate LaTeX
preview image creation to `org-latex-preview-cache-images'.
Require both 'svg and 'svg-embed in the :inline condition of
`org-html-latex-image-options' to embed svg tags.  Handle LaTeX
preview image generation errors gracefully when exporting to html,
and highlight missing images in the html output.
2024-04-16 19:58:50 +08:00
TEC 2fde128b19
ox-html: Fix C++ label CSS
* lisp/ox-html.el (org-html-style-default): The "C++" pre-label works if
the "+" characters are backslash-escaped.
2024-04-16 19:58:50 +08:00
TEC 3019d930d6
ox-html: Allow inlining svg tex as <svg> elements
* lisp/ox-html.el (org-html-latex-image--data, org-html-latex-image):
Add support for inlining dvisvgm-exported svgs as <svg> elements,
preserving the effect of the currentColor attribute.  While making this
change, we improve a few other aspects of the html LaTeX fragment export
system, namely refactoring/code style improvements and the recognition
of \[...\] and $$...$$ fragments as blocks not inline fragments.
2024-04-16 19:58:50 +08:00
TEC fdaeb38609
org-latex-preview: Skip blank fragments
* lisp/org-latex-preview.el (org-latex-preview--construct-entries,
org-latex-preview-auto--regenerate-overlay): Blank fragments produce
invisible previews, which is at best silly and at worst confusing.  It's
much better to simply not produce a preview image of blank fragments.
We also now avoid exessive re-numbering calculations when repeatadly
generating live previews.
2024-04-16 19:58:50 +08:00
TEC bc2ef6c91d
ox-html: Support for customised latex image dir
* lisp/ox-html.el (org-html-latex-image, org-html-prepare-latex-images,
org-html-latex-image-options): Allow for customising the LaTex image
directory in `org-html-latex-image-options'.
2024-04-16 19:58:50 +08:00
TEC 4280eb3869
org-latex-preview: Put :page-width in opt plist
* lisp/org-latex-preview.el (org-latex-preview-options,
org-latex-preview-appearance-options): Rename
`org-latex-preview-options' to `org-latex-preview-appearance-options',
as it better reflects the purpose of the variable.

(org-latex-preview--tex-styled, org-latex-preview--image-extract-async,
org-latex-preview--create-tex-file,
org-latex-preview--create-image-async, org-latex-preview--hash,
org-latex-preview-place, org-latex-preview--update-overlay): Put the
page width specification in `org-latex-preview-appearance-options', and
adjust existing code to handle this new structuring.

* lisp/ox-html.el (org-html-prepare-latex-images,
org-html-latex-image-options): Adjust for the
`org-latex-preview-appearance-options' rename, and put :page-width in
the options plist, just with a raised value of 1.0 as the HTML default.

* lisp/org.el (org-do-latex-and-related, org-latex-preview-options),
org-compute-latex-and-related-regexp): Adjust for the
`org-latex-preview-appearance-options' rename.

* lisp/org-compat.el: Adjust for the
`org-latex-preview-appearance-options' rename.

* lisp/ob-latex.el (org-babel-execute:latex, org-latex-preview-header)):
Adjust for the `org-latex-preview-appearance-options' rename.

* etc/ORG-NEWS: Adjust for the `org-latex-preview-appearance-options'
rename.

* doc/org-manual.org (Previewing LaTeX fragments): Adjust for the
`org-latex-preview-appearance-options' rename.
2024-04-16 19:58:50 +08:00
TEC ea44c61cf1
ox-html: Allow inlining of LaTeX images
* lisp/ox-html.el (org-html-latex-image, org-html-latex-image-options):
Add a new `org-html-latex-image-options' keyword, ":inline", which
controls image inlining in `org-html-latex-image'.
2024-04-16 19:58:49 +08:00
TEC fed2ebc16a
org-latex-preview: Fix snippet preamble hash
* lisp/org-latex-preview.el (org-latex-preview--create-tex-file,
org-latex-preview--hash, org-latex-preview-place,
org-latex-preview-clear-cache): The only the default preamble was being
hashed, which led to incorrect results across documents.  To correctly
hash the preamble, it is now determined at the start of
`org-latex-preview-place', and used in `org-latex-preview--hash',
`org-latex-preview--create-tex-file', and
`org-latex-preview-clear-cache'.
2024-04-16 19:58:49 +08:00
TEC 39e0faebd1
ox-html: Update LaTeX export for images and mathml
* lisp/ox-html.el (org-html-latex-environment, org-html-format-latex,
org-latex-to-html-convert-command, org-format-latex-as-html,
org-html-latex-image-options): Introduce new functions and variables to
work directly with the new org-latex-preview and ox-mathml API.

* lisp/org-latex-preview.el (org-format-latex-as-html,
org-latex-preview--tex-styled, org-latex-preview-replace-fragments,
org-latex-to-html-convert-command, org-latex-preview-options,
org-latex-preview-place-image-link): Move all of the HTML-specific
processing out of org-latex-preview.el, and into ox-html.el, and remove
now-obsolete code.

* lisp/org-compat.el (org-place-formula-image, org-html-format-latex):
Relocate a copy of `org-place-formula-image' and `org-html-format-latex'
here, and mark them as obsolete.
2024-04-16 19:58:49 +08:00
TEC 239f3bab04
org-latex-preview: Use prefix more consistently
* lisp/ox-odt.el (org-odt--translate-latex-fragments): Use renamed
org-latex-preview-* functions/variables.

* lisp/ox-html.el (org-html-latex-fragment, org-html-latex-environment,
org-html-format-latex, org-html-with-latex): Use renamed
org-latex-preview-* functions/variables.

* lisp/org.el (org-compute-latex-and-related-regexp,
org-latex-packages-alist): Use renamed org-latex-preview-*
functions/variables.

* lisp/org-latex-preview.el (org-dvipng-color, org-create-formula-image,
org--get-display-dpi, org-create-latex-export,
org-preview-latex--tex-styled, org-preview-precompile,
org-latex-preview--place-images, org-latex-preview--generic-callback,
org-latex-preview--image-extract-async,
org-preview-latex--create-tex-file, org-create-formula-image-async,
org-create-latex-preview, org-format-latex, org-latex-preview-fragments,
org-latex-replace-fragments, org-latex-preview,
org--latex-preview-region, org-clear-latex-preview,
org-latex-preview--handle-insert,
org-latex-preview--close-previous-overlay,
org-latex-preview--handle-post-cursor, org--make-preview-overlay,
org-latex-preview-auto-generate-p, org-preview-use-precompilation,
org-format-latex-header, org-preview-latex-process-alist,
org-preview-latex-default-process, org-format-latex-signal-error,
org-format-latex-options): Use renamed org-latex-preview-*
functions/variables.  Use the org-latex-preview group instead of
org-latex for preview-related variables.

* lisp/org-compat.el: Add entries for renamed and obsoleted
org-latex-preview-* functions/variables.

* lisp/ob-latex.el (org-babel-execute:latex, org-format-latex-header)):
Use renamed org-latex-preview-* functions/variables.

* doc/org-manual.org (Footnotes, Previewing LaTeX fragments, LaTeX
fragments): Use renamed org-latex-preview-* functions/variables.

org-latex-preview: clear overlays name

* lisp/org-latex-preview.el (org-clear-latex-preview):
2024-04-16 19:58:49 +08:00
TEC 9edfc99fda
org-latex-preview: Split org-format-latex into two
* lisp/org-latex-preview.el (org-format-latex, org-create-latex-preview,
org-latex-replace-fragments): The rather large `org-format-latex'
function mixed the preview and export code paths together in rather
confusing way.  This has now been split into
`org-latex-replace-fragments' for export, and
`org-latex-preview-fragments' for in-buffer previews.
(org--latex-preview-region): Replace `org-format-latex' with the more
specific `org-latex-preview-fragments'.
(org-latex-tentative-math-re): Instead of let-binding the math regexp,
use a const and explain its usage.

* lisp/ox-odt.el (org-odt--translate-latex-fragments): Replace
`org-format-latex' with the more specific `org-latex-replace-fragments`.

* lisp/ox-html.el (org-html-format-latex): Replace `org-format-latex'
with the more specific `org-latex-replace-fragments`.
2024-04-16 19:58:48 +08:00
Ihor Radchenko b42867b5a1
org-html-toc: Fix duplicate ids when there are multiples TOCs
* lisp/ox-html.el (org-html-toc): When multiple TOCs are generated
inside the exported document, make sure that they do not have
duplicate IDs.

Reported-by: Michel Damiens <michel.damiens@gmail.com>
Link: https://orgmode.org/list/87sfj6av4t.fsf@localhost
2024-04-14 13:34:13 +03:00
Ihor Radchenko ead3f99901
Fix regression after 72b0e9ff0
* lisp/ox-html.el (org-html-link): Fix code branches assuming that
PATH variable strips link type.

Reported-by: Daniel Clemente <n142857@gmail.com>
Link: https://orgmode.org/list/CAJKAhPD=eMR2Tw3rsufPw_T6eEexpcHP=6PXKw3fLDtB2Z7qNg@mail.gmail.com
2024-04-10 17:02:01 +03:00
Ihor Radchenko c8d1338365
org-html-htmlize-generate-css: Do not omit faces without :inherit property
* lisp/ox-html.el (org-html-htmlize-generate-css): Fix not adding
faces without :inherit property to the generated css.  Update the
docstring, detailing that the css class names are the face names with
`org-html-htmlize-font-prefix' prepended.
2024-04-04 14:18:37 +03:00
Ross Timson 1be2f96931
lisp/ox-html.el: Add avif support for html export inline images
* lisp/ox-html.el (org-html-inline-image-rules): Add AVIF image
support for inline images on HTML export.

AVIF is well supported by browsers these days and offers similar
features and much better compression than the other image formats
commonly used for the web.

TINYCHANGE
2024-03-27 15:11:40 +03:00
Ihor Radchenko 16f7021c75
Merge branch 'bugfix' 2024-03-25 13:56:53 +03:00
Ihor Radchenko 656531edbe
org-html-style-default: Fix XHTML validation failing
* lisp/ox-html.el (org-html-style-default): Provide mandatory
attribute type for style tag.

Reported-by: c.buhtz@posteo.jp
2024-03-25 13:54:58 +03:00
Ihor Radchenko 72b0e9ff04
org-export: Do not strip link type by default during export
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-link--inline-image):
* lisp/ox-texinfo.el (org-texinfo-link): Preserve link type during
export for all the links, not just for a hard-coded subset.
* etc/ORG-NEWS (Built-in HTML, LaTeX, Man, Markdown, ODT, and Texinfo
exporters preserve the link protocol during export): Document the
breaking change.

Link: https://list.orgmode.org/orgmode/878r9nofpw.fsf@localhost/
2024-03-12 13:57:47 +03:00
Ihor Radchenko 5cb52f379b
org-html-example-block: Combine :class attributes using space
* lisp/ox-html.el (org-html-example-block): Avoid creating duplicate
class= attributes when example block has #+ATTR_HTML: :class foo.

Multiple class attributes must be combined with space, as per
https://www.w3schools.com/html/html_classes.asp

Reported-by: Joshua Honeycutt <joshua.honeycutt@gmail.com>
Link: https://orgmode.org/list/87fsfxfzex.fsf@localhost
2024-02-03 15:09:11 +01:00
Kyle Meyer 72a2db86d9 Merge branch 'bugfix' 2024-01-06 16:02:02 -05:00
Po Lu 9f1d6dfd73 Backport commit 8e1c56ae4 from Emacs
; Add 2024 to copyright years
8e1c56ae46754dd7baedff49a464f078f0e9912d
Po Lu
Tue Jan 2 09:47:10 2024 +0800
2024-01-06 15:48:23 -05:00
Ihor Radchenko 0c4358b4ac
lisp/ox-html.el: Fix some checkdoc warnings
* lisp/ox-html.el (org-html-format-list-item): Document some function
arguments.
(org-html--latex-environment-numbered-p): Suppress checkdoc heuristics.
(org-html-image-link-filter): Add docstring.
(org-html-table--table.el-table):
(org-html-final-function):  Document the function arguments.
2023-12-11 12:59:27 +01:00
Ihor Radchenko 4f92738774
lisp/ox-html.el: Fix some checkdoc warnings
* lisp/ox-html.el (org-html-mathjax-options): Use two spaces between
sentences and remove trailing newline in the docstring.
(org-html--container):
(org-html-xhtml-p):
(org-html-html5-p): Add docstring.
(org-html--anchor):
(org-html--todo):
(org-html-format-headline-default-function):
(org-html-format-inlinetask-default-function): Document all the
function arguments.
2023-12-10 12:52:16 +01:00
Ihor Radchenko 91ce96d04a
org-html-link-org-files-as-html: Fix checkdoc warning
Escape ( at bol.
2023-11-02 10:22:23 +02:00
Akira Kyle 8fa7f0279e
org-html-link: Fix relative links with :html-link-use-abs-url
* lisp/ox-html.el (org-html-link): When publishing relative links with
both :html-link-use-abs-url and :html-link-home, ensure the correct
link is constructed.  Never append `home' to absolute paths.

TINYCHANGE
2023-07-10 11:16:32 +03:00
Ihor Radchenko f93d855c51
Prefer `forward-line' over `beginning-of-line'
The latter is much slower.

Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63225#98
2023-07-01 14:36:14 +03:00
Ihor Radchenko 81a7e8c836
org-element-lineage: Allow TYPES to be a symbol
* lisp/org-element-ast.el (org-element-lineage): Allow TYPES argument
to be a symbol.
* lisp/ox-ascii.el (org-ascii--current-text-width):
(org-ascii-format-inlinetask-default):
(org-ascii-section):
* lisp/ox-beamer.el (org-beamer--format-block):
* lisp/ox-html.el (org-html-section):
(org-html-table-cell):
(org-html-table-row):
* lisp/ox-latex.el (org-latex-table-cell):
(org-latex-table-row):
* lisp/ox-odt.el (org-odt-headline):
(org-odt-table-style-spec):
(org-odt-get-table-cell-styles):
(org-odt-table-cell):
(org-odt-table-row):
* lisp/ox-org.el (org-org-section):
* lisp/ox-publish.el (org-publish-collect-index):
* lisp/ox-texinfo.el (org-texinfo--get-node):
(org-texinfo-section):
(org-texinfo-table-row):
* lisp/ox.el (org-export--skip-p):
(org-export-get-node-property):
(org-export-table-cell-borders):
(org-export-table-row-in-header-p):
(org-export-table-row-number):
(org-export-collect-headlines): Update all the callers.
2023-07-01 14:35:43 +03:00
Ihor Radchenko 2d22d7f515
ox.el: Rename `org-element-get-parent-element' and move to org-element
* lisp/org-element.el: Rename `org-element-get-parent-element' to
`org-element-parent-element'.
* lisp/org-compat.el (org-export-get-parent-element):
* lisp/ox.el (org-export-get-parent-element): Remove, adding obsolete
alias.
(org-export--skip-p):
* lisp/org-table.el:
* lisp/ox-beamer.el (org-beamer-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-footnote-reference):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-format-label):
(org-odt-link--inline-image):
(org-odt-link--inline-formula):
* lisp/ox-texinfo.el (org-texinfo--inline-image): Update all the
callers.
2023-07-01 14:35:42 +03:00
Ihor Radchenko ea4f4fdf58
Rename `org-export-get-parent' to `org-element-parent' 2023-07-01 14:35:41 +03:00
Ihor Radchenko a7d1dfa171
Use `org-element-type-p'
Use `org-element-type-p' across Org source, except some tests, where `eq' can
produce more meaningful failure explanations.
2023-07-01 14:35:35 +03:00
Matthew Trzcinski 88c572de25 Create aliases for export region functions
lisp/ox-ascii.el: Create alias `org-export-region-to-ascii` for
`org-ascii-convert-region-to-ascii`.
lisp/ox-html.el: Create alias `org-export-region-to-html` for
`org-html-convert-region-to-html`.
lisp/ox-latex.el: Create alias `org-export-region-to-latex` for
`org-latex-convert-region-to-latex`.
lisp/ox-md.el: Create alias `org-export-region-to-md` for
`org-md-convert-region-to-md`.
lisp/ox-texinfo.el: Create alias `org-export-region-to-texinfo` for
`org-texinfo-convert-region-to-texinfo`.
doc/org-manual.org: Change commands from "*-convert-region-*" form to
the "org-export-region-to-*" aliases.  Add function index for aliases.
2023-06-29 21:18:01 +02:00
Ihor Radchenko f81ba451a7
Prefer "backend" over "back-end"
* doc/org-manual.org (Exporting): Add cindex entry for both "backend"
and "back-end" for better searchability.

All other changes are trivial.

Note that `org-element-export-snippet-parser' will still use :back-end
property.  So will ox.el in INFO channel.
2023-04-20 14:11:19 +02:00
Feraidoon Mehri 5e9953fa0e
ox.el: Refactor ID prefixes
* lisp/ox-html.el (org-html--id-attr-prefix):
* lisp/ox-odt.el (org-odt--id-attr-prefix): Refactor hardcoded "ID-"
as a new private variable.

* org/ox-html.el (org-html--reference): Add support for the ID
property (previously only supported CUSTOM_ID).

These changes make crossfile ID links work in the exported HTML when
`org-html-prefer-user-labels' is not-nil.
2023-04-05 11:22:32 +02:00
Ihor Radchenko c1bb68ab9d
ox: Make export errors more prominent
* lisp/ox-html.el (org-html-fontify-code):
* lisp/ox-latex.el (org-latex-generate-engraved-preamble):
(org-latex-inline-src-block):
(org-latex-src-block):
(org-latex-src--engrave-code):
* lisp/ox-odt.el:
(org-odt--table):
(org-odt--translate-latex-fragments):
(org-odt--export-wrap): Use `warn' instead of `message' when external
dependency/tool is missing/fails.
2023-03-29 16:30:41 +02:00
Ihor Radchenko 8589de94d8
Merge branch 'bugfix' 2023-03-07 14:09:48 +01:00
Rudolf Adamkovič eb6379a417
Fix LaTeX spelled as Latex
etc/ORG-NEWS (Non-floating minted listings in LaTeX export):
* lisp/ob-latex.el: (org-babel-execute:latex):
* lisp/org-element.el:
* lisp/ox-ascii.el:
* lisp/ox-html.el:
* lisp/ox-latex.el:
* lisp/ox-md.el:
* lisp/ox-odt.el:
* testing/examples/ob-maxima-test.org (LaTeX output):
* testing/lisp/test-org-element.el (test-org-element/cache): Spell LaTeX
correctly.
2023-03-07 14:08:40 +01:00
Ihor Radchenko fe92a3cedb
Provide a uniform way to inform users about missing third-party packages
* lisp/org-macs.el (org-require-package): New macro trying to load a
library and displaying custom error message or warning on failure.
The actual package (not library) name can be provided as optional
argument.

* lisp/ob-R.el (org-babel-R-initiate-session):
* lisp/ob-clojure.el (ob-clojure-eval-with-inf-clojure):
(ob-clojure-eval-with-cider):
(ob-clojure-eval-with-slime):
* lisp/ob-forth.el (org-babel-forth-session-execute):
* lisp/ob-gnuplot.el (org-babel-execute:gnuplot):
(org-babel-gnuplot-initiate-session):
* lisp/ob-haskell.el (org-babel-interpret-haskell):
(org-babel-haskell-initiate-session):
* lisp/ob-js.el (org-babel-execute:js):
(org-babel-js-initiate-session):
* lisp/ob-julia.el (org-babel-julia-initiate-session):
* lisp/ob-lisp.el (org-babel-execute:lisp):
* lisp/ob-ocaml.el (org-babel-prep-session:ocaml):
* lisp/ob-octave.el (org-babel-octave-initiate-session):
* lisp/ob-processing.el (org-babel-processing-view-sketch):
* lisp/ob-ruby.el (org-babel-execute:ruby):
(org-babel-ruby-initiate-session):
* lisp/ol-bbdb.el (org-bbdb-open):
(org-bbdb-complete-link):
(org-bbdb-anniv-export-ical):
* lisp/org-agenda.el:
* lisp/org-plot.el (org-plot/gnuplot):
* lisp/org.el:
* lisp/ox-ascii.el (org-ascii-table):
* lisp/ox-html.el (org-html-htmlize-generate-css):
* lisp/ox-org.el: Use the new macro.

* lisp/oc-csl.el: Add FIXME. oc-csl uses a custom function doing
similar job.

* lisp/ob-js.el (org-babel-js-initiate-session): Add FIXME noting that
the third-party package is outdated.
2023-02-17 17:09:23 +03:00
Ihor Radchenko 77a1cfb9a4
org-html-src-block: Treat code blocks without LANG equally
* lisp/ox-html.el (org-html-src-block): Do not treat src blocks
without LANG as example blocks.  Instead, export them using "nil"
language.  This way, such src blocks will get captions, unlike example
blocks.

The new behavior is consistent with ox-latex and ox-ascii.

Reported-by: Johan Bolmsjö <org-mode@johan.bitmaster.se>
Link: https://orgmode.org/list/87zgb90win.fsf@localhost
2023-01-23 16:29:13 +03:00
Eli Zaretskii e0815d7545 Backport commit cae528457 from Emacs
; Add 2023 to copyright years.
cae528457cb862dc886a34240c9d4c73035b6659
Eli Zaretskii
Sun Jan 1 05:31:12 2023 -0500
2023-01-01 12:44:47 -05:00
Ihor Radchenko db34a7d837
* lisp/ox-html.el (org-html-link): Fix call to `org-export-get-ordinal'
Pass list of type symbols as third argument following the docstring
spec.

Reported-by: Brian Powell <powellb@hawaii.edu>
Link: https://orgmode.org/list/m2tu1s458q.fsf@hawaii.edu
2022-12-21 15:28:48 +03:00
Rudolf Adamkovič 7f4d91040a
ox-html: Use accurate MathJax versions
* etc/ORG-NEWS (HTML export uses MathJax 3+ instead of MathJax 2):
* lisp/ox-html.el (org-html-mathjax-options): Mention Mathjax 4+
version support where applicable.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m28rk2k8so.fsf@me.com
2022-11-23 19:08:27 +08:00
Rudolf Adamkovič 62e1513b5a
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility.  All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3.  Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.

Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-11-21 10:44:56 +08:00
Ihor Radchenko 5c247fb27b
org-html-postamble: Clarify that string value is format string
* lisp/ox-html.el (org-html-postamble): Clarify that string value of
the variable is not inserted verbatim, but used as format string.

Reported-by: Tim Cross <theophilusx@gmail.com>
Link: https://orgmode.org/list/86wn8gbvk0.fsf@gmail.com
2022-11-16 12:47:59 +08:00
Ihor Radchenko 84b4878680
ox-html: Do not allow `org-html-preamble' to be 'auto
* lisp/ox-html.el (org-html--build-pre/postamble): Avoid building
date/author/email info line when `org-html-preamble' is set to
'auto.  This is only meaningful in `org-html-postamble'.
2022-11-16 12:47:58 +08:00
Ihor Radchenko 4517fba441
org-html-htmlize-output-type: Mark safe as buffer-local
* lisp/ox-html.el (org-html-htmlize-output-type): This variable is
safe to set buffer-locally as a symbol.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m28ruxklo5.fsf@me.com
2022-11-11 11:31:58 +08:00
Ihor Radchenko 192742c9c5
org-export-with-buffer-copy: Allow safe reusable buffer copy
* lisp/ox.el (org-export--generate-copy-script):
(org-export-copy-buffer):  Accept cl-style key arguments.
* lisp/ox.el (org-export-with-buffer-copy): Allow optional cl-style
key arguments for fine-grained control on what to copy from the target
buffer and which buffer to use as a target.  Do not kill the target
buffer upon finished, when the target is provided.  Make sure that
remaining buffer copy does not preserve `buffer-file-name' from the
original buffer and that it never overwrites the file associated with
the original buffer.
* lisp/ox-html.el (org-html-format-latex): Use the new version of
`org-export-with-buffer-copy' instead of managing edge cases by
itself.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/87zge8j5iu.fsf@localhost
2022-10-10 17:36:10 +08:00
Ihor Radchenko 86b6d843f6
org-html-format-latex: Prevent side effects of copying `buffer-file-name'
* lisp/ox-html.el (org-html-format-latex): Unset `buffer-file-name'
after we are done with transcoding LaTeX.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2k05c579o.fsf@me.com/T/#m949ed054f0f219e2742697c4c4f49fbe07909f5a
2022-10-07 18:06:19 +08:00
Ihor Radchenko 0be36ac13e
org-html-format-latex: Prevent save prompt for temporary buffer
* lisp/ox-html.el (org-html-format-latex): Mark the temporary Org
buffer as unchanged to prevent buffer saving prompt before exiting
Emacs.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:18 +08:00
Ihor Radchenko 09fd5f886a
org-html-format-latex: Avoid unnecessary string allocation
* lisp/ox.el (org-export--generate-copy-script): Add new optional
arguments to limit what is being copied.
(org-export-copy-buffer): Allow copying into provided buffer and copy
selectively passing the new optional arguments to
`org-export--generate-copy-script'.  Do not try to check if all the
local variable values are `read'able - it is only needed during async
export.
* lisp/ox-html.el (org-html-format-latex): Re-use the same hidden
buffer during export.  Only copy local variables into that buffer.

This commit avoids excessive calls to `org-mode' and copying the
exported buffer contents for every single latex fragment.  The result
is lower impact on GC and better overall performance.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:16 +08:00
Giovanni Alfredo Garciliano Díaz 3e9f98c691
* lisp/ox-html.el (org-html-doctype-alist): Fix system identifier for XHTML 1.1 DTD
Right DTDs are listed on https://www.w3.org/QA/2002/04/valid-dtd-list.html

TINYCHANGE
2022-09-25 16:47:47 +08:00