[NTG-context] solved problem of footnote in framed text

2021-07-26 Thread jbf via ntg-context
I solved my own problem of the footnote not appearing. Discovered 
\startpostponingnotes! That solved the problem.


Julian

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


[NTG-context] footnote not appearing

2021-07-26 Thread jbf via ntg-context
Is there any reason why the following MWE does not produce the footnote 
at the bottom of the page? It seems like the use of framedtext is 
preventing it, but am not sure why. Can I get around this problem and 
still have framed text?


Julian

\setupframed[location=middle]

\startframedtext[width=.77\makeupwidth,corner=round]
The poems of St John of the Cross have been important for me in recent 
years. This is John’s prayer from a verse in his Spiritual 
Canticle:\footnote{John of the Cross, {\em Spiritual Canticle}, stanza 
32.  }


\startblockquote
You looked with love upon me, and deep within, your eyes imprinted 
grace. This mercy set me free, held in your love’s embrace, to lift my 
eyes adoring to your face.

\stopblockquote

I wonder how often John prayed that prayer.
\stopframedtext

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


[NTG-context] Adobe Acrobat accessibility criteria

2021-07-26 Thread Connor P. Jackson via ntg-context
Hello ConTeXt friends,

I am newly exploring ConTeXt in search of a better way to produce PDF/UA-1
accessible and PDF/A compliant documents programmatically. From my early
experiments, ConTeXt docs appear to fully satisfy the veraPDF validator,
but Adobe Acrobat’s Accessibility Checker has three qualms with
ConTeXt-produced documents:


   1. The document is configured to display the file name rather than the
   title in the top of the window (DisplayDocTitle == True is what I think is
   required). See here .
   2. "Tagged Annotations" fails, suggesting that the document’s links are
   not properly tagged. I believe the issue is missing "Link - OBJR” (object
   reference) tags. See here
   
,
   here , and here
   .
   3. "Tab Order" fails, I believe because ConTeXt does not specify that
   the tab order should follow the Document Structure, so Acrobat reads it as
   unspecified. See here .


Is there something I could be doing to correct these issues in my ConTeXt
documents? Or is this a change that would have to be made within
ConTeXt itself? I know that Adobe is not the definitive arbiter of what an
“accessible” PDF looks like, but for many organizations, passing the
Acrobat accessibility checker is a prerequisite, so it seems worthwhile to
me to make ConTeXt capable of it.

Many thanks!

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


Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-26 Thread Aditya Mahajan via ntg-context
On Mon, 26 Jul 2021, Gavin via ntg-context wrote:

> 2) While I’m having good luck with paths, colors are causing trouble. In the 
> data set the color information is in strings with French names of the color, 
> like “rouge.” If I hand this string to MetaPost, MetaPost doesn’t expand it 
> into a color. It does work if it is a native color, like “red,” but not if it 
> is a defined color and not if the color is in a Lua variable. Any suggestions?

\definecolor[rouge][red] should work. A better option will be use color 
palettes. 

This is very old code, but will give an idea of how to use palettes:
https://github.com/adityam/visualcounter/blob/master/visualcounter.pdf 
Effectively all you need to do is add \setuppalet[name] at an appropriate 
place, and then the user can easily change the colors (rather than having them 
specified as part of data files).

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


[NTG-context] Multimedia, PDF and ConTeXt

2021-07-26 Thread Michal Vlasák via ntg-context
Dear ConTeXt community,

recently, as part of my bachelor thesis, I looked into the state of
multimedia (audio, video, 3D) and other relatively obscure PDF
features, with the connection to TeX.

I already put off this write up long enough. Hopefully it clarifies
things that might influence the current uncertainty about these features
and their presence in ConTeXt (see abstract of Hans' talk for upcoming
ConTeXt meeting, chapter 8 of "On and on" and remarks in files like
"lpdf-wid.lmt").

The following text discusses the options for including multimedia in PDF
files from ConTeXt. First the different PDF mechanisms are introduced
and compared, then their support in ConTeXt is summarized. My ideas
for future steps are also included. Patch to fix some bugs is also
below. Lastly I link to some resources regarding the topic.

The various versions of the PDF standard have over the years developed
several ways of including "multimedia" in PDF files. The simplest are
XObjects which allow raster and vector graphics -- this is a well known
and well supported feature in both PDF writers and viewers. However,
later revisions of the PDF standard added what is essentially five
different mechanisms for including video, audio or 3D files (each
mechanism supports a different subset of these three). For evaluating
these mechanisms from perspective of ConTeXt it is possible to devise
the following criteria:

 - support in PDF standard (deprecation, etc.),
 - supported media types (audio, video[+optional audio], 3D),
 - support of different source types (embedded file, external file, URL)
 - what is possible to achieve ("usefulness") and at what cost
   ("complexity"),
 - current support in ConTeXt,
 - and the most important: support in PDF viewers.

Perhaps the "source types" need a bit of explanation. Essentially all
file references from PDF can be one of three types:

 - Embedded file. The referenced file is *in* the PDF file, this means
   that it can also be compressed as part of it (not very useful for
   multimedia though). This is nice because the result is integral --
   the media file can't get lost and there is only a single file to
   distribute.
 - URL file. The reference to the file is solely the URL. Takes almost
   no space at all in the PDF file, but means that the availability of
   the media file and PDF file are not tied.
 - External file. A file path is included in the PDF file. The file
   doesn't have to be available over the internet, but has to be
   distributed along with the PDF file (and the relative path has to
   match).

The "usefulness" aspect includes the possibility of interaction or
scripting. E.g. using media player buttons ("controls"), scripting with
JavaScript or some control with PDF actions (\goto, and triggers like
page open which allow auto-play).

The viewers I tested were: Acrobat Reader DC, Foxit Reader, Sumatra PDF
on Windows and Evince, Okular, Xpdf, MuPDF, Firefox and Google Chrome on
Linux.

Now to the different mechanisms:

1) Sound objects

 - First appeared in PDF 1.2 (1996), but had since been deprecated (PDF
   1.5, 2003) and became unsupported (PDF 2.0, 2017).

 - Only audio is supported.

 - "Raw" and in practice uncompressed PCM audio can be embedded (i.e.
   ".wav" format without the metadata).
   Otherwise an external file may be used (this one has to be in a real
   audio format - like ".wav" - i.e. with metadata).

 - Users usually don't have raw audio. So embedding requires
   preprocessing. Some control using PDF actions is possible.

 - Not supported in ConTeXt.

 - None of the viewers supports the external files. Only Acrobat Reader
   supports the embedded raw audio.

2) Movie objects

 - First appeared in PDF 1.2 (1996), but had since been deprecated (PDF
   1.5, 2003) and became unsupported (PDF 2.0, 2017).

 - Both video and audio is supported.

 - Any source (embedded, external and URL file).

 - In all regards superior to sound objects. Is still relatively simple
   and allows some customization and control (media player controls, PDF
   actions).

 - This is the backing mechanism for including video and audio in
   ConTeXt (\externalfigure, \useexternalsoundtrack).

 - Supported only in Evince and Okular (with their usual quirks, see
   below). Notably Acrobat Reader does no longer support this mechanism.

3) Multimedia ("Renditions")

 - First appeared in PDF 1.5 (2003). Adobe Acrobat considers them
   "legacy".

 - Both video and audio supported (as well as other unspecified types of
   multimedia, like images and Flash, but not really, see below).

 - In theory all source types should be possible.

 - This mechanism was supposed to replace sound and movie objects. Hence
   their deprecation. The mechanism is complex (the spec is 10 times
   longer than that for movie objects). It expects the PDF viewers to
   work with plugins and introduces ways for determining if a media file
   is really playable in some plugin. It is allowed to even include
   

Re: [NTG-context] mp-geo Metapost package with ConTeXt

2021-07-26 Thread Gavin via ntg-context
Hi everyone,

I’ve made great progress creating globes for my diagrams using the data in the 
mp-geo package and some ideas from Hans. I have a couple questions about moving 
information from Lua to MetaPost. Below is a MWE for illustration. I have two 
related questions:

1) Is there a way for MetaPost to grab information from a Lua table? Currently 
the MetaPost code calls a Lua function which has a single line returning the 
information from the table. Is this necessary, or is these something in 
MetaPost that can get a path or color from a Lua table? 

2) While I’m having good luck with paths, colors are causing trouble. In the 
data set the color information is in strings with French names of the color, 
like “rouge.” If I hand this string to MetaPost, MetaPost doesn’t expand it 
into a color. It does work if it is a native color, like “red,” but not if it 
is a defined color and not if the color is in a Lua variable. Any suggestions?

Thanks!
Gavin


