Commit Graph

442 Commits

Author SHA1 Message Date
TEC 6ee45518f3
ox: Add link localisation feature using persist
* lisp/ox.el (org-export-link-remote-p): A new function to determine
whether a link refers to a remote resource.
(org-export-link--remote-local-copy): Download and return the local
location of a remote resource link.
(org-export-link-localise): Transform remote links to refer to a local
copy of the resource.

* lisp/ox-latex.el (org-latex-link, org-latex-inline-image-rules): Make
use of the new functions for remote resources in ox.el to support
embedding https and tramp -linked files.
2022-01-31 19:37:39 +08:00
Kyle Meyer aae2ac3a68 Merge branch 'bugfix' 2022-01-01 15:21:37 -05:00
Kyle Meyer 5a229cbc44 Update copyright year to 2022 2022-01-01 15:17:08 -05:00
Nicolas Goaziou 5e35de34a6 Merge branch 'bugfix' 2021-11-28 20:44:44 +01:00
Rasmus c91271297d ox-latex: Fix asynchronous export
* lisp/ox-latex.el (org-latex-export-to-pdf): Fix "invalid-read-syntax
'#'" when exporting asynchronously with ox-latex.

See also previous bug report: https://lists.gnu.org/archive/html/emacs-orgmode/2021-06/msg00422.html
2021-11-28 20:44:22 +01:00
Juan Manuel Macías 85998490d9 ox-latex: add `options' latex attribute to tables
* lisp/ox-latex.el (org-latex--org-table): The `:options' LaTeX
attribute allows adding an optional argument (`\begin{env}[opt]'),
since certain tabular environments, such as `longtblr', accept optional
arguments.
* doc/org-manual.org (Tables in LaTeX export): this feature in the manual.
* etc/ORG-NEWS (New :options attribute when exporting tables to
LaTeX): this feature in `ORG-NEWS'.
2021-11-06 14:50:27 +01:00
Glenn Morris c3e8709e2d Backport commit f9111d878 from Emacs
* lisp/oc-basic.el (org-cite-basic-sorting-field)
(org-cite-basic-author-year-separator)
(org-cite-basic-max-key-distance)
(org-cite-basic-author-column-end)
(org-cite-basic-column-separator)
(org-cite-basic-mouse-over-key-face):
* lisp/oc-biblatex.el (org-cite-biblatex-options):
* lisp/oc-csl.el (org-cite-csl-link-cites)
(org-cite-csl-html-hanging-indent)
(org-cite-csl-html-label-width-per-char)
(org-cite-csl-latex-hanging-indent):
* lisp/oc.el (org-cite-adjust-note-numbers):
* lisp/org-keys.el (org-return-follows-link):
* lisp/org.el (org-fontify-todo-headline):
* lisp/ox-html.el (org-html-equation-reference-format)
(org-html-wrap-src-lines):
* lisp/ox-latex.el (org-latex-reference-command)
(org-latex-default-quote-environment): Fix :safe property.

The safe-local-variable property is a function (bug#50944)
f9111d8784bf12263abbe127cdfcbe5f409c9b3b
Glenn Morris
Sat Oct 2 10:37:42 2021 -0700
2021-10-02 13:44:34 -04:00
Bastien 806ac1b7f6 *el: Fix indentation 2021-09-29 09:22:47 +02:00
Bastien 777c1c3cb5 Merge branch 'bugfix' 2021-09-25 18:02:19 +02:00
Max Nikulin ec7c16a060 ox-latex: Allow percent sign in 'src-block' caption
* lisp/ox-latex.el (org-latex-src-block): Prevent leak of percent sign
from caption to `format' first argument causing export failure due to
insufficient argument number.  The fix covers only the case of verbatim
environment.
* testing/lisp/test-ox.el
(test-org-export/latex-src-block-verbatim-caption): New test for src
block LaTeX export with cases of various formatting of caption and
verbatim environment.  Check that percent signs in caption and source
block body do not lead to errors.

Reported-by: Charest, Luc <charest.luc@hydroquebec.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2021-08/msg00017.html>
2021-09-25 18:02:08 +02:00
Stefan Kangas 51cdd6e30f Various minor docfixes found by checkdoc 2021-09-16 21:24:59 +02:00
Nicolas Goaziou 229b018b60 ox-latex: Do not duplicate \texttt on inline source blocks
* lisp/ox-latex.el (org-latex-inline-src-block): When
`org-latex-listings' is nil, simply translate source block as code,
without adding an additional \texttt command.

Reported-by: Maxim Nikulin <manikulin@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-07/msg00489.html>
2021-07-27 21:59:43 +02:00
TEC 32739e35e3
ox-latex: Change default compiler to latexmk
* lisp/ox-latex.el (org-latex-pdf-process): Check for the presence of
latexmk when setting the default, and use it when available.  Fall back
to the current default.  This is important for the incoming citation
support, as PDF generation will now need to involve bibliography
generation.  By using latexmk this is taken care of for us.  The -%latex
part of the command is slightly hacky, but allows latexmk to behave more
intelligently for non-pdflatex options.  Note that latexmk also seems to
care about the order of the arguments.
2021-07-10 00:31:40 +08:00
Nicolas Goaziou 9aa304f957 ox-latex: Fix defcustom keywords.
* lisp/ox-latex.el (org-latex-reference-command): Do not provide
both :version and :package-version.  Add :safe keyword.
2021-06-13 22:28:10 +02:00
TEC f092cb30d9
ox-latex: Allow reference command to be customised
* lisp/ox-latex.el (org-latex-reference-command): Create a new variable
so the user may modify the reference command used.
(org-latex-link): Make use of the new `org-latex-reference-command' when
generating references for labels without a description (previously using
\ref).
(org-latex-prefer-user-labels): Mention the new
`org-latex-reference-command' when describing the generated LaTeX
referencing labels.
2021-06-10 01:37:00 +08:00
Markus Huber 54863e802f ox-latex: Surround option string with braces if it includes brackets
lisp/ox-latex.el (org-latex--make-option-string): If `value' of
a `pair' from `options' contains a bracket the whole `value' is
surrounded by braces.

In case of LaTeX export using listings the dialect of
a language (e.g. [LaTeX]TeX) is surrounded by brackets. For inline
source blocks all options end as optional argument to \lstinline
between brackets which breaks the LaTeX parser.

TINYCHANGE
2021-05-29 22:24:15 +02:00
Juan Manuel Macias f4aac6090d ox-latex: add LaTeX attributes to quote block
* doc/org-manual.org (Quote blocks in LaTeX export): manual updated
* etc/ORG-NEWS (Support quote blocks in LaTeX export): news updated
* lisp/ox-latex.el (latex): add `org-latex-default-quote-environment' to `:options-alist'
(org-latex-default-quote-environment): the default quote environment
is `quote'
(org-latex-quote-block): add two attributes: `environment' and `options'
2021-05-29 22:21:59 +02:00
Juan Manuel Macías 91373e15c8 ox-latex.el: Support specific attributes for verse block
* lisp/ox-latex.el (org-latex-verse-block): Support verse-specific
attributes.

* doc/org-manual.org (Verse blocks in LaTeX export): New section.

Link: https://orgmode.org/list/874kfdn0k5.fsf@posteo.net/
2021-05-15 16:13:49 +02:00
Thomas S. Dye ee40458d00 lisp/ox-latex.el: Allow arbitrary float environments
* lisp/ox-latex.el (org-latex--inline-image)
(org-latex--decorate-table): Recognize arbitrary :float value.

* etc/ORG-NEWS: Announce new :float capability.

LaTeX users are able to define arbitrary float types.
This patch makes them accessible from Org mode.
2021-05-15 16:13:49 +02:00
Nicolas Goaziou 196aae41c5 Merge branch 'maint' 2021-04-06 13:50:46 +02:00
Nicolas Goaziou 7575678959 ox-latex: Fix texttt usage in headlines
* lisp/ox-latex.el (org-latex-headline): Properly call
`org-latex--protect-texttt' on verbatim objects.

Reported-by: Greg Minshall <minshall@umich.edu>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00134.html>
2021-04-06 13:47:04 +02:00
Nicolas Goaziou c881b60593 Merge branch 'maint' 2021-04-04 00:18:04 +02:00
TEC bcfe6f985c ox-latex: convert verbatim text in headings to texttt
* lisp/ox-latex.el (org-latex--protect-texttt): New function.
(org-latex--text-markup): Use new function.
(org-latex-headline): Convert any instances of \verb text with
\texttt.  This is required to work around LaTeX peculiarities that
would otherwise cause compilation to fail (see the code comment for
more information).
2021-04-04 00:16:42 +02:00
Stefan Kangas 2e1c984153 Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
Kyle Meyer bc511b1cb8 Merge branch 'maint' 2021-01-24 23:12:33 -05:00
Basile Pesin 0abd4a44cb ox-latex.el: Use [Objective]Caml dialect
* ox-latex.el (org-latex-listings-langs): Change the binding for
  `ocaml' to "[Objective]Caml"

The "[Objective]Caml" dialect syntax highlighting is different from the
"Caml" one (reflecting the added features of OCaml compared to
Caml-light).

TINYCHANGE
2021-01-24 23:05:53 -05:00
Kyle Meyer 72e368a2e9 Merge branch 'maint' 2021-01-24 22:17:01 -05:00
Tara Lorenz 13e98e2a13 ox-latex.el: fix interpretation of org-latex-pdf-process
* ox-latex.el (org-latex-export-to-pdf):  The documentation for
`org-latex-pdf-process' states that "%bib" will be expanded into the
current binding of `org-latex-bibtex-compiler'.  However, the
`org-latex-export-to-pdf', where the expansion takes place, expects
"%bibtex" instead.  This fix will accept "%bib" as well as "%bibtex"
as markers for `org-latex-bib-compiler'.

This fixes a regression from f6187deca (ox-latex: Small refactor,
2015-09-13).

TINYCHANGE
2021-01-24 22:16:45 -05:00
Kyle Meyer 291993888d Merge branch 'maint' 2021-01-01 15:02:10 -05:00
Kyle Meyer 99eafe3787 Update copyright year to 2021 2021-01-01 14:59:01 -05:00
Nicolas Goaziou 7c8dce72bd ox-latex: Improve handling of footnotes within verse blocks
* lisp/ox-latex.el (org-latex-footnote-reference): Use the footmark +
footnotetext combination for footnotes in verse environments.
(org-latex-verse-block): Use `org-latex--delayed-footnotes-definitions'.

Reported-by: Juan Manuel Macías <maciaschain@posteo.net>
<http://lists.gnu.org/r/emacs-orgmode/2020-12/msg00006.html>
2020-12-05 10:05:46 +01:00
Nicolas Goaziou f4687993c5 ox-latex: Fix links to files with name matching an image type
* lisp/ox-latex.el (org-latex-inline-image-rules): Ensure
caracterization happens on extension only.
2020-08-16 12:01:20 +02:00
Nicolas Goaziou d391364ac9 Merge branch 'maint' 2020-06-01 15:16:01 +02:00
Nicolas Goaziou b908367b03 ox-latex: Fix coderef links with special characters
* lisp/ox-latex.el (org-latex-link): Properly resolve coderefs with
special characters.

Reported-by: Vincent Picaud <picaud.vincent@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-06/msg00004.html>
2020-06-01 15:15:15 +02:00
Nicolas Goaziou 20f0299bc3 ox-latex: Do not center images in image links
* lisp/ox-latex.el (org-latex--inline-image): Do not center image when
it is the description of a link.

Reported-by: Arne Babenhauserheide <arne_bab@web.de>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00157.html>
2020-05-10 14:43:40 +02:00
Mattias Engdegård 7265f2864e Backport commit af085ef40 from Emacs
* lisp/org-agenda.el (org-agenda-hide-tags-regexp)
(org-agenda-category-icon-alist):
* lisp/org-protocol.el (org-protocol-data-separator):
* lisp/org-table.el (org-table-number-regexp):
* lisp/ox-latex.el (org-latex-known-warnings):
Use 'regexp' instead of 'string' as type for values that are regexps
in defcustom declarations.

Use regexp type for regexps in defcustom declarations
af085ef40b961ca3466e8b2dfb7f722573e5a4cc
Mattias Engdegård
Thu Dec 26 16:50:58 2019 +0100
2020-03-15 22:51:31 -04:00
Nicolas Goaziou 42ec2462a0 Do not leak "attachment" links
* lisp/ol.el (org-link-open): Remove "attachment" for special cases.
* lisp/org-attach.el (org-attach-expand-links):
(org-attach-follow): New functions.
(org-attach-link-expand): Remove function.
* lisp/org-element.el (org-element-link-parser):
* lisp/ox-ascii.el (org-ascii-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex--inline-image):
(org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-inline-image-rules):
(org-odt-link):
* lisp/ox-texinfo.el (org-texinfo-inline-image-rules):
(org-texinfo-link): Remove "attachment" from special cases.
2020-02-22 14:22:49 +01:00
Nicolas Goaziou ab9166ad29 Extend export tooling in link parameters
* lisp/ol.el (org-link-parameters): Allow a fourth "info" argument for
`:export' property.  Expound docstring.
* lisp/ox.el (org-export-custom-protocol-maybe): Accept a fourth
optional argument.
* lisp/ox-ascii.el (org-ascii--describe-links):
(org-ascii-link):
* lisp/ox-beamer.el (org-beamer-link):
* 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):
* lisp/ox-org.el (org-org-link):
* lisp/ox-texinfo.el (org-texinfo-link):
* contrib/lisp/ox-groff.el (org-groff-link): Provide expected fourth
argument.
* lisp/ox.el (org-export-link-as-file): New function.
* lisp/ol.el (org-link-parameters): Add reference to new function in docstring.
* testing/lisp/test-ox.el (test-org-export/link-as-file): Add tests.
(test-org-export/custom-protocol-maybe): Update tests.
2020-02-19 18:41:37 +01:00
Bastien 9d58806fab Fix 5acf4d4692 2020-02-19 18:10:41 +01:00
Bastien 88d218a5a0 Fix 5acf4d4692 2020-02-19 18:10:26 +01:00
Bastien 9447287521 Merge branch 'maint' 2020-02-11 12:28:40 +01:00
Brian Carlson 5acf4d4692 ox-latex.el: Fix the display of checkbox items
* lisp/ox-latex.el (org-latex-item): Fix the display of
checkbox items.

