Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Confluence: formatting wide monofont so it's readable in PDF output

Robert Lauriston
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2014

I have some terminal output from a command-line utility that's 125 characters wide. It's in a tabular format so it's important that it not wrap. Neither Preformatted style nor the Code Block macro produce good results in the PDF. Any other ideas? Here's a sample:

============ SERVER 192.168.1.12:5701 =======================================================================================
= Name Version Free Mem CPU% Uptime =
= ------------------------------------------------------------------------------------------------------------------------- =
= 192.168.1.12:5701 1.0.0-SNAPSHOT (13a78a9357) 840Mb . 01:15:14 =

2 answers

1 accepted

1 vote
Answer accepted
Nils Bier _K15t_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2014

Hi Robert,

have you tried creating a user-macro and wrap the text in this usermacro?

E.g. you could create a new user-macro called "command" with code

# @noparam

<p class="command">$body</p>

Then add the following CSS to the Content Formatting section in your PDF template:

p.command {
    font-size: x-small;
}

This will output all text wrapped in the macro in font-size "x-small".

Does this help?

Cheers,
Nils

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2014

I was going to suggest the same thing and I had tried it on my system and could not get it to work. The "p.command" selector is not specific enough. Not only that it looks like the code macro overrides some other sytles with !impotant, so it's kinda tricky finding the right selector that has enough specificity.

Robert Lauriston
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2014

That pointed me in the right direction. I used this macro:

<pre class="pre-small">$body</pre>

And this in Content Formatting:

pre.pre-small {
font-size: smaller
}

0 votes
Daniel Wester
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2014
Put it in a Confluence table. I do t think that PDF has a nowrap directive.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events