8000 LaTeX writer: embedding pdf and video files · Issue #7181 · jgm/pandoc · GitHub 8000
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
LaTeX writer: embedding pdf and video files #7181
Open
@MinmoTech

Description

@MinmoTech

Hey! :)
I'm trying some things out to create a workflow with pandoc markdown that is similar to org-noter.
This means I want to reference locations inside of pdfs (and later video files as well) inside my documents.
This is already somewhat possible by using html and latex directly inside of markdown:

---
header-includes: |
    \usepackage{pdfpages}
---

# Test title

Have some test text

\```{=html}
<object data="loremipsum.pdf#page=2" type="application/pdf" width="700px" height="700px">
    <embed src="loremipsum.pdf#page=2">
        <p>PDF download: <a href="loremipsum.pdf">Download PDF</a>.</p>
    </embed>
</object>
\```

\```{=latex}
\includepdf[pages={2-3}]{loremipsum.pdf}
\```

I put a backslash in front of the triple backticks so they don't break the code block.

After converting this markdown document into pdf, it embeds pages 2-3 from the loremipsum.pdf into the newly generated pdf.
output.pdf

The generated html has the complete pdf embeded, but starts at page 2.

output.html:

<h1 id="test-title">Test title</h1>
<p>Have some test text</p>
<object data="loremipsum.pdf#page=2" type="application/pdf" width="700px" height="700px">
    <embed src="loremipsum.pdf#page=2">
        <p>Referenced pages 2-3: <a href="loremipsum.pdf">Download PDF</a>.</p>
    </embed>
</object>

loremipsum.pdf

This part: <p>Referenced pages 2-3: <a href="loremipsum.pdf">Download PDF</a>.</p> only gets displayed in case the browser does not support embedded pdfs.

Now I would like to have some syntax in pandoc markdown that can generate each of these blocks for their respective filetypes.
I would imagine the syntax to be something like this:
!embed[pdf-title](loremipsum.pdf:2-3)
Or anything like it.

A similar thing might be possible for embedding video files in html:

<object data="project.mp4#t=66,71" type="video/mp4">
    <embed src="project.mp4#t=66,71">
        <p>Referenced time: 66-71<a href="project.mp4">Download mp4</a>.</p>
    </embed>
</object>

And you even might be able to include these in pdf, but that might be undesireable.

If this is a stupid idea, feel free to close this issue 👋

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0