citeproc-lua icon indicating copy to clipboard operation
citeproc-lua copied to clipboard

Hyphen not showing between page range, and words

Open ay111 opened this issue 1 year ago • 5 comments

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]

ay111 avatar Oct 11 '24 13:10 ay111

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).

zepinglee avatar Oct 12 '24 08:10 zepinglee

I realized that \usepackage[T1]{fontenc} is causing the omission of apostrophe and en dash in the bibliography. If I remove it, the citation-style-language package works normally but bold fonts are lost throughout the document. Can you suggest an alternative to T1 font for Lualatex that will retain bold fonts in the rest of the document? Thanks.

On Sat, Oct 12, 2024 at 10:39 AM Zeping Lee @.***> wrote:

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).

— Reply to this email directly, view it on GitHub https://github.com/zepinglee/citeproc-lua/issues/80#issuecomment-2408460140, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK4NBY4BYHDHSCN7EHWHXCLZ3DN5NAVCNFSM6AAAAABPY66Q2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBYGQ3DAMJUGA . You are receiving this because you authored the thread.Message ID: @.***>

ay111 avatar Oct 13 '24 15:10 ay111

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.

zepinglee avatar Oct 14 '24 05:10 zepinglee

It seems the error was caused by the mathptmx package.

ay111 avatar Oct 14 '24 09:10 ay111

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

zepinglee avatar Oct 14 '24 14:10 zepinglee