Can't insert new tags in table macro

I’d like to add a logo on the title bar of slides. It looks like this now.


More tweaks are needed. For example, center the title text and disable text height correction for the logo so that it’s truly centered. However, I can’t structure-insert new cwith tags in the tit macro by clicking the buttons or use shortcuts. I tried a plain tabular, and no luck neither. A minimal example is

<tabular|<tformat|<cwith|1|1|1|1|cell-valign|c>|<table|<row|<cell|>>>>>

Can you put the cursor in a cell element and then use the menus to set the options you want?

1 Like

Yes, I can now set the properties using the menu. The entire tit contains only one column and two rows, one for the title and another for the page numbers. I set cell-valign of the top row to ‘c’
However, the result is not what I want:


The text is not centered and I got an extra white space above. Maybe I need check the structure more carefully. The code in the preamble is

<assign|title-vpadding|0spc>

<assign|title-right|<image|logo.png||25pt||>>

<assign|tit|<\macro|body>
  <\no-margins>
    <\surround|<assign|page-this-top|0mm>|<assign|gpag-length|<macro|<minus|1pag|<plus|<times|2|<value|title-vpadding>>|<times|<value|title-font-size>|1.5fn>|0.8fn|<value|par-par-sep>>>>>>
      <with|font-family|ss|par-par-sep|0fn|color|<value|title-shadow-color>|font-size|<if|<value|title-old-style>|1|<value|title-font-size>>|<resize|<tabular*|<tformat|<twith|table-width|1par>|<twith|table-hmode|exact>|<cwith|1|1|1|-1|cell-tsep|<value|title-vpadding>>|<cwith|1|1|1|-1|cell-bsep|<value|title-vpadding>>|<cwith|1|1|1|-1|cell-background|<title-bar-color>>|<cwith|1|1|1|1|cell-halign|l>|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|2|2|1|1|cell-vcorrect|n>|<cwith|2|2|1|1|cell-halign|l>|<twith|table-valign|T>||<cwith|1|1|1|1|cell-bborder|<value|title-border>>|<cwith|2|2|1|1|cell-hyphen|t>|<cwith|2|2|1|1|cell-lsep|0spc>|<cwith|2|2|1|1|cell-rsep|0spc>|<cwith|2|2|1|1|cell-bsep|0spc>|<cwith|2|2|1|1|cell-tsep|0spc>|<cwith|1|1|1|1|cell-valign|c>|<table|<row|<\cell>
        <with-tit-color| <arg|body><htab|5mm><title-right|<arg|body>>>
      </cell>>|<row|<\cell>
        <title-sub-bar-frame| <title-sub-bar-contents|<arg|body>>>
      </cell>>>>>||<plus|1b|0.2fn>||>>
    </surround>
  </no-margins>
</macro>>

and this is the logo.png
logo

I would think that since the text and the logo are on one line, the cell tries to center that whole line. Since the text and the image are anchored to that line, they align at their bottom-most point. This means that the cell is effectively center-aligning the image.

I would try putting the logo and text in separate cells. You can create a 4x4 table and then join the bottom two for the page numbers.

2 Likes

I see! I’ll try it.

I remember somewhere in the manual that we can center align text and image in one line.

What possibly causes the white space above? It looks like the table is shifted downward. But I haven’t change any table properties, just cell properties.

It seems to have to do with the page-this-top definition: it changes if you put e.g. -3mm in there. I don’t really know what that variable is meant for, though.

Try to play with table-valign, setting it to “c”, “C”, “b”, or “B” removes the top whitespace.