7

When learning a foreign alphabet or language (hence [x]unicode), it's helpful to print the letters or words, scatter them around one's surroundings, and quiz oneself once in a while to improve one's speed of recognition.

For example the figure:

greek-letters

can be obtained from:

\documentclass{article}
\usepackage[letterpaper,margin=1.0in]{geometry} 
\usepackage{fontspec} 
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Lucida Sans Unicode}

\begin{document}

\Huge
\begin{tabular}{|c|c|c|c|c|}
\hline
α & β & γ  & δ  & ε \\
\hline
ζ & η & θ & ι & κ \\ 
\hline
\end{tabular}

\end{document}

The table above does the trick, but it has two problems:

  • It's tough to cut exactly along the lines, and it's nice not to have a meandering line at all. How can the lines be replaced with minuscule crosses that hint where to cut?
  • Even with "Huge" this is still too small and so:
    • How can each letter or word be surrounded with a more ample margin?
    • How can the size of the letters be increased in a generic way (to work with any font)?

Update:

With words it's nice to keep the words centered, which tabular and c do easily. I'm not sure about tikz. For example:

\documentclass[12pt]{article}
\usepackage[letterpaper,margin=1.2in]{geometry} 
\usepackage[no-math]{fontspec}
\setmainfont{Comic Sans MS}
\usepackage{mathtools}
\usepackage{unicode-math}

\begin{document}
\fontsize{10mm}{11mm}\selectfont % was: \Huge
\begin{tabular}{|c|c|c|c|c|}
\hline
Dolce & mia & fanciulla & il & tuo \\
\hline
signore & sara & domani & solo & mondo \\
\hline
\end{tabular}

\end{document}

produces:

words

I suppose replacing the lines with dotted lines would do just fine. They will then be imperceptible after a semi-careful cut. David answered the font size question (which I'm using here). So that keeps centering, a margin, and a more discrete boundary.

8
  • you can use any font size you like, you are not limited to the named ones, \fontsize{5cm}{6cm}\selectfont hello is quite big for example. Jan 12, 2016 at 20:03
  • @DavidCarlisle Thanks. You answered the third part. I updated the question.
    – Calaf
    Jan 13, 2016 at 6:36
  • I've updated my answer with a tcolorbox solution which I think is easy to type compared with tabular and matrix.
    – Ignasi
    Jan 13, 2016 at 8:39
  • never end of your question :-). Your upgrade seems to be actually new, quit different one, isn't it?
    – Zarko
    Jan 13, 2016 at 9:01
  • @Zarko Well, I did specify from the beginning that it's for the use of someone learning a foreign alphabet {\em or language} :). My example worked with the "language" part (i.e. words, not letters), but none of the four solutions offered nailed it. I preferred in this case to avoid a sequel question and just keep everything in one place.
    – Calaf
    Jan 13, 2016 at 16:43

2 Answers 2

6

A TiKZ matrix can help to solve part of the problem.

\documentclass{article}
\usepackage[letterpaper,margin=1.0in]{geometry} 
\usepackage{fontspec} 
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Lucida Sans Unicode}
\usepackage{tikz}
\usetikzlibrary{matrix,shapes.misc}


\begin{document}

\begin{tikzpicture}[mycross/.style={cross out, draw=gray, 
    minimum size=4pt, rotate=45, outer sep=0pt, inner sep=0pt},
        myletter/.style={inner sep=5mm, 
            minimum width=15mm, 
            minimum height=20mm, anchor=center, font=\Huge}]

\matrix (A) [matrix of nodes, nodes=myletter, column sep=0pt, row sep=0pt,]{
α & β & γ  & δ  & ε \\
ζ & η & θ & ι & κ \\ };

    \foreach \j in {1,...,2}{
        \foreach \i in {1,...,5}
            \node[mycross] at (A-\j-\i.north west) {};
        \node[mycross] at (A-\j-5.north east) {};
    }
    \foreach \i in {1,...,5}
        \node[mycross] at (A-2-\i.south west) {};
    \node[mycross] at (A-2-5.south east) {};
