ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] horizontal line in math align environment
@ 2024-08-26  9:39 niklas
  0 siblings, 0 replies; only message in thread
From: niklas @ 2024-08-26  9:39 UTC (permalink / raw)
  To: ntg-context

Hi everyone,

I’m working on creating a horizontal line within a math align environment that spans the entire equation, rather than being restricted by the columns. My current "solution" is to use `\hl`, as shown below:

```
\startformula
\startalign
\NC  a + b \NC = c \NR
\NC  d + e \NC = f \NR
\NC  \hl[4]\NC \hl[4] \NR
\NC  g + h \NC = i \NR
\stopalign
\stopformula
```

While this somewhat works, it’s not exactly what I’m aiming for. I need the line to extend across the full width of the equation. My final goal is something like this:

\startformula 
\startalign[n=11]
\NC   \NC 1001 \NC \rightarrow \NC 1000 \NC + \NC 000 \NC + \NC 00 \NC + \NC 1 \NR
\NC + \NC 100  \NC \rightarrow \NC      \NC   \NC 100 \NC + \NC 00 \NC + \NC 0 \NR
% here should be a horizontal line
\NC   \NC      \NC \rightarrow \NC 1000 \NC + \NC 100 \NC + \NC 00 \NC + \NC 1 \NR
\NC   \NC      \NC \rightarrow \NC 1101 \NC   \NC     \NC   \NC    \NC   \NC   \NR
% here should be a horizontal line
\NC = \NC 1101 \NC             \NC      \NC   \NC     \NC   \NC    \NC   \NC   \NR
\stopalign
 \stopformula

The horizontal line should not take the height of a hole line.

I also considered using `\underline{}`, but it wont span across multiple columns. I’ve heard of `\noalign`, but I couldn’t find any helpful resources on it, and my attempts to use it were unsuccessful.

In LaTeX, the desired outcome would be something like this:

```
\begin{equation*}
  \begin{split}
    x &= 1 \\
    y &= 2 \\
    \hline
    x + y &= 3 
  \end{split}
\end{equation*}
```

Does anyone have suggestions for achieving this effect in ConTeXt?

Thank you in advance for your help!

Best regards,

Niklas von Hirschfeld
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-26  9:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-26  9:39 [NTG-context] horizontal line in math align environment niklas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).