3

In the following output, I would like the texts "ou" to be aligned with the first line of each cell. Maybe a yshift can do the job. But in that case, which length should be preferred?

enter image description here

Here is the M(erely)WE used.

\documentclass[varwidth, border = 3pt]{standalone}

\usepackage{witharrows}
\usepackage{tabularray}
\UseTblrLibrary{tikz}

\newcommand\testit{
    \begin{WithArrows}[right-overlap = false, format = l]
        f(x)   \ge g(x)   \Arrow{S1} \\
        f(x)^2 \ge g(x)^2 \Arrow{S2} \\
        f(x)^2 - g(x)^2 \ge 0
    \end{WithArrows}
}

\begin{document}

\begin{tblrtikzabove}
  \node at (v2) [fill=white, inner sep=2pt] {ou};
  \node at (v3) [fill=white, inner sep=2pt] {ou};
\end{tblrtikzabove}%
\begin{tblr}{
    vline{2-Y},
    colsep = 10pt,
    cells  = {mode = math}
}
      \testit 
    & ABC
    & \testit
\end{tblr}


\begin{tblrtikzabove}
  \node at (v2) [fill=white, inner sep=2pt] {ou};
  \node at (v3) [fill=white, inner sep=2pt] {ou};
\end{tblrtikzabove}%
\begin{tblr}{
    vline{2-Y},
    colsep = 10pt,
    cells  = {mode = math}
}
    A & B & C
    \\
    A & B & C
\end{tblr}

\end{document}
4
  • Have a look at the new tikz tabularray library. Commented May 10 at 21:36
  • Question updated. Just remove our comments, if you want. Commented May 10 at 21:46
  • What do you mean with "better place"? Commented May 10 at 21:49
  • I would like the texts "ou" to be aligned with the first line of each cell. Maybe a yshift can do the job. But in that case, which length should be preferred? Commented May 10 at 21:52

1 Answer 1

2

Instead of using the coordinates from the vertical line, you could place your node at the .base east coordinate of the cell left to it:

\documentclass[varwidth, border = 3pt]{standalone}

\usepackage{witharrows}
\usepackage{tabularray}
\UseTblrLibrary{tikz}




\newcommand\testit{
    \begin{WithArrows}[right-overlap = false, format = l]
        f(x)   \ge g(x)   \Arrow{S1} \\
        f(x)^2 \ge g(x)^2 \Arrow{S2} \\
        f(x)^2 - g(x)^2 \ge 0
    \end{WithArrows}
}

\begin{document}

\begin{tblrtikzabove}
  \node at (1-1.base east) [fill=white, anchor=base, text height=\baselineskip] {ou};
  \node at (1-2.base east) [fill=white, anchor=base, text height=\baselineskip] {ou};
\end{tblrtikzabove}%
\begin{tblr}{
    vline{2-Y},
    colsep = 10pt,
    cells  = {mode = math}
}
      \testit 
    & ABC
    & \testit
\end{tblr}


\begin{tblrtikzabove}
  \node at (1-1.base east) [fill=white, anchor=base, text height=\baselineskip] {ou};
  \node at (1-2.base east) [fill=white, anchor=base, text height=\baselineskip] {ou};
\end{tblrtikzabove}%
\begin{tblr}{
    vline{2-Y},
    colsep = 10pt,
    cells  = {mode = math}
}
    A & B & C
    \\
    A & B & C
\end{tblr}

\end{document}

enter image description here

2
  • Great. Ready to put in prod. :-) Commented May 10 at 22:24
  • 1
    @projetmbc You're welcome! Commented May 10 at 22:24

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.