## LaTeX forum ⇒ Document Classes ⇒ How to put date on top-left under letter class? Topic is solved

Information and discussion about specific document classes and how to create your own document classes.
Cham
Posts: 904
Joined: Sat Apr 02, 2011 4:06 pm

### How to put date on top-left under letter class?

I'm having a problem with the date position under the letter class. Here's a MWE code to show the problem:
\documentclass[11pt,letterpaper]{letter}\usepackage[T1]{fontenc}\usepackage[letterpaper,top=1in]{geometry}\usepackage{charter} \begin{document} \date{\begin{flushleft}\today\end{flushleft}} % Use todays date and left-align it \begin{letter}{To someone} \begin{center}	\Large\textsc{sue letter}\end{center} \signature{Bob Doe} \opening{Hello.}Blabla bla bla.\closing{Yours,} \end{letter} \end{document}

Here's a preview and what I need to do (in red) :
letter.jpg (18.58 KiB) Viewed 1116 times

So how can I move the date in the upper-left corner, while moving the title under the date? This should be very easy but I don't get it.

Cham
Posts: 904
Joined: Sat Apr 02, 2011 4:06 pm
I solved my issue by using this code, but it seems odd to me. Is there a better solution for this?

\documentclass[11pt,letterpaper]{letter}\usepackage[T1]{fontenc}\usepackage[letterpaper,top=1in]{geometry}\usepackage{charter} \begin{document} \date{\begin{flushleft}\today\end{flushleft}}\signature{Bob Doe} \begin{letter}{{\hfill\Large\textsc{sue letter}\hfill} \bigskip \\ \textbf{Someone} \\ Address} \opening{Hello.} Blabla bla bla. \closing{Yours,} \end{letter} \end{document}

If I remove the \bigskip command, the "sue letter" title is flushed to the right. What am I doing wrong here?

Stefan Kottwitz
Posts: 9452
Joined: Mon Mar 10, 2008 9:44 pm
Hi Cham,

good that you found a way! Well, one can use such a workaround, or patch letter class macros. It's probably not worth the effort if there's a simple way.

To enforce the \hfill that may not be done at the end of a line, you can use \hspace*{\fill}:

\begin{letter}{{\hfill\Large\textsc{sue letter}\hspace*{\fill}}

Stefan
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.964921236038208, "perplexity": 2082.082724484517}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-43/segments/1570987834649.58/warc/CC-MAIN-20191023150047-20191023173547-00440.warc.gz"}