# Option precedence for CellLabel

In Mathematica, when an option is specified multiple times with different values, the first one will take precedence. This works with Cell and Background:

CellPrint@Cell["asd", "Text", Background -> Red, Background -> Blue]


However, with the CellLabel option, the last one seems to take precedence. This is unique and unusual. Is this a bug, or intentional? Is there any reason why it should be like this? Are there other options with such behaviour?

CellPrint@Cell["asd", "Text", CellLabel -> "one", CellLabel -> "two"]


• Wanted to test this but coudln't because I usually hav switched off CellLabels but where to switch them on again? It used to be in the Preferences (like so) but it is not anymore. Where has that menu gone? – gwr Mar 25 '17 at 21:29
• @gwr I am not sure, but I would try Option Inspector, Global Preferences (dropdown at top left), then search for ShowCellLabel. If it's False, set it to True. In 11.1, many options were removed from the Preferences GUI to simplify things. These are always retained in the Option Inspector, but may have a more technical name there. – Szabolcs Mar 25 '17 at 21:31
• Thanks: SetOptions[EvaluationNotebook[], ShowCellLabel -> True] there we go. – gwr Mar 25 '17 at 21:38
• Couldn't it be related to whether Association is used to represent large chunks of options internally: With Options usually a symbol is changed by a rule and therefore a later rule will not affect it anymore. With Association the last value given to a Key counts. – gwr Mar 25 '17 at 21:41
• @gwr I don't think it is related to associations for two reasons: (1) It's the same in v9 (2) These options seem to be handled by the front end (not kernel), which probably doesn't know anything about associations. At first, I suspected that the front end is different from the kernel in that it always preserves the last (not first) option. But that is not the case as demonstrated with the Background option in the post. – Szabolcs Mar 26 '17 at 15:04