0

I am having issues getting a nice font for my paper as whatever I try, the serif font just looks way too thin in places and parts of characters are disappearing.

enter image description here enter image description here

You can see it in the "A", "e", "g" "s", "o" and some other places.

My preamble looks like this:

\documentclass[12pt]{report}

\usepackage[tmargin=2cm,rmargin=1in,lmargin=1in,margin=0.85in,bmargin=2cm,footskip=.2in]{geometry}
\usepackage{amsmath,amsfonts,amsthm,amssymb,mathtools}
\usepackage{mathtools}
\usepackage{hyperref,theoremref}
\hypersetup{
    pdftitle={Thesis},
    colorlinks=true, linkcolor=doc!90,
    bookmarksnumbered=true,
    bookmarksopen=true
}
\usepackage{multicol,array}
\usepackage{tikz-cd}
\usepackage[ruled,vlined,linesnumbered]{algorithm2e}
\usepackage{comment}
\usepackage{import}
\usepackage{microtype}
\usepackage{fancyhdr}
\usepackage{tikzsymbols}
\usepackage{tabularray}


\usepackage{tkz-graph}

\usepackage{xcolor}
\usepackage{libertine}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{helvet}

\DisableLigatures{encoding = *, family = *}
\begin{document}


This chapter will describe a language modelling framework that seeks to solve the previously described problems. The framework automatically induces a hierarchical, graph based N-Gram structure from raw text, which is easy to explain, predict and efficiently updateable. The structure models the text as a hyperedge which has been compressed into a grammar-like structure of nested hyperedges. The structure avoids repetitions and other redundancy while maintaining all of the containment relations between elements which are used for a count-based language modelling.


\end{document}

I compile in vs-code using Latex Workshop using the lualatex command:

    "latex-workshop.latex.tools": [
    
        {
            "name": "latexmk",
            "command": "lualatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "--output-directory=%OUTDIR%",
                "%DOC%"
            ],
            "env": {}
        },
    ],
14
  • unrelated but this comment is completely wrong: \usepackage{comment} % enables the use of multi-line comments (\ifx \fi) Commented Sep 24, 2023 at 14:34
  • As always, it would help if you made your example have some text and showed the output of the posted code, not a different document, then people can compare and debug. Commented Sep 24, 2023 at 14:35
  • @DavidCarlisle okay, good to know, its from a template, so not my fault :D
    – simulate
    Commented Sep 24, 2023 at 14:35
  • never use weird templates and never include packages you are not using. Commented Sep 24, 2023 at 14:37
  • @DavidCarlisle that is literally all there is to it.. in the document I can just write only text and it gives the same effect. There is nothing else in the preamble.
    – simulate
    Commented Sep 24, 2023 at 14:42

1 Answer 1

1

The posted code produces

enter image description here

Your image does not appear to be using Linux Libertine, which can not happen unless you got an error or warning about missing files. (After any error the pdf is not intended to be usable, just a debugging aid)

what is the ouput of pdffonts on your pdf, it should be:

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
KYKDBY+LinLibertineT                 Type 1            Custom           yes yes yes     11  0

The document is set up for 8 bit fonts: if you use lualatex you get the warning

LaTeX Font Warning: Font shape `T1/LinLibertine(0)/m/n' undefined
(Font)              using `T1/cmr/m/n' instead on input line 112.

so uses cm fonts not linux libertine. It looks as if you only have bitmap T1 fonts installed (which means most likely you are usiung miktex and have not installed the cm-super package with type1 cm fonts)

8
  • I am using TexLive and it shows cm-super as installed.. I removed [T1] from fontenc and now it shows the libertine font
    – simulate
    Commented Sep 24, 2023 at 14:56
  • that explains why you are getting cm fonts, not why they rendered so poorly, what does pdffonts report, type1 or type 3? @stimulate Commented Sep 24, 2023 at 15:00
  • QZOAHE+LinLibertineO CID Type 0C and RADTPX+LinLibertineMO CID Type 0C
    – simulate
    Commented Sep 24, 2023 at 15:03
  • 1
    with luatex you usually don't need any font packages at all, just load fontspec and then select the font you want. There are no "random encodings" involved as you just need OpenType Unicode encoded fonts. @stimulate Commented Sep 24, 2023 at 16:28
  • 1
    well if you don't want to mess with font-specific packages, yes. Of course for some fonts, the package author may know more about the font than you eg options to select funky swash capitals but if you just want to load a font from your system and have latex figure out matching italic and bold versions, then fontspec is your friend. The libertine package you use here is essentially: if luatex just load fontspec else if pdftex do lots of stuff loading tex-specific font subsets @stimulate Commented Sep 24, 2023 at 16:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .