From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ethan Ligon Subject: Re: Org, latex and asymptote in a math project Date: Mon, 12 Sep 2011 15:49:24 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R38le-0005TV-Pw for emacs-orgmode@gnu.org; Mon, 12 Sep 2011 11:49:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R38lR-0002HG-46 for emacs-orgmode@gnu.org; Mon, 12 Sep 2011 11:49:54 -0400 Received: from lo.gmane.org ([80.91.229.12]:48986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R38lQ-0002Gz-OW for emacs-orgmode@gnu.org; Mon, 12 Sep 2011 11:49:41 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R38lN-0006ui-PI for emacs-orgmode@gnu.org; Mon, 12 Sep 2011 17:49:38 +0200 Received: from c-24-5-193-224.hsd1.ca.comcast.net ([24.5.193.224]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Sep 2011 17:49:37 +0200 Received: from ligon by c-24-5-193-224.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Sep 2011 17:49:37 +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: emacs-orgmode@gnu.org Hi, Jarmo- Jarmo Hurri syk.fi> writes: > 1. If I have understood correctly, in order for an asymptote image to be > included as an inline image, one has to specify a file name at the > beginning of the code block, as in > > #+CAPTION: A test caption. > #+begin_src asymptote :file foo.pdf > size (1cm, 0); > filldraw (unitsquare, red); > #+end_src > > It would be convenient if the user would not need to specify a > (unique) invented file name for the inline image. Instead, in the > case of an exported pdf, as an end user I would like for asymptote to > generate a unique temporary pdf image file, which would be removed > after the pdf corresponding to the complete document was > complete. The case of exported html is not as clear to me yet; my > current guess is that I would like the system to automatically > generate a uniquely named image file (preferably an svg image, but > not sure which browsers support these) which would then be inline > included into the html page. I'm starting on a textbook project using a similar set of tools. I'm making progress, but am still finding lots of little snags; perhaps as we both proceed we can share what we've learned. In any case, using temporary file names is a good idea, which hadn't occurred to me. But I guess it's easy to do, using something like #+CAPTION: A test caption. #+begin_src asymptote :file (org-babel-temp-file "figure-" ".pdf") size (1cm, 0); filldraw (unitsquare, red); #+end_src > 2. At least for me, _by far_ the most common way of referring to a > floating element (table or figure) is immediately before or after the > latex code that defines the float. For this, having to generate a > unique label for the float has always been an overkill, and I have > wanted a way to just refer to the previous or next float in the > document. In org this could mean something like specifying > #+AUTOLABEL and then some way of referring to the labels of the next > and previous float (regardless of whether they would be automatically > generated labels or standard named labels). Any support for this? Any > ideas regarding the syntax? How would one implement this behavior in LaTeX? > 3. It seems that currently inline images generated by asymptote are > included in the resulting latex file with a default size > width=.9\linewidth. I prefer them to be included in their original > size. To achieve this I first tried to define > > (setq org-export-latex-image-default-option "") > > This did not help: in the resulting latex file, the size was now > defined as width=.7\textwidth, which seems to come from > org-latex.el. Finally I obtained the wanted behaviour by artificially > defining the option to some value that does not cause any harm; in my > case > > (setq org-export-latex-image-default-option "keepaspectratio=true") > > Like I said, this is artificial. Is there a more natural way to > achieve the desired result, that is, inclusion of images in their > original size? Would it be ok if the code were changed so that > setting > > (setq org-export-latex-image-default-option "") > > would override the width=.7\textwidth coming from org-latex.el? This was one of the "snags" for me that I mentioned above. But this works: #+CAPTION: A test caption. #+Attr_LaTeX: width=\textwidth #+begin_src asymptote :file (org-babel-temp-file "figure-" ".pdf") size (1cm, 0); filldraw (unitsquare, red); #+end_src > > 4. Let us say that in the math document there would be questions with > corresponding answers and solutions. An answer would be just the > result, while the solution would show the steps needed to obtain the > result. In the org document I would like to write the question, the > corresponding answer and the solution in one place, one after the > other, while in the exported pdf / html I would like the answers and > solutions to be at the end of the document, numbered according to the > numbers of the questions. How could I achieve this? > Haven't done this, but the LaTeX code could put the answers and solutions in a float, which could then be floated to the end of the document. -Ethan