[NTG-context] Difficulties with \startformula

Elspeth McGullicuddy elspethmcgullicuddy at gmail.com
Tue Jan 14 00:13:03 CET 2014


Hi,

1- I put here a far too long example to show difficulties that I have
with formulas in conjunction with framed:
I haven't find a way to insert a formula (displaystyle, vertical
mode), at the beginning of a \framed.

2- It might be related with this other thing:
The last examples are about mouse text selection with Okular (haven't
tried with another viewer):

When I "mouse text select" elements of the formula, when the
\startformula \stopformula in embeded in a \hbox, what is highlighted
looks alright. Instead, when it's in "vertical mode", what is
highlighted is very very large.

It's probably not the purpose of pdf documents, but this select (and
copy) feature is very convenient. This feature is rather impinged with
this not so nice looking behavior. Also in these conditions Okular
can't select the text precisely, but instead select a much wider area
of text (one example here does this).

3- When embedded in \hbox (not vertical mode then), the height of
"mouse text section" is alright is formula is 'x+y', but there is an
error if the formula in instead '\int_a^b'.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\starttext

\setupformulas[spacebefore=-1ex]


\framed[width=5cm,align=yes]{%
Hello
}


\framed[width=5cm,align=yes]{%
Hello
\startformula
x+y
\stopformula
}

\framed[width=5cm,align=yes]{%
%Hello
\startformula
x+y
\stopformula
}

\framed[width=5cm,align=yes]{%
\vskip-1.3\baselineskip
\startformula
x+y
\stopformula
}

\framed[width=5cm,align=yes]{%
\hairline
\startformula
x+y
\stopformula
\hairline
}


\hairline
\startformula
x+y
\stopformula
\hairline

\framed[align=yes]{%
\type{\vrule \hrule \vbox $$}\\
\hbox{\vrule{\hsize=7cm\vbox{\hrule
$$
x+y
$$
\input{knuth}
\hrule}}\vrule}}



\framed[align=yes]{%
trying to select the ``x'' in the next formula, select text [\type{he
``xhe \vbox x+ syste conyer and}]\\
\type{\vrule \hrule \vbox \startformula}\\
\hbox{\vrule{\hsize=7cm\vbox{\hrule
\startformula
x+y
\stopformula
\input{knuth}
\hrule}}\vrule}}

\framed[align=yes]{%
\type{\framed \vbox \startformula}\\
\framed{%
{\hsize=5cm\vbox{%
\startformula
x+y
\stopformula
\input{knuth}
}}}}

\framed[align=yes]{%
\type{\framed $$}\\
\framed[align=yes,width=5cm]{%
$$
x+y
$$
\input{knuth}
}}

\startbuffer
\hbox{\vrule\startformula \int_a^b x+y \stopformula}
\stopbuffer

\framed[align=yes]{%
This line generates an error\\
\typebuffer}

\framed[align=yes]{%
When one ``text select'' with mouse with Okular, height of selection
is correct.\\
\hbox{\vrule\startformula x+y \stopformula}}

\framed[align=yes]{%
When one ``text select'' with mouse with Okular, height of selection
is much larger than expected.\\
\startformula x+y \stopformula}



\stoptext

%%%%%%%%%%%%%%%%%%%%

Regards,
Chris


More information about the ntg-context mailing list