TINYCHANGE
2020-02-11 12:28:02 +01:00
Bastien 4e7c3f45b2 Merge branch 'maint' 2020-02-08 07:55:02 +01:00
Robertson, Seth 7e4e34db1d ox-latex.el (org-latex--format-spec): Add :subtitle
* lisp/ox-latex.el (org-latex--format-spec): Add :subtitle.

TINYCHANGE
2020-02-08 07:54:46 +01:00
Gustav Wikström a24c8c481f Refactor attachment path expansion
* lisp/org-attach.el (org-attach-link-expand): New function for link
  element expansion.

* lisp/org-element.el (org-element-link-parser): Remove info about
  expanded attachment paths from link elements.

* lisp/ol.el (org-link-open)
* lisp/ox-texinfo.el (org-texinfo-link)
* lisp/ox-odt.el (org-odt-link)
* lisp/ox-md.el (org-md-link)
* lisp/ox-man.el (org-man-link)
* lisp/ox-latex.el (org-latex--inline-image, org-latex-link)
* lisp/ox-html.el (org-html-link)
* lisp/ox-ascii.el (org-ascii-link): Refactor to use new link
  expansion function from org-attach.el instead of (now removed)
  custom link property from org-element.el.
2020-02-06 22:09:18 +01:00
Gustav Wikström 20d293b4aa Give link parser knowledge of attachment link expanded path
* lisp/org-element.el (org-element-link-parser): Add info about
  expanded attachment paths to the link parse tree export.

