Searched online for similar cases and didn't find anything relevant.
The context is that I recently was made aware that the French insist that a thin space be inserted immediately before some punctuation characters ',:!?»%' etc.… So in dialogs for instance e.g. … the .md source has: « · bonjour mademoiselle · » where the middle dots represent a single U+202f non-breaking space.
When I take a look at the intermediate .tex file that pandoc generates the thin spaces are correctly converted to '\,' which I believe is the latex way of coding thin spaces. But when I run xelatex on the latex file and look at the resulting PDF I can see that the thin spaces have become regular-width spaces.
I compared the PDF output to another PDF I had created using plain latex rather than pandoc and the U+202F's that I typed in my .tex source clearly materialize as thin spaces in the PDF.
What I suspect at this point is that one of the latex packages that pandoc sticks in the generated latex file (or the way it is invoked? perhaps a combination of packages? …?) is causing this.
As to an MWE… I'm not sure it's really appropriate in this particular case…
Just in case… here's what I get from a minimal .md input file:
`\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[oneside,10pt,french,]{extbook} % cjns1989 - 27112019 - added the oneside option: so that the text doesn't jump left & right when reading on a tablet/ereader
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provides euro and other symbols
\else % if luatex or xelatex
\usepackage{unicode-math}
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
% \setmainfont[]{EBGaramond-Regular}
\setmainfont[Numbers={OldStyle,Proportional}]{EBGaramond-Regular} % cjns1989 - 20191129 - old style numbers
\fi
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\usepackage{hyperref}
\hypersetup{
pdftitle={WME},
pdfborder={0 0 0},
breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
\usepackage[papersize={3.75 in, 6.0 in},left=.3 in,right=.3 in]{geometry}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
% set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[shorthands=off,main=french]{babel}
\else
% load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic)
\usepackage{polyglossia}
\setmainlanguage[]{french}
\fi
\title{WME}
\date{}
\begin{document}
\maketitle
\$ ECM
\hypertarget{wme-title}{%
\chapter{WME (title)}\label{wme-title}}
en lettres capitales, soigneusement imprimées au pochoir\,:
--- «\,Crétins\,!\,» murmura-t-il.
\end{document}`
Customization is minimal: old style numbers (proportional) and one-sided since the document is not destined for hard-copy printing…
What I have in mind at this point to try and figure out what is happening is to work
with a one line .md source that has some U+202F's and remove default packages
until the problem goes away but before I do this I thought maybe someone
has run into something similar or might suggest a better approach than
plain trial and error to help determine the cause of the problem.
Thoughts?
Thanks,
CJ