From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: MACRO calls with linebreaks? Date: Tue, 11 Aug 2009 11:02:57 +0200 Message-ID: <81647743-5305-4BE8-B2AC-B7EEFEF36D67@gmail.com> References: <816D6127-7EC3-486B-846E-9A20BCCB3147@nf.mpg.de> Mime-Version: 1.0 (Apple Message framework v936) 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 1ManG6-000292-TW for emacs-orgmode@gnu.org; Tue, 11 Aug 2009 05:03:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ManG2-00028Q-Ga for emacs-orgmode@gnu.org; Tue, 11 Aug 2009 05:03:06 -0400 Received: from [199.232.76.173] (port=56985 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ManG2-00028L-7p for emacs-orgmode@gnu.org; Tue, 11 Aug 2009 05:03:02 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:34802) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ManG1-0000C6-FN for emacs-orgmode@gnu.org; Tue, 11 Aug 2009 05:03:01 -0400 Received: by ewy7 with SMTP id 7so4083633ewy.42 for ; Tue, 11 Aug 2009 02:03:00 -0700 (PDT) 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: Stefan Vollmar Cc: emacs-orgmode Hi Stefan, could you please make a complete example, with the complete macro definition and calls, i.e. no ...? This would give me something to test without having to guess what might be happening. Thanks. - Carsten On Aug 11, 2009, at 12:58 AM, Stefan Vollmar wrote: > 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 "}}}", =20 >> just 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 =20 > following 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 =20 >>> should be next to the person's portrait). This can (currently) not =20= >>> been 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 =20 >>> in 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. =20 >>> Maybe 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 > > > > > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode