# Mathematica 12 Frontend for Mac: cell grouping messed up upon copy/paste

Bug introduced in 12.0 or earlier and persisting through 13.0 or later

I am not sure whether this has been addressed somewhere already, I couldn't find any comment.

I suffer from an annoying bug: when I copy and then paste a cell between grouped cells (forming eg a chapter), the grouping is destroyed (creating a new empty cell is fine). If there are several levels of nested groupings, all these groupings are mangled. This pretty quickly messes up any well-structured notebook.

This seems new for the Mathematica 12, 64 bit frontend for MacOS. However a precursor exists already for Mathematica 11: this happens eg if one deletes a cell and wants to reinstate it via undo.

Is there any way to get around this?

Thanks!

Alas, even in the new release 12.1.1 which supposedly has 1000 bug fixes, that one wasn't fixed. So it seems that the interest in fixing this is basically zero.

This is very unfortunate as the situation as it is now is so unworkable that it prevents me to upgrade to Mma 12, which in turn is a pre-condition to upgrade to macos Catalina. So all is stalled because of this.

I just checked the new Mma 12.2: even about 1.5 years after I submitted a bug report, and after 1000+ alleged bug fixes in 12.1, this one still wasn't fixed. I guess they won't do it. I am just wondering why they don't remove the "manual grouping" option for cells for good, as it is just not useable.

So, also in 12.3 this bug remains. After 1000+ bug fixes last year, and 1000+ bug fixes this year, this important one still has not been fixed.

• If you can reproduce the bug, please report it to Wolfram directly. This is not a Wolfram site and mentioning it here won't ensure that it will get fixed. It is okay to ask for workarounds here, but even then it is important to explain very precisely how to reproduce the issue. If we cannot reproduce it, we won't be able to help. Aug 6 '19 at 7:54
• I removed the bugs tag for now, as this tag is reserved for bugs that are clearly described, and are confirmed by the community or by Wolfram. Please see the tag description for more details. Aug 6 '19 at 7:55
• @Szabolcs pretty sure this is a bug (at least on a Mac?) - try pasting a Cell/CellGroup inside any (manually-grouped) CellGroup. Mar 25 '20 at 3:49
• @RonaldMonson Can you please use the standard bug header? If we do not follow the standard, it will be difficult to search for bugs. Adding Markdown formatting that deviates from the standard also causes some searches to fail. Mar 25 '20 at 8:18
• @Szabolcs Done. Mar 25 '20 at 9:10

I reported this as a bug to support ~8 months ago and then logged it again in Redmine about 7 months ago (Bug #132) - it was one of the first things I noticed in 12.0's release. It was also documented on Wolfram Community around the same time.

The work-around is pretty unsatisfactory - basically save, close the notebook, open and then laboriously reconstruct all the nested cells just mangled (or wait until that organization is somewhat finalised to avoid repeating).

Aside: It surprises me that this bug has lasted so long given no real work-around and that nesting cells is a pretty fundamental activity for notebook organization. Perhaps it suggests that most users just don't use manual grouping? It so disrupted my workflow that I looked at reverting to automatic grouping while implementing hierarchical grouping via CellGroupingRules in stylesheets. This might have actually been a structural improvement as most of my CellGroups do have a natural hierarchy but unfortunately this approach doesn't seem to work sufficiently robustly for such a fundamental change (while also noting CellGroupingRules "has not been fully integrated into the long-term Wolfram Language, and is subject to change").

I have the same problem with Mathematica 12.0 and 12.1. As soon as you copy paste a cell or group of cells into an existing group of cells (I call it target-cell-group) the grouping is messed up. (see added pictures)

My workaround ist also not very nice: I create a new cell within the target-cell-group, and insert the cell/group of cells into this new cell. The grouping of the inserted cellgroup is gone of course, but at least the target-cell-group still exisists.

Anyway I will report this problem to wolfram this week. Let me know if someone has any solution for this problem.

Thanks a lot!

Wolfram is aware of the bug, and hopes it will be fixed:

"We hope that this issue will be resolved in future versions of Mathematica." -- Oct 9, 2020.

"Our developers are aware of the cell grouping issue and it is indeed a high priority one. I have passed all your comments to the report and conveyed the inconvenience you are experiencing." -- Oct 22, 2020.

Wolfram is aware that Mac users cannot roll back to v11 unless they are using rather old computers. I will not renew my Mathematica subscription until this bug is fixed. (The bug was introduced in 12.0 and remains in two variants of 12.1 and the recent 12.2. I suspect the front end has become too complex to maintain.)

I'm not seeing this for Mathematica 12.1 under macOS Catalina 10.15.3.

Can you post a specific notebook in which this happens and say what, if you copy from one section (chapter, or whatever) to another messes up the grouping?

• That's also my set-up (12.1 Catallina 10.15.3). A notebook shouldn't be necessary; just try pasting a CellGroup inside any other CellGroup (with the notebook's Cell->Grouping style set to "Manual"). Mar 25 '20 at 23:15
• Hello, first thing I checked in 12.1 was this bug and it is still there. I had asked Wolfram on a different channel back in December and got told that the bug won't be fixed in 12.1. This is annoying, as said, since I have amassed many hundreds of notebooks, as a daily user since 1991, often with sophisticated cell nesting patterns, and they all get mangled. To be sure: this applies to "Manual Grouping" only. And both to Mojave and Catalina. Mar 26 '20 at 9:06
• See here a picture, don't know how to add the .nb here: gyazo.com/300b7f2da14dadba97326191369ad4ee Mar 26 '20 at 9:12
• Best to avoid editing Mathematica notebooks outside the Mathematica front-end. Do it in the notebook while it is opened within Mathematica. To copy a single cell or a group of cells, just click on the corresponding cell bracket or the surrounding group bracket, respectively. Mar 27 '20 at 0:55