Scaling code samples in codeblock

Last Updated : May 28, 2021 |

About this task

When you use the codeblock element, the number of characters that appear on each line depends on where you’re using the codeblock element. For example, in a reference topic, a codeblock can have 83 characters on a line. In an info tag in a step, there are 73 characters. If you’ve got a codeblock element with more characters on a line and the line breaks are incorrect, you can scale the codeblock element to decrease the size of the text and fit more characters in a line.

Important:

The way the element appears in the editor is not the same as it will appear in your output. Therefore, you must generate the output to check the size of the code sample and make sure that the text is still readable. Do not reduce the scale to a point where the text cannot easily be read.

Procedure

  1. Put the code sample in a codeblock element.
  2. Double-click or select the codeblock element.
  3. In the Attributes dialog box, select a value from the scale menu that represents the percentage you want to codeblock to appear.

    For example, if you select 90, the codeblock text will be scaled down to 90% of its normal size. The number of characters that fit on a line in a codeblock element depends on where the codeblock element is used, therefore, the scaling needs to be changed as appropriate.

  4. Click OK.