How do I assign a character format in marker text?
Copy link to clipboard
Copied
I'm generating a List of Markers to serve as an index of figures with their respective sources rather than citing the source with each figure in the body of the book. I'm using a marker on each figure and then adding the source in the marker text. Some of the sources require bold or italicized type, and using the <> building blocks doesn't work; it just generates the text exactly as I type it into the Marker Text.
(So instead of having "source stuff document title date" it says "source stuff <Italics>document title</> date")
I inherited this project and the syntax was already there, so I assume it was working in prior versions. What's wrong and how do I fix it?
Copy link to clipboard
Copied
What version of FM? Was there an existing LOM that worked?
Copy link to clipboard
Copied
v 17.0.5.725
And yes, I believe this is the same file that was working before, but I don't know what version they were using
Copy link to clipboard
Copied
And I believe this is the version that was working before but I'm not sure
what version of FrameMaker they were using before I took it over.
Copy link to clipboard
Copied
<Italics> is the name of a character tag/format. Have you tried applying that character tag to something to check whether it actually makes text italic?
Bjørn Smalbro - FrameMaker.dk
Copy link to clipboard
Copied
Yes, it works when manually assigned to text
Copy link to clipboard
Copied
I tried putting together a sample like this:
"Emphasis" is the standard FrameMaker italic character tag.
Bjørn Smalbro - FrameMaker.dk
Copy link to clipboard
Copied
Your solution would make all of the marker text italic. The original poster may just want some of them (or parts of them) in italic.
Copy link to clipboard
Copied
This help page - https://help.adobe.com/en_US/framemaker/using/using-framemaker/user-guide/topic_format-text-in-an-in... - seems to imply that you can enter character tag instructions in the marker text (at least in Index type markers) - but they seems to be styled a particular way - take a look.
Copy link to clipboard
Copied
@Jeff_Coatsworth you provided the light bulb moment. The character styles do work as intended in an index but not in a list. The same marker be pulled into either, but when you make a list the words appear, when you make an index they assign the character style.
So @Lin23827968yzve: this is confusing: "I'm generating a List of Markers to serve as an index of figures" because you can generate a list or an index. If those character styles were working before, it was because it was an Index of Markers (IOM) and not a List of Markers (LOM). Take a look at the bottom of the Insert menu while in the book window:
- Create TOC is the most popular list, so it is pullled out for our convenience.
- List Of is next and offers the remainder of the list options, including Markers and Markers (Alphabetical). Character styles will not work in these.
- Standard Index is the most popular index, so it is pulled out for our convenience.
- Index Of is last and displays the other index options and also offers Markers. You need to use this one.
~Barb
Copy link to clipboard
Copied
The small example I showed above, is from the reference pages of a List Of (subject) Markers. You can accomplish the desired for formatting by applying character tags to the reference pages. Not in the markers, though - that is true
Bjørn Smalbro - FrameMaker.dk
Copy link to clipboard
Copied
That explains it! Now I'm struggling to format the IOM as a straight list of figures instead of it formatting as an index (alphabetically). I was tinkering with the reference pages but it's not working. Is it possible to use an LOM reference page to format the IOM? Both are in there, but even when I change the IOM reference page, it follows an index format instead of a list without the headings.
Copy link to clipboard
Copied
Hi @Lin23827968yzve:
I can't tell if you met with Rick and were able to solve this, but to answer the last question you asked me, no, you can't use an LOM reference page to control and IOM. They are two different types of lists and each have their own reference pages. And an index is always alphabetical (with or without the group titles). Lists are mostly chronological, with a few exceptions.
If you met with Rick and this is resolved, please mark his last comment as correct so that we know this is resolved—or let us know and I'll do it.
~Barb
Copy link to clipboard
Copied
We didn't meet. I appreciate the distinction you are making between lists (document order) and indexes (alphabetical order). I do find it strange that character formatting works in indexes but not in lists.
Copy link to clipboard
Copied
Rick, I appreciate the offer and was going to contact you today, but you and Barb just answered my question. It can't be done, apparently.
I need the list of markers to be chronological, so I can't use an index of markers. But I need the marker text to be able to accommodate italics or other character formatting if the reference is to a publication title or contains Latin words, for example.
Copy link to clipboard
Copied
I am not sure why you can not use the reference pages for the formatting? When you write "chronological order" - do you actually mean sorting by the time the marker has been created or updated? Or do you merely mean a sorting in the order of appearance in the manuscript?
Bjørn Smalbro - FrameMaker.dk
Copy link to clipboard
Copied
Order of appearance in the book.
Copy link to clipboard
Copied
So, how about a script that converts an index into a list where the index entries appear in document order? And you can use character formatting. Can anyone guess what I am doing here?
main ();
function main () {
var doc, counter;
doc = app.ActiveDoc;
if (doc.ObjectValid () === 1) {
processDoc (doc, counter = 0);
}
}
function processDoc (doc, counter) {
var pgf;
// Proces all paragraphs in the main flow.
pgf = doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
while (pgf.ObjectValid () === 1) {
counter = processPgf (pgf, doc, counter);
pgf = pgf.NextPgfInFlow;
}
return counter;
}
function processPgf (pgf, doc, counter) {
var textList, count, i, textItem;
// Get markers and tables in the paragraph.
textList = pgf.GetText (Constants.FTI_MarkerAnchor | Constants.FTI_TblAnchor);
count = textList.length;
for (i = 0; i < count; i += 1) {
textItem = textList[i];
// Process the marker.
if (textItem.dataType === Constants.FTI_MarkerAnchor) {
counter = processMarker (textItem.obj, doc, counter);
}
// Process the table.
else if (textItem.dataType === Constants.FTI_TblAnchor) {
counter = processTbl (textItem.obj, doc, counter);
}
}
return counter;
}
function processTbl (tbl, doc, counter) {
var pgf, cell;
// If the title is at the top, process it first.
if (tbl.TblTitlePosition === Constants.FV_TBL_TITLE_ABOVE) {
pgf = tbl.FirstPgf;
while (pgf.ObjectValid () === 1) {
counter = processPgf (pgf, doc, counter);
pgf = pgf.NextPgfInFlow;
}
}
// Process each cell and its paragraphs.
cell = tbl.FirstRowInTbl.FirstCellInRow;
while (cell.ObjectValid () === 1) {
if (cell.CellIsStraddled === 0) {
pgf = cell.FirstPgf;
while (pgf.ObjectValid () === 1) {
counter = processPgf (pgf, doc, counter);
pgf = pgf.NextPgfInFlow;
}
}
cell = cell.NextCellInTbl;
}
// IF the title is at the bottom, process it last.
if (tbl.TblTitlePosition === Constants.FV_TBL_TITLE_BELOW) {
while (pgf.ObjectValid () === 1) {
counter = processPgf (pgf, doc, counter);
pgf = pgf.NextPgfInFlow;
}
}
return counter;
}
function processMarker (marker, doc, counter) {
var regex, markerText;
// Regular expression for removing any existing sort string.
regex = /\s*\[[^\]]+\]$/;
// Only process Index markers.
if (marker.MarkerTypeId.Name === "Index") {
// Remove any existing sort string.
markerText = marker.MarkerText.replace (regex, "");
// Add a new sort string.
marker.MarkerText = markerText + "[" + padWithLeadingZeros (counter += 1, 5) + "]";
}
return counter;
}
function padWithLeadingZeros (number, places) {
var padded = String (number);
while (padded.length < places) {
padded = "0" + padded;
}
return padded;
}
Copy link to clipboard
Copied
Note that the script currently only works at the document level and it would have to be modified to work on an entire book. It also just processes Index markers but it could be modified to work with any marker type.
Copy link to clipboard
Copied
Here is the result of a script run at the book level. I have included each document's name so you can see that the entries are in book order.
Copy link to clipboard
Copied
Just to clarify: both documents in the book have the same content and markers but you can see that the markers appear in book / document order, even though it is an index, not a list. Even duplicate entries, which would normally be grouped together in an index, appear as separate entries.
Copy link to clipboard
Copied
You can make an index look somewhat like a list if you remove Group Titles from the index. Go to the IX Reference Page and delete the contents of the GroupTitlesIX paragraphs, while leaving the empty paragraph intact.
Copy link to clipboard
Copied
I tried that, and FrameMaker crashed and it still didn't work as expected. Is that the only change I should be making to the reference pages?
Copy link to clipboard
Copied
Let me know if you want to meet via Zoom or Teams. It is probably easier to troubleshoot it that way. Please contact me offlist: rick at frameexpert dot com
Copy link to clipboard
Copied
@frameexpert - thanks for the comment! This helped us solve the issues we were having, getting us closer to finally finishing a few manuals we've been working on.


-
- 1
- 2