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

Incorrect LaTeX syntax results in wrong line skip #34

Open
samcarter opened this issue Feb 8, 2023 · 3 comments
Open

Incorrect LaTeX syntax results in wrong line skip #34

samcarter opened this issue Feb 8, 2023 · 3 comments
Assignees
Milestone

Comments

@samcarter
Copy link

samcarter commented Feb 8, 2023

System settings:

  • Quarto v1.3.49
  • nmfs-opensci/titlepage v3.3.8
  • macOS 11.7.2
  • Texlive 2022

Description

A simple test file like

---
title: "Some Very Long Title Which Spans Multiple Lines "  
format:  
  titlepage-pdf:  
    titlepage-theme:   
      title-fontstyle: Huge
---  

test

will result in the following latex syntax for the title:

{{\Huge{\nohyphens{Some Very Long Title Which Spans Multiple
Lines}}}\par
}%

There are a couple of problems with this syntax. The most important one is that the paragraph is ended at the wrong position. If you insert \par only after you switched back from the custom font size, then the text will be set with a wrong baselineskip (the one from the normal font around it and not with your title font). Try the following two lines to see the difference:

{{\Huge{\nohyphens{Some Very Long Title Which Spans Multiple
Lines}}}\par
}%

{{\Huge{\nohyphens{Some Very Long Title Which Spans Multiple
Lines}}\par}
}%

Screenshot 2023-02-08 at 10 45 56

Another potential problem: Depending on what comes after the title, you might get an additional space from the unprotected line ending after \par}

Not a problem as such, just unnecessary:

  • the outermost {...} is unnecessary
  • font size commands like \Huge etc are switches and don't take an argument. Instead of writing \Huge{...} it should normally be \Huge ...
@eeholmes
Copy link
Member

Thanks for bringing this up. I am not able to replicate your image. Mine looks ok with the title broken where expected.

image

Re font size commands, I don't know what font styles the user will use and \whatevertheyputin{...} seemed to be a fairly robust solution. However in general the font specs commands, like \Huge, have been a bit flakey. Using title-fontsize which takes a different approach to setting font size has been more robust.

My system settings and what I compiled with:

  • Quarto v1.2.335
  • nmfs-opensci/titlepage v3.3.8
  • macOS 11.6.2
  • XeTeX 3.141592653-2.6-0.999994 (TeX Live 2022)

I'll try updating my quarto to the latest version and see if that changes things.

@samcarter
Copy link
Author

samcarter commented Mar 20, 2023

Thanks for bringing this up. I am not able to replicate your image. Mine looks ok with the title broken where expected.

The break point is fine, but as also evident in your image, the spacing between the lines is wrong. The y and the L nearly touch each other. That's because the \par is at the wrong position in the code.

226378922-695e8d44-a3f9-42e9-8d5d-e76301054670

@eeholmes
Copy link
Member

EEH: to do for this issue

  • Try changing the placement of the \par
  • Try adding % after the \par to get rid of the line feed
  • The issue with \Huge ... being the right syntax won't fix since I don't know what the user will pass in for fontstyle and some need \foo{} syntax. Anyhow \Huge{} seems to work 'ok'.
{{\Huge{\nohyphens{Some Very Long Title Which Spans Multiple
Lines}}}\par
}%

{{\Huge{\nohyphens{Some Very Long Title Which Spans Multiple
Lines}}\par}
}%

@eeholmes eeholmes self-assigned this May 13, 2023
@eeholmes eeholmes added this to the 3.4 milestone May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants