- From: Giovanni Piredda <address@hidden>
- To: address@hidden
- Subject: Re: Custom title page
- Date: Sun, 18 Apr 2021 13:19:47 +0000
In the help files (Help -> Reference Guide -> Standard TeXmacs styles,
at par 4.1.2.) you will find a general description of the mechanism for
rendering titles.
As far as I understand the key macro that lays out the title,
doc-data-main, is not implemented as a TeXmacs macro but as a Scheme
function (here the help document might be inaccurate in suggesting that
it is a TeXmacs macro); you can find it in
$TEXMACS_PATH/progs/database/title-markup.scm, and I copy it here
(tm-define (doc-data-main t)
`(document
,@(select t '(doc-title))
,@(select t '(doc-subtitle))
,@(with authors (select t '(doc-author))
(if (<= (length authors) 1) authors
(list `(doc-authors ,@authors))))
,@(select t '(doc-date))
,@(select t '(doc-misc))
,@(select t '(doc-inactive))))
You can place your new definition in a Scheme module that you load from
your document (please ask if you do not know how to do that).
Rearranging the order of the elements is intuitive I think. Here is an
example, where I place the author first and set a line between author
and title (I tested it and it works):
(tm-define (doc-data-main t)
`(document
,@(with authors (select t '(doc-author))
(if (<= (length authors) 1) authors
(list `(doc-authors ,@authors))))
(line (point "0par" "0") (point "1par" "0"))
,@(select t '(doc-title))
,@(select t '(doc-subtitle))
,@(select t '(doc-date))
,@(select t '(doc-misc))
,@(select t '(doc-inactive))))
Said this, what I wrote is not authoritative at all :-) The mechanism
for the layout is complex and there are many parts which I haven't grasped.
I hope that someone else can extend/complete/correct what I wrote, and
that it helps to get you started.
I would say that for further info either ask here again, or if the
discussion becomes quite complex maybe the forum at
http://forum.texmacs.cn/ might be a good place.
G.
On 18.04.21 14:11, Pycpp wrote:
Hello,
I'd like to know how to create a custom style for the title page. The
manual explains how to modify the appearance of individual elements,
but I'd like to define new elements (like an illustration image) and
define the global layout of the title page, i.e. the order in which
the elements appear, their positions and additional decorations (for
instance I'd like to draw a horizontal line between the title and the
subtitle).
How can this be done?
Thank you for your answers!
- Custom title page, Pycpp, 04/18/2021
- Re: Custom title page, Giovanni Piredda, 04/18/2021
Archive powered by MHonArc 2.6.19.