Pages: 1
Print
Author Topic: Adding a line break for each indexterm  (Read 1719 times)
rgatotubo
Member

Posts: 3


« on: April 22, 2016, 12:59:55 AM »

How do I enable line breaks for indexterms in Tags On View? It is hard to edit without line breaks. I'm using Xmetal Author 7.

Attached is a screencap.

Thanks.


* indexterms.PNG (25.39 KB, 1189x153 - viewed 210 times.)
Logged
barbwire
Member

Posts: 44


« Reply #1 on: April 22, 2016, 04:04:16 AM »

How do I enable line breaks for indexterms in Tags On View? It is hard to edit without line breaks. I'm using Xmetal Author 7.

Attached is a screencap.

Thanks.
http://forums.xmetal.com/index.php?topic=1011.0 or http://forums.xmetal.com/index.php/topic,925.0.html ...

I think the css could be the best solution.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2484



WWW
« Reply #2 on: April 22, 2016, 05:59:49 PM »

I think the reason the CSS for indexterm elements is like this is because there is a dialog that lets you work with these in a nice way (or you might not agree). See the "Indexterms" section of the "Topic Metadata" dialog. To open that dialog select the Insert menu then select Topic Metadata.

However, if you prefer to work with the indexterm elements directly in a topic you can modify the CSS that displays them.

There are a bunch of override CSS files but these can be difficult to find as there is a different file for each topic type and for each different version of the DITA DTDs. I also don't have access to this old release (7 is unsupported) at the moment so I'm not sure if they are in the same place as the current release. I'd say try modifying the following file as I don't think this has changed for a long time:
<xmetal installation path>\Author\DITA\XACs\shared\ditabase-base.css

On a 64-bit installation of Windows with XMetaL Author Enterprise 7 installed in the default path that file should be here:
C:\Program Files (x86)\XMetaL 7.0\Author\DITA\XACs\shared\ditabase-base.css

Changing that file should change this for all DITA versions (1.1, 1.2, and newer versions also have 1.3) and all topic types.

Note: That this file includes the "base" DITA elements, which is where the indexterm element is defined. There is also a file for "derived" DITA elements, so if you need to alter the appearance of another element (other than indexterm) and you don't find it in ditabase-base.css look in ditabase-derived.css.

Change the following selector(s) depending on your needs...

To get indexterm elements to appear on separate lines you will need to change "inline" to "block" but you might want to make other changes.
To understand which one you are changing you might change color to "red" (color:red) to make that obvious, then change that back to the original #AAAAAA grey or something else you prefer.

After each change switch views to refresh the CSS. If that does not affect the CSS then you will need to restart XMetaL Author Enterprise to reload the CSS files.

This selector affects only indexterms inside keywords:

/* indexterm in keywords{*/
[class~="topic/keywords"] [class~="topic/indexterm"] {
   display: inline;
}


You might also want to change this one, or maybe not depending on what you consider easiest to work with:

/* nested indexterm in keywords{*/
[class~="topic/keywords"] [class~="topic/indexterm"] [class~="topic/indexterm"] {
   display: inline;
}


This selector affects all indexterms (provided they are not inside keywords because the selectors above are more specific and the standard W3C CSS cascading rules apply in XMetaL Author):

/* indexterm {*/
[class~="topic/indexterm"] {
   display: inline;
   color: #AAAAAA;
}


Note: The reason the class attribute is used and not simply the "indexterm" element is to allow XMetaL Author Enterprise to use the same CSS files for all DITA document types, including specialized DTDs.
Logged
rgatotubo
Member

Posts: 3


« Reply #3 on: April 24, 2016, 10:03:12 PM »

Thanks Derek!
Logged
mag3737
XMetaL Evangelist
Administrator
Member

Posts: 114

I even use XMetaL to write my business letters.


« Reply #4 on: April 26, 2016, 10:56:39 AM »

The "intended" way to make changes like this to the CSS is not to edit this file Derek mentioned:
<xmetal installation path>\Author\DITA\XACs\shared\ditabase-base.css

but rather to edit the following file (note slightly different directory path):
<xmetal installation path>\Author\DITA\XACs\ditabase\ditabase-base-override.css

The technique is to copy the CSS you want from the original file, paste it into the "override" file, and then make the changes there (including adding entirely new selectors if needed). XMetaL loads these files in a specific order so that the override file is loaded AFTER the original one. Thus the settings for all style attributes specified in the override file will supersede any previous values they were assigned.

This may be considered a nit-picky correction. The resulting text display either way is the same. There may be advantages gained in code maintenance practice by doing it this way, but one might argue that those gains are minor.
« Last Edit: April 26, 2016, 06:02:05 PM by mag3737 » Logged

Tom Magliery
JustSystems Canada, Inc.
Pages: 1
Print
Jump to:  

email us