From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: FR: Define Latex macros from export header Date: Thu, 26 Feb 2009 21:19:48 +0100 Message-ID: References: <20090215065910.GG7810@thinkpad.adamsinfoserv.com> <693E9A38-E1AA-49BC-BB05-5ADFE2199A57@uva.nl> <20090219200249.GI17284@thinkpad.adamsinfoserv.com> <597A6150-6F0C-46A4-A70B-906FC68D0B09@uva.nl> <20090220163330.GL17284@thinkpad.adamsinfoserv.com> <20090221142813.GH14026@thinkpad.adamsinfoserv.com> <20090223000641.GL14026@thinkpad.adamsinfoserv.com> Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: multipart/mixed; boundary="===============1400704221==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LcmjJ-0004Oz-E8 for emacs-orgmode@gnu.org; Thu, 26 Feb 2009 15:21:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LcmjI-0004OO-PK for emacs-orgmode@gnu.org; Thu, 26 Feb 2009 15:21:12 -0500 Received: from [199.232.76.173] (port=36715 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LcmjI-0004OI-BJ for emacs-orgmode@gnu.org; Thu, 26 Feb 2009 15:21:12 -0500 Received: from nf-out-0910.google.com ([64.233.182.188]:20090) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LcmjH-0007yZ-Rj for emacs-orgmode@gnu.org; Thu, 26 Feb 2009 15:21:12 -0500 Received: by nf-out-0910.google.com with SMTP id d3so266632nfc.26 for ; Thu, 26 Feb 2009 12:21:08 -0800 (PST) In-Reply-To: <20090223000641.GL14026@thinkpad.adamsinfoserv.com> 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: Russell Adams Cc: emacs-orgmode@gnu.org --===============1400704221== Content-Type: multipart/alternative; boundary=Apple-Mail-4--325649351 --Apple-Mail-4--325649351 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi Russel, you can now write {{{TITLE}}} and {{{EMAIL}}} etc to get these interpolated. More generally, you can write #+MACRO: name value of the macro and then write {{{name}}} to get the value interpolated. - Carsten On Feb 23, 2009, at 1:06 AM, Russell Adams wrote: > On Sat, Feb 21, 2009 at 08:28:13AM -0600, Russell Adams wrote: >>>> I'm also trying to resolve an ordering issue. I want to have a >>>> header/footer line declared in the header, but I want to use these >>>> orgTITLE macros in that. Currently LATEX_HEADER and the class go >>>> first >>>> before the definitions, and TEXT occurs inside the document. If the >>>> macro isn't defined before the header/footer, you get an error. >>>> >>>> I may have to manually code those, which defeats the purpose of >>>> using >>>> the org options. > > I think I got it! The issue here is that we're trying to define a > _Latex_ macro with the export options, and THAT is where the > resolution order becomes an issue. > > Could we create some org-export macros that will be translated inline? > That way the header data would be replaced in the body of all export > types (ascii, html, & latex)? No more need to define latex macros. > > ------- Example ------------ > > #+TITLE: This is a title > ... > Welcome to %%orgTITLE%%. > > after export: > > Welcome to This is a title. > > ---------------------------- > > This resolves the ordering issue and lets the metadata be used in the > document, which is the original purpose. > > The syntax would require some consideration, but anything fairly > obtuse that wouldn't be confused for a code sample would work. I like > "closing" formats and would prefer multiple symbols be involved to > minimize the chance of a collision. We'd likely need a OPTION for > whether or not to honor these. > > Suggested formats: > > - %%orgVAR%% > - (-:orgVAR:-) (credit to johnw for "Entranced by Smileys Format") > - !~orgVAR~! > > I need to learn lisp so I can start helping with these. :P > > Thanks. > > ------------------------------------------------------------------ > Russell Adams RLAdams@AdamsInfoServ.com > > PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ > > Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 > > > _______________________________________________ > 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 --Apple-Mail-4--325649351 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi = Russel,

you can now write {{{TITLE}}} and {{{EMAIL}}} = etc to get these interpolated.
More generally, you can = write

#+MACRO: name value of the = macro

and then write {{{name}}} to get the = value interpolated.

- = Carsten

On Feb 23, 2009, at 1:06 AM, Russell = Adams wrote:

On Sat, Feb 21, = 2009 at 08:28:13AM -0600, Russell Adams wrote:
I'm = also trying to resolve an ordering issue. I want to have = a
header/footer line declared in the header, but I want to = use these
orgTITLE= macros in that. Currently LATEX_HEADER and the class go = first
before = the definitions, and TEXT occurs inside the document. If = the
macro = isn't defined before the header/footer, you get an = error.

I may = have to manually code those, which defeats the purpose of = using
the = org options.

I think I got = it! The issue here is that we're trying to define a
_Latex_ macro = with the export options, and THAT is where the
resolution order = becomes an issue.

Could we create some org-export macros that = will be translated inline?
That way the header data would be replaced = in the body of all export
types (ascii, html, & latex)? No more = need to define latex macros.

------- Example = ------------

#+TITLE: This is a title
...
Welcome to = %%orgTITLE%%.

after export:

Welcome to This is a = title.

----------------------------

This resolves the = ordering issue and lets the metadata be used in the
document, which = is the original purpose.

The syntax would require some = consideration, but anything fairly
obtuse that wouldn't be confused = for a code sample would work. I like
"closing" formats and would = prefer multiple symbols be involved to
minimize the chance of a = collision. We'd likely need a OPTION for
whether or not to honor = these.

Suggested formats:

- %%orgVAR%%
- (-:orgVAR:-) = (credit to johnw for "Entranced by Smileys Format")
- = !~orgVAR~!

I need to learn lisp so I can start helping with = these. = :P

Thanks.

-------------------------------------------------= -----------------
Russell Adams =             &n= bsp;           &nbs= p;  RLAdams@AdamsInfoServ.com
PGP Key ID:     0x1160DCB3 =           http://www.adamsinfoserv.com/
Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 = 1154 E018 1160 = DCB3


_______________________________________________
Emacs-o= rgmode mailing list
Remember: use `Reply All' to send replies to the = list.
Emacs-orgmode@gnu.org
http://= lists.gnu.org/mailman/listinfo/emacs-orgmode
<= br>
= --Apple-Mail-4--325649351-- --===============1400704221== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1400704221==--