Symbol for skeptical consequence (|~ aka snake)

How can I have a symbol like the one described in the link below in TeXmacs?
https://tex.stackexchange.com/questions/31466/symbol-for-skeptical-consequence

That symbol is used in logic to denote a non-monotonic inference relation.

In LaTeX I used this code
\newcommand\snake{\ensuremath{\mathrel{\resizebox{!}{\heightof{\gate}}{\TurnWavy}}}}

A minimal example in LaTeX is the following (I was not able to upload the pdf)

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathabx}
\usepackage{graphicx}
\usepackage{logix}
\newcommand\gate{\ensuremath{\mathrel{\Rule}}}
\newcommand\ngate{\ensuremath{\mathrel{\NotRule}}}
\newcommand\snake{\ensuremath{\mathrel{\resizebox{!}{\heightof{\gate}}{\TurnWavy}}}}
\newcommand\nsnake{\ensuremath{\mathrel{\resizebox{!}{\heightof{\ngate}}{\NotTurnWavy}}}}
%%%%%%%%%% Start TeXmacs macros
\newcommand{\tmop}[1]{\ensuremath{\operatorname{#1}}}
%%%%%%%%%% End TeXmacs macros
\begin{document}
\centerline{\Large{\textbf{Translation rule \tmop{Cn}, \tmop{Inf} / \gate, \snake}}}
\begin{displaymath}a \in \tmop{Cn}(H) \iff H \gate a\end{displaymath}
%
\begin{displaymath}a \in \tmop{Inf}(H) \iff H \snake a\end{displaymath}
\end{document}

Hi @Aigor and welcome to the forum.
I do not have immediately the time to try and compose the character myself, but here is a hint: you can compose new symbols using the functions in the “Format” menu: pls. see this forum message, from which I took my words and where you can find an example

In particular look in the submenus Adjust, Transform and Special.

Thank you for the info.
My current version for TeXmacs is now produced with this code
<math|<resize|<superpose|||<shift|<math|<sim>>|1pt|>>||||>>

Nice. I suggest you use the width in em units, not in pt units. I think that in this way your definition will be ok for all font sizes. Moreover, I think you may take away the resize tag (you are not resizing) and also the inner math tag (the outer is enough).
Pls. let me know if you need help with any of that.

An idea is

<superpose|\||<shift|\<sim\>|.08em|0>>
1 Like

Thank you for the info. Now I have done this macro

<assign|snake|<macro|<math|<superpose|\||<shift|\<sim\>|.1em|>>>>>

It looks nice. The following snippet

<math|a\<vdash\>b <snake> c>

is show in TeXmacs as
parvula
A nice improvement would be to have \snake with the same height as \vdash.
In LaTex this is done with

\resizebox{!}{\heightof{\gate}}{\TurnWavy}
ydim = set height of \TurnWavy the same as the one of \gate
xdim = keep original scale ratio

In TeXmacs still I don’t know how to do this.

I suggest experimenting with the function Format → Font effects → Magnify vertically to achieve your desired height. Alternatively, you could also try using the macro <with|magnification|1|...>, replacing “1” with any magnification degree you find suitable.

1 Like

Let me think if in addition to the suggestion of @xuyiqi1 there is something else as well.

Besides, I think that one should also tell TeXmacs that the snake is a relational operator, so that TeXmacs spaces it with respect to its left and right hand sides.

I looked in the manual and I came up with

<assign|snake|<macro|<math|<syntax|<superpose|\||<shift|\<sim\>|.1em|>>|\<less\>>>>>

which I think tells TeXmacs to treat the snake as a relational symbol.

1 Like

Using the received info, the current version is grown to the following macro:

<assign|snake|<macro|<math|<syntax|<move|<with|vmagnified-factor|0.76|hmagnified-factor|0.76|<hmagnified|<vmagnified|<superpose|\||<shift|\<sim\>|.1em|>>>>>||.18em>|\<less\>>>>>

The produced typesetting looks like this example:

snake

Thi is good enough for me. :grinning:

A possible improvement could be to take the size(s) of ⊢ and use this info to compute vmagnified-factor and hmagnified-factor

1 Like

If you’d like to capture the vertical segment from the symbol , I suggest trying the function Format → Adjust → Clip with a suitable right position chosen so that the horizontal segement can be hidden. After a quick test, <clipped|\<vdash\>|||0.1em|> should do the trick.

In addition to @pireddag’s helpful suggestion, TeXmacs also offers a simple but equivalent syntax macro <math-relation|...> that mimics the nice-looking spacing of .

Last iteration (I suppose). :grinning:
The macro became smaller

<assign|snake|<macro|<math|<math-relation|<superpose|<clipped|\<vdash\>|||0.1em|>|<shift|<with|hmagnified-factor|0.8|<hmagnified|\<sim\>>>|.04em|.1em>>>>>>

Capture

2 Likes