emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Feature suggestion: support "scale=" includegraphics option in the builtin latex exporter.
@ 2019-04-19  7:27 Emmanuel Charpentier
  2019-04-20  8:55 ` [PATCH] Feature proposal : " Emmanuel Charpentier
  0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel Charpentier @ 2019-04-19  7:27 UTC (permalink / raw)
  To: emacs-orgmode

Dear list,

Most graphics-able exporters support some form of a scale parameter,
sizing the resultant image as a function of the original graphics file
(intended) size.

This is true for:
  * built-in ODT exporter
  * ox-pandoc Latex/ODT/DOCX exporters.

This possibility comes handy to avoid (or at least master) the side
effects of scaling (fonts amplification, /reduction, bitmap fuzinness,
etc...).

It should be supported on the native LaTeX exporter (and possibly
"scale: 1" may become the default...).

In addition (but this is probably a different problem), some
scaling/sizing mechanism may be implemented for the HTML exporter.

--
Emmanuel Charpentier

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] Feature proposal : support "scale=" includegraphics option in the builtin latex exporter.
  2019-04-19  7:27 Feature suggestion: support "scale=" includegraphics option in the builtin latex exporter Emmanuel Charpentier
@ 2019-04-20  8:55 ` Emmanuel Charpentier
  2019-04-22 12:04   ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel Charpentier @ 2019-04-20  8:55 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]

Attached is my proposal for the feature I suggested. My quick tests
pass[1]. Better tests by someone knowledgeable in graphics would be 
useful, as well as a test in the test suite.

HTH,

--
Emmanuel Charpentier

[1] I get unrelated failures from "make test" :
4 unexpected results:
   FAILED  test-org-clock/clocktable/extend-today-until
   FAILED  test-org-clock/clocktable/step
   FAILED  test-org/timestamp-from-string
   FAILED  test-org/timestamp-from-time

I can't see any link with my proposal. BTW, I get the same failures
from the unmodified master branch (fetched this morning...).

Le vendredi 19 avril 2019 à 09:27 +0200, Emmanuel Charpentier a écrit :
> Dear list,
> 
> Most graphics-able exporters support some form of a scale parameter,
> sizing the resultant image as a function of the original graphics
> file
> (intended) size.
> 
> This is true for:
>   * built-in ODT exporter
>   * ox-pandoc Latex/ODT/DOCX exporters.
> 
> This possibility comes handy to avoid (or at least master) the side
> effects of scaling (fonts amplification, /reduction, bitmap
> fuzinness,
> etc...).
> 
> It should be supported on the native LaTeX exporter (and possibly
> "scale: 1" may become the default...).
> 
> In addition (but this is probably a different problem), some
> scaling/sizing mechanism may be implemented for the HTML exporter.
> 
> --
> Emmanuel Charpentier
> 

