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

Some => ligature doesn't work with Scala #3

Open
limansky opened this issue Nov 24, 2019 · 2 comments
Open

Some => ligature doesn't work with Scala #3

limansky opened this issue Nov 24, 2019 · 2 comments

Comments

@limansky
Copy link

Hi,

I've found that => doesn't replaced with ligature for Scala code in lstlisting. E.g.

\documentclass{article}
\usepackage{fontspec}
\setmonofont{FiraCode-Regular.otf}[
  BoldFont=FiraCode-Bold.otf,
  Contextuals=Alternate% Activate the calt feature
]

\usepackage{xcolor}
\usepackage{listings}
\usepackage[verbatim]{lstfiracode}% Activate ligatures in verbatim

\lstset{
  language=scala,
  style=FiraCodeStyle,% Use predefined FiraCodeStyle
  basicstyle=\ttfamily,% Use \ttfamily for source code listings
  commentstyle=\color{orange}
}

\begin{document}

\begin{lstlisting}
object Main extends App {

  println("Hello world")

  def foo(lst: List[String]) = {
    lst.sortBy((a, b) => a >= b)
  }
}

\end{lstlisting}
\end{document}

I suppose it's because => is defined as keyword in lstlisting for Scala

@RuixiZhang42
Copy link
Owner

@limansky You are probably right. I will need to figure out something to override the language=scala setting.

@limansky
Copy link
Author

limansky commented Dec 3, 2019

I wish it still would have a color and font weight defined for keywords, but printed as a ligature.

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