Skip to content

davidbauch/tex_bionic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Bionic Reading TeX Formatter

This luatex script formats simple text into a bionic reading format. In bionic reading, the beginning of the words in text are emphasized, significantly increasing reading performance.

The resulting text will look like this:

$$\text{So}\text{\textcolor{gray}{me}}\text{ te}\text{\textcolor{gray}{xt}}\text{ i}\text{\textcolor{gray}{n}}\text{ bi}\text{\textcolor{gray}{onic}}~\text{ form}\text{\textcolor{gray}{atting}}.$$

Run 'lua test.lua -p' to print some examples.

Here is an Overleaf Example of the bionic formatting running on some lorem ipsum text.

Note

Requires LuaTex.

Usage

\usepackage{luacode}
\directlua{dofile("bionic.lua")}

% Bionic Command. You can change "percentage" to anything you want (between 0 and 100)
\newcommand{\bionic}[1]{
  \directlua{
    local input = [[\detokenize{#1}]]
    local percentage = 30
    tex.print(bionic_text(input, percentage))
  }
}

% These commands define the formatting
\newcommand{\bionicfront}[1]{\textbf{#1}}
\newcommand{\bionicback}[1]{#1}

...

\bionic{Some text in bionic formatting.}

About

Simple Bionic formatting in LuaTex

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages