[Tex/LaTex] Signature image using newlfm between closeline and sender name

graphicsnewlfmsignatures

Is it possible to insert an image of my signature between the closing line and my name in a letter created with the class newlfm?

This is the code I have now:

\documentclass[10pt,stdletter,orderfromtodate,sigleft,a4paper]{newlfm}
\usepackage{blindtext, xfrac}
\usepackage{etoolbox}
\usepackage{lmodern}

\makeatletter
\patchcmd{\@zfancyhead}{\fancy@reset}{\f@nch@reset}{}{}
\patchcmd{\@set@em@up}{\f@ncyolh}{\f@nch@olh}{}{}
\patchcmd{\@set@em@up}{\f@ncyolh}{\f@nch@olh}{}{}
\patchcmd{\@set@em@up}{\f@ncyorh}{\f@nch@orh}{}{}
\makeatother

\newlfmP{dateskipbefore=50pt}
\newlfmP{sigsize=50pt}
\newlfmP{sigskipbefore=50pt}

\newlfmP{Headlinewd=0pt,Footlinewd=0pt}

\namefrom{John Smith}
\addrfrom{%
    221B Baker Street\\
    London, UK
}

\addrto{%
    Basil of Baker Street\\
    221$\sfrac{1}{2}$ Baker Street\\
    London, UK
}

\dateset{January 6, 1914}

\greetto{To Whom It May Concern,}

\closeline{Sincerely,}

\begin{document}
\begin{newlfm}
    \blindtext
\end{newlfm}
\end{document}

enter image description here

I tried changing the closing part with:

\closeline{With best regards,\newline
\includegraphics[width=0.4\linewidth]{signature.eps}}

This places the signature nicely just under "With best regards" but leaves too much spaces between the signature and "John Smith".

Best Answer

Your issue here has two parts:

  1. Adding the signature as an image into the letter and
  2. reducing the space between closing line and name.

Solution point 1: As already mentioned in the other answer you can use command \signature to place a photographed signatur into your letter after the closing line and before the printed (readable) name:

\signature{\includegraphics[width=4cm]{example-image-a}} % <============

Please see that I used an example image comming from package mwe, which must be installed but not called ...

Solution point 2: The distance between closing line and following image/name can be controlled for positive values (that means adding more space!) only with

\newlfmP{closeskipafter=0pt} % Skip after closeline before signature image <=================

There is a hard coded new line after the closing line you can only get rid off with patching command \closeline I did not investigate yet.

So the following mwe

\documentclass[10pt,stdletter,orderfromtodate,sigleft,a4paper]{newlfm}

\usepackage{blindtext, xfrac}
\usepackage{etoolbox}
\usepackage{lmodern}

\makeatletter
\patchcmd{\@zfancyhead}{\fancy@reset}{\f@nch@reset}{}{}
\patchcmd{\@set@em@up}{\f@ncyolh}{\f@nch@olh}{}{}
\patchcmd{\@set@em@up}{\f@ncyolh}{\f@nch@olh}{}{}
\patchcmd{\@set@em@up}{\f@ncyorh}{\f@nch@orh}{}{}
\makeatother

\newlfmP{dateskipbefore=50pt} % 
\newlfmP{sigsize=50pt}        % Size for written signature
\newlfmP{sigskipbefore=50pt}  % Skip between text and closeline 
\newlfmP{closeskipafter=50pt} % Skip after closeline before signature image <=================

\newlfmP{Headlinewd=0pt,Footlinewd=0pt}

\namefrom{John Smith}
\addrfrom{%
    221B Baker Street\\
    London, UK
}

\addrto{%
    Basil of Baker Street\\
    221$\sfrac{1}{2}$ Baker Street\\
    London, UK
}

\dateset{January 6, 1914}

\greetto{To Whom It May Concern,}

\closeline{Sincerely,}
\signature{\includegraphics[width=4cm]{example-image-a}} % <============

\begin{document}
\begin{newlfm}
    \blindtext
\end{newlfm}
\end{document}

you get the resulting pdf:

resulting pdf

As you can see an example image simulation an hand written signature is added and there is an additional distance a defined with command \newlfmP{closeskipafter=50pt}.

Change the value in that command to 0pt to get the minimal possible distance (please note: negative values doe not work!):

resulting pdf with minimal space