0

I have written my letter to the Head of the Department to grant On-Duty.I want to format it to the Indian way of writing, I want to add "To" and I want to remove the text underlined(the address part repeated), place and date at the right corner or at the bottom and in the 6th , the "th" must appear as a superscript.How to achieve these? Here is the code:

   \documentclass[pagenumber=false,parskip=half,fromalign=right,foldmarks=true,addrfield=true
,subject=afteropening]{scrlttr2}
\usepackage[english]{babel}
\renewcommand*{\raggedsignature}{\raggedright}

\setkomavar{fromname}{Subham Soni.S}
\setkomavar{fromaddress}{6th Semester \\ B.Tech Computer Science and Engg. \\ Pondicherry Engineering College \\ Puducherry$-$605 014}
\setkomavar{signature}{\textsc{Subham Soni.S}}
\setkomavar{subject}{Request for grant of On$-$Duty regarding,}

\date{\today}
\begin{document}
\begin{letter}{Head of the Department \\ Computer Science and Engineering \\ Pondicherry Engineering College \\ Puducherry$-$605 014 }
\opening{Respected Sir,}
I Subham Soni.S of 6th semester pursuing my B.Tech degree in Computer Science and Engineering request you to grant me \emph{On$-$Duty} on 9-Jan-2014 and 10-Jan-2014 because I attended the National Workshop on Intelligent Information Retrieval(NWIIR) conducted by the Department. 
\closing{Sincerely,}
\end{letter}
\end{document}

enter image description here

  • 1
    Is there still interest in the matter? you can remove the backaddress setting backaddress=false. Also, use: 6\textsuperscript{th}. You want to have »To« but there isn't any indication where this should go. – Johannes_B Dec 11 '14 at 17:26
  • @Johannes_B thanks :). I will get back to you soon – subham soni Dec 12 '14 at 8:43
1

The underlined address is called the backaddress, it can be switched off by simply setting the false option. To get the ordinal number, KOMA-script provides \textsuperscript. A more specialised solution would be to use package nth with the option super

\documentclass[pagenumber=false,parskip=half,
fromalign=right,foldmarks=true,addrfield=true
,subject=afteropening,
backaddress=false%<--------
]{scrlttr2}
\usepackage[english]{babel}
\renewcommand*{\raggedsignature}{\raggedright}
%\usepackage[super]{nth} %\nth{6}

\setkomavar{fromname}{Subham Soni.S}
\setkomavar{fromaddress}{6\textsuperscript{th} Semester\\%
B.Tech Computer Science and Eng.\\%
Pondicherry Engineering College\\%
Puducherry--605 014%
}
\setkomavar{signature}{Subham Soni.S}
\setkomavar{subject}{Request for grant of On--Duty regarding,}

\date{\today}
\begin{document}
\begin{letter}{Head of the Department\\%
Computer Science and Engineering\\%
Pondicherry Engineering College\\%
Puducherry--605 014}
    \opening{Respected Sir,}
    I Subham Soni.S of 6th semester pursuing my B.Tech
    degree in Computer Science and Engineering request you
    to grant me \emph{On--Duty} on 9-Jan-2014 and
    10-Jan-2014 because I attended the National Workshop
    on Intelligent Information Retrieval (NWIIR) conducted
    by the Department. 
    \closing{Sincerely,}
\end{letter}
\end{document}

Changing the position of elements on the page can be done, but it needs to use a specialised interface of pseudolengths described in the advanced section of the KOMA documentation. Following an example, that changes the distance of the receiver and the sender and additionally adds the strings To: and From:.

\begin{filecontents}{\jobname-special.lco}
\@setplength{firstheadvpos}{%
  3cm}
\@setplength{toaddrvpos}{%
  5.5cm}
  \endinput
\end{filecontents}
\documentclass[%loading the speacial options
\jobname-special,
backaddress=false]{scrlttr2}
\usepackage[english]{babel}
\renewcommand*{\raggedsignature}{\raggedright}

\setkomavar{fromname}{Subham Soni.S}
\setkomavar{fromaddress}{6\textsuperscript{th}
Semester\\%
B.Tech Computer Science and Eng.\\%
Pondicherry Engineering College\\%
Puducherry--605 014%
}
\setkomavar{signature}{Subham Soni.S}
\setkomavar{subject}{Request for grant of On--Duty regarding,}
\providecommand{\fromstartstring}{From:}
\usepackage{regexpatch}
\makeatletter
\tracingxpatches% for debugging
\xpatchcmd*{\@gen@firsthead}{%
    \usekomafont{fromname}\strut\ignorespaces}%
    {\fromstartstring\\\usekomafont{fromname}\strut\ignorespaces}{}{}
\makeatother
\date{\today}
\begin{document}
\begin{letter}{To:\\Head of the Department\\%
Computer Science and Engineering\\%
Pondicherry Engineering College\\%
Puducherry--605 014}
    \opening{Respected Sir,}
    I Subham Soni.S of 6th semester pursuing my B.Tech
    degree in Computer Science and Engineering request you
    to grant me \emph{On--Duty} on 9-Jan-2014 and
    10-Jan-2014 because I attended the National Workshop
    on Intelligent Information Retrieval (NWIIR) conducted
    by the Department. 
    \closing{Sincerely,}
\end{letter}
\end{document}

subhamScrlttrPlength

Letters in the sense of KOMA-script are meant to be reusable material (according to some standard), capable of sending thousands of letters using a database. If there are no restrictions or one wants to write up an informal letter one can use a simple article document to achieve the follorwing:

subhamInformal

\documentclass[parskip=half]{scrartcl}
\usepackage{blindtext}
\begin{document}
\begin{parbox}{.5\linewidth}
    \raggedright
    From:\\The sender\\
    Sesame street\\
    N.Y.C\\[1cm]
    To:\\The receiver\\
    Elm Street\\
    Horror Twon
\end{parbox}
\begin{center}\bfseries I want to have a day off\end{center}
\hfill\mbox{2014-12-23}\bigbreak
Respected sir,

please let me have a day off. I am tired. \blindtext
\bigbreak
Sincerely,\par Your Slave
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.