How can one control the format of text and images during copy-paste or Export-to-Word procedure from Live Editor?

7 views (last 30 days)
I am preparing a Word document with MATLAB LiveScript code, ouput equations and images. Questions:
  1. Is it possible to control the size of the font when copying and pasting selected text in Live Editor? I seem always to get Consolaas 10.5 size when pasting into Word, even though I set size 10 in MATLAB Preferences>Fonts>Desktop code font.
  2. Is it possible to control the scaling of the equations while pasting, i.e. images of the equations (I realize that the equations are automatically converted to images)? They are all somehow scaled to 50%, but I would like to play around with that.
  3. If one tries to use the Export to Word option, are there any helpful options regarding questions 1 and 2 (font and image size control)?

Accepted Answer

Aabha
Aabha on 11 Feb 2025
Edited: Aabha on 12 Feb 2025
I was also trying to create a Word document with MATLAB Live Script code, and I faced the same issues. It seems that while copy-pasting code from the LiveScript, or using the “Export to Word” option, there are limited formatting options that MATLAB provides. However, I managed to find a manual workaround to this problem which might help.
While pasting the code in an independent Word document, if the font and font size of the document are customized as per your requirement, the code pasted from the live editor is also formatted as per those settings.
Additionally, while saving a Live Script as a Word document, the equations are converted to images, and scaling is not enabled to ensure consistent rendering across different platforms and versions of Microsoft Word. However, you can try copying and pasting the equation from the output pane of Live Script. Use the “Copy as MathML” option for copying the equation from output pane and paste it into the equation editor of Microsoft Word. This method of copying will enable you to edit the equations in MS Word.
I hope this workaround is helpful to you.

More Answers (0)

Categories

Find more on Scripts in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!