mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Modifying postscript macros


Chronological Thread 
  • From: Rasmus Grøndahl Olsen <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Modifying postscript macros
  • Date: Thu, 29 Jun 2006 11:02:31 +0200
  • Organization: Silicide Aps

Henri Lesourd wrote:
address@hidden wrote:

Hi TeXmacs users,
I have been using Latex for serveral years and I are now looking for a more userfriendly option for writing documentation and TeXmacs seems to be a good alternative.

I want to modify the "postscript" macro in a way, to display a default image if a "dead" link is given as argument. Can anyone here help me a little?

I have tried making a copy of the macro but I can get it to work (see example below).

<assign|postscript-copy|postscript>

<postscript-copy|./image.eps||||||>


If you do a copy a of the macro and change nothing, the
behaviour will remain the same anyway.

First, you should have a function :
[[
<is-dead-link|link>
]]

, which sends you back "true" or "false" according to if the link is dead or not.

One can write such a function as a TeXmacs macro by
means of an external Scheme routine, namely :
[[
<assign|is-dead-link|<macro|link|<extern|is-dead-link?|<arg|link>>>
]]

along with :
[[
(tm-define (is-dead-link? link)
(if <<testing if the link is dead>>
"true"
"false"))
]]

(it is mandatory that inside such Scheme routines, you use
the strings "true" and "false", if you want that the <if>
construct of the TeXmacs macrolanguage understands you
correctly).


And then you write :
[[
<assign|my-postscript|
<macro|link|...|
<if|<is-dead-link|link>|My own image here|<postscript|link|...>
>>
]]

, and then possibly (if this works, I'm not sure it will do it),
write :
[[
<assign|postscript|my-postscript>
]]

, but in case it doesnt, it should not be a huge
problem if you plan to start writing a new documentation
from scratch, you should use <my-postscript> instead
of <postscript>.

[I just tried : it doesn't work, the names
of predefined functions like <postscript>
are hardwired].


Best, Henri


Ok, so what you are saying is that the <postscript> macro can be copied and re-assigned because it is hardwired? Does this also apply for the <include> macro?

Rasmus



Archive powered by MHonArc 2.6.19.

Top of page