[NTG-context] Re: Draft vertical text in margins

2024-06-03 Thread Kip Warner
On Mon, 2024-06-03 at 17:04 +0200, Wolfgang Schuster wrote:
> ai2472206...@yeah.net schrieb am 03.06.2024 um 11:35:
> > you can try 'setuptext' and '\setuptexttexts' to put "draft" in
> > margin.and use 'orientation' to change direction.
> > 
> > 
> > \defineframed    [marginframe]
> >   [width=max, height=max,  
> > style=\ss,
> >    corner=08, location=lohi,   
> > frame=off]
> > \setuptext [style={\ss}]
> > \setuptexttexts  [margin] []
> >  [\marginframe{\hbox orientation 1
> > {DRAFT}}]
> >  [\marginframe{\hbox orientation 1
> > {DRAFT}}]
> 
> There is no need for low level option when you use \rotate, e.g.
> 
>  [\marginframe{\rotate[rotation=270]{DRAFT}}]
> 
> \framed has a orientation key but it's not so easy to use in this
> case 
> because you have to set length for width and height, e.g.
> 
>  \defineframed
>    [marginframe]
>    [width=\textheight,
>     height=\rightmarginwidth,
>     orientation=270]
> 
> Wolfgang

Thank you kindly, Wolfgang et al. Very helpful.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


signature.asc
Description: This is a digitally signed message part
___
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
___


[NTG-context] Re: Draft vertical text in margins

2024-06-03 Thread Wolfgang Schuster

ai2472206...@yeah.net schrieb am 03.06.2024 um 11:35:

you can try 'setuptext' and '\setuptexttexts' to put "draft" in margin.and use 
'orientation' to change direction.


\defineframed[marginframe]
  [width=max, height=max,   style=\ss,
   corner=08, location=lohi,frame=off]
\setuptext [style={\ss}]
\setuptexttexts  [margin] []
 [\marginframe{\hbox orientation 1 {DRAFT}}]
 [\marginframe{\hbox orientation 1 {DRAFT}}]


There is no need for low level option when you use \rotate, e.g.

[\marginframe{\rotate[rotation=270]{DRAFT}}]

\framed has a orientation key but it's not so easy to use in this case 
because you have to set length for width and height, e.g.


\defineframed
  [marginframe]
  [width=\textheight,
   height=\rightmarginwidth,
   orientation=270]

Wolfgang
___
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
___


[NTG-context] issue with signing

2024-06-03 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample

  \setupinteraction[state=start]
  \definefield[signature][signed]
  \defineoverlay[signature][my signature]
  \starttext
\startTEXpage[offset=1ts,frame=on,framecolor=darkblue]
  sign: \inframed[background=signature,framecolor=darkred]
  {\fieldbody[signature][width=3cm,option=hidden]}
\stopTEXpage
  \stoptext

After compiling, I sign it with the following command (in latest from
2024.05.31 18:50):

 mtxrun --script pdf --sign --certificate=mycert.pfx --password=ABCabc a

It requires the pass phrase (again?) and I get a signed PDF document.

But Acrobat cannot find (or display) any signature in that PDF document.

pdfsig (from poppler-utils-24.02.0) complains about digest mismatch:

  $ pdfsig a.pdf
  Digital Signature Info of: a.pdf
  Signature #1:
- Signature Field Name: signature
- Signer Certificate Common Name: John Doe
- Signer full Distinguished Name: CN=John Doe,O=No Brainer
- Signing Time: Jun 03 2024 16:24:03
- Signing Hash Algorithm: SHA-256
- Signature Type: adbe.pkcs7.detached
- Signed Ranges: [0 - 6428], [10527 - 10912]
- Not total document signed
- Signature Validation: Digest Mismatch.

mutool sign (from mupdf-1.24.1) also complains about modified document
after signing:

  $ mutool sign -v a.pdf
  Verifying signature 3:
Distinguished name: cn=John Doe, o=No Brainer, ou=, email=, c=XX
Certificate error: Self-signed certificate.
Digest error: Signature invalidated by change to document.

Sorry, but what am I doing wrong here?

Many thanks for your help,

Pablo

mycert.pfx
Description: application/pkcs12
___
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
___


[NTG-context] Re: setuphead in connection with the command argument

2024-06-03 Thread Hans Hagen via ntg-context

On 6/3/2024 1:36 PM, Gerion Entrup wrote:

Thank you. I think that I understand command vs alternative now.
With try and error, I experienced, that the font/style of the `style`
parameter interleave in a strange way. Therefore I see it as related.
What i mean is:
style: outer level, also sets interline spacing and adapts before after 
blanks


numberstyle and textstyle : specific to the element

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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 / 
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
___


[NTG-context] Re: setuphead in connection with the command argument

