From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emmanuel Charpentier Subject: [PATCH] Feature proposal : support "scale=" includegraphics option in the builtin latex exporter. Date: Sat, 20 Apr 2019 10:55:49 +0200 Message-ID: <2963aafd1acd60a6a6df2acf2d6d7c1c0f4371b2.camel@free.fr> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-ynJhMjh8v8pY3gdd1fkH" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:54038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHlwu-0001UT-Gj for emacs-orgmode@gnu.org; Sat, 20 Apr 2019 05:06:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHlmu-0000hr-Vd for emacs-orgmode@gnu.org; Sat, 20 Apr 2019 04:55:58 -0400 Received: from smtp1-g21.free.fr ([2a01:e0c:1:1599::10]:39053) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hHlmu-0000fj-LX for emacs-orgmode@gnu.org; Sat, 20 Apr 2019 04:55:56 -0400 Received: from zen-book-flip (unknown [82.228.67.28]) (Authenticated sender: emm.charpentier) by smtp1-g21.free.fr (Postfix) with ESMTPSA id DA6CBB00595 for ; Sat, 20 Apr 2019 10:55:49 +0200 (CEST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode --=-ynJhMjh8v8pY3gdd1fkH Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attached is my proposal for the feature I suggested. My quick tests pass[1]. Better tests by someone knowledgeable in graphics would be=20 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 =C3=A0 09:27 +0200, Emmanuel Charpentier a =C3=A9= crit : > Dear list, >=20 > 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. >=20 > This is true for: > * built-in ODT exporter > * ox-pandoc Latex/ODT/DOCX exporters. >=20 > This possibility comes handy to avoid (or at least master) the side > effects of scaling (fonts amplification, /reduction, bitmap > fuzinness, > etc...). >=20 > It should be supported on the native LaTeX exporter (and possibly > "scale: 1" may become the default...). >=20 > In addition (but this is probably a different problem), some > scaling/sizing mechanism may be implemented for the HTML exporter. >=20 > -- > Emmanuel Charpentier >=20 --=-ynJhMjh8v8pY3gdd1fkH Content-Disposition: attachment; filename*0=0001-Support-a-scale-parameter-in-org-latex-export-to-lat.pat; filename*1=ch Content-Type: text/x-patch; name="0001-Support-a-scale-parameter-in-org-latex-export-to-lat.patch"; charset="UTF-8" Content-Transfer-Encoding: base64 RnJvbSAyNTI2YTA2ZTRmNzdhMmZkYWU2MTVhOTUzNjVmNTU3YzQwYjZkOTY4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBFbW1hbnVlbCBDaGFycGVudGllciA8ZW1tLmNoYXJwZW50aWVy QGZyZWUuZnI+CkRhdGU6IFNhdCwgMjAgQXByIDIwMTkgMTA6MjU6MjQgKzAyMDAKU3ViamVjdDog W1BBVENIXSBTdXBwb3J0IGEgOnNjYWxlIHBhcmFtZXRlciBpbiBvcmctbGF0ZXgtZXhwb3J0LXRv LWxhdGV4IGFuZAogZnJpZW5kcwoKKiBsaXNwL294LWxhdGV4LmVsOiBpbnRyb2R1Y2UgYSA6c2Nh bGUgIytBVFRSX0xBVEVYIHBhcmFtZXRlciwgYXMgd2VsbAphcyBhICIiIGRlZmF1bHQgdmFsdWUg Zm9yIGl0LiAgV2hlbi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