我想把地点放在左边,日期放在中间,签名放在右边。在它们上面应该有一行。我正在 Sharelatex 上尝试这个。我无法控制对齐和名称
我的代码如下:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{tikz}
\usepackage{geometry}
\geometry{
a4paper,
total={180mm,266mm},
left=15mm,
top=14mm,
}
\setlength{\parindent}{0em}
\setlength{\parskip}{1.4em}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\makeatletter% since there's an at-sign (@) in the command name
\renewcommand{\@maketitle}{%
%\parindent=0pt% don't indent paragraphs in the title block
{\begin{minipage}[t]{.5\textwidth}\@author\end{minipage}\begin{minipage}[t]{.5\textwidth}\raggedleft\@date\end{minipage}}
\par
\centering
{\Large \bfseries\textsc{\@title}}
\HRule\par%
}
\makeatother% resets the meaning of the at-sign (@)
\title{Motivation Letter}
\author{}
\date{}
\newcommand{\namesigdatehrule}[1]{\par\tikz \draw [black, ultra thick] (0,0) -- (#1,0);\par}
\newcommand{\namesigdate}[2][5cm]{%
\begin{minipage}{#1}%
\vspace{1.0cm}\namesigdatehrule{#1}\smallskip
\small \noindent\textit{Signature}
\end{minipage}
}
\begin{document}
\maketitle
Lorem lipsum...
\namesigdate{} \namesigdate{} \namesigdate{}
\end{document}
我的输出是这样的:
答案1
我理解你需要三行等长且行\quad
与行之间有空格。行填充排版区域的宽度。每行在行的左侧下方都有一个单词,中间有一个空格。可以按如下方式完成:
\def\sign#1{\rlap{\lower2.7ex\hbox{ #1}}\leaders\hrule\hfil}
\hbox to\hsize{\sign{Place}\quad \sign{Date}\quad \sign{Signature}}