1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-26 07:33:39 +00:00

Export: org-export-latex-image-default-option can be buffer-local

Jason Riedy writes:

>  I'm trying to change org-export-latex-image-default-option
>  to "width=.7\\linewidth" in a file local variable.  It's set
>  correctly as a buffer local variable, and it's having no
>  effect on the export.  My guess is that the buffer-local
>  property is stopping it as soon as org-export-as-latex runs
>  set-buffer.
>
>  I can smuggle the value in by adding an entry to org-export-plist-vars
>  referring to org-export-latex-image-default-option and pulling the value
>  from the plist, but that feels incorrect.

It is actually the correct way to do this, and I have
implemented this change.
This commit is contained in:
Carsten Dominik 2009-05-05 09:41:00 +02:00
parent 9e8bb3d213
commit d79696d914
4 changed files with 14 additions and 3 deletions

View File

@ -9378,6 +9378,7 @@ respective variable for details.
@item @code{:email} @tab @code{user-mail-address} : @code{addr;addr;..}
@item @code{:select-tags} @tab @code{org-export-select-tags}
@item @code{:exclude-tags} @tab @code{org-export-exclude-tags}
@item @code{:latex-image-options} @tab @code{org-export-latex-image-default-option}
@end multitable
Most of the @code{org-export-with-*} variables have the same effect in

View File

@ -1,3 +1,10 @@
2009-05-05 Carsten Dominik <carsten.dominik@gmail.com>
* org-latex.el (org-export-latex-links): Use the property list to
retrieve the default image attributes.
* org-exp.el (org-export-plist-vars): Add a new option.
2009-05-04 Carsten Dominik <carsten.dominik@gmail.com>
* org-exp.el (org-export, org-export-visible): Support ASCII

View File

@ -576,7 +576,9 @@ much faster."
(:author nil user-full-name)
(:email nil user-mail-address)
(:select-tags nil org-export-select-tags)
(:exclude-tags nil org-export-exclude-tags))
(:exclude-tags nil org-export-exclude-tags)
(:latex-image-options nil org-export-latex-image-default-option))
"List of properties that represent export/publishing variables.
Each element is a list of 3 items:
1. The property that is used internally, and also for org-publish-project-alist

View File

@ -1345,7 +1345,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
"file")))
(coderefp (equal type "coderef"))
(caption (org-find-text-property-in-string 'org-caption raw-path))
(attr (org-find-text-property-in-string 'org-attributes raw-path))
(attr (or (org-find-text-property-in-string 'org-attributes raw-path)
(plist-get org-export-latex-options-plist :latex-image-options)))
(label (org-find-text-property-in-string 'org-label raw-path))
(floatp (or label caption))
imgp radiop
@ -1380,7 +1381,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
(concat
(if floatp "\\begin{figure}[htb]\n")
(format "\\centerline{\\includegraphics[%s]{%s}}\n"
(or attr org-export-latex-image-default-option)
attr
(if (file-name-absolute-p raw-path)
(expand-file-name raw-path)
raw-path))