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

Tricky formatting of crossreference formats

Community Expert ,
Aug 23, 2023 Aug 23, 2023

I can't figure out why the formatting of my cross references is working unpredictably.

I have two character formats, "Bold" and "Blue"

StudioSm_0-1692793569028.pngStudioSm_1-1692793583325.png

 

I want my cross references to look Bold and Blue when applied, so I am adding this code to the definition:

<Blue> <Bold>Chapter <$chapnum>, Section <$paranum>. <$paratext>

This code will produce this cross reference:

StudioSm_2-1692793720234.png

While it works, I am consternated about the code applying Bold and Blue.

I want to get rid of the space between <Blue> <Bold> because it adds an unwanted empty space in front of the cross reference. But if I remove that space, this is what's happening:

StudioSm_3-1692794005757.png

But why? Should the bracket not be enough to separate the two formats? And it is not even consistent behaviour. Some cross reference formats do NOT have the empty space, but works nevertheless!

 

 


Bjørn Smalbro - FrameMaker.dk
765
Translate
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

correct answers 1 Correct answer

Community Expert , Aug 23, 2023 Aug 23, 2023

I would define a single character format, maybe called "Link" that has both Blue and Bold properties. That way, you are only dealing with a single character format building block in the Cross-Reference.

image.png

Translate
Community Expert ,
Aug 23, 2023 Aug 23, 2023

A look at the MIF for both cases might turn up something.

If a fix-now understand-later solution is needed, a new Character Format of Bold+Blue would do, but you could also try:
<Blue>\u200c<Bold>Chapter <$chapnum>, Section <$paranum>. <$paratext>
U+200C being ZERO WIDTH NON-JOINER

Translate
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 ,
Aug 23, 2023 Aug 23, 2023

Unicode to the rescue, again! 😂

 

I was going to just say make a new character format that includes both attributes but you knew that, so Bob's second suggestion looks like the way to go. Did you give it a shot, Bjørn?

 

~Barb

Translate
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 ,
Aug 23, 2023 Aug 23, 2023

Be mindful that I haven't tried this, and there are a couple of caveats:
1. FM is apt to collapse >\u200c< to >< in the dialog, making it invisible to future stewards
2. FM frequently does not honor Unicode semantics This would be a problem for \u200d (ZWJ), but for ZWNJ, perhaps not a problem.

Translate
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 ,
Aug 23, 2023 Aug 23, 2023

That WAS an interesting trick you suggested. The font is Roboto, but it seems "\u200c" won't work. I get a "?" for the "invisible" character.  And same goes for "\u200d", unfortunately

StudioSm_0-1692800042646.png

 


Bjørn Smalbro - FrameMaker.dk
Translate
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 ,
Aug 23, 2023 Aug 23, 2023

The ? often means that the font doesn't populate the codepoint, but heck, how can a font not bother to populate a codepoint that has no glyph.

You might also try some other non-glyph non-advancing character, such as the legacy FM \x05 (suppress hyphenation).

Translate
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 ,
Aug 23, 2023 Aug 23, 2023

I always heard that two character formats on top of each other do not work reliably.

Therefore I would recommend a format which is blue and bold.

Translate
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 ,
Aug 23, 2023 Aug 23, 2023

WR: I always heard that two character formats on top of each other do not work reliably.

Interesting. I've not heard that (until now), but it is often a problem, where people are creating a new Character Format without taking care to set the whole thing to
⦿As-Is
before specifying only what needs to be changed. That doesn't seem to be an issue here. Failing to do this often results in ChrFmt1 being stomped by ChrFmt2.

Applying multiple ChrFmts by select-and-click can be iffy because it's hard to know what ordering is being used (if that matters).

The ⦿As-Is attribute aspect was likely mainly intended to protect the PgfFmt. It may well be that ChfFmt stacking was not contemplated.

Translate
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 ,
Aug 23, 2023 Aug 23, 2023

I would define a single character format, maybe called "Link" that has both Blue and Bold properties. That way, you are only dealing with a single character format building block in the Cross-Reference.

image.png

Translate
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 ,
Aug 25, 2023 Aug 25, 2023

Thanks @frameexpert This is where finally gave up on making them combo of formats work. The behaviour of two character formats beside each other is highly erratic, so a new character style became the solution. Which works!


Bjørn Smalbro - FrameMaker.dk
Translate
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 ,
Mar 08, 2024 Mar 08, 2024
LATEST

I came across an inconsistent bug (?) with x-refs--if you have to sequential character styles, it can sometimes not read them properly after updating the book. (I've gone for 40 years without running into this bug until today!!)

 

I found that if you use ONE style that combines the settings, it works. So basically, do what @frameexpert suggested. 

David Creamer: Community Expert (ACI and ACE 1995-2023)
Translate
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