EDITED (See SUPPLEMENT for compatibility with natbib
)
I stand corrected from my comment. It can be done. I followed the example of Chapter title alignment with titleformat but made it to title caps, instead of small caps.
I even employed the word exclusion available from \Addlcwords{}
.
In my original comment to the OP, I recommended the use of the titlecaps
package, which I wrote precisely because the \capitalizetitle
macro of the stringstrings
package (which I also wrote) was embarrassingly slow.
\documentclass[12pt]{book}
\usepackage{titlesec}
\usepackage{xcolor,lipsum,titlecaps}
\titleformat{\chapter}[block]
{}
{\llap{\color{gray}\chapterNumber\thechapter
\hspace{10pt}\vline}}
{10pt}
{\formatchaptertitle}
\newcommand{\formatchaptertitle}[1]{%
\parbox[t]{\dimexpr\textwidth-10pt}{\raggedright\LARGE\titlecap{#1}}}
\newcommand{\chapterNumber}{%
\fontsize{50}{50}\usefont{U}{eur}{b}{n}}
\Addlcwords{is with}
\begin{document}
\chapter{this is my long long long long title with several lowercase words}
\lipsum[1]
\end{document}
SUPPLEMENT
Apparently, the use of \titlecap
in section titles via titlesec
is incompatible with natbib
. The solution here was to \let\titlecap\relax
immediately prior to the bibliography call, which essentially turns off titlecap
for the bibliography. But since the section name of the bibliography is "References" and does not need \titlecap
, there is no harm is so doing.
\documentclass{article}
%%% Language support
\usepackage[english]{babel} % Get everything translated properly
\usepackage[latin1]{inputenc} % Input text correctly
\usepackage[T1]{fontenc} % Get hyphenation right
\usepackage{lmodern} % The Latin Modern fonts
%%%
%%% AMS support
\usepackage{amsmath}
\usepackage{amsfonts} % fonts
\usepackage{amssymb} % extra symbols
%%%
\usepackage{natbib}
\bibpunct{(}{)}{;}{a}{,}{,}
\usepackage{titlesec,titlecaps}
\Addlcwords{is with}
\titleformat{\section}[block]{}{\normalfont\Large\bfseries\thesection.\;}{0pt}{\formatsectiontitle}
\newcommand{\formatsectiontitle}[1]{\normalfont\Large\bfseries\titlecap{#1}}
\titleformat{\subsection}[block]{}{\normalfont\large\bfseries\thesubsection.\;}{0pt}{\formatsubsectiontitle}
\newcommand{\formatsubsectiontitle}[1]{\normalfont\large\bfseries\titlecap{#1}}
\begin{document}
\section{this is a title 1}
\subsection{this is a Subsection Title 1}
\section{Another title 2}
Please see \cite{author2016}.
\let\titlecap\relax
\bibliographystyle{apalike}
\bibliography{test_bib}
\end{document}
You can use \lcnamecref
:
\documentclass{article}
\usepackage{ntheorem}
\usepackage[capitalize]{cleveref}
\newtheorem{conjecture}{Conjecture}
\newtheorem{solution}{Solution}
\Crefname{conjecture}{Conjecture}{Conjectures}
\Crefname{solution}{Solution}{Solutions}
\begin{document}
\begin{conjecture} \label{c1} Something happened.
\end{conjecture}
\begin{conjecture} \label{c2} Something else also happened.
\end{conjecture}
\begin{solution} \label{s} A lot of things happened.
\end{solution}
\cref{c1,c2,s} are both \lcnamecref{s} and \lcnamecref{c1}.
\end{document}
Best Answer