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

Write non-breaking space as "~" in LaTeXWriter #2300

Merged
merged 6 commits into from
Oct 23, 2023

Conversation

goerz
Copy link
Member

@goerz goerz commented Oct 13, 2023

In DocumenterCitations, non-breaking spaces (nbsp="\u00A0") are used pretty extensively, e.g., in author names ("M.$(nbsp)H.$(nbsp)Goerz").

Currently, the LaTeXWriter leaves these unchanged, so that a unicode non-breaking space ends up in the TeX file. Depending on fonts installed on the user's system and their general LaTeX setup, that doesn't tend to work too well, see JuliaDocs/DocumenterCitations.jl#46 (comment).

This PR recognizes \u00A0 as a character that needs to be "escaped" and replaces it with the standard ~ that LaTeX traditionally uses to indicate non-breaking spaces.

Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @goerz! Will tag as soon as this is merged.

Project.toml Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@mortenpi mortenpi added Format: LaTeX Related to the LaTeX / PDF output Type: Bugfix labels Oct 23, 2023
@mortenpi
Copy link
Member

@goerz It looks like the maintainer access to the PR is not enabled. Do you mind enabling it so that I could push a small additional test?

@goerz
Copy link
Member Author

goerz commented Oct 23, 2023

Do you mind enabling [maintainer access]

I would certainly not mind… but I don't seem to be able to figure out how!

@mortenpi
Copy link
Member

From a different PR, but there should be a thingy like this at the bottom of the right sidebar:

image

And it should also ask that under the PR description text box when you open a PR.

@mortenpi mortenpi enabled auto-merge (squash) October 23, 2023 08:46
@mortenpi mortenpi merged commit 6052e5f into JuliaDocs:master Oct 23, 2023
19 of 21 checks passed
@mortenpi mortenpi deleted the nbsp branch October 23, 2023 09:25
goerz added a commit to JuliaDocs/DocumenterCitations.jl that referenced this pull request Oct 23, 2023
Documenter changed how non-breaking spaces are written to LaTeX, see
JuliaDocs/Documenter.jl#2300

This checks the version of Documenter in the tests, so it works both
with old and new versions of Documenter.
@goerz
Copy link
Member Author

goerz commented Nov 3, 2023

I'm pretty sure I've seen that "Allow edits and access to secrets by maintainers" option before on other PRs I've opened, but with Documenter, it's just not there for me, for this PR or for #2330 which I just opened. I have absolutely no idea why. In any case, I've given you write access to my entire goerz-forks/Documenter.jl repo from which I'm opening these PRs, so hopefully that'll be sufficient.

@goerz
Copy link
Member Author

goerz commented Nov 3, 2023

Ah! It's a Github bug! https://github.com/orgs/community/discussions/5634

I have a goerz-forks organization that I normally use for making PRs so as not to litter my main account with cloned throw-away forks. Maybe I'll have to rethink that :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Format: LaTeX Related to the LaTeX / PDF output Type: Bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants