I've played around a bit with the trying to get a variable automatically (this would be the key) inserted into a heading level. Can it be done? I am bringing in DITA files via a DITA map and for reviewers, we print a PDF. One of the hard things is once reviews are made, the writers have to go back and find the source material to make any changes. What I am attempting to do is come up with a target that is used solely for reviews and would automatically insert the file name of the topic into the headings. There is a system variable called SourceFile that has exactly what I'm looking for, but I don't want to have to manually insert this into the H1, H2 types and I only want them for a specific target type that I would setup (a PDF output).
Can this be done?
Wayne
Any way to do this?
-
GregStenhouse
- Sr. Propeller Head
- Posts: 330
- Joined: Tue May 13, 2008 3:27 pm
- Location: Christchurch, New Zealand
Re: Any way to do this?
Try modifying your heading style to use an autonumber, and for the autnumber use the {file} command.
1. Open your stylesheet
2. Open H1 or whatever heading style you are using
3. Make sure you are in the Advanced view, with Show:Property Groups, then select AutoNumber
4. Click on mc-auto-number-format, and define your format (using commands under "Show File Commands"). For example:
5. Click OK
6. You may also want to set mc-auto-number-position to float:right
If you want this change to apply to a certain target only, then create a new medium (in your stylesheet, select Options>Add Medium) and make the change in the stylesheet while that medium is selected. Then select the medium for your target (under Advanced)
Cheers
Greg
1. Open your stylesheet
2. Open H1 or whatever heading style you are using
3. Make sure you are in the Advanced view, with Show:Property Groups, then select AutoNumber
4. Click on mc-auto-number-format, and define your format (using commands under "Show File Commands"). For example:
Code: Select all
({file})6. You may also want to set mc-auto-number-position to float:right
If you want this change to apply to a certain target only, then create a new medium (in your stylesheet, select Options>Add Medium) and make the change in the stylesheet while that medium is selected. Then select the medium for your target (under Advanced)
Cheers
Greg
Re: Any way to do this?
Thanks Greg I tried this. It only sort of works. For example, if the file name is v353197.htm (note, all our file names are numbers since that's how our content management system assigns them). Then my H1 ends up being v353197708781697.htm. When there are words in the file name (as we have in the registers that I generate from a script), it's not so bad. A102_1_x00_base.htm ends up being A102_1_0x00_base3911293819.htm, so you can easily see what the filename should be. I was hoping that somebody had a better answer than what I've already come up with. Ironically, if you manually insert the variable SourceFile, it works. The problem is with large documents with hundreds (or thousands) of topics, you just can't manually enter these.
I wonder what those numbers mean?
Wayne
I wonder what those numbers mean?
Wayne
Re: Any way to do this?
More curious...... I zipped the project, took it home to do some further development on it, and my filenames on my home system (Mac OS X running VMWare), doesn't show these extra numbers. Very interesting... Now I wonder why they appear on one computer, but not another.
edit: Even more strange still. Inside Flare the name looks correct. However, when the PDF is generated all the extra numbers appear.
Bummer.
edit: Even more strange still. Inside Flare the name looks correct. However, when the PDF is generated all the extra numbers appear.
Re: Any way to do this?
Talked with MadCap's Tech Support about this today. Seems there is a bug in the filename as an auto number format. 
Also found a bug in the PDF generation when I changed the color of the text of my auto number format. Both bugs were logged. I'm going to have to start keeping a spreadsheet with all the bugs I'm generating.
Also found a bug in the PDF generation when I changed the color of the text of my auto number format. Both bugs were logged. I'm going to have to start keeping a spreadsheet with all the bugs I'm generating.