It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

format of code block in proportional font in .pdf

We have recently upgraded to Confluence 5.4.2 and I'm having problems with the code macro. On the screen, all is well and the code block is displayed in a non proportional font. However when I export to .pdf , the code block is rendered in a proprotioal font. Having done some more research, I find the code block is written by the syntaxhighlighter script.

I can change the characteristics of the output by adding the following to the html stylesheet changes the screen output, but adding the same to the pdf style sheet does nothing.

.syntaxhighlighter .code .container * {
font-size: 8px !important;
line-height: 20px !important;

Similarly specifying the font in the above in the pdf stylesheet as shown below has no effect. So I am left displaying missaligned contents.

font-family: "courier new", monospace;

Can anyone give me an answer?

2 answers

1 accepted

0 votes
Answer accepted

Well Atlassian are now looking at the problem, which I believe shows itself only on our installation - their test environment renders everything correctly. We have a JIRA open which is being looked into so this should be closed.

Well, it appears Atlassian does not think this is a problem - it is not part of the 'default' functionality of Confluence which they say only supports one font in the exported .pdf file by default. The question remains, why is a code block displayed on screen in a monospace font nicely color coded by tag/element/command etc (by language) and in a proportional font (in black only) in the .pdf export - especially as this 'worked correctly' in confluence 3.2 while v5.4.2 does allow a monospace font to be used with the <code> tag i.e. {{code here}} in wiki markup. I don't have time to argue with them, especially as they are now ignoring the JIRA so I have written a macro which works (albeit with no colour coding) and uses the html <pre> </pre> tags.

Ours is obviously not to reason why - but I am very disappointed in what I had expected to be 'customer service'.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Introducing Confluence Cloud and Jira Software Cloud Premium

Wherever you are in your team’s journey , our goal is to support your big ambitions. We’re a cloud-first company with the mission of unleashing the potential of every team, and to address the range ...

612 views 4 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you