MyNixOS website logo
Description

Flatten camel case text in LaTeX files.

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.

Text.SmallCaps

exports the main program as library.

Text.SmallCaps.Config

specifies the default configuration values for Text.SmallCaps.

Text.SmallCaps.TeXParser

parses Text to a TeXElement token stream.

Text.SmallCaps.TeXLaTeXParser

parses a TeXElement token stream and produces a LaTeXElement token stream.

Text.SmallCaps.DocumentParser

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.

Metadata

Version

0.6.0.6

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows