zepinglee / citeproc-lua

A Lua implementation of the Citation Style Language (CSL) for use with LaTeX
MIT License
64 stars 8 forks source link

Hyphen not showing between page range, and words #80

Open ay111 opened 1 week ago

ay111 commented 1 week ago

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

zepinglee commented 1 week ago

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 commented 1 week ago

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: @.***>

zepinglee commented 1 week ago

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 commented 1 week ago

It seems the error was caused by the mathptmx package.

zepinglee commented 1 week ago

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