2

To reproduce the unwanted behaviour if in my .tex file I have

\documentclass[12pt]{report}

\usepackage{enumerate}

\usepackage[inline]{enumitem}

\usepackage{fontspec}

\setmainfont{Times New Roman}

\usepackage[greek, english]{babel}

\begin{document}
\selectlanguage{greek}

\begin{enumerate}[label = \alph*)]

\item first line

\item second line

\end{enumerate}

\end{document}

I get this as output, where you can see the squares next to letters How to get rid of them? PS: I run XeTeX

enter image description here

David Carlisle
  • 757,742
  • 2
    Welcome to TeX.SX! As you seem to be writing in Greek, some more information is needed. Please, add a minimal example starting from \documentclass up to \end{document}. – egreg Oct 09 '18 at 22:14
  • Sorry, but I can't reproduce the issue. I removed \usepackage{enumerate} (you shouldn't load both it and enumitem), but it's not relevant. Do you get some message in the log file about Missing character? – egreg Oct 09 '18 at 22:25
  • Just now I noticed that if i choose Consolas as argument at setmainfont command, I don't get rectanlge but i get an accent " ' ". Maybe that character is missing. Let me check the log file and I'll come back – Curious_Dim Oct 09 '18 at 22:30
  • @egreg. Yes! as I looked in the log file there is this line "Missing character: There is no ʹ in font Times New Roman/OT:mapping=tex-text;!" – Curious_Dim Oct 09 '18 at 22:32
  • @egreg. The point now is that neither ' character is desirable in the output. I would like an output as if I had selected english language but with greek letters in the enumeration (i.e. without ' after each letter) – Curious_Dim Oct 09 '18 at 22:35
  • Apparently it depends on the version of Times New Roman you have on your machine. I think it can be solved by removing the “apostrophe”. Stay tuned. – egreg Oct 09 '18 at 22:36

1 Answers1

2

It's apparently a problem with the version of Times New Roman you have on your machine, because with mine the “apostrophe” appears. The dashed rectangle is a sign that a character is missing from the font.

If you want to remove it from the particular environment, you can recycle an answer of mine; it was written for polyglossia and xgreek, but works also here.

\documentclass[12pt]{report}
\usepackage{fontspec}
\usepackage[english,greek]{babel}

\usepackage[inline]{enumitem}
\usepackage{etoolbox}

\setmainfont{Times New Roman}

% recycled from https://tex.stackexchange.com/a/292127/4427
\makeatletter
\renewrobustcmd{\anw@true}{\let\ifanw@\iftrue}
\renewrobustcmd{\anw@false}{\let\ifanw@\iffalse}\anw@false
\newrobustcmd{\noanw@true}{\let\ifnoanw@\iftrue}
\newrobustcmd{\noanw@false}{\let\ifnoanw@\iffalse}\noanw@false
\renewrobustcmd{\anw@print}{\ifanw@\ifnoanw@\else\numer@lsign\fi\fi}
\newrobustcmd{\noanw}{\noanw@true}
\makeatother

\begin{document}

\begin{enumerate}[label = \noanw\alph*)]
\item first line
\item second line
\end{enumerate}

\end{document}

enter image description here

Note that \selectlanguage{greek} is not needed if you load greek last.

Also, enumerate and enumitem fight each other, so just one of them should be loaded (the latter is much more powerful).

Final recommendation: fontspec should be loaded before babel when Greek is involved.

enter image description here

Alternative solution if you want to remove the “apostrophe” altogether from your document

\documentclass[12pt]{report}
\usepackage{fontspec}
\usepackage[english,greek]{babel}

\usepackage[inline]{enumitem}
\usepackage{etoolbox}

\setmainfont{Times New Roman}

% see https://tex.stackexchange.com/a/173572/4427
\renewcommand\textdexiakeraia{}    

\begin{document}

\begin{enumerate}[label = \alph*)]
\item first line
\item second line
\end{enumerate}

\end{document}
egreg
  • 1,121,712
  • +1 for the tip of \selectlanguage{greek}, I found, the hard way, that changing the order from english,greek to greek, english the command is necessary. Now I learned a way not to be. I think this solution of yours is more suitable for removing the apostrophe https://tex.stackexchange.com/questions/173534/how-to-enumerate-with-capital-latin-or-greek-letters-without-the-apostrophe – Curious_Dim Oct 09 '18 at 22:57
  • Yes Times New Roman was installed manually on my linux machine, now is a challenge to reinstall manually a recent-working set of this type of fonts – Curious_Dim Oct 09 '18 at 22:59
  • @Curious_Dim I had forgotten about the other strategy. Added. – egreg Oct 09 '18 at 23:10