I'd like to have a function for a "letter". By letter I mean that it is a ruled paper, and the text looks justified, as if it would be without the "uline" function.

Moreover, the ulem package is not what I want, since the last line will always be short (any line that has a linebreak).

I am more thinking of something as in the exam class, the \fillwithlines order.

Anyone has an idea? Thanks in advance!

\documentclass[fontsize=9pt,twoside, DIV=calc]{scrbook}
\usepackage[papersize={12.5cm,19cm},inner=10mm, outer=10mm, bottom=13mm, top=10mm, footskip=6mm]{geometry}





                                \begin{tikzpicture}[pencildraw/.style={ %
                                    decoration={random steps,segment length=2pt,amplitude=1pt}
                                    } %
                                \node[ preaction={fill=black,opacity=.5,% zeilenabstand=2.8,
                                          transform canvas={xshift=1mm,yshift=-1mm}},
                                          pencildraw,draw,fill=notiz,text width=.8\textwidth,
                                          inner sep=5mm] {\uline{#1}};





Find suitable ruled paper, such as http://www.wordmstemplates.com/wp-content/uploads/2015/08/lined-paper-template-9898.jpg, download the image and use that as the \includegraphics filename.


Here I introduce \linedbox{<width>}{<content>}, which does not support page breaking. User parameters are shown at top of the MWE:

  1. \addedleftmargin left margin of the lined box (currently 20pt);

  2. \addedrightmargin right margin of the lined box (currently 20pt);

  3. \scaledheight the scaled paper height. Used to match the paper's rule spacing with that of your fontsize (currently 6.98in);

  4. \scaledwidth the scaled paper width. It should be at least as large as the widest box you intend to make (it's value will affect the apparent width of the red line and the left margin size) (currently \textwidth);

  5. \naturalindent the natural left indent of the scaled paper, typically to a point just right of the red line (currently 15% of \scaledwidth).

  6. \topdiscard that amount of unruled paper at the top of the scaled image to discard (currently 10% of \scaledheight); and

  7. \topbottomgap vertical gap added above and below the ruled box (currently 1pt).

Here is the MWE

\def\addedleftmargin{20pt}% LEFT MARGIN OF RULED BOX
\def\addedrightmargin{20pt}% RIGHT MARGIN OF RULED BOX
\def\scaledheight{6.98in}% ADJUST FOR DIFFERENT FONT SIZES
\def\scaledwidth{\textwidth}% SHOULD BE SET AT LEAST AS WIDE AS WIDEST USAGE
\def\naturalindent{.15\dimexpr\scaledwidth\relax}% BASED ON PAPER'S RED LINE LOCATION
\def\topdiscard{.10\dimexpr\scaledheight\relax}% UNRULED TOP OF PAPER TO THROW AWAY
\def\topbottomgap{1pt}% GAP ADDED ABOVE/BELOW RULED BOX
\def\reducedindent{\dimexpr\naturalindent-\addedleftmargin\relax}% CALCULATED QUANTITY
{\centering\linedbox{4.3in}{\lipsum[1]Hi Mom!!}\par}
Or this: \linedbox{2in}{This is a test of the emergency broadcasting system.  
This is only a test}

enter image description here


Note that geometry margins and \fontsize need to be altered to conform to the paper.

Hi Mom!!

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.