Code Monkey home page Code Monkey logo

beamer-frame-extract.vim's Introduction

vim plugin to extract the beamer frame under the cursor

This vim plugin adds a command for LaTeX files to extracts the beamer frame that is under the cursor. If editing file spam.tex, the extracted frame is saved to spam-frame.tex that includes:

  • the full preamble from spam.tex
  • the source code of the current frame
  • \end{document}

If the cursor is currently not within a frame, a dummy frame is saved instead.

Note that LaTeX source code is extracted from the saved file and not from the live buffer in order to rely on a content whose consistency is under user's control. Note also that the plugin expects \begin{frame}, \end{frame}, \begin{document}, and \end{document} to be written at the beginning of lines without anything before except possible spaces.

Automation can be performed by asking vim to run the command every time the file is saved:

autocmd BufWritePost,FileWritePost *.tex :BeamerFrameExtract

Then, launch latexmk spam-frame or other automated compiler to get an up-to-date PDF of the frame currently edited. The plugin does not take care of compilation, it just extract and save the relevant source code.

Dependencies

The plugin requires python3 to be available in vim.

Changelog

  • 0.0.2 (2023/11/17): don't save spam-frame.tex if documentclass is not beamer
  • 0.0.1 (2023/11/17): initial version

Licence

beamer-frame-extract is (C) 2023 Franck Pommereau [email protected] and released under the terms of MIT licence, see file LICENCE for details.

beamer-frame-extract.vim's People

Contributors

fpom avatar

Watchers

 avatar

beamer-frame-extract.vim's Issues

No support for allowframebreaks :-(

Hi,

When single-frame-ing a given frame, everything works as intended, including adding the right headers/pictures/etc.

However, I also tried to generate a frame with multiple blocks that overflow and require the allowframebreaks option (which is something I often use), and no output was generated, which is a shame.

Any hope for an upgrade? O:-)

EDIT: I STAND CORRECTED (or maybe the generation doesn't happen all the time, or maybe only when the cursor is somewhere specific in the frame text?). I tried again, and it does generate the multi-frame PDF!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.