[Framers] Importing a single variable. WAS: Preventing 2-word product name from line breaks

Heiko Haida info at heiko-haida.de
Thu Apr 7 03:43:13 PDT 2016


 

Hi Roger, 

one objection: 

Although the mif-file contains only a single variable, FM will add a set
of default system variables to it.
By importing the variables into another file, all changes in the
definition of system variables (like added character formats e.g.) will
be discarded there. 

Best regards -- Tino H. Haida 

Roger Shuttleworth: 

> This discussion seems to have morphed into one about importing variable definitions in a situation where your work environment doesn't allow you to install plugins. Here's my two pennorth:
> 
> Monique Semp said:
> "Yes, but that presupposes that you want *all* the variables from the sourcefile. But in my case, I have different variables in different FrameMakertemplates (for frontmatter, ToC, chapters), with only some variables, suchas the doc's part number, in all the templates. So by using BookVars, I caneasily change/add only the desired variable, to all files in the book,without affecting any other variables."
> 
> There is a way to import a single variable into your doc. This method may be familiar to those as long in the tooth as I am, but new to the younger generation. I append an answer that was given by Framers years ago, with my acknowledgments to the original author, whoever he/she was.
> 
> Importing a single variable into a template
> 
> Create a small text file with the variable and save it with a .mif extension. If you then open that file in FrameMaker, it will appear to be a regular blank FrameMaker document, but you'll know for sure that the only thing it actually contains is the one variable definition you want to import.
> 
> There are two ways that you can use the variable created in the .mif file: Use that .mif file the same as you would any file from which you are importing formats; or from the File menu, choose Import > File, and then select the Copy into the document radio button.
> 
> If you need to change the variable definition, edit the text file. See the following example for more information.
> 
> Example:
> 
> <MIFFile 6.00>
> <VariableFormats
> <VariableFormat
> <VariableName `CompanyName'>
> <VariableDef `Your definition here'>>
> # end of VariableFormat >
> # end of VariableFormats
> 
> Note that the opening quote symbol for the variable name and its definition is actually the left slanting character below the tilde on your keyboard. The closing quote is a straight single quote/apostrophe. Note also that if you want to include more variables, you just need the whole group of four lines for each variable. For example, if you added a CompanyShortName variable, the MIF snippet file might look like this:
> 
> <MIFFile 6.00>
> <VariableFormats
> <VariableFormat
> <VariableName `CompanyName'>
> <VariableDef `The Fish Dance Slapstick Ballet Company, Ltd.'>>
> # end of VariableFormat
> <VariableFormat
> <VariableName `CompanyShortName'>
> <VariableDef `Fish Dance'>>
> # end of VariableFormat>
> # end of VariableFormats
> 
> Caveats:
> I'm not sure whether you would need to change "MIFFile 6.00" into something a bit more up-to-date, but I doubt it. Also, I've not tested this on recent FM versions, but see no reason why it wouldn't work.
> 
> Hope this helps.
> Roger
 


More information about the Framers mailing list