# ConTeXt: Get edges of frames without intersections with other edges. Vertical lines between words

I was wandering if it would be possible and not a daunting task to obtain in ConTeXt the edges of a frame excluding its intersection with other two edges. By an example, to obtain the left edge without points also in bottom and top edges. I think it could be very useful if one wants to draw thick vertical lines between words, cause one can manage very easily the height of the vertical line (a lateral edge of a frame) in a way that this height doesn't change with the thickness. I looked for a solution but I found nothing. Perhaps in order to implement that, one must touch very deep the code that controls the behaviour of \framed. Or in general, the problem is to find a way of putting (in title) a vertical line controlling at the same time and independently: a) its thickness; b) its bottom line c) its top line. The issue with boxes is something that could solve it, but I don't know if it is an efficient way, and I cannot figure out some another. The problem can be set this way:

Consider this code:

\setupalign[hanging]
\definecolor[marca][red]
[chapter]
[
page=yes,sectionsegments=chapter,
before={\blank[force,4*line]},
after={\blank[4*line]},strut=no,
command=\mychap, numberstyle=\tfd
]

\definebodyfontenvironment[default][d=3.3]

\defineframed
[chapterframeda]
[
offset=0em,
frame=off,
strut=no,
align={flushright,nothypenated},
location=top,
foregroundstyle=sans,
rulethickness=5pt
]

\defineframed
[chapterframedb]
[
offset=0em,
%frame=off,
strut=no,
align={flushleft,nothypenated},
location=top,
foregroundstyle=sans,
rulethickness=5pt,
]

\define[2]\mychap
{\hbox \bgroup
%\hfill
\chapterframeda[width=2cm, framecolor=marca]{#1}
\chapterframedb[width=\textwidth,framecolor=marca,leftframe=on,align=normal,location=bottom]{#2}
\egroup}

\setuppagenumbering
[alternative=doublesided,
location=]

[style=\ss, strut=no]

\getmarking[chapter][current]
\stopsetups

\quad\chapterframedb[framecolor=marca, leftframe=on,align=normal,location=top]{Platonismo pleno y estructuralismo {\it ante rem}}
\stopsetups

\definetext
[chapterstart]
[footer]
[pagenumber]

\newdimen\Margin
\Margin=3cm

\newdimen\MarginRaise
\MarginRaise=56ex

\setuplayout
[
backspace=4.3cm,
width=fit,
height=middle,footer=\bodyfontsize,
bottom=3\bodyfontsize,
location={middle,doublesided},
margin=\Margin,
rightmargin=3.5cm,
marking=on
]

\showgrid

\starttext

\chapter{Presentación de la doctrina}

\stoptext


The two frames are there only to provide a vertical line as separator between number and text, the left edge of the frame created with \chapterframedb. But I am looking for a separator of exactly the height of the text inside the frame, in both cases the height of the initial "P". I thought that if I could obtain the left edge of that frame without the points that belongs also to the top or bottom edges, this could be done trivially. But I don't know if it is feasible and i've tryied others methods to obtain a separator of which I could decide its bottom, its top and its thikness all at a time, and I 've obtained nothing.

• Just so that I understand correctly, you want a frame with different thickness of the top line and the bottom line? Usually, this is done with metapost. If you can show some visual examples of what you want, i can post the corresponding metapost code. Aug 10, 2016 at 2:49
• I've edited the question. Thank you very much for your interest. Aug 10, 2016 at 5:21

I wouldn't use any fancy \framed solution but just the good old \vrule. If you don't specify height and depth the \vrule will assume the height and depth of the current line.

\definecolor[marca][red]
[chapter]
[
page=no, % for this example
strut=no,
command=\mychap,
numberstyle=\tfd,
]

\definebodyfontenvironment[default][d=3.3]

\define[2]\mychap
\dontleavehmode
\hbox to 2cm {\hss #1\hskip10pt}%
\hskip15pt
\vtop{%
\hsize=\dimexpr\textwidth-2cm-15pt
\hskip-15pt\color[marca]{\vrule width 5pt}\hskip10pt
#2}%
}

\showgrid

\starttext

\startchapter[title={Presentación de la doctrina and some more text to force a linebreak}]
\stopchapter

\startchapter[title={g}]
\stopchapter

\stoptext


For this solution the title of your chapter shouldn't be longer than one line but the code is easier.

\definecolor[marca][red]
[chapter]
[
page=no, % for this example
strut=no,
command=\mychap,
numberstyle=\tfd,
]

\definebodyfontenvironment[default][d=3.3]

\define[2]\mychap
{\hbox \bgroup
\hbox to 2cm {\hss #1\ }%
\hbox to \dimexpr\textwidth-2cm {\color[marca]{\vrule width 5pt}\ #2\hss}
\egroup}

\showgrid

\starttext

\startchapter[title={Presentación de la doctrina}]
\stopchapter

\startchapter[title={g}]
\stopchapter

\stoptext