Skip to main content
Alternative palette
Source Link
Jens
  • 97.9k
  • 7
  • 215
  • 510

Here is a palette that does the slashing when you select a character and press the button:

CreatePalette[{Button["Slash it!", 
    NotebookWrite[InputNotebook[], 
     Replace[FromCharacterCode[
       Join[ToCharacterCode[
         ToString[NotebookRead[InputNotebook[]]]], {824}]], 
      FromCharacterCode[{8706, 824}] :> 
       OverlayBox[{"\<\[PartialD]\>", "\</\>"}]]]]}];

It uses the unicode character for a combining solidus (824). This adds the slash to whatever character is printed in front of it.

Edit

Because operators such as $\partial$ don't allow combining marks in Mathematica, I had to add special treatment for $\partial$ in the form of an OverlayBox. All I do is look for the result of the unicode combination to contain the sequence of characters corresponding to $\partial$ and the combining solidus, then replace that particular combination by an overlay. Using an Overlay in all cases may also be workable, but I thought it's better to rely on the alignment provided by the built-in Unicode functionality.

Edit 2

While the above palette yields (I think) a cleverer representation of most slashed characters based on the Unicode standard, it doesn't seem to work on all platforms (it does work on Mac). Therefore, here is a simpler version that uses only OverlayBoxes:

CreatePalette[{Button["Slash it!", 
    NotebookWrite[InputNotebook[], 
     OverlayBox[{"\<" <> ToString[NotebookRead[InputNotebook[]]] <> 
        "\>", "\</\>"}]]]}];

To use either of these palettes, select the desired character in the notebook, hit the button, and you're done.

Here is a palette that does the slashing when you select a character and press the button:

CreatePalette[{Button["Slash it!", 
    NotebookWrite[InputNotebook[], 
     Replace[FromCharacterCode[
       Join[ToCharacterCode[
         ToString[NotebookRead[InputNotebook[]]]], {824}]], 
      FromCharacterCode[{8706, 824}] :> 
       OverlayBox[{"\<\[PartialD]\>", "\</\>"}]]]]}];

It uses the unicode character for a combining solidus (824). This adds the slash to whatever character is printed in front of it.

Edit

Because operators such as $\partial$ don't allow combining marks in Mathematica, I had to add special treatment for $\partial$ in the form of an OverlayBox. All I do is look for the result of the unicode combination to contain the sequence of characters corresponding to $\partial$ and the combining solidus, then replace that particular combination by an overlay. Using an Overlay in all cases may also be workable, but I thought it's better to rely on the alignment provided by the built-in Unicode functionality.

Here is a palette that does the slashing when you select a character and press the button:

CreatePalette[{Button["Slash it!", 
    NotebookWrite[InputNotebook[], 
     Replace[FromCharacterCode[
       Join[ToCharacterCode[
         ToString[NotebookRead[InputNotebook[]]]], {824}]], 
      FromCharacterCode[{8706, 824}] :> 
       OverlayBox[{"\<\[PartialD]\>", "\</\>"}]]]]}];

It uses the unicode character for a combining solidus (824). This adds the slash to whatever character is printed in front of it.

Edit

Because operators such as $\partial$ don't allow combining marks in Mathematica, I had to add special treatment for $\partial$ in the form of an OverlayBox. All I do is look for the result of the unicode combination to contain the sequence of characters corresponding to $\partial$ and the combining solidus, then replace that particular combination by an overlay. Using an Overlay in all cases may also be workable, but I thought it's better to rely on the alignment provided by the built-in Unicode functionality.

Edit 2

While the above palette yields (I think) a cleverer representation of most slashed characters based on the Unicode standard, it doesn't seem to work on all platforms (it does work on Mac). Therefore, here is a simpler version that uses only OverlayBoxes:

CreatePalette[{Button["Slash it!", 
    NotebookWrite[InputNotebook[], 
     OverlayBox[{"\<" <> ToString[NotebookRead[InputNotebook[]]] <> 
        "\>", "\</\>"}]]]}];

To use either of these palettes, select the desired character in the notebook, hit the button, and you're done.

partial can be handled now
Source Link
Jens
  • 97.9k
  • 7
  • 215
  • 510

Here is a palette that does the slashing when you select a character and press the button:

