Subject: mailing-list for TeXmacs Users
List archive
From : address@hidden- To: address@hidden
- Subject: Re: URL on printed documents
- Date: Tue, 10 Dec 2002 13:44:30 +0100
On Mon, Dec 09, 2002 at 06:06:01PM +0100, Yannick Patois wrote:
> On Mon, 9 Dec 2002 address@hidden wrote:
> > No you cannot redefine <hyperlink||> because it is built-in typesetter
> > element. You can only redefine style elements.
>
> But I dont want to 'redefine', I just need to change it's apearance... For
> DocBook, it would means changing the style-sheet, not the dtd...
Sorry, my explanation was not very clear.
In TeXmacs there are two types of structures (i.e. elements)
typesetter elements -- they are defined by the C++ core and cannot
be redefined. When they are "inactive" (or in preamble mode) they
appear with an uneditable name in blue color.
style elements -- they are defined by style files and can be
redefined. They are used through the typesetter elements "apply",
"expand" and (marginally) "value", and their name can be edited.
Inactive 'expand' appear as '{name|arg1|...|argn}' where 'name' is
green and args are black. In the TM format and Scheme format,
'expand' are presented the same way as built-in elements (that is
the 'expand' node is implicit) if 'name' is not the name of a
typesetter element.
Inactive 'apply' appear as '<name|arg1|...|argn>' where 'name' is
green and args are black. 'apply' nodes are always explicit in TM
and Scheme formats.
By "redefining", I mean "change the way the element is handled by the
typesetter". Actually those semantics cannot map cleanly either to TeX
or XML. The closest thing is '\renewcommand' in LaTeX.
> > Actually, I believe user documents should not normally use typesetter
> > elements (except for physical layout control, like spacing, breaking
> > and font control) so many customizations would become seamless. But I
> > do not know what Joris thinks of it.
>
> Hum, this is what comes under my mouse when clicking the obvious menue.
> If it's not what I should use, then it's surprising the interface is made
> that way.
That is my point. Currently, the GUI inserts typesetter elements for
structures that the user may want to redefine. I think it should
instead use style elements for things like 'hyperlink'.
> <hyperlink|A|B> is probably now:
> - Displaying A with a link to B when exporting to HTML
> - Using \htmladdnormallink{A}{B} for latex export
> - Displaying A and forgeting about B on ps export.
>
> I belive this latest behavior should have other setting, and probably the
> current one shouldnt even be the default (as a big lost of information on
> print).
Well, that may be another discussion entirely. Export filters should
allow the user to customize the conversion of specific elements.
PostScript export is a special conversion because it is meant to be
absolutely WYSIWYG. However, if you use a style element for
hyperlinks, you can change the way they are displayed using a menu
item. But that is fairly advanced customization.
> If there is no other way than to redefine my own command for this, could
> you anyway point me to the right documentation to do that ? (I dont have a
> clue about that kind of customisation in texmacs). Thanks.
Documentation is currently lacking in this domain.
You may get some clues by reading "Help->Manual->TeXmacs style files"
(and other related chapters) and "Help->Document format". Note that
there have been significant addition to the documentation in release
1.0.0.24.
Then, you can learn more by reading existing style files or provided
example packages (TeXmacs-1.0.0.24/packages/example/) and the user
interface scheme files (TeXmacs-1.0.0.24/progs/menu/).
Well, you could use the following customization:
In ~/.TeXmacs/progs/my-init-texmacs.scm (read
Help->Manual->Customizing TeXmacs, first).
(define make-inactive-hyperlink
(let ((default-action make-inactive-hyperlink))
(lambda ()
(if (style-has? "hlink-dtd")
(make-inactive-apply-args "hlink" 2)
(default-action)))))
(define hlink-menu
'(("Default" (init-default "hlink style"))
---
("HTML" (init-env "hlink style" "html"))
("Footnote" (init-env "hlink style" "footnote"))))
(set! texmacs-extra-menu (menu-merge texmacs-extra-menu
'(if (style-has? "hlink-dtd")
(=> "HLink" (link hlink-menu)))))
And the put the attached style file in "~/.TeXmacs/packages/hlink.ts".
Then if you use the hlink package (in Document->Use package->hlink)
you will create <hlink||> function application using the Hyperlink
menu item or the shortcut, and the HLink menu will allow you to select
the desired layout style.
But you will have to distribute this package with documents which use
it for them to display properly, and the HTML and LaTeX export filters
will not handle them properly (at the moment).
--
David Allouche | GNU TeXmacs -- Writing is a pleasure
Free software engineer | http://www.texmacs.org
http://ddaa.net | http://alqua.com/tmresources
address@hidden | address@hidden
TeXmacs is NOT a LaTeX front-end and is unrelated to emacs.<TeXmacs|1.0.0.24>
<\body>
<assign|hlink-dtd|1.0>
<assign|hlink style|html>
<assign|hlink|<func|text|href|<case|<equal|<apply|hlink
style>|footnote>|<apply|text><\footnote>
<apply|href>
</footnote>|<hlink|<apply|text>|<apply|href>>>>>
</body>
<\initial>
<\collection>
<associate|preamble|true>
<associate|paragraph width|150mm>
<associate|odd page margin|30mm>
<associate|page right margin|30mm>
<associate|page top margin|30mm>
<associate|reduction page right margin|25mm>
<associate|page type|a4>
<associate|reduction page bottom margin|15mm>
<associate|even page margin|30mm>
<associate|reduction page left margin|25mm>
<associate|page bottom margin|30mm>
<associate|reduction page top margin|15mm>
<associate|language|english>
</collection>
</initial>
- URL on printed documents / unwanted generated code, Yannick Patois, 12/04/2002
- Re: URL on printed documents / unwanted generated code, Joris van der Hoeven, 12/05/2002
- <Possible follow-up(s)>
- Re: URL on printed documents / unwanted generated code, Yannick Patois, 12/09/2002
- Re: URL on printed documents / unwanted generated code, david, 12/09/2002
- RE: URL on printed documents / unwanted generated code, Marc Mertens, 12/09/2002
- Re: URL on printed documents / unwanted generated code, Yannick Patois, 12/09/2002
- Re: URL on printed documents, david, 12/10/2002
- Re: URL on printed documents, Joris van der Hoeven, 12/11/2002
- Re: URL on printed documents, Yannick Patois, 12/11/2002
- Re: URL on printed documents, Joris van der Hoeven, 12/11/2002
- Re: URL on printed documents, david, 12/10/2002
- RE: URL on printed documents / unwanted generated code, Marc Mertens, 12/09/2002
- Re: URL on printed documents / unwanted generated code, david, 12/09/2002
Archive powered by MHonArc 2.6.19.