This site is missing an important feature: a button for copying
LaTeX code and co to the clipboard.
It would be possible, but stackexchange powers declined adding it. There's a long thread on the main meta:
This would be so useful, I keep meaning to add one of the user scripts that adds it.
Note that is a very old thread, and some of the earlier excuses for not adding this refer to security. At the time there was no standard clipboard API and the common way was to use a flash plugin which had "interesting" security implications. That hasn't been an issue for a decade or more. All common browsers provide native clipboard access.
If you install a user script (greasemonkey or similar) there are several available scripts that would add a copy button for stackexchange sites, but it would be better if one was there by default (or Ctrl-a Ctrl-c was adjusted to select all of a code block, not the whole page, which would also be possible).
After discussing this with the other CMs, we've decided to decline this request. We already has enough issues with folks copying and pasting without attribution, so this would require further investigation to determine whether it would be worth implementing (and how to mitigate the risks). Our developers also have limited bandwidth to investigate and implement this at the moment, so this isn't something that's likely to be implemented in the near future.
For now, you can use the workarounds of simply copying and pasting manually, or using a userscript as others have suggested.