Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

pdf layout improvements needed (wishlist) #25

Closed
Incei opened this issue Jun 27, 2019 · 50 comments
Closed

pdf layout improvements needed (wishlist) #25

Incei opened this issue Jun 27, 2019 · 50 comments
Labels
pdf type: feature New feature or request
Milestone

Comments

@Incei
Copy link
Member

Incei commented Jun 27, 2019

Currently the pdf reports that are generated from MD files look very unprofessional, there are compared to e.g pdf created from word, that include

  • table of contents with links and numbering,
  • sidebar with page-thumbnails or links to different subsections
  • text coloring and format of different text sections (figure description, main text)
  • header footers (with timestamp-title-pagenumber)
  • no page number on titlepage
  • ...others please add

@Yuri05 @sfrechen

@msevestre
Copy link
Member

Comparing word export to pdf with md export to pdf is not a fair comparison. MD does not have the concept of page etc.. where word clearly has it embedded (One markdown page can have 1000 lines!)

Some elements are simply not possible with a MD to pdf processor (at least what we are using).

For example table of contents with links and numbering requires multi parsing of content, which is not available.

What can be changed:

Header, footer, styling (colors etc..)
Inconsistency between figure description and main text is because the description is IN the graph. Nothing can be done here

A wish list is good, but let's try to keep the expectations reasonable. Or we need to use something else to create pdf

@sfrechen
Copy link
Member

sfrechen commented Jun 27, 2019

The typical github style how md files are presented looks pretty good. Any chance to adopt the style sheet?

@msevestre msevestre added pdf type: feature New feature or request labels Jun 27, 2019
@msevestre
Copy link
Member

@sfrechen @Incei @Yuri05
I'll have a designer look at what can be done to improve the styling.

Time to add all the features here :)

@Yuri05 Yuri05 added this to the Milestone 2 milestone Jul 2, 2019
@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

Dear @msevestre @Yuri05 are there any improvements on the wish-list above, and if so which ones :).

Regarding the issue 'hyperlinks are not created when converting to pdf' This should be possible as e.g. with Typora it works when exporting to pdf. This also counts for the table of contents with hyperlinks.

Additional wish:

  • option to have 2 plots in 1 page, without 'cutting-the-figure-in-half' spread in 2 pages. :) This seems also to work with typora.

Many thanks!

@msevestre
Copy link
Member

@Incei None. I have someone who is going to work on this package in the next few weeks to optimize the layout. However, the package that we are using is limited in terms of functionality. We will never be able to create a pdf that looks like a report you export from words and as such, expectation should be set accordingly

What is typora? Are you able to create a pdf from our markdown export?

@msevestre
Copy link
Member

Another option is to use pandoc to create the pdf. This requires latex but will create much nicer pdf that what we currently have

@msevestre
Copy link
Member

But this is a massive undertaking...that will require some time to investigate

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

@Incei None. I have someone who is going to work on this package in the next few weeks to optimize the layout. However, the package that we are using is limited in terms of functionality. We will never be able to create a pdf that looks like a report you export from words and as such, expectation should be set accordingly

What is typora? Are you able to create a pdf from our markdown export?

Typora is a markdown editor too, yes it can create a pdf from our markdown export, however the markdowns need to be merged first together via a seperate script first (although I did not check if this is also a feature in typora).

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

pan

Another option is to use pandoc to create the pdf. This requires latex but will create much nicer pdf that what we currently have

pandoc is integrated /can be integrated with typora

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

"In Typora, import function and export function for some file formats (including docx, odt, rtf, epub, LaTeX and wiki) are powered by a 3rd party software named Pandoc. Those features requires Pandoc (≥ v1.16) to be installed.

Please note that install Pandoc is optional for Typora, if you do not need those advanced import/export support in typora, then you do not have to install Pandoc on your computer."

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

@msevestre
Copy link
Member

typora is using pandoc for export

What we can do is change the script to unify all markdown in one (whatever that means) to create a markdown that typora can use. Then use typora to create the report.

Is this acceptable for everyone? Probably way easier than implementing the stuff ourselves

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

yes from my side. @sfrechen @Yuri05 ?

@msevestre
Copy link
Member

Note: Typora will not be free forever. But still :)

@Incei Please describe what needs to be done to migrate our joined markdown into a markdown that typora can understand

Our markdown is conformed to specs so I am not sure why we would need to change anything

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

I don't know what the current specs are, but

when i copied all the markdown files from the markdown_for_pdf in the corrected order into 1 MD file, i could open it with typora and export it to pdf. The only thing i did different is:

  • I typed [TOC] un the the titel ,instead of copying over the summary.MD file
  • i changed all the references to the reference chapted within the MD file...

