1

I want to modify the following lines of code

\documentclass{article}
\usepackage{amsmath,amssymb}
\def\forkindep{\mathrel{\raise0.2ex\hbox{\ooalign{\hidewidth$\vert^{d}$\hidewidth\cr\raise-0.9ex\hbox{$\smile$}}}}}

 \begin{document}
 $A \underset{C}{\forkindep}B$
 \end{document}

found in What is the LaTeX symbol for "forking independent" (model theory)? to have a line followed by a prime symbol (i.e. |') in the forking independence relation. I attempted to do this by changing the $\vert$ to $\vert^{'}$. However this cause the line segment to not align properly with the smile symbol (I want the line segment bisect the smile, but it is a little to the left the command). I was wondering how I could fix this issue.

6
  • welcome to tex.sx. you should be able to treat the prime as having no width; try $\vert\rlap{{}^\prime}$. (you may have to invoke math mode inside the \rlap, as \rlap{${}^\prime$}; (i'm not in a position to test at the moment). Mar 12, 2016 at 1:46
  • @barbarabeeton: That didn't work. It ended up pushing the line even more to the left.
    – user100492
    Mar 12, 2016 at 2:13
  • Try \llap ? It would be much easier if you posted a complete minimal example.
    – cfr
    Mar 12, 2016 at 2:33
  • @barbarabeeton I'm sorry. You suggestion worked! I had changed the code a bit, trying to get it to work and didn't realize till now. Thank you!
    – user100492
    Mar 12, 2016 at 3:51
  • Welcome to TeX.SX!! It is better to post a full minimal working example that starts with a \documentclass command, has a minimal preamble and then \begin{document}...\end{document}. Unless the problem is a compilation error, the code should compile and be as small as possible to demonstrate your problem. This makes it much easier for people to help you --- and much more likely that they will!
    – user30471
    Mar 12, 2016 at 4:46

1 Answer 1

0

I can offer a variant of my solution to the problem of the linked question:

\documentclass[a4paper]{article}
\newcommand{\forkindep}[1][]{%
  \mathrel{
    \mathop{
      \vcenter{
        \hbox{\oalign{\noalign{\kern-.3ex}\hfil$\vert$\hfil\cr
              \noalign{\kern-.7ex}
              $\smile$\cr\noalign{\kern-.3ex}}}
      }
    }\displaylimits_{#1}
  }
}
\newcommand{\nonforkindep}[1][]{%
  \mathrel{
    \mathop{
      \vcenter{
        \hbox{\oalign{\noalign{\kern-.3ex}\hfil$\vert$\rlap{$'$}\hfil\cr
              \noalign{\kern-.7ex}
              $\smile$\cr\noalign{\kern-.3ex}}}
      }
    }\displaylimits_{#1}
  }
}

\begin{document}
$A\forkindep[C]B$ $A\nonforkindep[C]B$
\[
A\forkindep[C]B\quad A\nonforkindep[C]B
\]
\end{document}

enter image description here

You must log in to answer this question.