2

I want to make a table in latex with different posters from movies that when I click on them, vlc should open and play the movie the poster is displaying.

So what I have been trying out is this, I have used href to open a pdf document separate from the document in question. I have tried to open an mkv file with href as well, but to no avail. So I thought of making a script that opens the file in question and playing it in vlc making it full screen from the get go. (I haven't completed this task as of yet, but google is my friend)

The question before I start making scripts for each and every video file is this. Has this been done before, does anyone know a better easier solution? I want to sort my entire video library this way, and it is a lot of ripped copies as I have put my collection on storage and am trying to make it easier to find the movies I have.

Is there any way of opening scripts this way?

This is my latex document thus far:

\documentclass{article}
\usepackage{graphicx}
\usepackage[margin=5pt]{geometry}
\usepackage{hyperref} 

\begin{document}

\begin{tabular}{ l | c | r }

 \href{run:./firstscript.sh}{\includegraphics[width=4cm,height=4cm,keepaspectratio]{pictures/2fast2furious.jpg}}&movie 2& movie 3\\
  movie 4 & 5 & 6 \\
  7 & 8 & 9 \\
  \hline  
\end{tabular}

\end{document}
Dai Bowen
  • 6,117

1 Answers1

1

So I figured it out.

I added infinite page with geometry and used beamer to launch shell.command, the shell command simply opens up the video file. However I need to view the PDF document in Skim as Adobe does not open the shell script.

LaTeX code:

\begin{filecontents*}{shell.command}
#!/usr/bin/env sh
echo "This finally works!"
\end{filecontents*}

\documentclass[t]{beamer}
\usepackage{graphicx}
\geometry{paperwidth=170mm, paperheight=2000pt, left=40pt, top=40pt, textwidth=280pt, marginparsep=20pt, marginparwidth=100pt, footskip=40pt}
\setcounter{totalnumber}{100}
\begin{document}

\begin{frame}
\begin{tabular}{ p{3cm}p{3cm}p{3cm}p{3cm}}

 \href{run:./Shellcoms/shell.command}{\includegraphics[width=4cm,height=4cm,keepaspectratio]{bilder/2fast.jpg}}& 
  \href{run:./Shellcoms/shell2.command}{\includegraphics[width=4cm,height=4cm,keepaspectratio]{bilder/2guns.jpg}}&
   \href{run:./Shellcoms/shell3.command}{\includegraphics[width=4cm,height=4cm,keepaspectratio]{bilder/diehard2013.jpg}}&
    \href{run:./Shellcoms/shell4.command}{\includegraphics[width=4cm,height=4cm,keepaspectratio]{bilder/apollo13.jpg}}\\
2fast2furious 2003 \newline imdb 5.9 &2 Guns 2013 \newline imdb 6.7 &
A Good Day to Die Hard 2013 \newline Imdb 5.3 &Apollo 13 1995 \newline Imdb 7.6 \\
  \hline  
\end{tabular}
\end{frame}
\end{document}

Shell I used:

#!/bin/bash
open  -a Finder /Volumes/My\ Passport/Æverything/Mac\ reformatting\ 2/Latex/bah.mkv 
exit 0

The PDF looks like this

enter image description here

I am now working on a general path to the pictures and shell commands so that I can move the PDF around without worrying about it not working.

Stefan Pinnow
  • 29,535
  • You can format code by indenting it four spaces or selecting it and pressing the {} button or for small snippets enclose them with back ticks ` like `foo` – Dai Bowen Oct 08 '16 at 14:48