Skip to main content
February 18, 2010
Question

Editing variables for Headers

  • February 18, 2010
  • 1 reply
  • 636 views

Hi,

I am trying to give a header a particular look. The header I am using looks like this:

Running H/F 1--Running H/F 2

The varaiables are separated by an em dash.

Running H/F 1 definition is <$paranum[ChapTitle]> <$paratag[ChapTitle]>

Running H/F 2 definition is <$paratag[Heading1]>

On the body page header it displays like this:

Chapter X: Chapter Title--Heading1

It all works well except when there is no Heading1 on the page before the header. It looks like this:

Chapter X: Chapter Title--

I would like to anchor the em dash to the second variable so it only displays if there is a Heading1.

The only way I could find to do this was by erasing the em dash and adding <$marker1> before <$paratag[Heading1]> and inserting a Header/Footer $1 marker with the special character for an em dash in the marker text box before all Heading1's. I would like to avoid this extra step and would like to automate the process, either by editing the variable or the autonumber property in the Heading1 paragraph definition.

Any suggestions?

pracktikal

    This topic has been closed for replies.

    1 reply

    Arnis Gubins
    Inspiring
    February 19, 2010

    No matter how you define a variable, if you include specific content like the em-dash, it will always show even if there isn't any content for the paratag that you're trying to pickup.

    Using markers, where the em-dash is part of the marker content would be one possibility, but as you inidcate, it is labour intensive and would be high maintenance as well. Populating the marker content could be automated with Framescript to make it easier.

    Another kludge could be using FM's Color Views to render objects in specific colours invisible. If the Heading 1 doesn't have an auto-number sequence, you could add the em-dash in the autonumber and apply a character tag (in the autonum definition) that uses a custom colour (and small font size to minimize the space used by the em-dash). This custom colour is set to be "Invisible" using View > Color > Views for the view that you typically work in (usually View 1 by default).

    In your variable definition, you could then include the em-dash by specifying  <$paranum[Heading 1]>, so when there is no Heading 1, the em-dash won't appear either. Even if an object is set to be invisible, FM knows it's still there and can access it. This is different behaviour from hiding content using Conditional text.

    February 19, 2010

    Hi Arnis,

    Thanks for your reply on the thread and your email.

    I had tried including the em-dash code in the variable but it displays whether or not there is a Heading1. I guess that is because it is not part of the definition. I tested it by placing some text in the same place and the text also displays. If there were a way to make it a part of the variable's definition, it would work.

    I also tried various combinations in the autonum format for Heading1 but there I couldn't find a way to hide it. Ideally it would be part of the Paragraph tag.

    I just now tested your suggestion to manage its display through Character Tag and making it an invisible color. The em-dash did not display in the header. I tried making it normal instead of invisible and it still didn't display. I tried both ways with small and large font sizes but it didn't display. I added before the variable definition but it made no difference.

    So far, the marker method is the only way I have found to do this but it is not elegant.

    I appreciate your responses. I wonder if there is a way using user variables?

    Peter Rack aka pracktikal

    Arnis Gubins
    Inspiring
    February 19, 2010

    Peter,

    After you've defined the em-dash as part of the autonum for the Heading 1 variable, you then have to explicitly ask for it in the variable definition, e.g.

    Running H/F2 defined as: <$paranum[Heading 1]><$paratext[Heading 1]>

    You do not include an actual em-dash in the variable definition, as this will always show (as you've found out).

    To make the em-dash invisible in your Heading 1 in the main text flow, in paratag definition for Heading 1 on the Numbering tab, specify the character tag that you've defined for the invisible colour. This will colour the em-dash (and adjust size). Then when you select a Color View where the em-dash color is set to be Invisible, it will disappear from view and never get into the output stream.

    Works for me...