The code below produces four pie shape wedges to show the different results of 
handling the color. They should all be red, but the last two are black.


\startMPinclusions
  color rouge;  % To avoid changing the data files, I need to define 
colors in French.
  rouge=(1,0,0);% For this MWE, I only define rouge.
  
  color mycolor;% Defining mycolor in MetaPost works great, as shown in 
the first shape.
  mycolor = rouge;
\stopMPinclusions

\startluacode
  myluapath = {{0,0}, {1,0,0,0,1,0.25}, {0.8,0.6,0.95,0.4}, cycle = true}
  myluacolor = “red”--% Data files are read by Lua, so the myluacolor will 
be a string (in French, but native colors don't work either).
  
  function mp.getpath() --% Is there a way for the MetaPost code to grab the 
path directly from the table?
mp.inject.path(myluapath)
  end
  
  function mp.getred() --% Returning a string work for native colors.
mp.inject.string("red")
  end

  function mp.getrouge() --% Returning a string does not work for defined
mp.inject.string("rouge")
  end

  function mp.getcolor() --% Putting the string in a variable does not work.
mp.inject.string(mycolor)
  end
\stopluacode

\starttext
  \startMPpage
   fill lua.mp.getpath() scaled 2.5cm withcolor mycolor; % MetaPost color 
definition works great.
   fill lua.mp.getpath() scaled 2.5cm shifted (0, -2cm) withcolor 
lua.mp.getred(); % Returning a string work for native colors.
   fill lua.mp.getpath() scaled 2.5cm shifted (0, -4cm) withcolor 
lua.mp.getrouge(); % Returning a string does not work for defined colors.
   fill lua.mp.getpath() scaled 2.5cm shifted (0, -6cm) withcolor 
lua.mp.getcolor(); % Putting the string in a variable does not work.
  \stopMPpage
\stoptext
___
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
___


Re: [NTG-context] Texte source 30 / 5000 Résultats de traduction Adjust the length of a frame

2021-07-26 Thread Wolfgang Schuster via ntg-context

Fabrice Couvreur via ntg-context schrieb am 26.07.2021 um 13:13:

Hello,
Following on from my previous questions for writing my book (thanks 
again Wolfgang), I have to create a solution environment like the 
attached image.

My problem is adjusting the length of the frame.
Thank you.
Fabrice

\setupbodyfont[newcomputermodern-book,11pt]

\defineframed
    [ACFRAME]
    [frame=off,
     width=fit,
     align=flushleft,
     location=low,
     background=color,
     backgroundcolor=lightgray,
     foregroundcolor=,
     foregroundstyle=]


\startuseMPgraphic{acframe}
fill OverlayBox
leftenlarged (BackSpace + 5mm)
rightenlarged ExHeight
withcolor "lightgray";
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\defineoverlay
  [acframe]
  [\useMPgraphic{acframe}]

\defineframed
   [ACFRAME]
   [...,
background=acframe,
...]

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


[NTG-context] Texte source 30 / 5000 Résultats de traduction Adjust the length of a frame

2021-07-26 Thread Fabrice Couvreur via ntg-context
Hello,
Following on from my previous questions for writing my book (thanks again
Wolfgang), I have to create a solution environment like the attached image.
My problem is adjusting the length of the frame.
Thank you.
Fabrice

\setupbodyfont[newcomputermodern-book,11pt]

\defineframed
   [ACFRAME]
   [frame=off,
width=fit,
align=flushleft,
location=low,
background=color,
backgroundcolor=lightgray,
foregroundcolor=,
foregroundstyle=]


\setupenumerations
  [before={\blank},
   after={\blank},
   alternative=top,
   title=yes,
   titleleft={},
   titleright={},
   titlestyle=bold,
   width=broad]

\defineenumeration
   [exercice]
   [text=Exercice,
number=yes,
numbercommand=\groupedcommand{}{.},
style=italic]

\defineenumeration
   [solution]
   [text=Solution,
headcommand=\ACFRAME,
number=no,
numbercommand=\groupedcommand{}{},
style=normal]

\starttext

\startexercice{Le nombre d'or est irrationnel}
  Le nombre d'or, noté \m{\phi}, est tel que
\m{\phi=\dfrac{1+\sqrt{5}}{2}}. Montrer que \m{\phi} est irrationnel.
\stopexercice

\startsolution
  Nous raisonnons par l'absurde en supposant que \m{\phi} est rationnel.
\stopsolution

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