From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [ox-latex] Bad default value for image width? Date: Wed, 10 Apr 2013 18:53:02 +0200 Message-ID: <87k3oasic2.fsf@gmail.com> References: <87haji85a7.fsf@pank.iue.private> <8761zv9xd0.fsf@gmail.com> <87y5cqiown.fsf@pank.iue.private> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPyGj-0004sU-7N for emacs-orgmode@gnu.org; Wed, 10 Apr 2013 12:53:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPyGh-0003JI-NI for emacs-orgmode@gnu.org; Wed, 10 Apr 2013 12:53:09 -0400 Received: from mail-we0-x22c.google.com ([2a00:1450:400c:c03::22c]:55991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPyGh-0003IX-GY for emacs-orgmode@gnu.org; Wed, 10 Apr 2013 12:53:07 -0400 Received: by mail-we0-f172.google.com with SMTP id r3so546341wey.3 for ; Wed, 10 Apr 2013 09:53:06 -0700 (PDT) In-Reply-To: <87y5cqiown.fsf@pank.iue.private> (rasmus@gmx.us's message of "Wed, 10 Apr 2013 13:52:08 +0200") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: emacs-orgmode@gnu.org Hello, Rasmus writes: >> Set `org-latex-image-default-width' to "". > > But as my second email shows this still doesn't work with > captions. . . > > This exmample: > > #+BEGIN_SRC org > #+BEGIN_SRC emacs-lisp > (make-local-variable 'org-latex-image-default-width) > (setq org-latex-image-default-width "") > #+END_SRC > > #+NAME:firm-ts-fig > #+CAPTION: test > [[file:figs/test.tikz]] > > no caption > [[file:figs/test.tikz]] > #+END_SRC The problem is different here. More on this below. >> This wouldn't help to solve the general problem. Though, you can change >> it in your config to something else, as suggested above. > > I have. But I don't think it's a sensible default. It's against what > your usual stand of Org not trying to be too clever. You would also > not put tables in resize boxes to make them "fit" on the page. This is different. You always build tables from LaTeX so they are, in a way, normalized. On the other hand, images can be imported from various sources, with different sizes and resolutions. > I think this is the solution to a general problem. But I still find > the default width to be wrong. It only works as intended when I have > a slightly too large picture. And then, if anything, I'd want full > page width. > > It's a bad default for > - Picture smaller than textwidth > - Picture crafted to the document which shouldn't have a width. > > It's a decent solution for > - pictures which are unintentionally larger than textwidth. But IMO > it's my responsibility, and not Org's, to fix these > images/situations. Exactly. I'm not selling you the default value as the perfect solution: it isn't, obviously. I even agree that in most situations, no default value is better. However, in my experience, the worst situation is the image (much) larger than textwidth, which makes it difficult to even read the produced document. It isn't as bad for enlarged small pictures. So, the current default is good to control the worst case. And since there is no decent solution in all situations, it makes sense here. I think the same applies to default wrap width (.48\textwidth), which ensures that the display will be coherent. Now, the ".7\textwidth" for floats is harder to explain. I don't feel very strong about it, and I don't mind removing it (meaning `org-latex-image-default-width' would also apply to floats). >> If "" is really read as "", """" will still be read as "\"\"\"\"", and >> it will not be possible to obtain "\"\"". > > Fine with me. > >> Another possibility is to read the empty string as the empty string >> instead of nil, that is >> >> #+attr_latex: :prop1 :prop2 1 > > I like the "" better. It works better with my "intuitive logic". I have pushed a patch which should fix your initial problem about :width "" not being taken into account. Could you confirm the new behaviour works as expected? Regards, -- Nicolas Goaziou