3

I'm looking to recreate this title environment below. enter image description here I think the person used mdframed so I choose to use that as well. I get stuck when I try implementing the course name, professor name or week number. I thought about using fancyhdr for this but I'm not sure if it can be done or if it's the best option.

What do you guys this? Here's the code I've written so far. enter image description here

\documentclass[a4paper]{article}

\usepackage{ragged2e}
\usepackage{mdframed}

\newcommand{\createtitle}{
\begin{mdframed}
[nobreak=true, % prevents page breaking
outerlinewidth=0.5pt,
innertopmargin=0.5\baselineskip,
innerbottommargin=0.75\baselineskip,
innerrightmargin=11pt,
innerleftmargin=11pt]
    \begin{center}
        \Huge\textsc{This is the Title}
    \end{center}
\end{mdframed}}
2
  • 3
    Use \hfill; as in Week 4 \hfill UCSB 2015. May 31 at 16:21
  • The tricky one is left center right in one line. \noindent\rlap{left}\hfill center\hfill\llap{right}\par Note that it is possible to overlap the text. May 31 at 22:20

2 Answers 2

5

Via Left Text\hfill Right Text.

\documentclass[a4paper]{article}

\usepackage{ragged2e}
\usepackage{mdframed}

\newcommand{\createtitle}{
\begin{mdframed}
[nobreak=true, % prevents page breaking
outerlinewidth=0.5pt,
innertopmargin=0.5\baselineskip,
innerbottommargin=0.75\baselineskip,
innerrightmargin=11pt,
innerleftmargin=11pt]
    \begin{center}
  Top left\hfill Top Right\\
        {\Huge\textsc{This is the Title\strut}}\\
  Bottom Left\hfill Bottom Right
    \end{center}
\end{mdframed}}
\begin{document}
\createtitle
\end{document}

enter image description here

2

No need to use mdframed.

\documentclass{article}

\begin{document}

\noindent
\fbox{%
  \parbox{\dimexpr\textwidth-2\fboxsep-2\fboxrule}{%
    \setlength{\topsep}{0.2\topsep}
    Math 7H\hfill Professor: Padraic Bartlett\par
    \begin{center}\large
    Lecture 4: Induction, the Euler Characteristic and Chemistry
    \end{center}
    \textit{Week 4}\hfill\textit{UCSB 2015}
  }%
}

\end{document}

enter image description here

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.