smallcaps: Flatten camel case text in LaTeX files

[ bsd3, latex, library, program, text ] [ Propose Tags ]

smallcaps is a pre-processor library for LaTeX files. The library comes with an executable that makes most functionality accessible through a command line interface. The pre-processor formats sequences of uppercase letters with TeX's \small macro or whatever you configure. Uppercase letters at the beginning of sentences are not formatted. Other formatting conditions can be configured by the user.

The executable can be configured through its command line arguments as well as through TeX comments. In the default configuration, lesscase does not change the content of any macro argument or environment (different from document). More and less restrictive configuration profiles can be activated and adapted. Configurations can be stored and restored at any time, even while processing the input file.

exports the main program as library.
specifies the default configuration values for Text.SmallCaps.
parses Text to a TeXElement token stream.
parses a TeXElement token stream and produces a LaTeXElement token stream.
replaces uppercase letters in LaTeXElement token streams.

A simple program can be defined as

import Data.Default           ( def )
import Text.SmallCaps         ( smallcaps )
import Text.SmallCaps.Config  ( defaultProfile )
main = smallcaps def defaultProfile

This is virtually all the code that is necessary to implement the executable lesscase. Have a look in the source of the executable twocase which only formats sequences of two or more uppercase letters. It is a good reference for understanding the API changes that took place between the revisions 0.5 and 0.6.


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS], 0.4,, 0.4.1,,,,,,,,,,,,,
Dependencies attoparsec, base (>=4.8 && <5), containers, data-default, directory, filepath, parsec, smallcaps, text, transformers [details]
License BSD-3-Clause
Author Stefan Berthold
Category Text, LaTeX
Bug tracker
Source repo head: git clone
Uploaded by StefanBerthold at 2019-05-28T20:39:22Z
Reverse Dependencies 1 direct, 0 indirect [details]
Executables twocase, lesscase
Downloads 11598 total (56 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-05-28 [all 1 reports]