I am using macvim for a ruby tutorials book that will be produced directly with vim as a PDF (using the macvim print/make pdf function but the principle should be the same for any PDF generated from Vim). Unfortunately in the text part of the tutorial book there seems be no easy way to make a url clickable in the pdf.
What is the best solution to have clickable URLs in .pdf files generated from vim ?
thanks in advance !
If you’re really after producing a “book”, I would reconsider your approach. After all, you cannot get around certain Vim limitations like a single, fixed-width font, and detailed control of page breaks, table of contents, etc. will be difficult to achieve.
If you just like the syntax highlighting of (Ruby) code, you can use Vim’s
:TOhtmlcommand to get a faithful rendition of a Vim buffer in HTML, which I suppose can then be included in your publishing master.To make links clickable in PDF, you’d probably have to “decompile” the binary format into PostScript, then do a text search for URLs and modify the PostScript code to include a link, then recompile to PDF. I haven’t found a (command-line) tool that does this, but I guess some of the (GUI, often expensive) PDF editors allow you to do that.