Two questions about embedded videos

25 views
Skip to first unread message

Juan Carlos

unread,
May 8, 2022, 6:47:13 PM5/8/22
to pretext...@googlegroups.com
Hello to everyone,

Just moving to CLI, so I followed Sean's instructions. Almost everything
goes fine on my side (see below). One not so directly related question
though :

I want to make a document whose .html version should have some lecture
videos here and there. In the .pdf version I want to have a blank space
for the students to take notes of what I deliver with these videos. I
was thinking bout playing with the .tex file to have the blank spaces I
want, but this does not seem very efficient. I was also thinking about
playing with worksheets, but I don't really know how to proceed. Can
someone suggest something here?

On the other hand, the youtube thumbnails are not working, I tried to
include a video, the thumbnail is not where it should be, but the link
to the video is correct. I saw a discussion about this mentioning the
"publisher" file, but I was not able to solve my problem.

Kind regards,

JC




Rob Beezer

unread,
May 9, 2022, 2:53:47 PM5/9/22
to pretext...@googlegroups.com
Dear JC,

You could make, or find, an image that looks like lined paper and use that as @preview on the video. And if you don't want that in HTML, there is support for "versions", which I believe is documented.

Please describe in detail what you have tried to do to obtain thumbnails, referencing documentation, rather than having us ask a bunch of unnecessary leading questions to isolate the problem. We can't easily find "Sean's instructions".

Rob

Juan Carlos

unread,
May 9, 2022, 7:12:44 PM5/9/22
to pretext...@googlegroups.com

Hello,

Thanks for the tip with the @preview trick! I was looking for that "versions" part, I did not find the documentation, though.

On the other hand, for the thumbnails, here is what I did:

  • Installed the pretext-CLI. When I run pretext --version I get 0.6.3.
  • I created a new project with pretext new book
  • I entered in the /new-pretext-project/source directory, added the code
    <p>
    Puis ici je voudrais autre chose, un tutoriel qu'il faut regarder bientôt.
    <figure>
    <caption>Ben au ukulele <articletitle>Don't worry, be happy</articletitle></caption>
    <video xml:id="DontWorry" youtube="HpGk7D4Dyao" width="60%" start="12" preview="images/DontWorry.jpg" />
    </figure>
    </p>
  • Then I run pretext build html -d, which creates everything, almost as expected. When I preview the output with pretext view html the thumbnail for the video is missing. I get what you see below:


    However, upon clicking in the icon, I get the thumbnail... Upon clicking again, I go to the video. Further, the file output/html/generated/youtube/DontWorry.jpg is there, so 
  • When I do pretext build pdf no output is created at all (I find this rather radical, taking into account that there's only one .png missing).
  • The latex error message complains about not finding the file [...pectratio]{external/images/DontWorry.jpg}. The figure however is at output/latex/generated/youtube

So I thing that some copying - moving files is not done right.

JC

Rob Beezer

unread,
May 9, 2022, 8:08:04 PM5/9/22
to pretext...@googlegroups.com
Thanks for the very helpful details. A missing image will most likely abort the PDF build. You could ask for more verbose error messages.

You should have a "directories" element in your publication file. And it should be specified for the CLI somehow? Can you post that "directories" element here? Itd help with what you have given

I might be able to locate versions in the documentation later.

Rob

On May 9, 2022 1:12:39 PM HST, Juan Carlos <jotac...@gmail.com> wrote:
>Hello,
>
>Thanks for the tip with the @preview trick! I was looking for that
>"versions" part, I did not find the documentation, though.
>
>On the other hand, for the thumbnails, here is what I did:
>
> * Installed the pretext-CLI. When I run pretext --version I get 0.6.3.
> * I created a new project with pretext new book
> * I entered in the /new-pretext-project/source directory, added the code
> <p>
> Puis ici je voudrais autre chose, un tutoriel qu'il faut regarder
> bientôt.
> <figure>
> <caption>Ben au ukulele <articletitle>Don't worry, be
> happy</articletitle></caption>
> <video xml:id="DontWorry" youtube="HpGk7D4Dyao" width="60%"
> start="12" preview="images/DontWorry.jpg" />
> </figure>
> </p>
> * Then I run pretext build html -d, which creates everything, almost
> as expected. When I preview the output with pretext view html the
> thumbnail for the video is missing. I get what you see below:
>
>
> However, upon clicking in the icon, I get the thumbnail... Upon
> clicking again, I go to the video. Further, the file
> output/html/generated/youtube/DontWorry.jpg is there, so
> * When I do pretext build pdf no output is created at all (I find this
> rather radical, taking into account that there's only one .png missing).
> * The latex error message complains about not finding the file

Juan Carlos

unread,
May 9, 2022, 10:19:09 PM5/9/22
to pretext...@googlegroups.com
Hi,

Line 16 of new-pretext-projet/publication/publication.ptx (file created
when running  "pretext new book") is

<directories external="../assets" generated="../generated-assets"/>

Thanks again!

JC

Rob Beezer

unread,
May 10, 2022, 8:33:56 PM5/10/22
to pretext...@googlegroups.com
Dear JC,

Based on what you have reported, you should be providing your own file,
"DontWorry.jpg", at

../assets + images/DontWorry.jpg

i.e., at

../assets/images/DontWorry.jpg

where the path is relative to your source file that has the top-level "pretext"
element.

You could adjust

1. directories/@external

2. video/@preview

3. the actual location of the file.

Since your video/@xml:id is "DontWorry", the -d flag may be producing a
thumbnail "DontWorry.jpg" from YouTube itself, which should be 100% managed for
you by the CLI inside

../generated-assets/youtube

Naming the author-supplied preview identically to the scraped YouTube thumbnail
means I cannot be totally sure of your intent or understanding, but should not
be a technical mistake.

Directory management can be used independent of the CLI, but is presumed by the
CLI. Read more at:

https://pretextbook.org/doc/guide/html/processing-directory-management.html

I hope this gets you onto the right track.

Rob

Juan Carlos

unread,
May 15, 2022, 2:21:17 PM5/15/22
to pretext...@googlegroups.com
Dear Bob,

Thanks for your answer, I understood now. I was wrong about the usage of
"preview".

Any news about the "versions" documentation?

JC

Rob Beezer

unread,
May 15, 2022, 10:12:22 PM5/15/22
to pretext...@googlegroups.com
> Any news about the "versions" documentation?

I don't think it exists. I'll see if I can get something written some evening
this coming week.

Rob
Reply all
Reply to author
Forward
0 new messages