CreatePalette[{Button["Slash it!", 
    NotebookWrite[InputNotebook[], 
     Replace[FromCharacterCode[
       Join[ToCharacterCode[
         ToString[NotebookRead[InputNotebook[]]]], {824}]], 
      FromCharacterCode[{8706, 824}] :> 
       OverlayBox[{"\<\[PartialD]\>", "\</\>"}]]]]}];

It uses the unicode character for a combining solidus (824). This adds the slash to whatever character is printed in front of it.

Edit

Because operators such as $\partial$ don't allow combining marks in Mathematica, I had to add special treatment for $\partial$ in the form of an OverlayBox. All I do is look for the result of the unicode combination to contain the sequence of characters corresponding to $\partial$ and the combining solidus, then replace that particular combination by an overlay. Using an Overlay in all cases may also be workable, but I thought it's better to rely on the alignment provided by the built-in Unicode functionality.

Here is a palette that does the slashing when you select a character and press the button:

CreatePalette[{Button["Slash it!", 
    NotebookWrite[InputNotebook[], 
     Replace[FromCharacterCode[
       Join[ToCharacterCode[
         ToString[NotebookRead[InputNotebook[]]]], {824}]], 
      FromCharacterCode[{8706, 824}] :> 
       OverlayBox[{"\<\[PartialD]\>", "\</\>"}]]]]}];

It uses the unicode character for a combining solidus (824). This adds the slash to whatever character is printed in front of it.

Edit

Because operators such as $\partial$ don't allow combining marks in Mathematica, I had to add special treatment for $\partial$ in the form of an OverlayBox.

Here is a palette that does the slashing when you select a character and press the button:

CreatePalette[{Button["Slash it!", 
    NotebookWrite[InputNotebook[], 
     Replace[FromCharacterCode[
       Join[ToCharacterCode[
         ToString[NotebookRead[InputNotebook[]]]], {824}]], 
      FromCharacterCode[{8706, 824}] :> 
       OverlayBox[{"\<\[PartialD]\>", "\</\>"}]]]]}];

It uses the unicode character for a combining solidus (824). This adds the slash to whatever character is printed in front of it.

Edit

Because operators such as $\partial$ don't allow combining marks in Mathematica, I had to add special treatment for $\partial$ in the form of an OverlayBox. All I do is look for the result of the unicode combination to contain the sequence of characters corresponding to $\partial$ and the combining solidus, then replace that particular combination by an overlay. Using an Overlay in all cases may also be workable, but I thought it's better to rely on the alignment provided by the built-in Unicode functionality.

partial can be handled now
Source Link
Jens
  • 97.9k
  • 7
  • 215
  • 510

Here is a palette that does the slashing when you select a character and press the button:

CreatePalette[{Button["Slash it!", 
    NotebookWrite[InputNotebook[], 
     FromCharacterCode[Replace[FromCharacterCode[
       Join[ToCharacterCode[
         ToString[NotebookRead[InputNotebook[]]]], {824}]], 
      FromCharacterCode[{8706, 824}] :> 
       OverlayBox[{"\<\[PartialD]\>", "\</\>"}]]]]}];

It uses the unicode character for a combining solidus (824). This adds the slash to whatever character is printed in front of it.

Edit

Because operators such as $\partial$ don't allow combining marks in Mathematica, I had to add special treatment for $\partial$ in the form of an OverlayBox.

Here is a palette that does the slashing when you select a character and press the button:

CreatePalette[{Button["Slash it!", NotebookWrite[InputNotebook[],
     FromCharacterCode[
      Join[ToCharacterCode[
        ToString[NotebookRead[InputNotebook[]]]], {824}]]]]}];

It uses the unicode character for a combining solidus (824). This adds the slash to whatever character is printed in front of it.

Here is a palette that does the slashing when you select a character and press the button:

CreatePalette[{Button["Slash it!", 
    NotebookWrite[InputNotebook[], 
     Replace[FromCharacterCode[
       Join[ToCharacterCode[
         ToString[NotebookRead[InputNotebook[]]]], {824}]], 
      FromCharacterCode[{8706, 824}] :> 
       OverlayBox[{"\<\[PartialD]\>", "\</\>"}]]]]}];

It uses the unicode character for a combining solidus (824). This adds the slash to whatever character is printed in front of it.

Edit

Because operators such as $\partial$ don't allow combining marks in Mathematica, I had to add special treatment for $\partial$ in the form of an OverlayBox.

Source Link
Jens
  • 97.9k
  • 7
  • 215
  • 510
Loading