[-- Attachment #2: 0001-Support-a-scale-parameter-in-org-latex-export-to-lat.patch --]
[-- Type: text/x-patch, Size: 5783 bytes --]

From 2526a06e4f77a2fdae615a95365f557c40b6d968 Mon Sep 17 00:00:00 2001
From: Emmanuel Charpentier <emm.charpentier@free.fr>
Date: Sat, 20 Apr 2019 10:25:24 +0200
Subject: [PATCH] Support a :scale parameter in org-latex-export-to-latex and
 friends

* lisp/ox-latex.el: introduce a :scale #+ATTR_LATEX parameter, as well
as a "" default value for it.  When present, it overrides :width and
:height parameters (as it does for ODT export and in ox-pandoc
exporters) ; therefore, setting a default value for :scale should be
exceptional.

Implementation: uses \scalebox for tikz/pgf images, "scale=" parameter
of \includegraphics in other cases.

* doc/org-manual.org: document the new :scale #+ATTR_LATEX parameter,
---
 doc/org-manual.org |  8 ++++++--
 lisp/ox-latex.el   | 49 ++++++++++++++++++++++++++++++++++------------
 2 files changed, 42 insertions(+), 15 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index a8f4a45ea..a9114184a 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13277,14 +13277,18 @@ insert the image.  But for TikZ (http://sourceforge.net/projects/pgf/)
 images, the back-end uses an ~\input~ macro wrapped within
 a ~tikzpicture~ environment.
 
-For specifying image =:width=, =:height=, and other =:options=, use
-this syntax:
+For specifying image =:width=, =:height=, =:scale= and other =:options=,
+use this syntax:
 
 #+begin_example
 ,#+ATTR_LATEX: :width 5cm :options angle=90
 [[./img/sed-hr4049.pdf]]
 #+end_example
 
+A =:scale= parameter overrides both =:width= and =:height= parameters ;
+therefore, setting its default value should be done only in exceptional
+circumstances.
+
 For custom commands for captions, use the =:caption= attribute.  It
 overrides the default =#+CAPTION= value:
 
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index cdcb07aca..60b8773b0 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -127,6 +127,7 @@
     (:latex-format-headline-function nil nil org-latex-format-headline-function)
     (:latex-format-inlinetask-function nil nil org-latex-format-inlinetask-function)
     (:latex-hyperref-template nil nil org-latex-hyperref-template t)
+    (:latex-image-default-scale nil nil org-latex-image-default-scale)
     (:latex-image-default-height nil nil org-latex-image-default-height)
     (:latex-image-default-option nil nil org-latex-image-default-option)
     (:latex-image-default-width nil nil org-latex-image-default-width)
@@ -708,6 +709,17 @@ This value will not be used if a height is provided."
   :package-version '(Org . "8.0")
   :type 'string)
 
+(defcustom org-latex-image-default-scale ""
+  "Default scale for images.
+This value will not be used if a width or a scale is provided,
+or if the image is wrapped within a \"wrapfigure\",environment.
+Since scale overrides width and height, setting its default
+value should be done only in exceptional circumstances."
+  :group 'org-export-latex
+  :version "25.1"
+  :package-version '(Org . "9.2")
+  :type 'string)
+
 (defcustom org-latex-image-default-height ""
   "Default height for images.
 This value will not be used if a width is provided, or if the
@@ -2374,13 +2386,18 @@ used as a communication channel."
 	  (if (plist-member attr :center) (plist-get attr :center)
 	    (plist-get info :latex-images-centered)))
 	 (comment-include (if (plist-get attr :comment-include) "%" ""))
-	 ;; It is possible to specify width and height in the
-	 ;; ATTR_LATEX line, and also via default variables.
-	 (width (cond ((plist-get attr :width))
+	 ;; It is possible to specify scale or width and height in
+	 ;; the ATTR_LATEX line, and also via default variables.
+	 (scale (cond ((eq float 'wrap) "")
+		      ((plist-get attr :scale))
+		      (t (plist-get info :latex-image-default-scale))))
+	 (width (cond ((org-string-nw-p scale) "")
+		      ((plist-get attr :width))
 		      ((plist-get attr :height) "")
 		      ((eq float 'wrap) "0.48\\textwidth")
 		      (t (plist-get info :latex-image-default-width))))
-	 (height (cond ((plist-get attr :height))
+	 (height (cond ((org-string-nw-p scale) "")
+		       ((plist-get attr :height))
 		       ((or (plist-get attr :width)
 			    (memq float '(figure wrap))) "")
 		       (t (plist-get info :latex-image-default-height))))
@@ -2402,18 +2419,24 @@ used as a communication channel."
 		  (format "\\begin{tikzpicture}[%s]\n%s\n\\end{tikzpicture}"
 			  options
 			  image-code)))
-	  (when (or (org-string-nw-p width) (org-string-nw-p height))
-	    (setq image-code (format "\\resizebox{%s}{%s}{%s}"
-				     (if (org-string-nw-p width) width "!")
-				     (if (org-string-nw-p height) height "!")
-				     image-code))))
+	  (if (org-string-nw-p scale)
+	      (setq image-code
+		    (format "\\scalebox{%s}{%s}" scale image-code))
+	    (when (or (org-string-nw-p width) (org-string-nw-p height))
+	      (setq image-code (format "\\resizebox{%s}{%s}{%s}"
+				       (if (org-string-nw-p width) width "!")
+				       (if (org-string-nw-p height) height "!")
+				       image-code)))))
       ;; For other images:
       ;; - add width and height to options.
       ;; - include the image with \includegraphics.
-      (when (org-string-nw-p width)
-	(setq options (concat options ",width=" width)))
-      (when (org-string-nw-p height)
-	(setq options (concat options ",height=" height)))
+      (if (org-string-nw-p scale)
+	  (setq options (concat options ",scale=" scale))
+	(progn
+	  (when (org-string-nw-p width)
+	    (setq options (concat options ",width=" width)))
+	  (when (org-string-nw-p height)
+	    (setq options (concat options ",height=" height)))))
       (let ((search-option (org-element-property :search-option link)))
         (when (and search-option
                    (equal filetype "pdf")
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Feature proposal : support "scale=" includegraphics option in the builtin latex exporter.
  2019-04-20  8:55 ` [PATCH] Feature proposal : " Emmanuel Charpentier
@ 2019-04-22 12:04   ` Nicolas Goaziou
  2019-04-22 12:52     ` Emmanuel Charpentier
       [not found]     ` <b0e5ee44ec52830a01beddae2bd2de468c706f40.camel@free.fr>
  0 siblings, 2 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2019-04-22 12:04 UTC (permalink / raw)
  To: Emmanuel Charpentier; +Cc: emacs-orgmode

Hello,

Emmanuel Charpentier <emm.charpentier@free.fr> writes:

> Attached is my proposal for the feature I suggested. My quick tests
> pass[1]. Better tests by someone knowledgeable in graphics would be 
> useful, as well as a test in the test suite.

Applied, with some slight fixes.

Could you provide an entry in ORG-NEWS?

Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Feature proposal : support "scale=" includegraphics option in the builtin latex exporter.
  2019-04-22 12:04   ` Nicolas Goaziou
@ 2019-04-22 12:52     ` Emmanuel Charpentier
       [not found]     ` <b0e5ee44ec52830a01beddae2bd2de468c706f40.camel@free.fr>
  1 sibling, 0 replies; 9+ messages in thread
From: Emmanuel Charpentier @ 2019-04-22 12:52 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Possible duplicate answer (my email provider isn't very reliable at the
moment...).

Le lundi 22 avril 2019 à 14:04 +0200, Nicolas Goaziou a écrit :
> Hello,
> 
> Emmanuel Charpentier <emm.charpentier@free.fr> writes:
> 
> > Attached is my proposal for the feature I suggested. My quick tests
> > pass[1]. Better tests by someone knowledgeable in graphics would
> > be 
> > useful, as well as a test in the test suite.
> 
> Applied, with some slight fixes.

Thank you !

> Could you provide an entry in ORG-NEWS?

Do you want some free text or a patch against etc/ORG-NEWS ?

--
Emmanuel Charpentier

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Feature proposal : support "scale=" includegraphics option in the builtin latex exporter.
       [not found]       ` <87bm0ytbl9.fsf@nicolasgoaziou.fr>
@ 2019-04-22 15:12         ` Emmanuel Charpentier
  2019-04-23  8:26           ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel Charpentier @ 2019-04-22 15:12 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 466 bytes --]

Le lundi 22 avril 2019 à 15:26 +0200, Nicolas Goaziou a écrit :
> Emmanuel Charpentier <emm.charpentier@free.fr> writes:
> 
> > Do you want a direct answer or a partch against /etc/ORG-NEWS ?
> 
> Anything that suits you.

A patch it is (enclosed).

If this documentation is customaty, this should be mentioned in the
"Contribute" page of Worg (which, IMHO, should be pointed to by the 
"Feedback" section of the manual).

--
Emmanuel Charpentier


[-- Attachment #2: 0002-Document-the-LATEX_ATTR-scale-parameter-in-ORG-NEWS.patch --]
[-- Type: text/x-patch, Size: 1683 bytes --]

From 99d503bb11ef7923393c7bbd0dd5cdc07e3fca6d Mon Sep 17 00:00:00 2001
From: Emmanuel Charpentier <emm.charpentier@free.fr>
Date: Mon, 22 Apr 2019 16:56:00 +0200
Subject: [PATCH 2/2] Document the LATEX_ATTR :scale parameter in ORG-NEWS

* etc/ORG-NEWS: document the new builtin LaTeX exporters' LATEX_ATTR
  :scale parameter
---
 etc/ORG-NEWS | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 79659ea50..3285c91d9 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -192,6 +192,31 @@ This is a function for convenience.
 The new paramater ~:dbconnection~ allows to specify a connection name
 in a SQL block header: this name is used to look up connection
 parameters in ~sql-connection-alist~.
+
+*** New ~LATEX_ATTR~ ~:scale~ supported by the built-in LaTeX exporters
+
+The builtin ~org-latex-export*~ exporters now accept and use a
+~:scale~ attribute, which scales an image by a given factor.
+
+This attribute is wrapped adound the ~scale=~ parameter of LaTeX's
+~\\includegraphics~ (bitmap images) or a ~TiKZ~'s
+~\\scalebox~. Therefore, its value should be some string palatable to
+LaTeX as a positive float Its default value is an empty string
+(i.e. disabled).
+
+This attribute *overrides* the ~:width~ and ~:height~ attributes ;
+therefore, while it can be given a default value, this should be done
+only under exceptional circumstances.
+
+#+begin_example
+
+#+name: Beastie
+#+caption: I think I saw this curious horse already, but where ?
+#+LATEX_ATTR: :scale 2
+[[https://orgmode.org/img/org-mode-unicorn-logo.png]]
+
+#+end_example
+
 ** New functions
 *** ~org-dynamic-block-insert-dblock~
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Feature proposal : support "scale=" includegraphics option in the builtin latex exporter.
  2019-04-22 15:12         ` Emmanuel Charpentier
@ 2019-04-23  8:26           ` Nicolas Goaziou
  2019-06-16  5:39             ` Emmanuel Charpentier
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2019-04-23  8:26 UTC (permalink / raw)
  To: Emmanuel Charpentier; +Cc: emacs-orgmode

Hello,

Emmanuel Charpentier <emm.charpentier@free.fr> writes:

> Le lundi 22 avril 2019 à 15:26 +0200, Nicolas Goaziou a écrit :
>> Emmanuel Charpentier <emm.charpentier@free.fr> writes:
>> 
>> > Do you want a direct answer or a partch against /etc/ORG-NEWS ?
>> 
>> Anything that suits you.
>
> A patch it is (enclosed).

Applied. Thank you.

> If this documentation is customaty, this should be mentioned in the
> "Contribute" page of Worg (which, IMHO, should be pointed to by the 
> "Feedback" section of the manual).

Feel free to edit Worg, it is user-maintained. OTOH, I don' think the
manual should rely on the wiki. We could, instead, augment
"README_contribute".

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Feature proposal : support "scale=" includegraphics option in the builtin latex exporter.
  2019-04-23  8:26           ` Nicolas Goaziou
@ 2019-06-16  5:39             ` Emmanuel Charpentier
  2019-06-16  8:35               ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel Charpentier @ 2019-06-16  5:39 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]

Le mardi 23 avril 2019 à 10:26 +0200, Nicolas Goaziou a écrit :
> Hello,
> 
> Emmanuel Charpentier <emm.charpentier@free.fr> writes:
> 
> > Le lundi 22 avril 2019 à 15:26 +0200, Nicolas Goaziou a écrit :
> > > Emmanuel Charpentier <emm.charpentier@free.fr> writes:
> > > 
> > > > Do you want a direct answer or a partch against /etc/ORG-NEWS ?
> > > 
> > > Anything that suits you.
> > 
> > A patch it is (enclosed).
> 
> Applied. Thank you.

We are now on June 16. The ELPA-distributed org-plus-contrib still does
not carry these patches (re-attached, FWIW).

I have checked that they are present in the ~master~ branch of the
source tree, but not its ~maint~ branch.

Am I misunderstanding anything ?

--
Emmanuel Charpentier

> 
> > If this documentation is customaty, this should be mentioned in the
> > "Contribute" page of Worg (which, IMHO, should be pointed to by
> > the 
> > "Feedback" section of the manual).
> 
> Feel free to edit Worg, it is user-maintained. OTOH, I don' think the
> manual should rely on the wiki. We could, instead, augment
> "README_contribute".
> 
> Regards,
> 

[-- Attachment #2: 0001-Support-a-scale-parameter-in-org-latex-export-to-lat.patch --]
[-- Type: text/x-patch, Size: 5787 bytes --]

From 2526a06e4f77a2fdae615a95365f557c40b6d968 Mon Sep 17 00:00:00 2001
From: Emmanuel Charpentier <emm.charpentier@free.fr>
Date: Sat, 20 Apr 2019 10:25:24 +0200
Subject: [PATCH 1/2] Support a :scale parameter in org-latex-export-to-latex
 and friends

* lisp/ox-latex.el: introduce a :scale #+ATTR_LATEX parameter, as well
as a "" default value for it.  When present, it overrides :width and
:height parameters (as it does for ODT export and in ox-pandoc
exporters) ; therefore, setting a default value for :scale should be
exceptional.

Implementation: uses \scalebox for tikz/pgf images, "scale=" parameter
of \includegraphics in other cases.

* doc/org-manual.org: document the new :scale #+ATTR_LATEX parameter,
---
 doc/org-manual.org |  8 ++++++--
 lisp/ox-latex.el   | 49 ++++++++++++++++++++++++++++++++++------------
 2 files changed, 42 insertions(+), 15 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index a8f4a45ea..a9114184a 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13277,14 +13277,18 @@ insert the image.  But for TikZ (http://sourceforge.net/projects/pgf/)
 images, the back-end uses an ~\input~ macro wrapped within
 a ~tikzpicture~ environment.
 
-For specifying image =:width=, =:height=, and other =:options=, use
-this syntax:
+For specifying image =:width=, =:height=, =:scale= and other =:options=,
+use this syntax:
 
 #+begin_example
 ,#+ATTR_LATEX: :width 5cm :options angle=90
 [[./img/sed-hr4049.pdf]]
 #+end_example
 
+A =:scale= parameter overrides both =:width= and =:height= parameters ;
+therefore, setting its default value should be done only in exceptional
+circumstances.
+
 For custom commands for captions, use the =:caption= attribute.  It
 overrides the default =#+CAPTION= value:
 
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index cdcb07aca..60b8773b0 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -127,6 +127,7 @@
     (:latex-format-headline-function nil nil org-latex-format-headline-function)
     (:latex-format-inlinetask-function nil nil org-latex-format-inlinetask-function)
     (:latex-hyperref-template nil nil org-latex-hyperref-template t)
+    (:latex-image-default-scale nil nil org-latex-image-default-scale)
     (:latex-image-default-height nil nil org-latex-image-default-height)
     (:latex-image-default-option nil nil org-latex-image-default-option)
     (:latex-image-default-width nil nil org-latex-image-default-width)
@@ -708,6 +709,17 @@ This value will not be used if a height is provided."
   :package-version '(Org . "8.0")
   :type 'string)
 
+(defcustom org-latex-image-default-scale ""
+  "Default scale for images.
+This value will not be used if a width or a scale is provided,
+or if the image is wrapped within a \"wrapfigure\",environment.
+Since scale overrides width and height, setting its default
+value should be done only in exceptional circumstances."
+  :group 'org-export-latex
+  :version "25.1"
+  :package-version '(Org . "9.2")
+  :type 'string)
+
 (defcustom org-latex-image-default-height ""
   "Default height for images.
 This value will not be used if a width is provided, or if the
@@ -2374,13 +2386,18 @@ used as a communication channel."
 	  (if (plist-member attr :center) (plist-get attr :center)
 	    (plist-get info :latex-images-centered)))
 	 (comment-include (if (plist-get attr :comment-include) "%" ""))
-	 ;; It is possible to specify width and height in the
-	 ;; ATTR_LATEX line, and also via default variables.
-	 (width (cond ((plist-get attr :width))
+	 ;; It is possible to specify scale or width and height in
+	 ;; the ATTR_LATEX line, and also via default variables.
+	 (scale (cond ((eq float 'wrap) "")
+		      ((plist-get attr :scale))
+		      (t (plist-get info :latex-image-default-scale))))
+	 (width (cond ((org-string-nw-p scale) "")
+		      ((plist-get attr :width))
 		      ((plist-get attr :height) "")
 		      ((eq float 'wrap) "0.48\\textwidth")
 		      (t (plist-get info :latex-image-default-width))))
-	 (height (cond ((plist-get attr :height))
+	 (height (cond ((org-string-nw-p scale) "")
+		       ((plist-get attr :height))
 		       ((or (plist-get attr :width)
 			    (memq float '(figure wrap))) "")
 		       (t (plist-get info :latex-image-default-height))))
@@ -2402,18 +2419,24 @@ used as a communication channel."
 		  (format "\\begin{tikzpicture}[%s]\n%s\n\\end{tikzpicture}"
 			  options
 			  image-code)))
-	  (when (or (org-string-nw-p width) (org-string-nw-p height))
-	    (setq image-code (format "\\resizebox{%s}{%s}{%s}"
-				     (if (org-string-nw-p width) width "!")
-				     (if (org-string-nw-p height) height "!")
-				     image-code))))
+	  (if (org-string-nw-p scale)
+	      (setq image-code
+		    (format "\\scalebox{%s}{%s}" scale image-code))
+	    (when (or (org-string-nw-p width) (org-string-nw-p height))
+	      (setq image-code (format "\\resizebox{%s}{%s}{%s}"
+				       (if (org-string-nw-p width) width "!")
+				       (if (org-string-nw-p height) height "!")
+				       image-code)))))
       ;; For other images:
       ;; - add width and height to options.
       ;; - include the image with \includegraphics.
-      (when (org-string-nw-p width)
-	(setq options (concat options ",width=" width)))
-      (when (org-string-nw-p height)
-	(setq options (concat options ",height=" height)))
+      (if (org-string-nw-p scale)
+	  (setq options (concat options ",scale=" scale))
+	(progn
+	  (when (org-string-nw-p width)
+	    (setq options (concat options ",width=" width)))
+	  (when (org-string-nw-p height)
+	    (setq options (concat options ",height=" height)))))
       (let ((search-option (org-element-property :search-option link)))
         (when (and search-option
                    (equal filetype "pdf")
-- 
2.20.1


[-- Attachment #3: 0002-Document-the-LATEX_ATTR-scale-parameter-in-ORG-NEWS.patch --]
[-- Type: text/x-patch, Size: 1683 bytes --]

From 99d503bb11ef7923393c7bbd0dd5cdc07e3fca6d Mon Sep 17 00:00:00 2001
From: Emmanuel Charpentier <emm.charpentier@free.fr>
Date: Mon, 22 Apr 2019 16:56:00 +0200
Subject: [PATCH 2/2] Document the LATEX_ATTR :scale parameter in ORG-NEWS

* etc/ORG-NEWS: document the new builtin LaTeX exporters' LATEX_ATTR
  :scale parameter
---
 etc/ORG-NEWS | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 79659ea50..3285c91d9 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -192,6 +192,31 @@ This is a function for convenience.
 The new paramater ~:dbconnection~ allows to specify a connection name
 in a SQL block header: this name is used to look up connection
 parameters in ~sql-connection-alist~.
+
+*** New ~LATEX_ATTR~ ~:scale~ supported by the built-in LaTeX exporters
+
+The builtin ~org-latex-export*~ exporters now accept and use a
+~:scale~ attribute, which scales an image by a given factor.
+
+This attribute is wrapped adound the ~scale=~ parameter of LaTeX's
+~\\includegraphics~ (bitmap images) or a ~TiKZ~'s
+~\\scalebox~. Therefore, its value should be some string palatable to
+LaTeX as a positive float Its default value is an empty string
+(i.e. disabled).
+
+This attribute *overrides* the ~:width~ and ~:height~ attributes ;
+therefore, while it can be given a default value, this should be done
+only under exceptional circumstances.
+
+#+begin_example
+
+#+name: Beastie
+#+caption: I think I saw this curious horse already, but where ?
+#+LATEX_ATTR: :scale 2
+[[https://orgmode.org/img/org-mode-unicorn-logo.png]]
+
+#+end_example
+
 ** New functions
 *** ~org-dynamic-block-insert-dblock~
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Feature proposal : support "scale=" includegraphics option in the builtin latex exporter.
  2019-06-16  5:39             ` Emmanuel Charpentier
@ 2019-06-16  8:35               ` Nicolas Goaziou
  2019-06-16  9:38                 ` Emmanuel Charpentier
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2019-06-16  8:35 UTC (permalink / raw)
  To: Emmanuel Charpentier; +Cc: Bastien Guerry, emacs-orgmode

Hello,

Emmanuel Charpentier <emm.charpentier@free.fr> writes:

> We are now on June 16. The ELPA-distributed org-plus-contrib still does
> not carry these patches (re-attached, FWIW).
>
> I have checked that they are present in the ~master~ branch of the
> source tree, but not its ~maint~ branch.
>
> Am I misunderstanding anything ?

New features are applied to master branch. maint branch is for bugfixes
only. 

Since your patch is a new feature, it went into master branch. It will
be available in Org 9.3. Hopefully, it should not be long, even though
I have no ETA. I'm Cc'ing Bastien as he may know.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Feature proposal : support "scale=" includegraphics option in the builtin latex exporter.
  2019-06-16  8:35               ` Nicolas Goaziou
@ 2019-06-16  9:38                 ` Emmanuel Charpentier
  0 siblings, 0 replies; 9+ messages in thread
From: Emmanuel Charpentier @ 2019-06-16  9:38 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Bastien Guerry, emacs-orgmode

Le dimanche 16 juin 2019 à 10:35 +0200, Nicolas Goaziou a écrit :

[ Snip... ]

> New features are applied to master branch. maint branch is for
> bugfixes
> only. 

Okay. I missed that...

> Since your patch is a new feature, it went into master branch. It
> will
> be available in Org 9.3. Hopefully, it should not be long, even
> though

It's clear now. Thanks !

--
Emmanuel Charpentier

> I have no ETA. I'm Cc'ing Bastien as he may know.
> 
> Regards,
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-06-16  9:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-19  7:27 Feature suggestion: support "scale=" includegraphics option in the builtin latex exporter Emmanuel Charpentier
2019-04-20  8:55 ` [PATCH] Feature proposal : " Emmanuel Charpentier
2019-04-22 12:04   ` Nicolas Goaziou
2019-04-22 12:52     ` Emmanuel Charpentier
     [not found]     ` <b0e5ee44ec52830a01beddae2bd2de468c706f40.camel@free.fr>
     [not found]       ` <87bm0ytbl9.fsf@nicolasgoaziou.fr>
2019-04-22 15:12         ` Emmanuel Charpentier
2019-04-23  8:26           ` Nicolas Goaziou
2019-06-16  5:39             ` Emmanuel Charpentier
2019-06-16  8:35               ` Nicolas Goaziou
2019-06-16  9:38                 ` Emmanuel Charpentier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).