\end{tikzpicture}

\end{document}

enter image description here

Update: scale

I don't know if it's the correct way to go, but looks like scale factor inside myletter style, changes font size:

\documentclass{article}
\usepackage[letterpaper,margin=1.0in]{geometry} 
\usepackage{fontspec} 
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Lucida Sans Unicode}
\usepackage{tikz}
\usetikzlibrary{matrix,shapes.misc}


\begin{document}

\noindent\begin{tikzpicture}[mycross/.style={cross out, draw=gray, 
    minimum size=4pt, rotate=45, outer sep=0pt, inner sep=0pt},
        myletter/.style={inner sep=3mm, 
            minimum width=15mm, 
            minimum height=20mm, anchor=center, 
            font=\Huge, scale=2.5}]

\matrix (A) [matrix of nodes, nodes=myletter, column sep=0pt, row sep=0pt,]{
α & β & γ  & δ  & ε \\
ζ & η & θ & ι & κ \\ };

    \foreach \j in {1,...,2}{
        \foreach \i in {1,...,5}
            \node[mycross] at (A-\j-\i.north west) {};
        \node[mycross] at (A-\j-5.north east) {};
    }
    \foreach \i in {1,...,5}
        \node[mycross] at (A-2-\i.south west) {};
    \node[mycross] at (A-2-5.south east) {};
\end{tikzpicture}

\end{document}

enter image description here

2nd Update: tcbraster

An alternative solution for arranging letters or words could be a tcbraster environment from tcolorbox. It organizes boxes on a matrix with fixed columns and fills it from left to right. An example which includes font scaling is:

\documentclass{article}
\usepackage[letterpaper,margin=1.0in]{geometry} 
\usepackage{fontspec} 
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Lucida Sans Unicode}
\usepackage[most]{tcolorbox}
\usetikzlibrary{shapes.misc}

\tcbset{%
        nobeforeafter, empty,
        overlay={%
            \foreach \i in {north west, south west, 
                                north east, south east}
                \node[mycross] at (frame.\i) {};},
        halign=center,
        valign=center,
        boxsep=8mm,
        raster equal height=rows, 
        raster column skip=0pt, 
        raster row skip=0pt
        }

\tikzset{
    mycross/.style={cross out, draw=gray, 
    minimum size=4pt, rotate=45, 
    outer sep=0pt, inner sep=0pt}
    }

\begin{document}
\thispagestyle{empty}

\begin{tcbitemize}[raster columns=3, before upper={\fontsize{40mm}{48mm}\selectfont}
]
\tcbitem α
\tcbitem β
\tcbitem γ
\tcbitem δ
\tcbitem ε
\tcbitem ζ
\tcbitem η
\tcbitem θ 
\tcbitem ι 
\tcbitem κ 
\end{tcbitemize}


\begin{tcbitemize}[raster columns=2, before upper={\fontsize{10mm}{11mm}\selectfont}]
\tcbitem Dolce
\tcbitem mia
\tcbitem fanciulla
\tcbitem il
\tcbitem tuo
\tcbitem signore
\tcbitem sara
\tcbitem domani
\tcbitem solo
\tcbitem mondo 
\end{tcbitemize}
\end{document}

enter image description here

1
  • The third solution is perfect. For other examples I sometimes needed to modify the boxsep, not just the font size, to avoid duplication of crosses. (This duplication is handy by itself to signal something is not right.)
    – Calaf
    Jan 13, 2016 at 17:40
6

An addendum to Ignasi answer, it solve all your asks in question:

\documentclass[border=5mm,14pt,tikz]{standalone}
\usetikzlibrary{matrix,shapes.misc}
    \usepackage{fontspec}
    \usepackage{xunicode}
    \usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Lucida Sans Unicode}

    \usepackage{graphicx}

    \begin{document}
