Message Boards Message Boards

Why can't multiline comments be aligned in Mathematica notebook?

Posted 2 years ago
Attachments:
POSTED BY: Hongyi Zhao
3 Replies

Regular comments seem to be formatted somewhat like input code. I sometimes do two different things when I wish to avoid this, which I, too, find rather dissatisfying.

  1. I type the comment in a text cell, select the cell bracket, copy the cell, and paste the cell between comment markers (* *).
  2. I put the comment in quotes: (*" comment... "*). This is the one I use most often.

See figure:

enter image description here

POSTED BY: Michael Rogers
Posted 2 years ago
POSTED BY: Michael Helmle
Posted 2 years ago

You could make each line a separate comment. Like this :

(* https://mathematica.stackexchange.com/questions/159808/commutator-of-gamma-matrices *)
(* https://mathworld.wolfram.com/DiracMatrices.html *)
(* https://en.wikipedia.org/wiki/Gamma_matrices *)
Table[Internal`DiracGammaMatrix[k, "Basis" -> "Chiral"] // MatrixForm, {k, 4}]
Table[Internal`DiracGammaMatrix[k, "Basis" -> "Dirac"] // MatrixForm, {k, 4}]
Table[Internal`DiracGammaMatrix[k, "Basis" -> "Majorana"] //  MatrixForm, {k, 4}]

If you copy this snippet to a notebook you have to add a line feed feed after each comment line.

POSTED BY: Hans Milton
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract