Styling the Text in Code Snippets

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
doloremipsum
Sr. Propeller Head
Posts: 290
Joined: Mon Aug 26, 2019 2:11 pm

Styling the Text in Code Snippets

Post by doloremipsum »

Has anybody worked out how to style the text in a code snippet for PDF and Word output yet? It doesn't seem like I can affect the font family and size from the MadCap|codeSnippetBody for PDF output (although, oddly, I CAN affect the font weight).

From the look of the Word output the code snippet is converted to a table, which is also suggested by viewtopic.php?f=10&t=32525. But I can't work out what styles I should be changing to affect the text. (On the assumption that I only want to affect this text and not that in my other tables.)
in hoc foro dolorem ipsum amamus, consectimur, adipisci volumus.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Styling the Text in Code Snippets

Post by ChoccieMuffin »

doloremipsum wrote:Has anybody worked out how to style the text in a code snippet for PDF and Word output yet? It doesn't seem like I can affect the font family and size from the MadCap|codeSnippetBody for PDF output (although, oddly, I CAN affect the font weight).

From the look of the Word output the code snippet is converted to a table, which is also suggested by viewtopic.php?f=10&t=32525. But I can't work out what styles I should be changing to affect the text. (On the assumption that I only want to affect this text and not that in my other tables.)
You may have identified exactly the way to change the font in your code snippets in that thread you quoted. I suggest you try adding "font-family: xxx;" to the first of these two additions to your CSS, as helpfully suggested by klees in that thread, and see what happens.
klees in the linked thread wrote:Update:
Just in case anyone else runs into this issue, I resolved it by adding the following to my stylesheet (manually).
MadCap|codeSnippetBody table td
{
border-right: solid 1px none;
border-top: solid 1px none;
border-bottom: solid 1px none;
padding: 0.0em;
}

MadCap|codeSnippetBody table
{
border: none;
}
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
doloremipsum
Sr. Propeller Head
Posts: 290
Joined: Mon Aug 26, 2019 2:11 pm

Re: Styling the Text in Code Snippets

Post by doloremipsum »

My reading comprehension obviously wasn't great yesterday arvo! The problem was actually being caused by some unnecessary formatting I had on my table and td tags, which was overriding the styles on the codeSnippetBody tag for CSS inheritance reasons. I can either delete that table/td formatting, or override it with a more specific selector (MadCap|codeSnippetBody td).

Cheers Mx Muffin!
in hoc foro dolorem ipsum amamus, consectimur, adipisci volumus.
Post Reply