I'd like to create my first LaTeX document to make an article for my science teacher.
I've decided to do it using LuaLaTeX, the opentype font newpx and with microtype. I'd like to use both Spanish and English.
I have preselected several libraries I think are useful and modern.
I'd like to know your opinion,
Is there any incompatibility between my packages or something unnecessary?
Do you suggest to add any other?
Would you change any option?
I'm mostly concerned about fontspec, fontenc, luainputenc y luatextra. Some posts say some are not needed anymore, some say the opposite or are too old.
\documentclass[11pt,a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage[backend=bibtex]{biblatex}
\usepackage{fontspec}
\usepackage[utf8]{luainputenc}
\usepackage{luatextra}
\usepackage{newpxtext}
\usepackage{mathtools}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{graphicx}
\usepackage{float}
\usepackage[section]{placeins}
\usepackage[section]{chngcntr}
\counterwithin{figure}{chapter}
\usepackage[section]{cleveref}
\usepackage{longtable}
\usepackage{polyglossia}
\setotherlanguage{english}
\setmainlanguage{spanish}
\usepackage[xindy={language=spanish, codepage=utf8}, style=altlist]{glossaries}
\usepackage[xindy, splitindex]{imakeidx}
\usepackage[backend=biber]{biblatex}
\usepackage{microtype}
New version with your suggestions:
\documentclass[11pt,a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage{mathtools, amsfonts, amssymb}
\usepackage[no-math]{fontspec}
\usepackage{newpxtext}
\usepackage{graphicx}
\usepackage{float}
\usepackage[section]{placeins}
\usepackage[section]{chngcntr}
\counterwithin{figure}{chapter}
\usepackage[section]{cleveref}
\usepackage{longtable}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\setotherlanguage{english}
\usepackage[xindy={language=spanish, codepage=utf8}, style=altlist]{glossaries}
\usepackage[xindy, splitindex]{imakeidx}
\usepackage[backend=biber]{biblatex}
\usepackage{microtype}
Best Answer
Some comments and suggestions:
Load
amsmath
(ormathtools
) beforefontspec
(andunicode-math
).Don't load the
fontenc
,inputenc
(orluainputenc
) andtextcomp
packages.The
luatextra
package appears to have been updated last in 2010. It simply loads the following 6 packages:fontspec
,luatexbase
,luacode
,lualibs
,metalogo
, andfixltx2e
.With a LaTeX format more recent that 2015/01/01,
fixltx2e
does nothing at all, as all of the package's various fixes have been incorporated into the LaTeX kernel code.The
luatexbase
package is, these days, also loaded automatically if you run LuaLaTeX. No need to load it again.In short, don't load the
luatextra
package. Load theluacode
,lualibs
, and/ormetalogo
packages only if you really need them.The
newtxtext
,newtxmath
,newpxtext
andnewpxmath
packages all interact very well withfontspec
. If you load these packages, there's probably no need to loadunicode-math
.Don't load any packages more than once. (I believe this is sound advice for pdfLaTeX and XeLaTeX users as well...)
With Spanish and English, both
babel
andpolyglossia
work very well under LuaLaTeX. Just use the package whose syntax and options you find more straightforward to master.