Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onehalfspacing causes overlapping of titles and text #535

Open
jajberni opened this issue Jun 9, 2023 · 8 comments
Open

onehalfspacing causes overlapping of titles and text #535

jajberni opened this issue Jun 9, 2023 · 8 comments
Labels
bug an unexpected problem or unintended behavior help wanted ❤️ we'd love your help!

Comments

@jajberni
Copy link

jajberni commented Jun 9, 2023

The package onehalfspacing seems to cause some overlapping in the titles of sections and sub-sections.

\usepackage[onehalfspacing]{setspace}

image

Commenting the line or adding explicit title spacing seems to fix it.

\titlespacing\section{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\usepackage[onehalfspacing]{setspace}
@cderv
Copy link
Collaborator

cderv commented Jun 9, 2023

This is part of the Frontiers template 🤔
https://www.frontiersin.org/guidelines/author-guidelines

So I could remove it here, but is this a specific effect expected by Frontiers Journals ?

Is their template broken ?

Maybe this is something else conflicting with this Frontiers requirements settings that we added for some Pandoc's feature support 🤔

@cderv cderv added the bug an unexpected problem or unintended behavior label Jun 9, 2023
@jajberni
Copy link
Author

jajberni commented Jun 9, 2023

That's right; I didn't realize the template comes from Frontiers. It only happens on certain occasions, which I haven't deciphered yet, but it is quite annoying. I have avoided it by introducing some empty lines or breaking the sentence, but it is not ideal. I will investigate a bit further and try to replicate it with the original template downloaded from Frontiers.

@jajberni
Copy link
Author

jajberni commented Jun 9, 2023

It looks like the template is a bit outdated. https://github.com/frontiersin/latex-manuscript-templates/tree/master/Frontiers_LaTex_Templates

In any case, I am unsure if this is the root of the problem.

@cderv
Copy link
Collaborator

cderv commented Jun 9, 2023

Oh didn't know about the github repo. Maybe an issue can be opened there ?

I don't know how often journals updates their template, nor if the content is mandatory or not.

@muschellij2 you added the format in #211 -do you have insight if this is safe to remove this part of the template ?

Otherwise what I can do maybe is

  • Remove from the template and show how to add it using includes = list(in_header=
  • Make it conditional in the template and add a YAML variable to opt-in

@jajberni
Copy link
Author

I have forked the repo and updated the templates to match the template and example from Frontiers:

b9bb1e0

Knitting the same RMarkdown with this version seems to fix my problem:
image

As part of the 'migration', I have done the following:

  • Added the extra optional fields in the affiliation: laboratory and Institute
  • Added a couple of examples for equations and cross-references to the equations
  • Added a couple of examples for adding existing graphics (pdf, eps) and with code, as well as showing how to cross-reference the graphs
    One issue that I found is that the figures were not placed at the end, just after the "Figure captions" section. Therefore I had to use the "float" extra dependency. I am not sure if there is other way around it.

Also, I am not sure how to add the option for generating a template for the supplemental material, which uses a different tex template and format. It is quite a simple tex file, so maybe the best would be just to include the sample template and leave the user the option of modifying it.

Happy to get some feedback before creating a PR.

@cderv
Copy link
Collaborator

cderv commented Jun 12, 2023

I have forked the repo and updated the templates to match the template and example from Frontiers:

So you are saying that the template in rticles needs an update to match latest from Frontier ?
If that is a case, PR welcome for sure !

Added the extra optional fields in the affiliation: laboratory and Institute

Added a couple of examples for equations and cross-references to the equations

In the skeleton.Rmd ? I think so... ✅

Added a couple of examples for adding existing graphics (pdf, eps) and with code, as well as showing how to cross-reference the graphs

All good also ✅

Also, I am not sure how to add the option for generating a template for the supplemental material, which uses a different tex template and format. It is quite a simple tex file, so maybe the best would be just to include the sample template and leave the user the option of modifying it.

This is another file completely ? Like it would be a new companion Rmd file ?

I am not sure to understand how this is working, but we can do a lot in the format function. There is possibility to do a post processing steps and generate another doc if needed.

Manually how does the supplemental materiel works ? You write you article and then you write another doc ?

Happy to get some feedback before creating a PR.

You can send it and we'll discuss in the PR ! Thank you very much for your help !

@cderv cderv added the help wanted ❤️ we'd love your help! label Jun 12, 2023
@jajberni
Copy link
Author

I have forked the repo and updated the templates to match the template and example from Frontiers:

So you are saying that the template in rticles needs an update to match latest from Frontier ? If that is a case, PR welcome for sure !

Added the extra optional fields in the affiliation: laboratory and Institute

Added a couple of examples for equations and cross-references to the equations

In the skeleton.Rmd ? I think so... ✅
Yes, that's right!

Added a couple of examples for adding existing graphics (pdf, eps) and with code, as well as showing how to cross-reference the graphs

All good also ✅

Also, I am not sure how to add the option for generating a template for the supplemental material, which uses a different tex template and format. It is quite a simple tex file, so maybe the best would be just to include the sample template and leave the user the option of modifying it.

This is another file completely ? Like it would be a new companion Rmd file ?

That is right, the problem is that it would need a different template.tex, which I don't know if that would be a problem, or how to manage it.

I am not sure to understand how this is working, but we can do a lot in the format function. There is possibility to do a post processing steps and generate another doc if needed.

Manually how does the supplemental materiel works ? You write you article and then you write another doc ?

The idea situation is:

  1. You write your article with your Rmd template, as usual
  2. In case you need to add supplemental material, you write another Rmd based on a suppmat_template.Rmd with a different document class and template.tex.

However, as far as I can tell, there in always only one template.tex in the resources file. Right?

Happy to get some feedback before creating a PR.

You can send it and we'll discuss in the PR ! Thank you very much for your help !

Sounds great, I'll make sure I remove any unnecessary files and proceed with the PR. We can resolve the supplemental material issue later on.

@cderv
Copy link
Collaborator

cderv commented Jun 15, 2023

I think there is some solutions for the supplementary part, either using a different format, or just switching template used based on a value from an argument in the format.

We could also imagine something where you write your supp material in the same main Rmd like in

# Supplementary Material {#supp}

<content here>

and then we catch this and copy to a different document, and render with a different template.

Anything seems possible - from the more manual to the more automated. We need to find the good balance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior help wanted ❤️ we'd love your help!
Projects
None yet
Development

No branches or pull requests

2 participants