[Tex/LaTex] How to set left,right,top and bottom margins in mm scale in latex

pdftex

I want to set the following page settings in Latex:

Paper Size : Standard A4 size (297mm x 210mm)

Margins:

Top edge: 35 mm

Bottom edge : 30 mm

Left side : 40 mm

Right side : 25 mm

line spacing : 1.5

Font Style: Times New Roman

Font Size: 13

I used the following code.

\documentclass[13pt,english]{article}
\usepackage{geometry}
 \geometry{
 a4paper,
 total={297mm,210mm},
 left=35mm,
 right=20mm,
 top=30mm,
 bottom=25mm,
}
\usepackage{fontspec} 
\setmainfont{Times New Roman}
\linespread{1.5}
%================================
\begin{document}
Sample Text ! Sample Text ! Sample Text ! Sample Text ! Sample Text ! Sample Text ! Sample Text ! 
%===============================
\end{document}

But it gives me error. Please guide me to set the above page settings in latex. Thanks in advance.

Best Answer

You can with xelatex and fontspec. In the following code, I calculated approximately the value for \linespread, based on the code from setspace: I computed the corresponding value for \baselineskip (15.6pt) and multiplied by 1.25.

\documentclass[a4paper, english]{article}
\usepackage{geometry}
\usepackage{babel}
\linespread{1.95}
 \geometry{
 left=40mm,
 right=25mm,
 top=35mm,
 bottom=30mm,
 showframe
}
\usepackage{lipsum}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX, Scale=1.3]{Times New Roman}
%================================
\begin{document}
Sample Text ! Sample Text ! Sample Text ! Sample Text ! Sample Text ! Sample Text ! Sample Text !

\lipsum
%===============================
\end{document}

enter image description here

Related Question