← Back to team overview

desktop-packages team mailing list archive

[Bug 1521047] [NEW] xelatex produces off-by-one error in listings package

 

Public bug reported:

The following LaTeX code produces good PDF with pdflatex, but the
\lstinline adds one to each character (e.g., "abc" -> "bcd") with the
\listingsfont from the listings package.

\documentclass{article}
\usepackage{bera}
\usepackage{listings}
\usepackage{ifxetex}
\ifxetex
   \usepackage{fontspec}\newfontface\listingsfont[Path]{fvmr8a.pfb}
   \newfontface\listingsboldfont[Path]{fvmb8a.pfb}
\else
   \edef\oldtt{\ttdefault}\usepackage[scaled]{beramono}\usepackage[T1]{fontenc}
   \renewcommand*\ttdefault{\oldtt}\newcommand{\listingsfont}{\fontfamily{fvm}\selectfont}
   \renewcommand*\ttdefault{\oldtt}\newcommand{\listingsboldfont}{\fontfamily{fvm}\selectfont}
\fi
\lstset{basicstyle=\listingsfont}
\begin{document}
An example that uses the listingfont to render ``int hms 0123'': \lstinline?int hms 0123?

Now for a program not using the listingfont:
\begin{lstlisting}[language=C]
#include <stdio.h>

int main(void)
{
    printf("Hello world.\n");
    return 0;
}
\end{lstlisting}
\end{document}

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: texlive-latex-recommended 2015.20150625-1ubuntu1
ProcVersionSignature: Ubuntu 4.2.0-19.23-generic 4.2.6
Uname: Linux 4.2.0-19-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
CurrentDesktop: Unity
Date: Sun Nov 29 20:04:29 2015
InstallationDate: Installed on 2015-04-24 (220 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_US
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: texlive-base
UpgradeStatus: Upgraded to wily on 2015-10-23 (37 days ago)

** Affects: texlive-base (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug wily

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to texlive-base in Ubuntu.
https://bugs.launchpad.net/bugs/1521047

Title:
  xelatex produces off-by-one error in listings package

Status in texlive-base package in Ubuntu:
  New

Bug description:
  The following LaTeX code produces good PDF with pdflatex, but the
  \lstinline adds one to each character (e.g., "abc" -> "bcd") with the
  \listingsfont from the listings package.

  \documentclass{article}
  \usepackage{bera}
  \usepackage{listings}
  \usepackage{ifxetex}
  \ifxetex
     \usepackage{fontspec}\newfontface\listingsfont[Path]{fvmr8a.pfb}
     \newfontface\listingsboldfont[Path]{fvmb8a.pfb}
  \else
     \edef\oldtt{\ttdefault}\usepackage[scaled]{beramono}\usepackage[T1]{fontenc}
     \renewcommand*\ttdefault{\oldtt}\newcommand{\listingsfont}{\fontfamily{fvm}\selectfont}
     \renewcommand*\ttdefault{\oldtt}\newcommand{\listingsboldfont}{\fontfamily{fvm}\selectfont}
  \fi
  \lstset{basicstyle=\listingsfont}
  \begin{document}
  An example that uses the listingfont to render ``int hms 0123'': \lstinline?int hms 0123?

  Now for a program not using the listingfont:
  \begin{lstlisting}[language=C]
  #include <stdio.h>

  int main(void)
  {
      printf("Hello world.\n");
      return 0;
  }
  \end{lstlisting}
  \end{document}

  ProblemType: Bug
  DistroRelease: Ubuntu 15.10
  Package: texlive-latex-recommended 2015.20150625-1ubuntu1
  ProcVersionSignature: Ubuntu 4.2.0-19.23-generic 4.2.6
  Uname: Linux 4.2.0-19-generic x86_64
  NonfreeKernelModules: nvidia
  ApportVersion: 2.19.1-0ubuntu5
  Architecture: amd64
  CurrentDesktop: Unity
  Date: Sun Nov 29 20:04:29 2015
  InstallationDate: Installed on 2015-04-24 (220 days ago)
  InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
  PackageArchitecture: all
  ProcEnviron:
   LANGUAGE=en_US
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: texlive-base
  UpgradeStatus: Upgraded to wily on 2015-10-23 (37 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/texlive-base/+bug/1521047/+subscriptions