Export MATLAB LiveScript into Viewable PDF

MATLAB LiveScript can be exported into pdf but the function is often broken. Sometimes figures are too large to stay in page frame, or it doesn't show figures at all.

To bypass this broken feature one possible way around is to save as HTML, and edit CSS to make sure things look normal before finally printing it into PDF.

Some useful CSS property to pay attention to:

.inlineElement
{
    max-hight: none; !important
}
.figureContainingNode{
    max-width: 100%;
}