How to best create Signature and Date lines?

I have two working options below, but both seem overly fiddly. Is there a simpler way or a package for adding signature and date lines to the bottom of a document? I may need more than one set on occasion.

// Inline
#let signature-line(width: 1fr) = box(width: width, line(length: 100%))
QA Manager:
#signature-line(width: 40%)
#h(3em)
Date:
#signature-line()

// Grid
#grid(
  columns: (auto, 50%, auto, 1fr),
  align: bottom,
  [QA Manager:~], line(length: 80%),
  [Date:~], line(length: 100%),
)

image

There are many ways to do it but you can use a simple version:

#let ll = 6cm
#let sign-line = [QA Manager: #box()[#line(length: ll)] #h(1fr) Date: #box()[#line(length: ll)]]

#sign-line

#sign-line

Most of the exam packages will have some sort of way of implementing it, which you could use as an example.

1 Like

Is there a good way to get all the signature lines to stop at the same horizontal point on the page, a few spaces before “Date:”?

#let signature-line(person, date-line-length: 1.5in) = [
  #person: #box(line(length: 40%))
  #h(1fr)
  Date: #box(line(length: date-line-length))
]

#signature-line()[Quality Manager]

#signature-line()[Product Manager]

#signature-line()[Authorized Inspector]

I tried using the end line parameter, but it didn’t seem to work any differently than length in that regard.

Next, I’m thinking I could measure the page width and subtract the date and person portions to get the remaining line length, but I don’t know how to dynamically get the page width.

like this, for example:

#let signature-line(person, date-line-length: 1.5in) = [
  #person: #box(width: 1fr, line(length: 100%))
  #h(3em)
  Date: #box(line(length: date-line-length))
]

#signature-line()[Quality Manager]

#signature-line()[Product Manager]

#signature-line()[Authorized Inspector]

A line() can’t have a 1fr length, but you can make it fill (100%) a box that has width 1fr, which torns out the same.

2 Likes

Oh right. I was almost there!