手写练习表

手写练习表

我想创建一些手写练习表。类似于此处的内容 http://www.handwritingworksheets.com/flash/cursive/paragraph/index.html

我还发现了这个问题: 书写练习纸 - 点状字母 但我希望能够简单地用已知字体写一段文字,并将线条放在后面,就像水印一样。

我在这里找到了一个 git repo,里面有一些漂亮的纵向和横向线条 https://github.com/gkthiruvathukal/kindergarten

从幼儿园的例子来看,我想在生成的线条上覆盖“幻影”文本(可能是虚线草书字体)。有什么想法吗?

\documentclass[10pt,letterpaper]{article}

\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}
\pagestyle{empty}
\usepackage{dashrule}
\usepackage{forloop}
\makeatother

\setlength{\parindent}{0pt}

\begin{document}

\newcounter{ct}
\forloop{ct}{1}{\value{ct} < 13}
{
\vskip 10pt
\rule[1.75ex]{7.5in}{1pt}
\\
\hdashrule{7.75in}{1pt}{4mm}
\\
\rule[-1.75ex]{7.5in}{1pt}
\\
}

\vskip 1cm

\end{document}

*编辑:我也刚刚发现了这个来源: http://failuresandfixes.blogspot.com/2011/12/faking-baseline-grid-in-latex.html

因此,这些的某种组合对我来说是有意义的,我只是不清楚如何......

*编辑:好的,我已经讲得相当多了。但似乎几个参数需要以某种方式相互配合。行距、字体大小等。我的情况如下:

\documentclass[10pt,letterpaper,english]{article}

\usepackage{babel} 
\usepackage{blindtext} 

\usepackage{setspace}

\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}
\pagestyle{empty}
\usepackage{dashrule}
\usepackage{forloop}
\makeatother

\usepackage{xcolor}

\newcommand{\baselinegrid}{%
  \raisebox{0pt}[\height][0pt]{\makebox[0pt][l]{%
  \begin{minipage}[t]{\textwidth}%
    \begin{color}{red}%
    \newcounter{ct}
    \forloop{ct}{1}{\value{ct} < 11}
    {
    %\vskip 15pt
    \rule[0.5ex]{7.5in}{1pt}
    \\
    \hdashrule[0.75ex]{7.75in}{1pt}{4mm}
    \\
    \rule[1.2ex]{7.5in}{1pt}
    \\
    }
    \end{color}
  \end{minipage}%
}}}

\begin{document}

  \baselinegrid%

\begin{spacing}{2.5}

  \usefont{T1}{wela}{m}{n}
  \fontsize{30}{15}\selectfont
  \setlength{\parskip}{0pt}
  \setlength{\parindent}{0pt}

  DURING the whole of a dull, dark, and soundless day in the autumn of the year, when the clouds hung oppressively low in the heavens, I had been passing alone, on horseback, through a singularly dreary tract of country; and at length found myself, as the shades of the evening drew on, within view of the melancholy House of Usher.

\end{spacing}

\end{document}

答案1

这是另一种解决方案,无需计算行号,并且可以将文本跨越多页。我使用了lineno有“每一行”钩,然后我重新定义行号为网格而不是实际数字。

Zapfino 网格

\documentclass[12pt]{article}

% necessary packages
\usepackage{tikz}

% set the font
%\usepackage{fontspec}
%\setmainfont{Zapfino}

% increase baseline skip
\usepackage{setspace}
\setstretch{1.5}

% define height of lowercase letters
\newcommand{\lowercaseheight}{1ex}
% define height of uppercase letters
\newcommand{\uppercaseheight}{2ex}
% define depth of descenders
\newcommand{\descenderdepth}{-0.5ex}
    % you may add more values here and then use them in the {tikzpicture}
    % to add more line to your grid


% package to have a "every line" hook
\usepackage{lineno}

\newenvironment{drillsheet}{%
    % let the "line numbers" start directly at the text
    \setlength\linenumbersep{0pt}%
    % let the "line numbers" be the grid
    \renewcommand{\thelinenumber}{%
        \begin{tikzpicture}[overlay]
                % baseline
                \draw ((0,0) -- ++(\textwidth,0);
                % lowercase height
                \draw [ultra thin] ((0,\lowercaseheight) -- ++(\textwidth,0);
                % uppercase height
                \draw (0,\uppercaseheight) -- ++(\textwidth,0);
                % descender depth
                \draw [ultra thin] (0,\descenderdepth) -- ++(\textwidth,0);
        \end{tikzpicture}%
    }%
    % the font and color of the numbers must be set explicitly
    \renewcommand\linenumberfont{\normalfont\color{black}}
    % start "line numbering", i.e. the grid
    \begin{linenumbers}%
        % set text color to gray
        \color{black!25}%
}{
    % end "numbering", i.e. the grid
    \end{linenumbers}%
}

\newenvironment{fakedisplaymath}{%
   \begin{center}%
   $\displaystyle
}{%
   $%
   \end{center}%
}

\begin{document}
\Large
\begin{drillsheet}
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed $a^2+b^2=c^2$
    incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
    nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
    \begin{fakedisplaymath}
       A=\int_0^2f(x)\,dx
    \end{fakedisplaymath}
    fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
    culpa qui officia deserunt mollit anim id est laborum.
\end{drillsheet}
\end{document}

数学
内联数学按预期工作:
内联数学

但是显示样式数学有点难,因为它lineno忽略了显示数学。我添加了{fakedisplaymath}环境以添加对方程式的基本支持。
显示数学
但我认为绘制数学的钻孔线很难,例如分数怎么样……?

答案2

我猜你不能用 LaTeX 制作点状字体,你要么使用设计为点状的字体,要么坚持使用直线字体。我建议使用浅灰色而不是点状字体。网格可以用蒂克兹, 例如。

如果您使用 XeTeX 或 LuaTeX,则可以使用fontspec并加载系统上安装的所有字体。否则,可以在以下位置找到 (PDF)LaTeX 兼容字体列表:LaTeX 字体目录

钻孔片

\documentclass[12pt]{article}

% necessary packages
\usepackage{environ}
\usepackage{tikz}
    \usetikzlibrary{calc}

% set the font
\usepackage{fontspec}
\setmainfont{Lilly}% from http://www.fontsquirrel.com/

% help length to store width of text
\newlength{\lengthoftext}

% increase baseline skip
\usepackage{setspace}
\setstretch{2}

% define height of lowercase letters
\newcommand{\lowercaseheight}{1ex}
% define height of uppercase letters
\newcommand{\uppercaseheight}{1.7ex}
% define depth of descenders
\newcommand{\descenderdepth}{-0.8ex}

% set up the environment. Use the optional argument to give a line number
% if it's not calculated properly
\NewEnviron{drillpar}[1][\numberoflines]{%
    % start new paragraph and add some space
    \par\addvspace{1\baselineskip plus 0.5\baselineskip}
    % measure the length of the text as if it's in a single line
    \settowidth{\lengthoftext}{\BODY}%
    % divide by text width to get the number of lines
    \pgfmathtruncatemacro\numberoflines{int(\lengthoftext/\textwidth)+1}%
    % use a {minipage} to keep the text on the same page
    \begin{minipage}{\textwidth}
        % for debugging
%       L: \the\lengthoftext\qquad N: #1\\%
        % set an anchor for the grid
        \tikz[remember picture,overlay] \coordinate (grid anchor);%
        % print the text
        {\color{black!25}\BODY}
        % draw the baseline grid
        \begin{tikzpicture}[remember picture,overlay]
            \foreach \line in {1,...,#1} {
                % baseline
                \draw [ultra thick] ($(grid anchor)+(0,{-(\line-1)*\baselineskip})$) --
                    ++(\textwidth,0);
                % lowercase height
                \draw ($(grid anchor)+(0,{-(\line-1)*\baselineskip+\lowercaseheight})$) --
                    ++(\textwidth,0);
                % uppercase height
                \draw [thick] ($(grid anchor)+(0,{-(\line-1)*\baselineskip+\uppercaseheight})$) --
                    ++(\textwidth,0);
                % descender depth
                \draw ($(grid anchor)+(0,{-(\line-1)*\baselineskip+\descenderdepth})$) --
                    ++(\textwidth,0);
            }
        \end{tikzpicture}%
    \end{minipage}%
    % start new paragraph and add some space
    \par\vspace{1\baselineskip plus 0.5\baselineskip}
}

\begin{document}
\Large
\begin{drillpar}
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
    incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
    nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
    fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
    culpa qui officia deserunt mollit anim id est laborum.
\end{drillpar}
\end{document}

使用 XeTeX 编译此示例两次(否则网格将无法正确放置)。要生成空网格,请使用空环境并使用可选参数设置行数,例如

\begin{drillpar}[6]
\end{drillpar}

您可以通过更改命令选项来更改网格的线宽\draw,请参阅 pgfmanual 了解更多信息或在评论中提问 ;-)

答案3

这里,每次发出\blankrow都会在纸上增加一行,而\fillrow允许您指定斜体(实际上是数学)文本。顶部和基线之间的距离用长度设置\letterheight,到中线的分数高度用指定\midpitch(对应于您希望为其开发练习表的字体),而相邻行之间的间隙用设置\parskip。我还假设大写字母的高度是 高度的 0.85 \strutbox,尽管这个数字可以更改。

如果您想要罗马文本,请将 放在\smash{#1}美元符号之间,如$\smash{#1}$的定义中\fillrow

\documentclass{article}
\usepackage{scalerel}
\usepackage[usestackEOL]{stackengine}
\newlength\letterheight
\setlength\letterheight{.5in}
\def\midpitch{.6}
\parskip 0.3in
\def\stacktype{L}\def\stackalignment{l}
%From morsburg at http://tex.stackexchange.com/questions/12537/
%how-can-i-make-a-horizontal-dashed-line/12553#12553
\def\dashfill{\cleaders\hbox to .6em{-}\hfill}
\newcommand\dashline[1]{\abovebaseline[-2pt]{\hbox to #1{\dashfill\hfil}}}
\def\myhline{\rule{\textwidth}{.3pt}}
\newcommand\blankrow{%
  \setstackgap{L}{\the\letterheight}%
  \stackon[\midpitch\letterheight]{%
    \stackon{\myhline}{\myhline}}{\dashline{\textwidth}}%
}
\newcommand\fillrow[1]{%
  \stackinset{l}{}{b}{}%
  {\scalerel*{\rule{0pt}{.85\ht\strutbox}\smash{#1}}{\blankrow}}{\blankrow}}
\begin{document}
\fillrow{ABC abc}

\fillrow{GHIJ ghij}

\blankrow
\end{document}

在此处输入图片描述


补充

hashable 询问两个问题...如何获取文本(而不是数学)字体作为字母,以及如何添加标记下行线的线条。我只是将其拼凑起来作为上面的变体。

\documentclass{article}
\usepackage{scalerel}
\usepackage[usestackEOL]{stackengine}
\newlength\letterheight
\setlength\letterheight{.5in}
\def\midpitch{.6}
\def\bottompitch{.3}
\parskip 0.4in
\def\stacktype{L}\def\stackalignment{l}
%From morsburg at http://tex.stackexchange.com/questions/12537/
%how-can-i-make-a-horizontal-dashed-line/12553#12553
\def\dashfill{\cleaders\hbox to .6em{-}\hfill}
\newcommand\dashline[1]{\abovebaseline[-2pt]{\hbox to #1{\dashfill\hfil}}}
\def\myhline{\rule{\textwidth}{.3pt}}
\newcommand\blankrow{%
  \setstackgap{L}{\the\letterheight}%
  \stackon[\midpitch\letterheight]{%
    \stackon{\smash{\stackunder[\bottompitch\letterheight]{\myhline}%
      {\dashline{\textwidth}}}}{\myhline}}{\dashline{\textwidth}}%
}
\newcommand\fillrow[1]{%
  \stackinset{l}{}{b}{}%
  {\scalerel*{$\rule{0pt}{.85\ht\strutbox}\smash{#1}$}{\blankrow}}{\blankrow}}
\begin{document}
\fillrow{ABC abc}

\fillrow{GHIJ ghij}

\blankrow
\end{document}

在此处输入图片描述

相关内容