38

I have a pdf file generated by latex which has many equations and what not. I want to use this pdf as the readme.md file in my github repo. How can I do this?

Alternatively, is it possible to directly integrate the tex file in github and use that as a readme instead of the pdf version? Does github allow any integration with latex syntax as does gmail for example?

ijuneja
  • 454
  • 1
  • 5
  • 17
JRun
  • 669
  • 1
  • 10
  • 17
  • 1
    You could convert it to images and put those on the README.md not very elegant though. Should be better just to convert the equations parts. – Rogério Peixoto Jun 15 '16 at 05:30
  • 2
    Check this out: http://webapps.stackexchange.com/questions/48061/can-i-trick-github-into-displaying-the-pdf-in-the-browser-instead-of-downloading – evan.oman Jun 16 '16 at 23:59
  • 7
    If I were visiting a project with complex (and probably extensive) documentation, I would not want the complex documentation to be displayed in the README area. Rather, I suggest you simply *summarise* your project in the readme and provide sufficient details for compilation, set up, running or whatever is necessary. Then, provide the PDF (which is better to read) as a separate download. I would also not like to see my browser download and render a complex PDF, but use my favourite PDF viewer. – Martin Nyolt Aug 15 '16 at 13:50
  • I think, what you want is not really doable. The readme.md is just markdown. Instead, try to convert it to markdown as much as possible (but see my [previous comment](http://stackoverflow.com/questions/37826259/how-can-i-use-a-pdf-file-as-the-readme-in-my-github-repo#comment65266615_37826259)), and link to the PDF. – Martin Nyolt Aug 15 '16 at 13:52
  • I see what you mean in your first comment. You are right; I agree. – JRun Aug 16 '16 at 22:05
  • I used equation in the wiki. The hack was to create external images for it. I used http://mathurl.com/ to create the PNG on the flie. You can then put them in your readme.md as an external image. An example here: https://github.com/scholi/pySPM/wiki/Mass-calibration – scholi Jun 21 '18 at 07:29

1 Answers1

4

You cannot import PDF as Readme, but I also don't see the point as it support the wonderful MD Language which can be seen easily with any device (also mobile).

I have fixed the equations problem by using images. There is a nice website for that: http://mathurl.com/

Just type your latex equation and click "Make Math url" (bottom left button), the copy paste the image link (in red).

I have used it in the wiki of github (but it should work the same with readme.md): https://github.com/scholi/pySPM/wiki/Mass-calibration

Enjoy!

scholi
  • 314
  • 2
  • 10
  • 8
    point is, I have a docx, with pictures, and converting to markdown just doesn't work. wasting too much time and failing – Gulzar Mar 22 '20 at 23:27
  • Then maybe do your document as markdown and convert markdow to docx afterwards. Users really appreciate the fact to be able to see the readme without having to open a document, specially docx which can hold viruses – scholi Mar 23 '20 at 17:40
  • githubs markdown files does not support equation libraries like KaTex. – Jonas Grønbek May 24 '20 at 22:28