From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: How to treat string results of src-block calls like text in export? Date: Tue, 24 Jun 2014 16:30:25 -1000 Message-ID: References: <8738etuac7.fsf@gmail.com> <87simtsrmm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzcyz-0004Ik-FP for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 22:30:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wzcyt-00018B-AP for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 22:30:45 -0400 Received: from gproxy3-pub.mail.unifiedlayer.com ([69.89.30.42]:52442) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Wzcys-000180-SL for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 22:30:39 -0400 In-Reply-To: <87simtsrmm.fsf@gmail.com> (Thorsten Jolitz's message of "Wed, 25 Jun 2014 03:30:09 +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: Thorsten Jolitz Cc: emacs-orgmode@gnu.org Aloha Thorsten, Thorsten Jolitz writes: > tsd@tsdye.com (Thomas S. Dye) writes: > > Hi Thomas, > >> Thorsten Jolitz writes: >> >>> Hi List, >>> >>> with this org file >>> >>> ,---- >>> | #+name: project-name >>> | #+header: :exports none >>> | #+begin_src emacs-lisp >>> | (mapconcat >>> | 'capitalize >>> | (split-string >>> | (file-name-nondirectory >>> | (directory-file-name >>> | (file-name-directory >>> | (buffer-file-name (current-buffer))))) >>> | "-" 'OMIT-NULLS) >>> | " ") >>> | #+end_src >>> | >>> | * call_project-name() >>> | some text >>> | >>> | * Sourcedir >>> | more text >>> `---- >>> >>> I get this when exporting to ascii (excerpt): >>> >>> ,---- >>> | Table of Contents >>> | _________________ >>> | >>> | 1 `Testdir' >>> | 2 Sourcedir >>> | >>> | >>> | 1 `Testdir' >>> | =========== >>> | >>> | some text >>> | >>> | >>> | 2 Sourcedir >>> | =========== >>> | >>> | more text >>> `---- >>> >>> and this when exporting to latex (excerpt): >>> >>> ,---- >>> | \section{\texttt{Testdir}} >>> | \label{sec-1} >>> | some text >>> | >>> | \section{Sourcedir} >>> | \label{sec-2} >>> | more text >>> `---- >>> >>> How do I achieve that the string returned by the src-block call is >>> treated just like normal text? >>> >>> I tried using (format ...) as well as several :results options, even >>> (intern ...), but to no avail. >> >> Here :results raw achieves what I think you want. > > Unfortunately not, I tried that before, and now again, same outpout as > shown above. Did it work for you? I use this a lot in my work, but hadn't tried it in a headline. I tried it with the call line in a headline and that works, too. This subtree is in a file called personal.org. * Jolitz #+name: project-name #+header: :exports none :results raw #+begin_src emacs-lisp (mapconcat 'capitalize (split-string (file-name-nondirectory (directory-file-name (file-name-directory (buffer-file-name (current-buffer))))) "-" 'OMIT-NULLS) " ") #+end_src ** call_project-name()[:results raw] ** Impersonal The LaTeX export looks like this, in part: \section{Personal} \label{sec-1} \section{Impersonal} \label{sec-2} % Emacs 24.3.1 (Org mode beta_8.3) Alternatively, you can put :results raw in a header-args property of the subtree and then just call_project-name(). hth, Tom -- Thomas S. Dye http://www.tsdye.com