\begin{tikzpicture}[
mycross/.style = {cross out, draw=gray,
                  minimum size=4pt, rotate=45, outer sep=0pt, inner sep=0pt},
myletter/.style = {inner sep=1mm,
                   minimum width=15mm, minimum height=20mm, anchor=center},
                   ]

\matrix (A) [matrix of nodes, nodes=myletter, column sep=0pt, row sep=0pt,]{
\scalebox{5}{α} & \scalebox{5}{β}
    & \scalebox{5}{γ}  & \scalebox{5}{δ}  & \scalebox{5}{ε} \\
\scalebox{5}{ζ} & \scalebox{5}{η}
    & \scalebox{5}{θ} & \scalebox{5}{ι} & \scalebox{5}{κ} \\ };

    \foreach \j in {1,...,2}{
        \foreach \i in {1,...,5}
            \node[mycross] at (A-\j-\i.north west) {};
        \node[mycross] at (A-\j-5.north east) {};
    }
    \foreach \i in {1,...,5}
        \node[mycross] at (A-2-\i.south west) {};
    \node[mycross] at (A-2-5.south east) {};
\end{tikzpicture}
    \end{document}

enter image description here

As you see, by use of scalebox from graphicx package you can enlarge letters, for scale greater than 5 you need to increase minimum node size (in myletter) accordingly.

Upgrade (1): According to comment of David Carlisle, far more efficient way to enlarge letters is to use \fontsize{<size>}{<line space>}\selectfont. With its use, with selecting font size 40mm, the code and result is:

\documentclass[border=5mm,14pt,tikz]{standalone}
\usetikzlibrary{matrix,shapes.misc}
    \usepackage{fontspec}
    \usepackage{xunicode}
    \usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Lucida Sans Unicode}

    \begin{document}
\begin{tikzpicture}[
mycross/.style = {cross out, draw=gray,
                  minimum size=4pt, rotate=45, outer sep=0pt, inner sep=0pt},
myletter/.style = {inner sep=1mm,
                   minimum width=40mm, minimum height=48mm, anchor=center,
                   font=\fontsize{40mm}{48mm}\selectfont},
                   ]

\matrix (A) [matrix of nodes, nodes=myletter, column sep=0pt, row sep=0pt,]{
α & β & γ & δ & ε \\
ζ & η & θ & ι & κ \\ };

    \foreach \j in {1,...,2}{
        \foreach \i in {1,...,5}
            \node[mycross] at (A-\j-\i.north west) {};
        \node[mycross] at (A-\j-5.north east) {};
    }
    \foreach \i in {1,...,5}
        \node[mycross] at (A-2-\i.south west) {};
    \node[mycross] at (A-2-5.south east) {};
\end{tikzpicture}
    \end{document}

enter image description here

Note: Horizontal distance between "minuscule crosses" is 40mm, so it fit on A4 paper with only 5mm margins. So, if you like to have even bigger leters, you should consider to rotate paper to landscape (or used A3 or bigger printer/plotter).

Upgrade (2): According to comment of Calaf, here is option, which use article as document class.

    \documentclass{article}
\usepackage[letterpaper,margin=0.1in,showframe]{geometry}
        \usepackage{tikz}
        ....

enter image description here

9
  • why use scalebox rather than just use a larger font size? Jan 12, 2016 at 20:01
  • Because the biggest letter size is \huge, by scalebox it can be set much bigger. That is, as I understand question, one of the OP asks.
    – Zarko
    Jan 12, 2016 at 20:04
  • I think scale option applied to node style also affects font size
    – Ignasi
    Jan 12, 2016 at 20:04
  • No, as far as I know, scale influence only on coordinates (size of shapes). I try this unsuccessfully (or I'm wrong?)
    – Zarko
    Jan 12, 2016 at 20:05
  • @Zarko \fontsize{10cm}{12cm}\selectfont is bigger than \huge in most document classes. You can set the font size to any legal tex length, just that a small list of sizes get named. Jan 12, 2016 at 20:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .