0

In Schechter's Classical and nonclassical logics, he distinguishes symbols at the semantic level, from those at the syntactic level, by encircling the operators. For example, formal logic uses "∧" (\wedge) for conjunction, while semantic logic uses an encircled version, which can be implemented by \owedge from the stmaryrd package:

owedge symbol

But semantic operators corresponding to implication ("→", \rightarrow) and negation ("¬", \neg) don't exist among the usual symbols. How can these be generated in such a way that they can be used from LyX?

2 Answers 2

2

Personally, I keep all of my math macros in a separate LyX file that I can then include from other LyX documents (via Insert > File > Child Document). The solution requires placing some of the LaTeX code in a LyX preamble (because LyX macros can't handle the \mathpalette macro's structure). So I also have a separate LaTeX file for the preamble code, which I can then \input{…} in the "LaTeX preamble" setting of both the child and parent LyX documents.

In math-macros-preamble.tex, I place:

\newcommand{\semanticlogic}[2]{\ooalign{$\m@th#1\ocircle$\cr\scalebox{0.9}[1]{$\m@th#1#2$}\cr}}

\newcommand{\encircled}[1]{\mathpalette\semanticlogic{#1}}

\semanticlogic is a macro that takes as its arguments (1) the style macro (provided by \mathpalette) and (2) the operator to be encircled. The \encircled macro wraps \mathpalette so that it's easy to use inside a LyX macro.

In math-macros.lyx, I add \input{math-macros-preamble} to its preamble, then define a macro from \newcommand{\oimplies}{\mathbin{\encircled{\shortrightarrow}}}, giving it a LyX representation like \mathbin{$\ocircle\shortrightarrow$} so that it looks nicer when inlined into the parent document. Similarly, I create \onot as \encircled{\mkern1mu \neg}.

In the parent document, where I use the logic operators, I also add \input{math-macros-preamble} to its preamble, and include math-macros.lyx as a child document.

example semantic relation with operators

1
  • A related answer—tex.stackexchange.com/questions/53698/…—covers the case where the encircled operator should be centered. Here the operators are left-aligned, as in Schechter's book. It's a matter of taste, certainly.
    – Mike
    May 24, 2022 at 19:55
1

The circle is a bit thicker, but I believe the emulation is passable.

\documentclass{article}
\usepackage{amsmath,stmaryrd,graphicx}

\makeatletter
\newcommand{\orightarrow}{\mathrel{\mathpalette\math@circled\rightarrow}}
\newcommand{\oleftarrow}{\mathrel{\mathpalette\math@circled\leftarrow}}
\newcommand{\olnot}{\mathord{\mathpalette\math@circled\lnot}}

\newcommand{\math@circled}[2]{%
  \begingroup
  \sbox0{$\m@th#1\owedge$}%
  \sbox2{$\m@th#1\mskip1mu$}%
  \raisebox{\wd2}{%
    \resizebox{\wd\z@}{!}{%
      \ooalign{$\m@th#1\varbigcirc$\cr\hidewidth$\m@th#1#2$\hidewidth\cr}%
    }%
  }%
  \endgroup
}
\makeatother

\begin{document}

$X\orightarrow Y\owedge \olnot Z\oleftarrow U$

{\ooalign{$\orightarrow$\cr$\owedge$\cr}}

\end{document}

enter image description here

The second line is to show that the symbol have the same dimensions.

Whether you're able to use this with LyX, I don't know.

2
  • \mathord is new to me. Is it really necessary?
    – Mike
    May 25, 2022 at 7:10
  • @Mike Not really necessary, but logically better to have it
    – egreg
    May 25, 2022 at 7:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .