MATLAB Answers

Why does Matlab code copy-pasted from PDF-file viewed with Preview copied to MATLAB's editor copy with some end-of-lines missing?

8 views (last 30 days)
Henrik Flyvbjerg
Henrik Flyvbjerg on 31 Aug 2020
Answered: Henrik Flyvbjerg on 3 Sep 2020
Why does Matlab code copy-pasted from PDF-file viewed with Apple's Preview copied to MATLAB's editor copy with some end-of-lines missing?
I use a MacBook Pro (15 inch, 2018) with macOS Catalina version 10.15.6
Years ago I had the same problem. After a macOS update it disappeared. Now it came back. Caused by latest update?
When I view the same file with Adobe Acrobat and copy-past from it, I have no problem. Which I then do. But I am writing a textbook. I want this to work in Preview as well.

Answers (2)

Nikhil Sonavane
Nikhil Sonavane on 3 Sep 2020
From my understanding, I think that you are facing the issue because of the latest macOS update. For now one of the possible workarounds may be using some other app to copy-paste your code to MATLAB.

Henrik Flyvbjerg
Henrik Flyvbjerg on 3 Sep 2020
That is also my understanding.
Now, and in the past when it was also a problem, I could just copy-and-paste from Adobe Acrobat.
I was/am hoping someone knows a fix of this problem with some LaTeX command.
For now, I have to tell my students that the latest macOC update regressed to a problem of the past that was already solved in the previous version of macOS. Bad news about a good system.

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!