From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Vollmar Subject: Re: MACRO calls with linebreaks? Date: Tue, 11 Aug 2009 00:58:32 +0200 Message-ID: References: <816D6127-7EC3-486B-846E-9A20BCCB3147@nf.mpg.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Madp9-0004LF-MO for emacs-orgmode@gnu.org; Mon, 10 Aug 2009 18:58:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Madp5-00048A-Gw for emacs-orgmode@gnu.org; Mon, 10 Aug 2009 18:58:39 -0400 Received: from [199.232.76.173] (port=45230 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Madp5-00047p-C5 for emacs-orgmode@gnu.org; Mon, 10 Aug 2009 18:58:35 -0400 Received: from mail.nf.mpg.de ([134.95.44.50]:35138) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Madp4-0002vu-Pm for emacs-orgmode@gnu.org; Mon, 10 Aug 2009 18:58:35 -0400 Received: from [192.168.178.21] (pD9E61920.dip.t-dialin.net [217.230.25.32]) by mail.nf.mpg.de (Sun Java(tm) System Messaging Server 6.3-8.03 (built Apr 24 2009; 32bit)) with ESMTPSA id <0KO600B39NU1PI00@mail.nf.mpg.de> for emacs-orgmode@gnu.org; Tue, 11 Aug 2009 00:58:49 +0200 (MEST) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Dear Carsten, On 10.08.2009, at 10:09, Carsten Dominik wrote: > this should now work. > > But note that the opening parenthesis must be attached to the macro =20= > name and the closing parenthesis must be attached to the "}}}", just =20= > as you have done in your proposal. > > I have not tested this, please verify. thank you! Almost perfect: there seems to be some confusion as to when MACRO =20 arguments are passed verbatim and when interpreted in org-fashion. =20 Ideally, there should be a way to make sure that one gets verbatim =20 text, possibly without leading white space. (1) {{{person(minerva_logo.png, ...)}}} and {{{person( minerva_logo.png, ...)}}} differ. The first version passes "minerva_log.png" as the first =20 argument to the MACRO, the second version turns it into =20 "minervalogo.png". (2) {{{person(minerva_logo.png, somebody.jpg, line1
line2
line3
, somebody@nf.mpg.de )}}} works fine, however, {{{person(minerva_logo.png, somebody.jpg, line1
line2
line3
, somebody@nf.mpg.de )}}} creates "line1" folled by a line break (as expected) but all following =20= HTML code rendered as text: line1
line2 <br/> line3 <br/>< [...] (3) {{{person(minerva_logo.png, somebody.jpg, line1
line2 @
line3 @
, somebody@nf.mpg.de )}}} this works (observe the inconsistency between line1 and the other =20 lines: no "@" here) up to and including line 3, the rest is HTML =20 markup rendered as text just as in (2). Warm regards, Stefan > > - Carsten > > On Aug 9, 2009, at 2:40 AM, Stefan Vollmar wrote: > >> Hello, >> >> I find org-mode's MACRO feature very useful for exporting to HTML =20 >> as it allows you to generate literally any HTML construct that you =20= >> need, here is a simple example: = http://www.nf.mpg.de/kinderuni/kinderuni_en.html=20 >> (see the "Colophon" section; thanks again to everybody from the =20 >> list who helped!). >> >> For another project, we need to generate a table with many (multi-=20 >> line) rows like this: >> >> | logo.png | somebody.jpg | name \\ telephone \\ email... | >> >> The images have different sizes (so some alignment is needed) and =20 >> the text in the last column should have several lines (which should =20= >> be next to the person's portrait). This can (currently) not been =20 >> done with standard org tables (I am not complaining). >> >> With something like this: >> >> #+macro: person #+HTML:
> align:middle;margin-right:2em;margin-left:2em;padding:5px;">[...]> table> >> >> {{{person(logo.png, somebody.jpg, somebody@nf.mpg.de, name
> >telephone
room
group
[...])}}} >> >> the problem can be solved and yet again org-mode's flexibility is =20 >> demonstrated. >> >> The MACRO can be hidden in a setup-file. However, the MACRO call =20 >> can not and it looks like a kludge and is awkward to read. MACRO =20 >> calls work well with few and short arguments - different from this =20= >> case. The problem is that org-mode seems to require the brackets in =20= >> one line for MACROs to work. Assuming this restriction was not =20 >> there, one could write in a much more readable fashion: >> >> {{{person( >> logo.png, somebody.jpg, >> somebody@nf.mpg.de, >> name
>> telephone
>> room
>> group
>> [...] >> )}}} >> >> and (just a thought) might expect white space in front of an =20 >> argument to be ignored and linebreaks in arguments conserved. Maybe =20= >> there is a better way to pass longer arguments to MACROs? >> >> Any help is appreciated. >> Warm regards, >> Stefan --=20 Dr. Stefan Vollmar, Dipl.-Phys. Max-Planck-Institut f=FCr neurologische Forschung Gleuelerstr. 50, 50931 K=F6ln, Germany Tel.: +49-221-4726-213 FAX +49-221-4726-298 Tel.: +49-221-478-5713 Mobile: 0160-93874279 Email: vollmar@nf.mpg.de http://www.nf.mpg.de