0

I was trying to put two images one next to the other, and then I noticed there was a big gap between the letters of the subcaptions inside the parenthesis(?)!

enter image description here

Any idea how this can be avoided?


\documentclass {article}
\usepackage {mwe}
\usepackage{xltxtra}
\usepackage{xunicode}
\usepackage{xgreek}
\usepackage[LGRx,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,greek]{babel}
\usepackage{alphabeta}
\usepackage{subcaption}
\usepackage{kerkis} % Fonts
\XeTeXlinebreaklocale "el"
\setmainfont[
    UprightFont = Kerkis,
    ItalicFont  = KerkisItalics,
    SlantedFont = KerkisItalics,
    BoldFont    = Kerkisb,
    BoldItalicFont  = Kerkisbi,
    BoldSlantedFont = Kerkisbi,
    SmallCapsFont    = KerkisSmallCaps]
    {Kerkis}
\newfontface\bfsc{KerkisSmallCaps-Bold}


\begin {document}
\blindtext

\begin {figure}
 \begin{subfigure}[b]{0.48\linewidth}
\includegraphics [width =\linewidth] {example-image-a}
\subcaption{Κάτι στα ελληνικά}
\label{Figure:FIG_A}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\linewidth}
\includegraphics [width =\linewidth] {example-image-b}
\subcaption{Something in English}
\label{Figure:FIG_B}
\end{subfigure}
\caption{Εικόνα Α (Αριστερά) και Εικόνα Β (Δεξιά)}
\label{Figure:FIG_A_B[![enter image description here][1]][1]}
\end{figure}

\end{document}
  • Which engine do you use to compile this code? – AndréC Jul 9 at 18:57
  • 1
    \usepackage[LGRx,T1]{fontenc} is 8bit font setup, for pdflatex, but \usepackage{xltxtra}\usepackage{xunicode} are packages for xelatex, you can not use both sets. – David Carlisle Jul 9 at 19:51
  • 1
    Hi @AndréC. I am using XeLaTeX to compile the code. – V. Nikolaidis Jul 10 at 11:20
  • Hi @DavidCarlisle. So I removed '\usepackage[LGRx,T1]{fontenc}' from my code, however, nothing changed regarding the Gap section. I also experimented and removed the packages '\usepackage{xltxtra}' & '\usepackage{xunicode}', but no luck either... – V. Nikolaidis Jul 10 at 11:29
  • yes looks like some macro has missing % at ends of lines and making spaces, but I couldn't run the example as I don't have the font so the questions were to check you intended xetex (rather than pdftex) – David Carlisle Jul 10 at 11:47
1

enter image description here

If I remove pdftex font code and switch to a font that I have available that has Latin and Greek alphabets I get the above.

Which implies that your "gap" is probably a missing ' in the font you are using. Check the log for missing character warnings. I do not have the Kerkis font set to suggest if there is a compatible character that could be used here, but posting this as a partial answer to show the image (with Arial font).

\documentclass {article}
\usepackage {mwe}
%\usepackage{xltxtra}
%\usepackage{xunicode}
\usepackage{fontspec}
\usepackage{xgreek}
%\usepackage[LGR,T1]{fontenc}
%\usepackage[utf8]{inputenc}
\usepackage[english,greek]{babel}
\usepackage{alphabeta}
\usepackage{subcaption}
\usepackage{kerkis} % Fonts
\XeTeXlinebreaklocale "el"
\setmainfont{Arial}

\begin {document}
\blindtext

\begin {figure}
 \begin{subfigure}[b]{0.48\linewidth}
\includegraphics [width =\linewidth] {example-image-a}
\subcaption{Κάτι στα ελληνικά}
\label{Figure:FIG_A}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\linewidth}
\includegraphics [width =\linewidth] {example-image-b}
\subcaption{Something in English}
\label{Figure:FIG_B}
\end{subfigure}
\caption{Εικόνα Α (Αριστερά) και Εικόνα Β (Δεξιά)}
\label{Figure:FIG_A_B[![enter image description here][1]][1]}
\end{figure}

\end{document}

The accent comes from the babel greek redefinition of \alph for alphabetic numbering, if you add

\renewcommand\thesubfigure{\arabic{subfigure}}

after the subcaption package these will be labelled (1) and (2).

  • Hi David. Thanks for your valuable information. I searched for the 'missing character' and i found quite a few inside the log.. But the ones below are the one regarding the case I am investigating now. 'LaTeX Info: Redefining \anw@print on input line 20.Missing character: There is no ʹ in font Kerkis/OT:mapping=tex-text;! LaTeX Info: Redefining \anw@print on input line 20.Missing character: There is no ʹ in font KerkisBold/OT:mapping=tex-text;!' – V. Nikolaidis Jul 10 at 12:52
  • @V.Nikolaidis I'm sorry I do not read Greek, so this is a naive question. Do you want the ' accents here? As an alternative to setting up the font so it works would be to customise the counter display just to use alpha, beta, or a, b or 1, 2 or anything else that didn't involve this accent. – David Carlisle Jul 10 at 13:21
  • That is a negative @David. I do NOT want the ' accents here. Does this mean that a) I have to contact the authors of the fonts for a fix, b) find a manual workaround or c) change Greek Fonts that might behave better in the document? – V. Nikolaidis Jul 10 at 13:44
  • @V.Nikolaidis no that's the easy case, babel greek will be defining the numbering to use this accented form so all you have to do is redefine that (or it may have an option to do that) probably just \renewcomand\thesubfigure{\alph{subfigure}} is all you need but let me see... – David Carlisle Jul 10 at 14:08
  • @V.Nikolaidis I added a redefinition at the end of the answer, the alternative of redefining the greek \alph command for alphabetic labels with no accent would be better done by someone who knows the language I think. – David Carlisle Jul 10 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.