* lisp/org-attach.el Remove org-attach-open-link.  Let attachment
  links use the built in code that already is developed for file
  links.

* lisp/ol.el (org-link-open): Add knowledge about attachment links to
  the function opening links, so they can be opened exactly as file
  links are opened.

* lisp/ox-texinfo.el (org-texinfo-link)
* lisp/ox-odt.el (org-odt-link)
* lisp/ox-md.el (org-md-link)
* lisp/ox-man.el (org-man-link)
* lisp/ox-latex.el (org-latex--inline-image, org-latex-link)
* lisp/ox-html.el (org-html-link)
* lisp/ox-ascii.el (org-ascii-link): Refactor to use property from
  link parser instead of invoking attachment expansion in the
  exporter.
2020-01-18 01:41:01 +01:00
Gustav Wikström f93020d5e6 Expand attachment links with point in correct place
* lisp/ox-texinfo.el (org-texinfo-link)
* lisp/ox-odt.el (org-odt-link)
* lisp/ox-md.el (org-md-link)
* lisp/ox-man.el (org-man-link)
* lisp/ox-latex.el (org-latex--inline-image, org-latex-link)
* lisp/ox-html.el (org-html-link)
* lisp/ox-ascii.el (org-ascii-link): Move point to the link for
  org-attach-expand to know from which headline to expand the link.
2020-01-15 20:40:24 +01:00
Gustav Wikström d70db54dbc Improve attachment link export functionality
Make attachment links export just as file links.

* lisp/ox-ascii.el
* lisp/ox-html.el
* lisp/ox-latex.el
* lisp/ox-man.el
* lisp/ox-md.el
* lisp/ox-texinfo.el
* lisp/org-attach.el: Move export functionality for attachment links
  into the respective export backend, for feature parity with file
  links.
2020-01-14 04:15:38 +01:00
Kyle Meyer ff5fc050d3 Update copyright year to 2020 2020-01-01 13:38:46 -05:00
Nicolas Goaziou eab7c4e581 ox-latex: Fix output for Tikz or PGF images
* lisp/ox-latex.el (org-latex--inline-image): Fix output for Tikz or
PGF images.
2019-12-07 12:30:19 +01:00