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

Hyphen not showing between page range, and words #80

Open
ay111 opened this issue Oct 11, 2024 · 5 comments
Open

Hyphen not showing between page range, and words #80

ay111 opened this issue Oct 11, 2024 · 5 comments

Comments

@ay111
Copy link

ay111 commented Oct 11, 2024

The hyphen between page range is not showing after running lualatex. For example 123-125 is shown as 123125. Also hyphen is omitted in compound words e.g Black-Scholes is shown as BlackScholes in texstudio.

Additional information

  • TeX distribution: MiKTEX
  • Package citation-style-language version: [e.g. v0.6.5
  • LaTeX engine: [e.g. pdflatex / xelatex / lualatex]
@zepinglee
Copy link
Owner

The hyphen between page range is not showing after running lualatex. For example 123-125 is shown as 123125.

Can your provide a small piece of LaTeX code to help me reproduce the bug?

Also hyphen is omitted in compound words e.g Black-Scholes is shown as BlackScholes in texstudio.

The correct delimiter in this case should be an en dash rather than a hyphen (see https://en.wikipedia.org/wiki/Dash#Relationships_and_connections and https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model).

@ay111
Copy link
Author

ay111 commented Oct 13, 2024 via email

@zepinglee
Copy link
Owner

I realized that \usepackage[T1]{fontenc} is causing the omission of apostrophe and en dash in the bibliography.

I can reproduce this problem with the following example.

\documentclass{article}
\begin{filecontents}[noheader, overwrite]{\jobname.json}
[
  {
    "id": "ITEM-1",
    "type": "article-journal",
    "author": [
      {
        "family": "Doe",
        "given": "John"
      }
    ],
    "title": "Title",
    "issued": {
      "date-parts": [
        [
          2000
        ]
      ]
    },
    "container-title": "Journal title",
    "volume": "1",
    "issue": "2",
    "page": "123-125"
  }
]
\end{filecontents}
\usepackage[T1]{fontenc}
\usepackage[style=apa]{citation-style-language}
\addbibresource{\jobname.json}
\begin{document}
123--125, 123–125\par
\textbf{123--125, 123–125}\par
\cite{ITEM-1}\par
\printbibliography
\end{document}
Screenshot 2024-10-14 at 12 50 25

If I remove it, the citation-style-language package works normally but bold fonts are lost throughout the document.

I can't reproduce this after removing \usepackage[T1]{fontenc} in the above example. It's probably caused by other packages. Please provide an example to show it (see https://en.wikipedia.org/wiki/Minimal_reproducible_example).

Screenshot 2024-10-14 at 12 54 03

Can you suggest an alternative to T1 font for Lualatex that will retain bold fonts in the rest of the document? Thanks.

I've found the following discussions but I've not fully understood the font encoding problem here. In general it's not recommend to use fontenc with luatex and fontspec can be used instead.

@ay111
Copy link
Author

ay111 commented Oct 14, 2024

It seems the error was caused by the mathptmx package.

@zepinglee
Copy link
Owner

I suggest posting the problem in https://tex.stackexchange.com/.

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