[NTG-context] separators between non-instantiantiated (foot)notes

2023-04-03 Thread Rudd, Kevin via ntg-context
Is there a better (automatic, consistent) way to insert separators between 
non-instantiated (foot)notes (i.e., where there is at least one \note involved 
with an immediately preceeding/following \footnote or \note? looking at the 
source, the obvious hack was apparent but ... not ideal. Maybe I'm missing 
something obvious, but from what I see:


\starttext
something that works
\footnote[a]{}
\footnote[b]{BB}

something that doesn't
\footnote[c]{CC}
\note[b]

something else that doesn't
\footnote[d]{}
\unprotect\strc_notes_inject_separator\protect
\note[b]

but can be made to work, but does not adapt to \quotation{normal} 
\type{\footnote} style/format customizations
\footnote[e]{E E E E}%
\high{\tx{,}}
\note[a]
\stoptext


It would be great if there were a command that treated a (some command like) 
\note as a \footnote-equivalent command for typesetting purposes but I'm not 
sure how/where the appropriate template that could produce this command might 
go. (And I don't know if there are? footnote-state subtleties that I'm missing  
that would make this kind of thing non-trivial to implement.)'


Many thanks,

 -K


Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)

Computing Systems Researcher
Computer Architecture & Computer Engineering  (CACE)
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)
ke...@lps.umd.edu

Visiting Research Professor
Electrical and Computer Engineering
United States Naval Academy
r...@usna.edu

Adjunct Faculty
Secure, Trusted, and Assured Microelectronics (STAM) Center
Arizona State University
kevin.r...@asu.edu

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Outlined text (from MP) inline in ConText has incorrect baseline (i.e. no depth)

2021-10-12 Thread Rudd, Kevin via ntg-context
Ok, now that I've had some time to experiment with effects and attributes, 
here's what I ended up with. It uses an overlaid double draw to create outlined 
text with optional fill (white), border (black). I've only tested it with words 
so haven't worked out how it could be adapted to support longer strings (e.g. 
the \hbox+\rlap hack likely will disappoint/fail in that case). For parameter 
simplicity, I don't allow specifying the outline width separately; but that 
might be another good exercise to use key–value parameters instead.

Thanks for the help,
 ---K



% \OutlinedText[fill][outline]{text}
\def\OutlinedText{\dodoubleempty\doOutlinedText}

\def\doOutlinedText[#1][#2]#3%
{%
\ifsecondargument
\makeOutlinedText{#1}{#2}{#3}%
\else\iffirstargument
\makeOutlinedText{#1}{black}{#3}%
\else
\makeOutlinedText{white}{black}{#3}%
\fi\fi
}

\defineeffect[OuterEffect][alternative=outer,rulethickness=0.1pt]
\defineeffect[InnerEffect][alternative=inner,rulethickness=0.1pt]

\def\makeOutlinedText#1#2#3%
{%
\hbox%
{%
\rlap{\color[#1]{\effect[InnerEffect]{#3}}}%
  \color[#2]{\effect[OuterEffect]{#3}}%
}%
\autoinsertnextspace
}

%%

\starttext
\OutlinedText[red][yellow]{Arguments: red yellow \ldots}\\
\OutlinedText[red]{Arguments: red \ldots}
\OutlinedText{Arguments: \ldots}\\
\stoptext



Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)

Computer Architecture & Computer Engineering
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)

443-654-7878
ke...@lps.umd.edu<mailto:ke...@lps.umd.edu>

Visiting Research Professor
United States Naval Academy

r...@usna.edu<mailto:r...@usna.edu>


On Oct 8, 2021, at 07:36, Hans Hagen 
mailto:j.ha...@xs4all.nl>> wrote:

On 10/7/2021 4:14 PM, Rudd, Kevin via ntg-context wrote:
Hey---
I'm trying to insert outlined text (derived from MetaFun example code) into a 
document and it seems to work up to the point that the text has depth 
(descenders). There's a previous post that mentions using textcommand for 
titles to ensure that the appropriate baseline is used but I haven't figured 
out why that would work; for my purposes, I'm insert the text inline so that 
solution wouldn't work here. I have included a MWE that demonstrates the 
problem; I've tried putting both the text and the outlined text in a box, then 
adjusting the outlined text by the depth of the text itself but that doesn't 
seem to work. I expect that there's an easy way either in MP or ConTeXt, but I 
haven't found it yet.

% \OutlinedText[glyph][outline]{text}
\def\OutlinedText{\dodoubleempty\doOutlinedText}
\def\doOutlinedText[#1][#2]#3%
{%
% \type{#1}::\type{#2}::\type{#3}
\ifsecondargument
\makeOutlinedText{#1}{#2}{#3}%
\else\iffirstargument
\makeOutlinedText{#1}{black}{#3}%
\else
\makeOutlinedText{white}{black}{#3}%
\fi\fi
}
\def\makeOutlinedText#1#2#3%
{%
\startMPcode
draw outlinetext.b("#3")
 (withcolor "#1")
 (withcolor "#2" withpen pencircle scaled 1/16);
\stopMPcode
\autoinsertnextspace
}
\starttext
start
 \OutlinedText{aaa}
and  \OutlinedText{Bbb}
and  \OutlinedText{ggg}
and  \OutlinedText{Yyy}
finish
\stoptext

(Here is the code with my attemps to shift the baseline; the \dp & \wd approach 
seems to do nothing, and the \lower doesn't compile and I haven't pursued why 
yet.)

% \def\makeOutlinedText#1#2#3%
% {%
% \newbox\tBox
% \newbox\uBox
% \setbox\tBox\hbox{#3}
% \setbox\uBox
% \hbox{%
% \startMPcode
% draw outlinetext.b("#3")
%  (withcolor "#1")
%  (withcolor "#2" withpen pencircle scaled 1/16);
% \stopMPcode
% }%
% % \lower\uBox\dp\tBox
% \ht\uBox=\ht\tBox
% \dp\uBox=\dp\tBox
% \unbox\uBox
% \autoinsertnextspace
}

Any feedback or suggestions would be appreciated.

\defineeffect[MyEffect][alternative=outer,rulethickness=.1pt]

\starttext
   start
  {\effect[MyEffect]{aaa}} \OutlinedText{aaa}
   and  {\red  \effect[MyEffect]{Bbb}} \OutlinedText{Bbb}
   and  {\green\effect[MyEffect]{ggg}} \OutlinedText{ggg}
   and  {\blue \effect[MyEffect]{Yyy}} \OutlinedText{Yyy}
   finish
\stoptext


Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)
Computer Architecture & Computer Engineering
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)
443-654-7878
ke...@lps.umd.edu<mailto:ke...@lps.umd.edu> 

Re: [NTG-context] Outlined text (from MP) inline in ConText has incorrect baseline (i.e. no depth)

2021-10-08 Thread Rudd, Kevin via ntg-context
thanks, Hans— that's so much simpler an approach. i'll have to look into text 
effects to see what else can be done. many many thanks! ---K

Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)

Computer Architecture & Computer Engineering
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)

443-654-7878
ke...@lps.umd.edu<mailto:ke...@lps.umd.edu>

Visiting Research Professor
United States Naval Academy

r...@usna.edu<mailto:r...@usna.edu>


On Oct 8, 2021, at 07:36, Hans Hagen 
mailto:j.ha...@xs4all.nl>> wrote:

On 10/7/2021 4:14 PM, Rudd, Kevin via ntg-context wrote:
Hey---
I'm trying to insert outlined text (derived from MetaFun example code) into a 
document and it seems to work up to the point that the text has depth 
(descenders). There's a previous post that mentions using textcommand for 
titles to ensure that the appropriate baseline is used but I haven't figured 
out why that would work; for my purposes, I'm insert the text inline so that 
solution wouldn't work here. I have included a MWE that demonstrates the 
problem; I've tried putting both the text and the outlined text in a box, then 
adjusting the outlined text by the depth of the text itself but that doesn't 
seem to work. I expect that there's an easy way either in MP or ConTeXt, but I 
haven't found it yet.

% \OutlinedText[glyph][outline]{text}
\def\OutlinedText{\dodoubleempty\doOutlinedText}
\def\doOutlinedText[#1][#2]#3%
{%
% \type{#1}::\type{#2}::\type{#3}
\ifsecondargument
\makeOutlinedText{#1}{#2}{#3}%
\else\iffirstargument
\makeOutlinedText{#1}{black}{#3}%
\else
\makeOutlinedText{white}{black}{#3}%
\fi\fi
}
\def\makeOutlinedText#1#2#3%
{%
\startMPcode
draw outlinetext.b("#3")
 (withcolor "#1")
 (withcolor "#2" withpen pencircle scaled 1/16);
\stopMPcode
\autoinsertnextspace
}
\starttext
start
 \OutlinedText{aaa}
and  \OutlinedText{Bbb}
and  \OutlinedText{ggg}
and  \OutlinedText{Yyy}
finish
\stoptext

(Here is the code with my attemps to shift the baseline; the \dp & \wd approach 
seems to do nothing, and the \lower doesn't compile and I haven't pursued why 
yet.)

% \def\makeOutlinedText#1#2#3%
% {%
% \newbox\tBox
% \newbox\uBox
% \setbox\tBox\hbox{#3}
% \setbox\uBox
% \hbox{%
% \startMPcode
% draw outlinetext.b("#3")
%  (withcolor "#1")
%  (withcolor "#2" withpen pencircle scaled 1/16);
% \stopMPcode
% }%
% % \lower\uBox\dp\tBox
% \ht\uBox=\ht\tBox
% \dp\uBox=\dp\tBox
% \unbox\uBox
% \autoinsertnextspace
}

Any feedback or suggestions would be appreciated.

\defineeffect[MyEffect][alternative=outer,rulethickness=.1pt]

\starttext
   start
  {\effect[MyEffect]{aaa}} \OutlinedText{aaa}
   and  {\red  \effect[MyEffect]{Bbb}} \OutlinedText{Bbb}
   and  {\green\effect[MyEffect]{ggg}} \OutlinedText{ggg}
   and  {\blue \effect[MyEffect]{Yyy}} \OutlinedText{Yyy}
   finish
\stoptext


Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)
Computer Architecture & Computer Engineering
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)
443-654-7878
ke...@lps.umd.edu<mailto:ke...@lps.umd.edu> <mailto:ke...@lps.umd.edu>
Visiting Research Professor
United States Naval Academy
r...@usna.edu<mailto:r...@usna.edu> <mailto:r...@usna.edu>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!
maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / 
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


--

-
 Hans Hagen | PRAGMA ADE
 Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.nl<http://www.pragma-ade.nl> | 
www.pragma-pod.nl<http://www.pragma-pod.nl>
-

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage 

[NTG-context] Outlined text (from MP) inline in ConText has incorrect baseline (i.e. no depth)

2021-10-07 Thread Rudd, Kevin via ntg-context
Hey---

I'm trying to insert outlined text (derived from MetaFun example code) into a 
document and it seems to work up to the point that the text has depth 
(descenders). There's a previous post that mentions using textcommand for 
titles to ensure that the appropriate baseline is used but I haven't figured 
out why that would work; for my purposes, I'm insert the text inline so that 
solution wouldn't work here. I have included a MWE that demonstrates the 
problem; I've tried putting both the text and the outlined text in a box, then 
adjusting the outlined text by the depth of the text itself but that doesn't 
seem to work. I expect that there's an easy way either in MP or ConTeXt, but I 
haven't found it yet.



% \OutlinedText[glyph][outline]{text}
\def\OutlinedText{\dodoubleempty\doOutlinedText}

\def\doOutlinedText[#1][#2]#3%
{%
% \type{#1}::\type{#2}::\type{#3}
\ifsecondargument
\makeOutlinedText{#1}{#2}{#3}%
\else\iffirstargument
\makeOutlinedText{#1}{black}{#3}%
\else
\makeOutlinedText{white}{black}{#3}%
\fi\fi
}

\def\makeOutlinedText#1#2#3%
{%
\startMPcode
draw outlinetext.b("#3")
 (withcolor "#1")
 (withcolor "#2" withpen pencircle scaled 1/16);
\stopMPcode
\autoinsertnextspace
}

\starttext
start
 \OutlinedText{aaa}
and  \OutlinedText{Bbb}
and  \OutlinedText{ggg}
and  \OutlinedText{Yyy}
finish
\stoptext




(Here is the code with my attemps to shift the baseline; the \dp & \wd approach 
seems to do nothing, and the \lower doesn't compile and I haven't pursued why 
yet.)




% \def\makeOutlinedText#1#2#3%
% {%
% \newbox\tBox
% \newbox\uBox
% \setbox\tBox\hbox{#3}
% \setbox\uBox
% \hbox{%
% \startMPcode
% draw outlinetext.b("#3")
%  (withcolor "#1")
%  (withcolor "#2" withpen pencircle scaled 1/16);
% \stopMPcode
% }%
% % \lower\uBox\dp\tBox
% \ht\uBox=\ht\tBox
% \dp\uBox=\dp\tBox
% \unbox\uBox
% \autoinsertnextspace
}




Any feedback or suggestions would be appreciated.
 ---K

Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)

Computer Architecture & Computer Engineering
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)

443-654-7878
ke...@lps.umd.edu

Visiting Research Professor
United States Naval Academy

r...@usna.edu

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___