2024-06-03 Thread Gerion Entrup
Am Montag, 3. Juni 2024, 00:05:22 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 01.06.2024 um 16:34:
> > Am Samstag, 1. Juni 2024, 09:53:46 MESZ schrieb Wolfgang Schuster:
> >> Gerion Entrup schrieb am 31.05.2024 um 00:37:
> >>> What, if I define multiple of them? Is the system not made for this?
> >>
> >> Multiple of what?
> > 
> > When I define `alternative=` _and_ `command=` in the same `\setuphead`.
> > Or `alternative=` and `style=`, or `alternative=` and `command=`.
> > 
> > I guess style is applied just to the arguments/macros of the command/the 
> > alternative?
> > And combining alternative and command never make sense.
> 
> The following descriptions applies to most setup commands when exclude 
> special cases like \setupbodyfont or \setuplayout.
> 
> 
> When you make multiple changes to the values of a command with
> 
>  \setuphead [section] [style=bold]
> 
> and
> 
> \setuphead [section] [color=blue]
> 
> you achieve the same result as setting both values at the same time like
> 
> \setuphead [section] [style=bold,color=blue]
> 
> 
> What you're doing here is just passing some value to a parameter, 
> nothing else happens at this time. When you process a document Context 
> has already passed the value "normal" to the "alternative" parameter in 
> the \setuphead command. When you now pass a custom macro the "command" 
> parameter in \setuphead all you have done is to set a value, nothing 
> else happened at this point.
> 
> 
> The evaluation of the parameter happens when Context places the content 
> of a heading with \startchapter etc. in your document and only at this 
> point it has to make a decision what should happen when both "command" 
> and "alternative" are set. The order in which the parameters are used is 
> the following: a) check if the "command" parameter has a value and if 
> this is true is it and ignore the "alternative" value b) if no value is 
> present for the "command" parameter use the value of "alternative".
> 
> 
> The value of the "style" parameter is unrelated of the 
> command/alternative values because it isn't needed to choose a layout 
> for the heading, all the parameter does is to change the font/style 
> which is independent of the layout.
> 

Thank you. I think that I understand command vs alternative now.
With try and error, I experienced, that the font/style of the `style`
parameter interleave in a strange way. Therefore I see it as related.
What i mean is:

Example 1
```
\define[2]\MyChapter{%
\bold This is bold #1 #2
}
\setuphead[title, chapter][command=\MyChapter, style=\italic]
\starttext
\startchapter[title=foo]
\stopchapter
\stoptext
```

"This is bold" is bold, but "1" and "foo" are italic.
The font size is normal.
It seems, that "style" is just applied to "#1" and "#2" _before_ evaluating 
MyChapter.

Example 2
```
\define[2]\MyChapter{%
\bold This is bold #1 #2
}

% this should be the "default" style
\setuphead[title, chapter][command=\MyChapter, style=\tfc]
\starttext
\startchapter[title=foo]
\stopchapter
\stoptext
```

"This is bold" is bold, "1" and "2" are normal, but the whole font size is 
bigger.
It seems, that "style" is applied partially to the whole text and somehow 
special to "#1" and "#2" (Why are these arguments not bold?)


As of your explanations, I currently think of the following logic for 
typesetting (in pseudocode):

```
function typeset_chapter(style, numberstyle, textstyle, command, alternative, 
chapter_number, chapter_title) {

local formatted_chapter_number = apply_style(numberstyle, 
apply_style(style, chapter_number))
local formatted_chapter_title = apply_style(textstyle, apply_style(style, 
chapter_title))
if (alternative != "normal")
set_TeX_macro("\headnumbercontent", formatted_chapter_number)
set_TeX_macro("\headtextcontent", formatted_chapter_title)
typeset_as_TeX(get_TeX_code(alternative))
else
evaluate_TeX_function(command, #1=formatted_chapter_number, 
#2=formatted_chapter_title)
endif
}
```
But this does not fit to example 2.

Best
Gerion





signature.asc
Description: This is a digitally signed message part.
___
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
___


[NTG-context] Re: Draft vertical text in margins

2024-06-03 Thread ai2472206007
you can try 'setuptext' and '\setuptexttexts' to put "draft" in margin.and use 
'orientation' to change direction.


\defineframed[marginframe]
 [width=max, height=max,   style=\ss,
  corner=08, location=lohi,frame=off]
\setuptext [style={\ss}]
\setuptexttexts  [margin] []
[\marginframe{\hbox orientation 1 {DRAFT}}]
[\marginframe{\hbox orientation 1 {DRAFT}}]
   []

\starttext
\chapter{C:Some Word}
\dorecurse{5}{
\section{S:Some Word}
\input knuth}
\stoptext
%%%
___
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
___


[NTG-context] Re: Draft vertical text in margins

2024-06-03 Thread Henning Hraban Ramm

Am 03.06.24 um 02:45 schrieb Kip Warner:

Hello list,

I'd like to place the text "DRAFT" in the left and right side margins
of every page, rotated 90 degrees so that the text runs vertically. It
would be nice if the text was 180 degrees rotated on the right side in
comparison to the left margin. I've tried with overlays and I can't
seem to get them to work correctly.

This should be simple, but as with so many things with ConTeXt it's a
bit enigmatic.


* repeated layers
* \rotate

Please make a M(n)WE that we can enhance.

Hraban

___
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
___