Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] Macros with hyperlinks

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] Macros with hyperlinks


Chronological Thread 
  • From: Oscar Gerardo Lazo Arjona <address@hidden>
  • To: address@hidden, address@hidden
  • Subject: Re: [TeXmacs] Macros with hyperlinks
  • Date: Thu, 06 Jan 2011 21:34:22 -0600
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=lQDNwKjRyQog6TMuQqfg+E8lWwTo/SicNTp3ZBV3iBY1QgfzT+a/880IXZZAJsvmE5 bbAikA9YpkwjhrNCSnUWOpx/pl5bdjK6YqRRaQ2zgPQlRCSTwkq14MVb1TOrzgQg4yTB /KXVVQSNQjurBbzR7gsv28RS16jZxSUNTlVAM=

On 06/01/11 02:21, Joris van der Hoeven wrote:
On Wed, Jan 05, 2011 at 10:08:01PM -0600, Oscar Gerardo Lazo Arjona wrote:
I am interested in using texmacs as a wiki. One of the essential parts
of wikis is links between documents. At this point I can link several
texmacs documents using

<hlink|NAME|/route/of/wiki/NAME.tm>

But that is time consuming, as I have to write the route in every link,
so I tried to make a macro that would do the job for me, like

<assign|wlink2|<macro|name|<hlink|<arg|name>|/route/of/wiki/<arg|name>.tm>>>
The second argument of hlink should be an url *string*. Hence, you should use
the 'merge' primitive for the concatenation of strings in order to write your
macro.

Best, --Joris
Thank you! That worked perfectly. Now I want to do some more intrincate things to make the links more wiki-like. Two things mainly:

1 .- Make it so that <wlink can accept either one or two arguments, so it can be either <wlink|Name> or <wlink|Name_of_file|Name as it should appear in the text>. My guess is that there some be some way to make the second argument optional (as is donde in other programming languages), and use an if then else statement in the macro so as to use or not use the second argument.

2.- Make the link appear blue if the file exists, and red if it doesn't exist.

Thank you!

Oscar.




Archive powered by MHonArc 2.6.19.

Top of Page