How to get the 'original' maty symbol after show rule?

Hi! In my code I’ve applied the following showrule:

#show math.xor: math.underline(math.or)

However, at some point in the same document, I want to go back to the original xor symbol ⊕, but it seems that both#math.plus.o and the unicode symbol are affected by the show rule. Is there a way to do this?

It seems to be that the best way would be to just define your own underlined or symbol:

#let uor = math.class(
  "binary",
  math.underline(math.or)
)

If you really need it to be done by a show rule on xor, the only way I can think of doing this is to keep track of a state about whether or not you want to show the underlined or default xor symbol:

#let force-xor = state("force-xor", false)
#let defaultxor = force-xor.update(true) + math.xor + force-xor.update(false)

#show math.xor: it => context {
  if force-xor.get() {
    return it
  }
  return math.underline(math.or)
}

$defaultxor xor$
1 Like

Another way is instead of using a show rule, redefine xor to be what you want, then use std.math.xor when you want the normal one:

#let xor = math.underline(math.or)

$ xor $
$ std.math.xor $

image