Subject: mailing-list for TeXmacs Users
List archive
From : Kris Kuhlman <address@hidden>- To: address@hidden
- Subject: style file: "if" in a macro
- Date: Fri, 14 Oct 2005 15:45:01 -0700
I am trying to write my own style file which will render figures and tables differently. I think I have it set up, except I am not seeing how to test the "type" argument of the macro (which is either table or figure). I tried equals using various forms of <arg|type> or <value|type>, but in the help files, it describes the equals macro for evaluating numbers. Is there a way to see check the contents of the argument "type"?
I tried checking the length of the string in type, since table and figure have different numbers of letters, but I get the error "bad length" when I do that. I figure I am trying to do the wrong thing to the wrong type of data, but I don't see any other clear options.
Kris
<TeXmacs|1.0.5.9>
<style|source>
<\body>
<\style-with|src-compact|none>
<assign|tabchoice|<\macro|type|name|fig|cap>
<length|<arg|<value|type>>>
<padded-normal|1fn|1fn|<tabular*|<tformat|<twith|table-width|1par>|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|1|-1|1|-1|cell-lsep|0spc>|<cwith|1|-1|1|-1|cell-rsep|0spc>|<cwith|1|1|1|1|cell-lsep|1.5fn>|<cwith|1|1|1|1|cell-rsep|1.5fn>|<cwith|3|3|1|1|cell-lsep|0spc>|<cwith|3|3|1|1|cell-rsep|0spc>|<table|<row|<\cell>
<small|<\surround|<figure-name|<arg|name><figure-sep>><list-caption|<arg|type>|<arg|cap>>|>
<arg|cap>
</surround>>
</cell>>|<row|<cell|>>|<row|<cell|<arg|fig>>>>>>>
</macro>>
<assign|figchoice|<\macro|type|name|fig|cap>
<padded-normal|1fn|1fn|<tabular*|<tformat|<twith|table-width|1par>|<cwith|3|3|1|1|cell-hyphen|t>|<cwith|1|-1|1|-1|cell-lsep|0spc>|<cwith|1|-1|1|-1|cell-rsep|0spc>|<cwith|2|2|1|1|cell-height|0.5fn>|<cwith|3|3|1|1|cell-lsep|1.5fn>|<cwith|3|3|1|1|cell-rsep|1.5fn>|<table|<row|<cell|<arg|fig>>>|<row|<cell|>>|<row|<\cell>
<small|<\surround|<figure-name|<arg|name><figure-sep>><list-caption|<arg|type>|<arg|cap>>|>
<arg|cap>
</surround>>
</cell>>>>>>
</macro>>
<assign|render-big-figure|<\macro|type|name|fig|cap>
<compound|<if|<equal|<value|<arg|type>>|table>|<value|figchoice>|<value|tabchoice>>|<arg|type>|<arg|name>|<arg|fig>|<arg|cap>>
</macro>>
</style-with>
\;
</body>
<\initial>
<\collection>
<associate|preamble|true>
<associate|src-compact|normal>
</collection>
</initial>
- style file: "if" in a macro, Kris Kuhlman, 10/15/2005
- Re: [TeXmacs] style file: "if" in a macro, Joris van der Hoeven, 10/15/2005
Archive powered by MHonArc 2.6.19.