3

I'm working on a small package to manage QRH (a sort of checklist for aeronautical purposes). I want to print a line with arrows on the left of the paragraph, possibly with text in the middle, like in the figure:

arrows

Currently I'm using siderules of mdframed package, as suggested here, but I'm able to produce only a straight vertical line, without arrows and without text.

Anyone has some idea? :)

1
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – user31729
    Commented May 4, 2015 at 8:40

2 Answers 2

3

tikzmark could be one option:

\documentclass{article}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{description}
\item[\tikzmark{a}Blabla text here:] \lipsum[1]
\item[\tikzmark{b}Blabla text here:] \lipsum[1]
\end{description}

\tikz[remember picture,<->] \draw[overlay] ([yshift=1ex]pic cs:a) --++(-0.5,0)  |- ([yshift=1ex]pic cs:b) node[midway, pos=0.25, fill=white]{text};
\end{document}

enter image description here

2

Here I use a macro approach, \connect{text}{lines}, where lines is the multiple of baselineskip to the connecting line. It can be a non-integer if there are added vertical spaces to contend with (e.g., \topskip and such).

Because the decoration is employed using the tabto package, the \connect{}{} macro can be issued at any place on the starting line of the connection.

EDITED to handle negative <lines> argument, which can reach upward. This can be useful to connect to display math, for which \connect is not valid.

\documentclass{article}
\usepackage{stackengine,tabto}
\newlength\tmplen
\setstackEOL{\cr}
\newcommand\connect[2]{%
  \setstackgap{S}{0pt}%
  \tabto*{0in}%
  \setlength\tmplen{\dimexpr#2\baselineskip-\baselineskip}%
  \setlength\tmplen{.5\tmplen}%
  \ifdim\tmplen>0pt\relax
  \smash{\raisebox{2.5pt}{\makebox[0pt][r]{%
    \Shortunderstack[l]{%
      \smash{\raisebox{-2.7pt}{\rarrow}}\cr
      \protect\rule{.5pt}{\tmplen}\cr
      \makebox[0pt]{#1\strut}\cr
      \protect\rule{.5pt}{\tmplen}%
      \smash{\raisebox{-2.4pt}{\rarrow}}\cr
    }%
  }}}%
  \else
    \setlength\tmplen{-\tmplen}%
    \smash{\raisebox{2.5pt}{\makebox[0pt][r]{%
    \Shortstack[l]{%
      \smash{\raisebox{-2.7pt}{\rarrow}}\cr
      \protect\rule{.5pt}{\tmplen}\cr
      \makebox[0pt]{#1\strut}\cr
      \protect\rule{.5pt}{\tmplen}%
      \smash{\raisebox{-2.4pt}{\rarrow}}\cr
    }%
  }}}%
  \fi
  \tabto{\TabPrevPos}%
}
\def\rarrow{$\kern-.7pt{-}\kern-2pt{-}\kern-2pt{\rightarrow}$}
\begin{document}
\noindent\connect{OR}{4}\textbf{Blabla text here}\par
   Blabla text here\par
   Blabla text here\par
   Blabla text here\par
\noindent\textbf{Blabla text here}\par
   Blabla text here\par
   Blabla text here\par
   Blabla text here\par
\noindent\connect{AND}{6}\textbf{Blabla text here}\par
   Blabla text here\par
   Blabla text here\par
   Blabla text here\par
   Blabla text here\par
   Blabla text here\par
\noindent\textbf{Blabla text here}\par
   Blabla text here\par
   Blabla text here\par
   Blabla text here\par
   Blabla text here\par
   Blabla text here\par
   Blabla text here\par
\[
  y = mx + b
\]
   Blabla text here\par
   Blabla text here\par
   \noindent \connect{Math!}{-1.8}Blabla text here\par
\end{document}

enter image description here

4
  • This is super cool. Is there any way how this could work with equations?
    – jak
    Commented Jul 10, 2018 at 7:38
  • @JakobH I don't believe that tabto works in display math. The closest I could come (for unnumbered display math) is Blabla text here\par \medskip \connect{Hmm}{3.5}\centerline{$y = mx + b$}\par \medskip Blabla text here\par Blabla text here\par Blabla text here\par Commented Jul 10, 2018 at 9:48
  • @JakobH See also tex.stackexchange.com/questions/263480/… Commented Jul 10, 2018 at 9:50
  • @JakobH See my edit. You cannot use \connect in display math, but you can backward connect to it with the use of a negative argument for the 2nd argument of \connect. Commented Jul 10, 2018 at 10:36

You must log in to answer this question.

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