[Tex/LaTex] How to fix the warning: No hyphenation patterns were preloaded for (babel) the language `Portuguese’

hyphenationmiktexpdftex

I am on Windows using this MikTexversion:

pdflatex --version
MiKTeX-pdfTeX 2.9.6211 (1.40.17) (MiKTeX 2.9.6210)
Copyright (C) 1982 D. E. Knuth, (C) 1996-2016 Han The Thanh
TeX is a trademark of the American Mathematical Society.
using bzip2 version 1.0.6, 6-Sept-2010
compiled with curl version 7.52.1; using libcurl/7.52.1 WinSSL
compiled with expat version 2.2; using expat_2.2.0
compiled with jpeg version 9.2
compiled with liblzma version 50020022; using 50020022
compiled with libpng version 1.6.28; using 1.6.28
compiled with libressl version LibreSSL 2.4.4; using LibreSSL 2.4.4
compiled with MiKTeX Application Framework version 1.6211; using 1.6211
compiled with MiKTeX Core version 1.6216; using 1.6233
compiled with MiKTeX Archive Extractor version 1.6211; using 1.6211
compiled with MiKTeX Package Manager version 1.6218; using 1.6229
compiled with poppler version 0.50.0
compiled with uriparser version 0.8.4
compiled with zlib version 1.2.10; using 1.2.10

When I am compiling it, I am getting this boring warning:

D:\User\Documents\latex\texmfs\install\tex\latex\babel-portuges\portuges.ldf: 
Package babel Warning: No hyphenation patterns were preloaded for(babel) 
the language `Portuguese' into the format.

This is my minimal example to trigger this issue:

% proposal.tex
% Based on http://www.latextemplates.com/template/simple-sectioned-essay
\documentclass[12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage[brazil]{babel}

\usepackage{hyphsubst}
\usepackage{graphicx} % resizebox
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{hyperref}
\usepackage{cite}

\newcommand{\Title}[1]{\textbf{\MakeUppercase{#1}}}

\begin{document}

\section{Riscos}

    A junção de agentes e realidade virtual, pode-se criar novos
    produtos de auxilio há indivíduos. Os agentes farão o trabalho de
    guiar o indivíduo, lhe mostrando exercícios e definições de um
    determinado assunto conforme seu nível de conhecimento, e a
    realidade virtual, proporcionando um nova experiência, onde é
    possível detalhar a explicação do corte de cônicas estudado em
    geometria analítica, por exemplo.

\end{document}

I spend hours searching and instaling a lots of stuff hope to get ride of it, but it just does not go away. Here I am listing all packages I got installed by the command mpm --list and getting all the lines with i:

i 00119     506513 ae
i 00027    1717404 amscls
i 00618    7714923 amsfonts
i 00025    2669600 amsmath
i 00257    7488486 arabi
i 00174    1224330 avantgar
i 00072    1620030 babel
i 00011     164011 babel-english
i 00005     383412 babel-french
i 00012     765427 babel-german
i 00003     159851 babel-portuges
i 00003      13418 babel-spanglish
i 00006     248833 babel-spanish
i 00017     635909 bibtex
i 00014     144398 bibtex8bit
i 00005      36515 bibtex8bit-polish
i 00148    5153378 bidi
i 00210    1389763 bookman
i 00011      64171 carlisle
i 00020     703910 catalan
i 00016     496287 cbcoptic
i 00002      24576 chktex
i 00012     223126 churchslavonic
i 00009     318992 cite
i 00325    3710497 cjk
i 00201     889884 cm
i 00840   68081483 cm-super
i 00128   29364389 cm-unicode
i 00014      33058 cmap
i 00031     388574 cmarrows
i 00018      71145 cmastro
i 00180    1066905 cmbright
i 00710    2489626 cmcyr
i 00010      31341 cmcyralt
i 00005     362208 cmdstring
i 00004     144467 cmdtrack
i 00026      64232 cmextra
i 00010     170298 cmfrak
i 00110     660888 cmll
i 00006      29026 cmpica
i 00012     826166 cmpj
i 00006       7089 cmsd
i 00082    1348007 cmtiup
i 00005     111287 combelow
i 00184    1258125 courier
i 00046     309082 croatian
i 00259     427180 csfonts
i 00042     117149 cslatex
i 00090    1610059 csplain
i 00002      27382 cweb
i 00119    1540549 cyrillic
i 00004     226487 dehyph
i 00013     590333 dehyph-exptl
i 00011     568289 dvipdfmx
i 00076     171333 dvips
i 00043    2124729 e-french
i 01233    2573583 ec
i 00011    1937013 elhyphen
i 00049     547873 enctex
i 00014     526673 etex
i 00003      20672 etex-pkg
i 00018     180439 euenc
i 00039     268300 eurosym
i 00004       3729 fahyph
i 00009     792145 fancyvrb
i 00007      61687 findhyph
i 00005     408447 fixltxhyph
i 00004     157534 float
i 00034      65485 fontconfig
i 00024    1509270 fontname
i 00018    2119120 fontspec
i 00005     374186 footmisc
i 00006     281484 geometry
i 00236    1264399 ghostscript
i 00010      40933 glhyph
i 00004     343243 gmverb
i 00035    2612687 graphics
i 00004       4638 graphics-cfg
i 00008     143924 graphics-def
i 00002       8598 gsftopk
i 00008     886014 he-le-na
i 00339    2456296 helvetic
i 00047    5445822 hyperref
i 00539    8732257 hyph-utf8
i 00004     192828 hyphenat
i 00007     115243 ibycus-babel
i 00004     169627 ifxetex
i 00020      39219 jknappen
i 00038     412797 kdgreek
i 00026     128912 knuth-lib
i 00028     147457 knuth-local
i 00055     123937 latex-fonts
i 00024     915384 latexmk
i 00053     208699 lhcyr
i 00069     424361 lithuanian
i 01093   43912172 lm
i 00207   12386523 ltxbase
i 00035     204707 ltxmisc
i 00006      10630 lua-alt-getopt
i 00009     132554 lua-check-hyphen
i 00005      46276 luahyphenrules
i 00010     443986 luainputenc
i 00042     704479 lualibs
i 00009     246501 luamplib
i 00098    5027490 luaotfload
i 00013     286569 luatexbase
i 00006     322823 luatextra
i 00013     421099 makeindex
i 00008     119377 metafont
i 00124    2902052 metapost
i 00011     253287 mex
i 00007     270547 mflogo
i 00019      41366 mflogo-font
i 00004      10421 mfware
i 00031    2451481 microtype
i 00003     156884 miktex-arctrl-bin-2.9
i 00003     225321 miktex-bibarts-bin
i 00002   23691765 miktex-biber-bin
i 00003     259829 miktex-bibtex-bin-2.9
i 00003     378122 miktex-bibtex8bit-bin-2.9
i 00005   28126073 miktex-bin-2.9
i 00002      79067 miktex-bzip2-bin-2.9
i 00002    1660570 miktex-cairo-bin-2.9
i 00002     111828 miktex-chktex-bin-2.9
i 00009     329671 miktex-cjkutils-bin-2.9
i 00062      42813 miktex-config-2.9
i 00002     408157 miktex-curl-bin-2.9
i 00003     232722 miktex-cweb-bin-2.9
i 00002      83173 miktex-devnag-bin-2.9
i 00007     583103 miktex-dict-english
i 00004    1392137 miktex-dict-french
i 00010    4347300 miktex-dict-german
i 00191    2693499 miktex-doc-2.9
i 00003     241921 miktex-dvicopy-bin-2.9
i 00003      10229 miktex-dvipdfmx
i 00003     822520 miktex-dvipdfmx-bin-2.9
i 00002     175009 miktex-dvipng-bin-2.9
i 00004       7611 miktex-dvips
i 00003     366818 miktex-dvips-bin-2.9
i 00002    5007596 miktex-dvisvgm-bin-2.9
i 00002     110292 miktex-epstopdf-bin-2.9
i 00002        710 miktex-etex
i 00002     148372 miktex-expat-bin-2.9
i 00002      95957 miktex-findtexmf-bin-2.9
i 00003      10349 miktex-fontconfig
i 00010     773632 miktex-fontconfig-bin-2.9
i 00005     368917 miktex-fonts-bin-2.9
i 00002     608221 miktex-freetype2-bin-2.9
i 00002     111845 miktex-fribidixetex-bin-2.9
i 00002     441009 miktex-gd-bin-2.9
i 00002   14569984 miktex-ghostscript-bin
i 00002     186039 miktex-graphite2-bin-2.9
i 00002     136390 miktex-gsf2pk-bin-2.9
i 00002     576956 miktex-hunspell-bin-2.9
i 00003   29286400 miktex-icu-bin
i 00004   21502283 miktex-int-bin-2.9
i 00002     300283 miktex-jpeg-bin-2.9
i 00002      67821 miktex-kpathsea-bin-2.9
i 00003        943 miktex-latex
i 00002    1433999 miktex-libressl-bin-2.9
i 00004    3188587 miktex-log4cxx-bin-2.9
i 00004     346436 miktex-lua52-bin-2.9
i 00004     137705 miktex-luatex
i 00004   17631837 miktex-luatex-bin-2.9
i 00002     173762 miktex-lzma-bin-2.9
i 00002     158097 miktex-m-tx-bin-2.9
i 00003     278302 miktex-makeindex-bin-2.9
i 00002      27368 miktex-md5-bin-2.9
i 00002        732 miktex-metafont
i 00003     499447 miktex-metafont-bin-2.9
i 00003        824 miktex-metapost
i 00002    2047138 miktex-metapost-bin-2.9
i 00009     645552 miktex-mfware-bin-2.9
i 00027     114790 miktex-misc
i 00002     214737 miktex-mkfntmap-bin-2.9
i 00006     660892 miktex-mktex-bin-2.9
i 00004     939783 miktex-mo-bin-2.9
i 00005     756552 miktex-mpm-bin-2.9
i 00002    6416125 miktex-mpmcli-bin-2.9
i 00002      92955 miktex-mspack-bin-2.9
i 00002     133319 miktex-mthelp-bin-2.9
i 00002     150734 miktex-mtprint-bin-2.9
i 00003        775 miktex-omega
i 00016    2124935 miktex-omega-bin-2.9
i 00006       2800 miktex-pdftex
i 00005    4446009 miktex-pdftex-bin-2.9
i 00003     660069 miktex-pmx-bin-2.9
i 00002     204628 miktex-png-bin-2.9
i 00013   22045268 miktex-poppler-bin-2.9
i 00002      57213 miktex-popt-bin-2.9
i 00003      99641 miktex-posix-bin-2.9
i 00002     176274 miktex-ps2pk-bin-2.9
i 00009     437207 miktex-psutils-bin-2.9
i 00011   19340288 miktex-qt5-bin
i 00021    4665814 miktex-runtime-bin-2.9
i 00002     214251 miktex-tdsutil-bin-2.9
i 00002     256235 miktex-teckit-bin-2.9
i 00003        842 miktex-tex
i 00003     560870 miktex-tex-bin-2.9
i 00002      68831 miktex-tex2xindy-bin-2.9
i 00002      13868 miktex-tex4ht
i 00003     237300 miktex-tex4ht-bin-2.9
i 00002     192199 miktex-texify-bin-2.9
i 00002        877 miktex-texinfo
i 00009     643523 miktex-texware-bin-2.9
i 00002    6913277 miktex-texworks-bin-2.9
i 00003     269089 miktex-ttf2pk2-bin-2.9
i 00042    1787762 miktex-ucrt-bin
i 00002      84354 miktex-uriparser-bin-2.9
i 00017    6547029 miktex-vc140-bin
i 00005     357628 miktex-web-bin-2.9
i 00002       3914 miktex-xetex
i 00003    2900223 miktex-xetex-bin-2.9
i 00002    5119516 miktex-xindy-bin
i 00004    2016241 miktex-yap-bin-2.9
i 00002     304800 miktex-zip-bin
i 00002     101275 miktex-zlib-bin-2.9
i 00002      41197 miktex-zzip-bin-2.9
i 00012      50417 mltex
i 00222    5000829 montex
i 00006     153202 mptopdf
i 00013    2614447 ms
i 00006     637728 multirow
i 00154     912870 ncntrsbk
i 00562   22030696 oberdiek
i 00245    1167385 palatino
i 00004     305952 path
i 00002     181083 pdftex
i 00011     105138 plain
i 00458    5090281 polish-doc
i 00115     955553 polyglossia
i 00251   12011866 poppler
i 00011      47671 pslatex
i 00119     540586 psnfss
i 00040    8804588 pstricks
i 00002       7157 psutils
i 00018     101828 rsfs
i 00027     223320 ruhyphen
i 00005     531798 russ
i 00015     763806 selnolig
i 00006     106984 showhyphens
i 00007     312496 soul
i 00003      15503 spanglish
i 00005     291172 sr-half-compound
i 00009     961652 sr-hyphen-spec
i 00005     395943 testhyphens
i 00032     117863 tetex
i 00010      11095 tex-ini-files
i 00027    1954420 texinfo
i 00006     436122 textglos
i 00012     676861 thailatex
i 00004      97442 thumbpdf
i 00239    1508359 times
i 00072    7079674 tools
i 00016     881891 ttf2pk
i 00023     328669 tui
i 00493    8647699 uk-tex-faq
i 00028     685133 ukrhyph
i 00004     270322 underscore
i 00011    2211998 unicode-data
i 00004     279266 url
i 00060     556968 utopia
i 00004      42334 varsfromjobname
i 00036     376531 xecyr
i 00008     392733 xetex
i 00005     104603 xgreek
i 00432    2616515 xindy
i 00022     630068 xkeyval
i 00005     148819 xltxtra
i 00003     207272 xunicode
i 00184    6003498 xypic
i 00036     326052 yannisgr
i 00031     175798 zapfchan
i 00010      70264 zapfding
i 00003       1494 zerohyph
i 04939    5792777 zhmetrics

To compile it I am using the plugin LaTeX Tools for Sublime Text.

But when I use directly the command line:

latexmk -pdf -pdflatex="pdflatex -interaction=nonstopmode" -use-make main.tex

I got the following error:

Package babel Warning: No hyphenation patterns were preloaded for
(babel)                the language `Portuguese' into the format.
(babel)                Please, configure your TeX system to add them and
(babel)                rebuild the format. Now I will use the patterns
(babel)                preloaded for \language=0 instead on input line 55.

How to fix this error? I am missing some package which is not installed?

This is image I got from the mo.exe latex program. It seems to have everything in place:

enter image description here

Best Answer

Although the question already has an accepted answer, I feel the urge to provide a solution which does not depend on luck with the update, for this did not work for me.

I had the same problem with German hyphenation and was eventually able to solve it. Maybe this helps future users to solve their problem.

Setup

Brand new TeX installation (MiKTeX, installed for single user, based on 'essential' package set).

Test document:

\documentclass{article}
\usepackage[ngerman]{babel}
\begin{document}Hello World!\end{document}

pdfLaTeX gave the infamous warning:

Package babel Warning: No hyphenation patterns were preloaded for
(babel)                the language `German (new orthography)' into the format.

1. Babel installed

⯈ Verify that package babel-german is installed.

2. Language installed

⯈ Check with MiKTeX Console (or similar) if the language is installed (Settings > Languages). For me, it was not. It showed ngerman and ngerman-x-2019-04-04 with loader and package names, but did not state that those were installed. I wonder why. Not any of the languages was installed.

⯈ If the language is not installed, install hyph-utf8 and dehyph-exptl or whatever file is mentioned for your language. Restart MiKTeX Console and verifiy that there is a check mark at both 'ngerman' rows.

3. pdflatex.fmt

⯈ (Obsolete if step 4 will be performed as well) (Re?)create the formats using initexmf --dump=pdflatex which will create/update %localappdata%\MiKTeX\2.9\miktex\data\le\pdftex\pdflatex.fmt. You may omit the =pdflatex to let initex create all format files.

Weird: I could not find folders for any other key containing the corresponding format files. Apparently, my appumption was invalid and the installation of a language file does not trigger re-creation of the format files.

4. language.dat

⯈ Have a look at language.dat file at %appdata%\MiKTeX\2.9\tex\generic\config. I found it absolutely empty. language.dat.lua contained just return {}, language.def contained %% e-TeX V2.2.

⯈ Fix (?) this with initexmf --mklangs which fills those files with content:

language.dat then contained

ngerman loadhyph-de-1996.tex
ngerman-x-2019-04-04 dehyphn-x-2019-04-04.tex
=ngerman-x-latest

and language.def contained

\addlanguage{ngerman}{loadhyph-de-1996.tex}{}{2}{2}
\addlanguage{ngerman-x-2019-04-04}{dehyphn-x-2019-04-04.tex}{}{2}{2}

and the referenced file dehyphn-x-2019-04-04.tex existed and had some probably useful content.

⯈ A new run of initexmf --dump updates the format files and finally, pdfLaTeX no longer complains.

References

[TeX:SX] [TeX-FAQ] [SourceForge] [GitHub]