Is there a way to force the text of an entire document to be typeset in all upper case with the exception of any math?
[Tex/LaTex] All Caps in Whole Document
capitalization
Related Solutions
This code should get you started. It uses a couple of the stringstrings
package's string manipulation routines, including its horrendously time-expensive \addlcwords
to identify the words you'd prefer to typeset in lower case. The rest of the code hooks this into APA's sectioning commands (it's tedious but it does the trick).
Note that although this should get you going, it isn't completely ready for prime time, mainly because the work will take some time which, if it weren't something you wanted to proceed with, would divert me from things I'm actually supposed to be doing :)
. Nevertheless, if this were something you wanted to proceed with, you'll need to let stringstrings
know that '-' (as in 'Knock-on') should be treated the same way as a space character (run the code below to see what I mean). That work would probably involve handing '-' to stringstrings
's \encodetoken
command and involve providing some extra buttressing code -- although I wouldn't be surprised if there were several ways to skin that particular cat.
Anyway, although there's still some work remaining, I hope it takes you in the direction you set out to go. (NB, don't forget: stringstrings
's \addlcwords
seems to scale time-exponentially. Or worse.)
\documentclass[jou]{apa}
\usepackage{lipsum}
\usepackage{stringstrings}
\addlcwords{all of the and a an is before on}
\DeclareRobustCommand*\MakeTitlecase[1]{%
\caselower[e]{#1}%
\capitalizetitle{\thestring}%
}
\makeatletter
% Four Levels with Sections in Title Case
\def\FourLevelHeadingTitleCase{%
\def\section{\@ifnextchar*{\@sections}%
{\@ifnextchar[{\@sectionb}{\@section}}}%
\def\@sections*##1{\leveltwo{\MakeTitlecase{##1}}}%
\def\@sectionb[##1]##2{\leveltwo{\MakeTitlecase{##2}}%
\@mkboth{\MakeUppercase{##1}}{\MakeUppercase{##1}}%
\addcontentsline{toc}{section}{\MakeTitlecase{##1}}}%
\def\@section##1{\leveltwo{\MakeTitlecase{##1}}%
\@mkboth{\MakeUppercase{##1}}{\MakeUppercase{##1}}%
\addcontentsline{toc}{section}{\MakeTitlecase{##1}}}%
%
\def\subsection{\@ifnextchar*{\@subsections}%
{\@ifnextchar[{\@subsectionb}{\@subsection}}}%
\def\@subsections*##1{\levelthree{\MakeTitlecase{##1}}}%
\def\@subsectionb[##1]##2{\levelthree{\MakeTitlecase{##2}}%
\addcontentsline{toc}{subsection}{\MakeTitlecase{##1}}}%
\def\@subsection##1{\levelthree{\MakeTitlecase{##1}}%
\addcontentsline{toc}{subsection}{\MakeTitlecase{##1}}}%
%
\def\subsubsection{\@ifnextchar*{\@subsubsections}%
{\@ifnextchar[{\@subsubsectionb}{\@subsubsection}}}%
\def\@subsubsections*##1{\levelfour{\MakeTitlecase{##1}}}%
\def\@subsubsectionb[##1]##2{\levelfour{\MakeTitlecase{##2}}%
\addcontentsline{toc}{subsubsection}{\MakeTitlecase{##1}}}%
\def\@subsubsection##1{\levelfour{\MakeTitlecase{##1}}%
\addcontentsline{toc}{subsubsection}{\MakeTitlecase{##1}}}%
%
\let\paragraph=\levelfive%
}
\makeatother
\FourLevelHeadingTitleCase
\title{On the Bodleianisation of L-Space Interior Topologies}
\author{The Librarian}
\affiliation{Unseen University}
\shorttitle{Ook}
\rightheader{Oook}
\leftheader{Capitalised Headers}
\abstract{\lipsum[1]}
\begin{document}
\maketitle
\section{Library-Space is NOT countable}
\lipsum[1]
\subsection{Turtles ALL the way down}
\lipsum[2]
\subsubsection{On THE Knock-ON Effect oN wood}
\lipsum[3]
\subsubsection{an orang And a utan}
\lipsum[3]
\end{document}
You can use the ucmark
package option:
\documentclass{report}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LE,RO]{\slshape \nouppercase{\rightmark}}
\fancyhead[LO,RE]{\slshape \leftmark}
\fancypagestyle{plain}{
\fancyhead{}
\fancyhead[LE,RO]{\slshape \rightmark}
\fancyhead[LO,RE]{\slshape \leftmark}
}
\usepackage[ucmark]{glossaries}
\makeglossaries
\newglossaryentry{test}{
name=test,
description={test}
}
\begin{document}
\chapter{Introduction}
Ceci est un \gls{test}.
\printglossary
\end{document}
Another option is to directly redefine \glossarymark
(in fact, this is what the ucmark
option does):
\makeatletter
\renewcommand{\glossarymark}[1]{%
\@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}
\makeatother
Best Answer
In principle you can use the OpenType
case
feature or itsfontspec
interfaceLetters=Uppercase
I can demonstrate with Caps and small Caps
Which comes from
However if you switch the commented
\setmainfont
then you just get lots of warnings looking likeand the output is just as input with no transformation.
So, if your actual font has the case opentype feature set that's all you need.
If not, then you could view it as a transliteration and use teckit in xetex or a lua callback in luatex, there were recent answers describing this for cyrillic but the system could work for case change as well (don't use my input_buffer callback suggestion for luatex, as you will mess up all the latex commands using lowercase ascii:-)
for xetex
Using XeTeX for automatic transliteration of cyrillic letters
or for luatex
Create a mapping for transliteration from cyrillic to latin in LuaLaTeX