1

I'm writing a cover letter and for the template I have everything except I want to add 2 border lines:

  • from top left to 2/3 paper height

  • from down right to 2/3 paper length

In the code I've already managed to add the vertical border. How do I add the horizontal one?

\documentclass{article}

\usepackage{charter,graphicx}
\usepackage[margin=1in]{geometry}
\usepackage{blindtext}

\geometry{
    total={200mm,297mm},
    top={20mm},
    tmargin={-3.5mm}
}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{.4pt}% Default header rule
\renewcommand{\footrulewidth}{0pt}% No footer rule
\fancyhf{}% Clear header/footer
\fancypagestyle{plain}{
    \renewcommand{\headrulewidth}{0pt}% No header rule
    \renewcommand{\footrulewidth}{.4pt}% Default footer rule
    \fancyhf{}% Clear header/footer
}
\AtBeginDocument{\thispagestyle{plain}}

\setlength{\parindent}{0pt}
\setlength{\parskip}{.5\baselineskip plus 1pt minus 1pt}

\usepackage[scale=1,angle=0,opacity=1]{background}

\definecolor{myblue}{RGB}{30,100,200}

\backgroundsetup{
    position=current page.north west,
    color=myblue,
    nodeanchor=north west,
    contents={\rule{10pt}{198mm}}  
}

\begin{document}

    \includegraphics[width=1.5in,trim={7mm 7mm 0 0},clip]{example-image-a}% Your logo here

    \hrulefill

    \hfill
    \begin{tabular}[b]{@{} l @{}}
        \today\\[12pt] % Date
        Email: julian.@
    \end{tabular}

    \vspace{\baselineskip}

    Dear Admissions Committee% greeting

    \bigskip

    \blindtext[5]

    \vspace{\baselineskip}

    Yours faithfully% Closing text

    \vspace{2\baselineskip}

    Julian


\end{document}
  • 3
    Welcome to TeX.SX! Could you please make your question clearer, and add a MWE if possible? If I understand your question correctly, I think a TikZ overlay picture is appropriate. – user156344 Dec 3 '18 at 9:18
  • Run texdoc tcolorbox – Fran Dec 3 '18 at 9:20
  • I've posted the code I have. Thanks in advance! – JuDeV Dec 4 '18 at 17:57
0

You can use \rule also for the horizontal rule.

I suggest to you, instead of manually set 198mm, to use .66\paperheight, and the analogous for the width .66\paperwidth.

\documentclass{article}

\usepackage{charter,graphicx}
\usepackage[margin=1in]{geometry}
\usepackage{blindtext}

\geometry{
    total={200mm,297mm},
    top={20mm},
    tmargin={-3.5mm}
}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{.4pt}% Default header rule
\renewcommand{\footrulewidth}{0pt}% No footer rule
\fancyhf{}% Clear header/footer
\fancypagestyle{plain}{
    \renewcommand{\headrulewidth}{0pt}% No header rule
    \renewcommand{\footrulewidth}{.4pt}% Default footer rule
    \fancyhf{}% Clear header/footer
}
\AtBeginDocument{\thispagestyle{plain}}

\setlength{\parindent}{0pt}
\setlength{\parskip}{.5\baselineskip plus 1pt minus 1pt}

\usepackage[scale=1,angle=0,opacity=1]{background}

\definecolor{myblue}{RGB}{30,100,200}

\backgroundsetup{
    position=current page.north west,
    color=myblue,
    nodeanchor=north west,
    contents={\rule{10pt}{.66\paperheight}\raisebox{-10pt}{\raisebox{.66\paperheight}{\rule{.66\paperwidth}{10pt}}}
    }
}

\begin{document}

    \includegraphics[width=1.5in,trim={7mm 7mm 0 0},clip]{example-image-a}% Your logo here

    \hrulefill

    \hfill
    \begin{tabular}[b]{@{} l @{}}
        \today\\[12pt] % Date
        Email: julian.@
    \end{tabular}

    \vspace{\baselineskip}

    Dear Admissions Committee% greeting

    \bigskip

    \blindtext[5]

    \vspace{\baselineskip}

    Yours faithfully% Closing text

    \vspace{2\baselineskip}

    Julian


\end{document}

enter image description here

  • Great, thank you for the very detailed answer! – JuDeV Dec 16 '18 at 21:08
  • @JuDeV You're welcome, thank you for accepting my answer! – CarLaTeX Dec 16 '18 at 21:14

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.