I have an example copied where you can see the difference. https://github.com/Incei/Raltegravir-Model/tree/master/report_under_review/pdf ..files merged.pdf (and merged.md) versus old output.pdf

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

Additionally 2 figures per page are created...
note: there is still 1 figure that is split in 2 pages, dont understand yet why. But i leave that to you experts :) (maybe its missing an 'enter' )

@msevestre
Copy link
Member

I think we should aim at having only one figure per page in any case. Our figures are always different etc... Without any manual editing, it will never work

@msevestre
Copy link
Member

@Incei The tables are weirdly formatted with typora. There is always en empty column...

@msevestre
Copy link
Member

no page number etc...
So I'd strongly suggest to make sure we can get exactly what we want out of typora before moving this way. This seems to me to be a step in the wrong direction looking at the merged pdf provided

We have no time to investigate typora BTW. We will rely on your decision and once we move, we are all in.

@msevestre
Copy link
Member

option to have 2 plots in 1 page, without 'cutting-the-figure-in-half' spread in 2 pages. :) This seems also to work with typora.

I do not know how this is possible with a dynamic approach. Even typora does not seem to get it right and this is the only thing they do. I would vote against this feature

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

I didnt say it was perfect :), it even creates a bookmarks-naviation pane.

@Incei The tables are weirdly formatted with typora. There is always en empty column...

This is my manual copy-paste error..it exported the exact copy of the MD file which i also updated.

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

no page number etc...
So I'd strongly suggest to make sure we can get exactly what we want out of typora before moving this way. This seems to me to be a step in the wrong direction looking at the merged pdf provided

We have no time to investigate typora BTW. We will rely on your decision and once we move, we are all in.

I did not check the page numbering...but its also not my idea to investigate this into all the details.

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

I also dont know it this is the perfect solution, but comparing it with our current pdf, it is defenitally not in the wrong direction ;).

If you dont have time to invest for this alternative approach, then that is a pitty. I cannot say anything about that :). I was thinking even that we could just create 1 output MD file as final report output.

Users can themselves then create a pdf/word file/latex file etc themselves via typora, depending on the intended use. This would even mean much less effort for you..?

@msevestre
Copy link
Member

@Incei I think someone (you probably) needs to make sure that this tool matches your expectations. If yes, we can consider. If not, then we can forget about it

There is no way for the very small dev team that we have to spend time on such a satellite feature. It would be easy to generate an export for typora that one could load in the tool directly. I'd say 4h work probably.

The question is: Do we want to invest the time (and money) to fix our markdown -to pdf script to export pdf? or do we agree that we are going to use a 3rd party tool to create pdf from markdown

@msevestre
Copy link
Member

@Yuri05 I have someone ready to start working on that very soon so I need to know asap

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

@msevestre I will discuss this in our team meeting, and get back to this :)..
Cheers,

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

correction...you are right...for windows its also beta :) hmm

@msevestre btw, how do you know it will not remain freeware for windows? I could only read on the site that they referred to Mac versions to be free during beta.

"* Free during beta. Available for mac OS X 10.13 and later."

@Yuri05
Copy link
Member

Yuri05 commented Aug 9, 2019

What we can do is change the script to unify all markdown in one (whatever that means) to create a markdown that typora can use. Then use typora to create the report.
Is this acceptable for everyone? Probably way easier than implementing the stuff ourselves

For me: YES

@msevestre
Copy link
Member

It might remain free for windows but this would be a weird strategy to make it pay for one platform and not the other. At any rate, we cannot assume it will be always free

@Incei
Copy link
Member Author

Incei commented Aug 9, 2019

This is ofcourse not ideal if it will be paid version lateron, but if we only would use typora for exporting into PDF, there are also other free md to pdf convertors out there.

The point of discussion (i believe) is not typora, its MD-joiner. If we decide that we only create a single report.MD file as final output, and if there are other free ways to convert it to a pdf with the wishes as mentioned above included, then we are fine i think without any additional effort...right ?

Have a nice weekend! :)

@msevestre
Copy link
Member

its MD-joiner. If we decide that we only create a single report.MD file as final output,

This requirement is only for typora at the moment so yes it has something to do with it.

I am going to put the upcoming implementation on hold for now (e.g. update our own MD to PDF converter) and focus on creating one output file FOR typora. If other MD to PDF tool support this format, even better

@msevestre
Copy link
Member

@Incei. The old output has another formatting than the one we are creating by default .How did you do that? (tables are differents, colors are different etc..)

@msevestre
Copy link
Member

@Incei @Yuri05

Can either of you paste here a link to the output of the markdown joiner for a real qualification use case? In github, I can only find the generated pdf, which is not very useful

What I want Ideally, for example for a CYP3A4 qualification, is
1/ The output of the reporting engine
2/ The output of the markdown joiner (although I can create it myself if it is not available)

Thanks

@msevestre
Copy link
Member

page number: https://pdfpagenumber.com/...yet another tool

@Incei
Copy link
Member Author

Incei commented Aug 12, 2019

@Incei @Yuri05

Can either of you paste here a link to the output of the markdown joiner for a real qualification use case? In github, I can only find the generated pdf, which is not very useful

What I want Ideally, for example for a CYP3A4 qualification, is
1/ The output of the reporting engine
2/ The output of the markdown joiner (although I can create it myself if it is not available)

Thanks

I have uploaded the output o the md joiner and RE zipped under:

https://github.com/Incei/test2

@Incei. The old output has another formatting than the one we are creating by default .How did you do that? (tables are differents, colors are different etc..)

Additionally i added under https://github.com/Incei/test2 the pdf-styles.css file which is adjusted by Sebastian originally located under ' \markdown-joiner\src\styles'

@msevestre
Copy link
Member

Shouldn't we use this style instead of the one we have already? I think it looks quite nice as is (and I am not sure that we should migrate away from the current implementation in that case considering all the issues that there is with typora).

So what do you want us to do?

@Incei
Copy link
Member Author

Incei commented Aug 12, 2019

For the pediatric reports it looks great. For the DDI report we need to align with @sfrechen

@sfrechen ok for you? (thinking of our last ddi results pdf the tables and plot looked weird..? ).

@sfrechen
Copy link
Member

No, we should not use it. It does not work with DDI.
I found this stylesheet by accident somewhere.
@Incei : this was jsut for testing purposes!

@msevestre
Copy link
Member

msevestre commented Aug 12, 2019

But the stylesheet is only about how things look and is not related to content. Why should it work with one use case and not the other? What issues were you having with DDI?

@sfrechen
Copy link
Member

The stylesheet also formats tables. The tables are not fully displayed anymore.
@Incei Actually, you found that! Why do you propose the usage then?

@Incei
Copy link
Member Author

Incei commented Aug 12, 2019

The stylesheet also formats tables. The tables are not fully displayed anymore.
@Incei Actually, you found that! Why do you propose the usage then?

That is exactly what i wrote...it doesnt work for our latest DDI work. We did not investigate why it didnt work for this latest work...

We have however seen that the format can look much nicer. Should we not try to make it work for DDI too??

@Incei
Copy link
Member Author

Incei commented Aug 12, 2019

@sfrechen, for my understanding you were not happy with the current format.. Im trying to improve it, unless you prefer not to change it. Then we leave everything as it is. :)

@msevestre
Copy link
Member

Ok we could work with the current version and make sure it does not screw up table.
Can we have examples of reporting engine output so that we can work with the two scenarios ?

@sfrechen
Copy link
Member

If we remove the blue color, that would already be quite an improvement (and pretty simple in the stylesheet).

@msevestre
Copy link
Member

The stylesheet was left intentionally ugly so that we would need to update it with some user input :)

@msevestre
Copy link
Member

ok so let's forget about typora for now and update the stylesheet to fit all scenarios

Please send us links for pediatric and DDI reporting engine outputs

@sfrechen
Copy link
Member

That means, you are able to fix the other issues, like no hyperlinks and no md code interpretation?
Typora does all that.
Irrespective of stylesheet (I believe)

@Incei
Copy link
Member Author

Incei commented Aug 12, 2019

@msevestre Im a little confused :). Do we want to forget about typora, ignore the alternative stylesheet and only change coloring?

@sfrechen, what I understand from @msevestre is that we cannnot fix the other issues and have to live with the way we have it currently, if we dont switch to e.g. typora instead....

@msevestre
Copy link
Member

Guys I have no idea what you want us to do. Please be clear and we'll go from there.
I will put on hold any new development until I understand what is it you want exactly.

I have tried typora and it cuts images, does not hvae page number, does not work with standard MD table and adds empty colums etc.. If this is what you want to use, we will use it.

If your only complain is styling, we can update the stylesheet.

I have no idea what md code is

@msevestre
Copy link
Member

see #32 PDF will now be creaeted using typora. If typora supports your requirements, it will work

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pdf type: feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants