0

I am trying to put together a book, that could be thought of as a kind of book of anniversaries with some certain prefilled entries. So there is one page per day, and most days are going to have an entry or two. After that I just want the page filled up with lines, so that someone can easily come and add a new one since the book was printed. I just can't work out how to do that. I looked into how \dotfill works, but it did not help when I tried messing with it, and Google turned up nothing. Any idea how this can be done?

Needs to work in lualatex.

EDIT: Inspired by the first answer I now have this, it is a complete but broken example of what I want.

\documentclass[12pt, twoside]{book}
\RequirePackage[a5paper,includehead,top=0.5in,inner=0.75in,outer=0.5in,bottom=0.5in]{geometry}


\newsavebox{\thetopstuffbox}
\newlength{\thetopstuffht}

\newcommand\Linepage[1]{%
  \vbox to \dimexpr\textheight-#1-2cm\relax {\leaders\hbox to \linewidth{\rule{0pt}{1cm}\hrulefill}\vfil}
}

\usepackage{changepage}

\newcommand{\personentry}[3][3em]{%
  \nopagebreak%
  \begin{adjustwidth}{#1}{0pt}%
    \ignorespaces \hspace{-3em}\textbf{#2} #3
  \end{adjustwidth}%
  \nopagebreak%
}

\begin{document}

\noindent\sbox{\thetopstuffbox}{%
    \noindent\begin{minipage}{\textwidth}
        \section*{September 17}

      \personentry{Joe Blow}{He did some important stuff and we want to remember him for it. He was a top bloke and did a lot of good work, and we are thankful for it and did I mention everything that he did.}

      \personentry{Jane Doe}{Also did a lot of stuff what we really want too remember her for it because if we don't we are going to feel really guiltly about it since I am now just rambling on.}

    \end{minipage}%
}\usebox{\thetopstuffbox}\newline\Linepage{\ht\thetopstuffbox}

\pagebreak


\noindent\sbox{\thetopstuffbox}{%
    \noindent\begin{minipage}{\textwidth}
        \section*{September 18}
      \personentry{Joe Blow}{He did some important stuff and we want to remember him for it. He was a top bloke and did a lot of good work, and we are thankful for it and did I mention everything that he did.}

      \personentry{Jane Doe}{Also did a lot of stuff what we really want too remember her for it because if we don't we are going to feel really guiltly about it since I am now just rambling on.}

    \end{minipage}%
}\usebox{\thetopstuffbox}\newline\Linepage{\ht\thetopstuffbox}

\end{document}
2

I had to solve this sort of problem some time ago with a questionnaire. Agree with StefanH that leaders are the best way to go. I think you need an environment to do this:

\documentclass[12pt, twoside]{book}

\usepackage[a5paper,includehead,top=0.5in,inner=0.75in,outer=0.5in,bottom=0.5in]{geometry}

\newcommand\Linepage[1][0.25in]{% Change to suit
  \vbox to \dimexpr\textheight-\pagetotal-#1\relax {% Let TeX do the work...
    \leaders\hbox to \linewidth{\rule{0pt}{#1}\hrulefill}\vfil
  }%
}

\newenvironment{formatpage}[1]{%
    \section*{#1}
}{
    \Linepage
    \pagebreak
}

\newcommand{\personentry}[3][3em]{%
  \nopagebreak%
  \noindent
  \hangindent#1
  \textbf{#2\ }#3
  \par
  \nopagebreak%
}

%% Usage:
%% \begin{formatpage}{<date>}
%%   \personentry{<name 1>}{<info>}
%%   \personentry{<name 2>}{<info>}
%%   ...
%% \end{formatpage}

\begin{document}

\begin{formatpage}{September 17}

      \personentry{Joe Blow}{He did some important stuff and we want to remember him for it. He was a top bloke and did a lot of good work, and we are thankful for it and did I mention everything that he did.}

      \personentry{Jane Doe}{Also did a lot of stuff what we really want too remember her for it because if we don't we are going to feel really guiltly about it since I am now just rambling on, and on and on and on and on and on\dots}
\end{formatpage}

\begin{formatpage}{September 18}
      \personentry{Joe Blow}{He did some important stuff and we want to remember him for it. He was a top bloke and did a lot of good work, and we are thankful for it and did I mention everything that he did.}

      \personentry{Jane Doe}{Also did a lot of stuff what we really want too remember her for it because if we don't we are going to feel really guiltly about it since I am now just rambling on.}

\end{formatpage}

\end{document}

text with lined pages

  • Awesome, exactly as it is supposed to look. Now I just need write the script dump the database into tex. I was also a one point trying to use an environment as it allows for anything to be put inside, but I could not work it out. Latex is just not my strong point. – Michael Buckley Sep 18 at 1:41
5

The lines can be drawn with \leaders, the problem is to find the end of the page. Here I started with a header for the day and then filling up with lines. The height of the line part is just \textheight-10mm, where 10mm is just a number that fitted. If you describe more about what the header should contain it should be possible to put it in a box and then finding the height of that instead. The distance between the lines is set to 1cm.

\documentclass{article}
\newcommand\Linepage[2]{%
  \noindent
  \begin{minipage}[c]{0.3\linewidth}
    \Huge #1
  \end{minipage}%
  \begin{minipage}[c]{0.7\linewidth}
    #2
  \end{minipage}\newline
  \vbox to \dimexpr\textheight-10mm\relax {\leaders\hbox to \linewidth{\rule{0pt}{1cm}\hrulefill}\vfil}
}
\begin{document}
\Linepage{Sept 17}{Someone is sitting in the shade today because someone planted a tree a long time ago.}
\end{document}

enter image description here

  • How can I add number lines? E.G \Lines{10}, I get 10 lines. – minhthien_2016 Sep 17 at 9:48
  • Ok this is useful, but does not do everything I need. The page layout would have a \section at the top with the date (1st January etc.). Then several entries (a few days have none, some have a few). Each entry is the person's name and something about them. The example as given would mean working out \textheight-10mm for every day of the year, which would be tedious. It would be nice if it was just auto computed. I will update my question, with a now half working but still broken example. – Michael Buckley Sep 17 at 10:24

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.