4

I have html report that generated by online software tools, whereas I intend to insert those report as an appendix in my latex project. I used online tools to convert html report to pdf first. However, I know how to add an appendix in latex, but adding independent pdf docs as latex appendix is unknown for me. How can I make this happen? Is there any shortcut to do this? How can I continue my latex preamble with latex code that could allow me to insert several pages of pdf doc as an appendix? Any idea please? Thaks in advance :)

Here is the url of html report:

html report

5
  • 1
    I think \includepdf from the pdfpages package is what you need here then.
    – user31729
    Commented Mar 28, 2017 at 21:13
  • @ChristianHupfer what would be concrete latex code I could try? Could you extend your motivation please? Thank you :)
    – Jerry07
    Commented Mar 28, 2017 at 21:14
  • 1
    \includepdf{mysupersophisticatedreport.pdf} ;-) If I remember correctly, the .pdf extension can be omitted, however
    – user31729
    Commented Mar 28, 2017 at 21:15
  • @ChristianHupfer Is that possible to add original html report as an appendix in latex? If I try your solution, where can I put pdf files in my latex project (I used sharelatex)?
    – Jerry07
    Commented Mar 28, 2017 at 21:17
  • 1
    I don't use such online 'tools' ... but I am pretty sure that they allow to upload .pdf files like for graphics, so you should be able to upload the converted html report. You can attach files to a .pdf file as will with attachfile2, the .html is then included in the .pdf file and be extracted ('saved') from that file
    – user31729
    Commented Mar 28, 2017 at 21:20

1 Answer 1

3

I used the given link by the OP and generated a htmlreport.pdf file from the .html document (just printing to file), in addition I saved the file (this provided two files, the .html and the .css file actually)

The .pdf file can be input in pieces or completely with \includepdf, the .html and .css file can be attached with \attachfile from attachfile2 (please read the documentation of attachfile as well).

\documentclass{book}


\usepackage{pdfpages}
\usepackage{attachfile2}

\begin{document}
\chapter{Theory of Brontosaurs}

\chapter{How to become a brain surgeon}

\appendix

\includepdf[pages={3-5}]{htmlreport.pdf}

Source of report: \attachfile[color=blue,mimetype=text/html,icon={Paperclip},description={Source of report}]{reportsource.html}
Additional CSS file: \attachfile[color=blue,mimetype=text/css,icon={Paperclip},description={CSS of report}]{report.css}



\end{document}

enter image description here

Please have a look on the embedfile package as well!

2
  • so I don't need to make conversion between html and pdf right? your answer is quite interesting. Thank you very much :)
    – Jerry07
    Commented Mar 28, 2017 at 21:51
  • @Dan: You can attach the .html file completely to the LaTeX output .pdf file without any conversion, yes, if you prefer do so. In this case you can omit the \includepdf statement, of course. I don't think that the .html file will be really large that any size restrictions are violated...
    – user31729
    Commented Mar 28, 2017 at 21:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .