• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Optional Variable in Header needs a Line Return included, what is syntax for this? (FM 2017)

New Here ,
Feb 10, 2020 Feb 10, 2020

Copy link to clipboard

Copied

I have a Running H/F 1, 2 and 3 on 3 separate lines in the Page Header. The Running H/F 2 is optional and appears on the second line between 1 and 3. Can I include a Line Return in the Running H/F 2 variable, because if the Running H/F 2 variable is set to OFF in the Page Header then I do not want a line space between Running H/F 1 and 3.

 

I have tried <$attribute[export:doc]> /r, but this didn't work. Any suggestions appreciated.

 


Thanks,

Tracey

TOPICS
Formatting and numbering

Views

823

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 10, 2020 Feb 10, 2020

Copy link to clipboard

Copied

Try \n

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 10, 2020 Feb 10, 2020

Copy link to clipboard

Copied

Hi Rick and Lynne, that works thanks! .. but it doesn't solve my problem unfortunately. When I have the \n, in the variable the line return is present even when I don't need it. .. of course. Doh. Do either of you know how I can solve this catch-22? perhaps there is some other way to approach it. .. so 3 line header, with optional 2nd line. If line in, great - currently just using attribute value and \n, but if the attribute is set to blank,.. and I have nothing displaying I am getting a blank line (from the \n of course),.. but I don't want that - I want no line return.. so just the line 1 and line 3 with no gap.

 

any tricks you'd be able to share?

 

 

Thanks,

Tracey

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Mar 03, 2020 Mar 03, 2020

Copy link to clipboard

Copied

Tracey,

    I don't believe you can create the desired formatting with Running H/F variables. There is no way to test the value of a variable; the point of Running H/F variables is to display information about the first (or last) occurrence of  something (paragraph, element, marker) on a page.

 

   You might be able to define two different master pages: one with and one without the line break. Your master page mapping table could then test for the attribute you want to trigger the different layouts. If one page has multiple occurrences with different values, though, the selected master page would depend on the order of entries in the mapping table rather than the order of elements on the page.

 

   You could also automate (with a script or plugin) selection of a master page or inserting the line break in the header of every page.

 

     --Lynne

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Mar 03, 2020 Mar 03, 2020

Copy link to clipboard

Copied

Forgot to mention: line breaks within an element are converted to spaces in a Running H/F variable and leading and trailing white space is removed. Thus, you can't solve the problem by picking up a line break from the body pages.

   --Lynne

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2020 Mar 03, 2020

Copy link to clipboard

Copied

LATEST

Thanks Lynne, 

 

I went with a script, it was pretty easy.  A lot tidier than duplicating Master pages for the sake of one line return.

 

 

Best Regards,

Tracey

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Feb 10, 2020 Feb 10, 2020

Copy link to clipboard

Copied

Tracey,

   Rick, of course, is correct. FYI, the problem with your first attempt was the direction of the slash. \r will also insert a line break in a variable.

    --Lynne

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines