I would like programmatically to insert/write an expression at the current insertion point, but matching the current format, such as font size and style, so that it looks like the user typed it. Default use of NotebookWrite[], NotebookApply[] and Paste[] doesn't do this.

For instance if you change the colour in a text cell and press the paste button -> it will paste text in black colour, unlike typing that text yourself. How to avoid this?

Off course, one could set any specific style when using Paste[Style[exp, Red]], but it is unknown here- it is the style at insertion. And the same for Font.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.