Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.