Pages: 1
Print
Author Topic: How do writers enter a non-breaking space in XMetal Author Essential 8.0  (Read 3210 times)
theanop
Member

Posts: 1


« on: June 12, 2014, 11:56:50 AM »

Our writers need to author non-breaking spaces in XMetaL Author Essential 8.0. Last time I worked with XMetaL was version 4.62 and I could swear there was a non-breaking space option on the Special Characters or Symbols toolbar. But I do not see one there today. Please let me know asap how they can do this. These are not programmers and are not comfortable with entering numeric or named entity code.
Logged
nancyt
Member

Posts: 9


« Reply #1 on: June 12, 2014, 05:27:51 PM »

In XMetaL 6.0, we use the Alt + 0160 command to create non-breaking space characters.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #2 on: June 13, 2014, 06:04:21 PM »

Yes, Alt+Numpad 0160 is the easiest solution.

This character has not been available on those toolbars in any version that I recall. I suspect that if it was in your version it was there due to customization. If so, bringing the customization files along from your old version to the current one should give you that same functionality, whatever it was.

If not, you could add it by customizing either toolbar. You'd need to create a macro first (to tie to a toolbar button) and find an appropriate icon for the button (the software does not include anything I would consider "nice", so you might want to draw a new one, which means even more customization). Such a macro could use the Selection.TypeText() API to insert the character (there are other APIs that could be used instead but this will do). Personally, I'd avoid toolbar customization in this case as I don't think it's worth the trouble.

If the numpad solution is difficult for your users to remember (or maybe they don't have a numpad, or are using a laptop where it is a PITA) and you'd like to give them something slightly easier you could add a macro with a new shortcut. Perhaps Shift+Space or something else your users prefer. Note that Ctrl+Space switches views and Alt+Space opens the application context menu, so best not to use those.

Code: (example)
<?xml version="1.0"?>
<!DOCTYPE MACROS SYSTEM "macros.dtd">

<MACROS>

<MACRO name="Insert No-Break Space" lang="JScript" key="Shift+Space" hide="false"><![CDATA[
Selection.TypeText("&#160;");
//Note: could also use &#x00a0; or a real no-break space.
]]></MACRO>

</MACROS>

I use the numbered character entity reference in this example to avoid issues with the forum changing the character, copying from the forum (which might change it if it isn't changed by the forum) and saving the MCR file. You could just replace it with a "real" no-break space provided you save your MCR file using UTF-8 encoding. Regardless, the character will be inserted as a no-break space character. As written, this particular macro will work in all three editing views (which is why I chose this API over others as some won't work in Plain Text view).

If you don't want the macro to appear in the list in the Macros toolbar or the Macros dialog change the "hide" value.
If you want it to be available to all schemas put the macro in an application-level MCR file (one you have added to your Startup folder).
If you want it to be available to a specific schema add it to the MCR file associated with that schema (DTD or XSD).
If you are not the person in charge of creating customizations for XMetaL Author at your organization then it would be best to have them add it instead to make sure it does not conflict with anything they have created.
« Last Edit: June 13, 2014, 06:07:45 PM by Derek Read » Logged
Pages: 1
Print
Jump to: