# How to right align the addrfrom, phonefrom, and emailfrom in the newlfm class?

I am new to LaTeX, and I have been struggling to find the solution on how to right align the header where I put the address, phone, and email. My email is pretty long because of my long name, so the header comes out to something like this

How can I right align the whole block so that it looks nicer? I have tried to use \addrfromright but it didn't seem to work.

Here is the source code:

\documentclass[11pt,stdletter,dateno,sigleft]{newlfm}

\usepackage{charter} % Use the Charter font for the document text

\newsavebox{\Luiuc}\sbox{\Luiuc}{\parbox[b]{1.75in}{\vspace{0.5in}
\includegraphics[width=1.2\linewidth]{BNP.png}}} % Company/institution logo at the top left of the page

\newlfmP{sigsize=50pt} % Slightly decrease the height of the signature field
\PhrPhone{Phone} % Customize the "Telephone" text
\PhrEmail{Email} % Customize the "E-mail" text

\lthUiuc % Print the company/institution logo

\namefrom{Nurzhan Kanatzhanov} % Name

\today\\[12pt] % Date
Nurzhan Kanatzhanov \\
6515 Wydown Blvd. \\ % Address
St. Louis, MO 63105
}

\phonefrom{(508) 410-1317} % Phone number

\greetto{Dear Mrs. Smith,} % Greeting text
\closeline{Sincerely yours,} % Closing text

\nameto{Mrs. Jane Smith} % Addressee of the letter above the to address

Recruitment Officer \\ % To address
The Corporation \\
123 Pleasant Lane \\
City, State 12345
}

\begin{document}
\begin{newlfm}

PARAGRAPH ONE: State the reason for the letter, name the position or type of work you are applying for and identify the source from which you learned of the opening (i.e. career development center, newspaper, employment service, personal contact).

PARAGRAPH TWO: Indicate why you are interested in the position, the company, its products, services - above all, stress what you can do for the employer. If you are a recent graduate, explain how your academic background makes you a qualified candidate for the position. If you have practical work experience, point out specific achievements or unique qualifications. Try not to repeat the same information the reader will find in the resume. Refer the reader to the enclosed resume or application which summarizes your qualifications, training, and experiences. The purpose of this section is to strengthen your resume by providing details which bring your experiences to life.

PARAGRAPH THREE: Request a personal interview and indicate your flexibility as to the time and place. Repeat your phone number in the letter and offer assistance to help in a speedy response. For example, state that you will be in the city where the company is located on a certain date and would like to set up an interview. Alternatively, state that you will call on a certain date to set up an interview. End the letter by thanking the employer for taking time to consider your credentials.

\end{newlfm}
\end{document}

• Welcome to the site TeX.SE. Into your minimal working example are missed \begin{document}....\end{document}. – Sebastiano Jun 27 at 10:29
• @Sebastiano just updated – childishjewbino Jun 27 at 10:32
• Thank you very much for your collaboration. – Sebastiano Jun 27 at 10:33

The issue here has two parts:

1. Package fancyhdr has changed, therefore the commands \fancy@reset, \f@ncyolh and \f@ncyorh are no longer defined with the current version of package fancyhdr. You should write an bug report to the mintainer of class newlfm. BTW: This was already mentioned in this question.
2. It seems that newlfm has an bug not using the class option addrfromright you called correctly with command \newlfmP{addrfromright}. You should write an bug report to the mintainer of class newlfm. In the following mwe I did an dirty patch to get the address from the letter writer to be ragged left, but that is not a solution for the class. Option addrfromright should be added (seems to me it is not evaluated for printing the address) to work correct in the class!

% Patches
\usepackage{etoolbox}
\makeatletter
% https://tex.stackexchange.com/questions/377454/undefined-control-sequence-error-on-fancyreset-fncyolh-and-fncyorh-when-u
\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}{}{}

\patchcmd{\openlfm}{%
\noindent%
\begin{tabular}{l@{}}%
}{%
\noindent%
\begin{tabular}{r@{}}%
}{}{\error}
\makeatother


and see the following complete mwe:

\documentclass[%
11pt,
stdletter,
dateno,
sigleft,
]{newlfm}

\usepackage{charter} % Use the Charter font for the document text

% Patches
\usepackage{etoolbox}
\makeatletter
% https://tex.stackexchange.com/questions/377454/undefined-control-sequence-error-on-fancyreset-fncyolh-and-fncyorh-when-u
\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}{}{}

\patchcmd{\openlfm}{%
\noindent%
\begin{tabular}{l@{}}%
}{%
\noindent%
\begin{tabular}{r@{}}%
}{}{\error}
\makeatother

\newsavebox{\Luiuc}\sbox{\Luiuc}{\parbox[b]{1.75in}{\vspace{0.5in}
\includegraphics[width=2cm]{example-image}}} % Company/institution logo at the top left of the page BNP.png

\newlfmP{sigsize=50pt} % Slightly decrease the height of the signature field
\PhrPhone{Phone} % Customize the "Telephone" text
\PhrEmail{Email} % Customize the "E-mail" text

\lthUiuc % Print the company/institution logo

\namefrom{Nurzhan Kanatzhanov} % Name

\today\\[12pt] % Date
Nurzhan Kanatzhanov \\
6515 Wydown Blvd. \\ % Address
St. Louis, MO 63105
}
\phonefrom{(508) 410-1317} % Phone number

\greetto{Dear Mrs. Smith,} % Greeting text
\closeline{Sincerely yours,} % Closing text

\nameto{Mrs. Jane Smith} % Addressee of the letter above the to address

Recruitment Officer \\ % To address
The Corporation \\
123 Pleasant Lane \\
City, State 12345
}

\begin{document}
\begin{newlfm}

PARAGRAPH ONE: State the reason for the letter, name the position or type of work you are applying for and identify the source from which you learned of the opening (i.e. career development center, newspaper, employment service, personal contact).

PARAGRAPH TWO: Indicate why you are interested in the position, the company, its products, services - above all, stress what you can do for the employer. If you are a recent graduate, explain how your academic background makes you a qualified candidate for the position. If you have practical work experience, point out specific achievements or unique qualifications. Try not to repeat the same information the reader will find in the resume. Refer the reader to the enclosed resume or application which summarizes your qualifications, training, and experiences. The purpose of this section is to strengthen your resume by providing details which bring your experiences to life.

PARAGRAPH THREE: Request a personal interview and indicate your flexibility as to the time and place. Repeat your phone number in the letter and offer assistance to help in a speedy response. For example, state that you will be in the city where the company is located on a certain date and would like to set up an interview. Alternatively, state that you will call on a certain date to set up an interview. End the letter by thanking the employer for taking time to consider your credentials.

\end{newlfm}
\end{document}


and its result:

I'm not sure that this class is actually maintained and it is a little bit old. Have you considered to use scrlttr2 from KOMA-Script instead?

• this is an amazing solution. Thank you, I will try to upvote as soon as I get a reputation > 15! – childishjewbino Jun 28 at 4:18