ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Paste PDF Text Block

by compleatang ALL

Paste PDF text block to Sublime after stripping new lines.

Details

  • 2013.06.02.07.22.02
  • github.​com
  • 7 years ago
  • 19 minutes ago
  • 7 years ago

Installs

  • Total 3K
  • Win 2K
  • Mac 775
  • Linux 667
May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14
Windows 0 3 0 0 0 4 0 0 0 1 1 1 2 0 0 0 0 0 1 2 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 1 1
Mac 0 2 0 2 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 2 1 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0

Readme

Source
raw.​githubusercontent.​com

Description

Tested on Sublime Text 2 and Sublime Text 3.

Clipboard functionality to copy a block of text from PDF and paste it with the new lines and hyphenated words stripped so that it is a clean paste of a block of text into the target area.

Given that we do a lot of work between PDFs and Markdown in drafting of documents, it seemed necessary to work on the paste functionality a bit.

Using

Base Paste PDF Text Block

The default keybinding is CTRL+ALT+V in Linux and Windows, CTRL+Super+V on OsX. To assign a new keybinding:

  • Open “…/Packages/User/Default.sublime-keymap”
  • The relevant command name is “paste_pdf”
{ "keys": ["ctrl+alt+v"], "command": "paste_pdf" }

The function will also correct French accents thanks to the kind help of Gery Casiez and Spanish accents thanks to Ome Gak.

Paste PDF Text Block with Pandoc Footnote

One thing I often do is paste a text block but then need to mark it for citation. There is a new command that will take care of that for you, called paste_pdf_pandoc. This command will preformat the text block using the clean_paste function, wrap the entire block in double quotes, add Pandoc's ^[] footnote formatting, and place the cursor so you can instantly put in the BibTex reference or citation holder. The default keybinding for this is CTRL+ALT+SHIFT+V in Linux & Windows, and CTRL+SHIFT+Super+v in OsX.

Source Code

MIT License - © 2012 - Watershed Legal Services, PLLC

Installation

Install using Sublime Package Control

If you are using Will Bond's excellent Sublime Package Control, you can easily install Paste PDF via the Package Control: Install Package menu item. The Paste PDF package is listed there. See Package Control

Install using Git

You can install the theme and keep up to date by cloning the repo directly into your Packages directory in the Sublime Text 2 application settings area. You can locate your Sublime Text 2 Packages directory by using the menu item Preferences -> Browse Packages. While inside the Packages directory, clone the theme repository using the command below:

$ git clone https://github.com/compleatang/sublimetext-pastepdf

Manual Install

To download and install package manually:

  • Download the files using the GitHub .zip download option
  • Unzip the files and rename the folder to Paste PDF
  • Move the folder to your Sublime Text 2 Packages directory