1

i am struggling to find a way to capitalize the first letter in "part", "chapter" and "sub-sections" automatically... so far i've used a manual workaround "\texorpdfstring{\MakeUppercase Xx}" which does the work in the document body, but for example in the pdfbookmark it doesn't show anylonger the first letter.

Is there a way to automatically change that "part I, II, III, IV, V ,...", Chapters and sub-section all start with capital letter (first sentence only) and the pdfbookmark is also shown correctly on pdf afterwards? Same goes for Appendixes...

thanks you all!

   \documentclass[oneside,11pt, a4paper, footinclude=true, headinclude=true, cleardoublepage=empty]{scrbook}
    \usepackage[linedheaders,parts,pdfspacing,dottedtoc]{classicthesis}
    \usepackage{amsmath}
    \usepackage{acronym}
    \usepackage[a4paper, hmargin={2.8cm, 2.8cm}, vmargin={2.5cm, 2.5cm}]{geometry}
    \usepackage{eso-pic} % \AddToShipoutPicture
    \usepackage{graphicx} % \includegraphics
    \graphicspath{
        {Pics/PDFs/}
        {Pics/JPGs/}
        {Pics/PNGs/}
    }
    \usepackage{color, colortbl}
    \definecolor{LightCyan}{rgb}{0.88,1,1}
    \definecolor{Gray}{gray}{0.9}
    %\usepackage{subfig}
    \usepackage{subcaption}
    \usepackage{textcomp}
    \usepackage{footnote}
    \usepackage{verse}
    \usepackage{hyperref}
    \usepackage{cmap}
    \usepackage[T1, T2A]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage[english]{babel}
    \usepackage{csquotes}
    \usepackage{bookmark}
    \usepackage{longtable}
    \usepackage{array}
    \usepackage{multirow}
    \usepackage{times}
    \usepackage{lingmacros}
    \usepackage{color, colortbl}
    \usepackage{tabularx}
    \usepackage{pdfpages}
    \usepackage{footnote}
    \definecolor{mygray}{rgb}{0.86,0.86,0.86}
    \makesavenoteenv{tabular}
    \makesavenoteenv{table}
    \renewcommand{\baselinestretch}{2.0}
    \def\signed #1{{\leavevmode\unskip\nobreak\hfil\penalty50\hskip2em
      \hbox{}\nobreak\hfil(#1)%
        \parfillskip=0pt \finalhyphendemerits=0 \endgraf}}
    
        \newsavebox\mybox
        \newenvironment{aquote}[1]
          {\savebox\mybox{#1}\begin{quote}}
              {\signed{\usebox\mybox}\end{quote}}
    
    
    \renewcommand{\cfttabpresnum}{} % get rid of "table"
    \renewcommand{\cftfigpresnum}{}
    
    \newcolumntype{S}{>{\footnotesize}l} % define a new column type for \small
    
    \usepackage{mdframed}
    
    \usepackage{array}
    \usepackage{threeparttable}
    \usepackage{graphicx}
    \newcommand{\tabhead}[1]{\textbf{#1}}
    \newcommand{\rothead}[1]{\rotatebox{45}{\tabhead{#1}}}
    
    \usepackage{tipa}
    \usepackage{tabularx}
    \newcolumntype{Y}{>{\centering\arraybackslash}X}
    \usepackage{breqn}
    \usepackage{setspace}
    %\doublespacing
    % or:
    \onehalfspacing
    \usepackage{ragged2e}
    
    
    %for R code
    \usepackage{listings}
    \lstset{    language=R,                       
    basicstyle=\footnotesize\ttfamily, numbers=left,
    stepnumber=5,                    
    numbersep=5pt, backgroundcolor=\color{white}, frame=single,   
    captionpos=b,                        keywordstyle=\color{blue},
    commentstyle=\color{red},
    breaklines=true,
      postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space}}
    
    
    %Box around fig
    \usepackage{wrapfig, framed, caption}
    
    
    
    %\usepackage[backend=biber,style=nature,dashed=false,sorting=nty, maxcitenames=2]{biblatex}
    
    \usepackage[%
      backend=bibtex      % biber or bibtex
    ,style=authoryear    % Alphabeticalsch
    %,style=numeric-comp  % numerical-compressed
     ,sorting=nyt        % no sorting
     ,sortcites=true      % some other example options ...
     ,bibencoding=ascii
     ,block=none
     ,indexing=false
     ,citereset=none
     ,isbn=true
     ,url=true
     ,doi=true            % prints doi
     ,natbib=true         % if you need natbib functions
    ]{biblatex}
    
    \addbibresource{references.bib} %Imports bibliography file
    
    \def \ColourPDF {Images/ku-farve.pdf}
    \def \TitlePDF   {Images/ku-en.pdf}
    
    
    \subject{ 
      \vspace{2.5cm}
     % \scriptsize{A thesis presented to the Faculty of Science in partial fulfillment of the requirements for the degree} \\
      \Large{Master of Science in } \\}
    
    \title{
    \vspace{1.0cm}
    \Large{Title}
      \vspace{0.5cm} \\}
    
    \author{
      \Large\textbf{Name Surname} \\
      \texttt{email address}
      \vspace{4.5cm} \\
      \large{Supervisors: }\\
    \textbf{Name surname}\\
    \large{Co-supervisors: }\\
    {\textbf{Name surname}\\\vspace{.01in}}
    \textbf{Name surname}\\
    \vspace{1cm} \\}
    \date{October 20th, 2020}
    
    
    
    \begin{document}
    \pagenumbering{roman}
    \AddToShipoutPicture*{\put(0,0){\includegraphics*[viewport=0 0 700 600]{\ColourPDF}}}
    \AddToShipoutPicture*{\put(0,602){\includegraphics*[viewport=0 600 700 1600]{\ColourPDF}}}
    \AddToShipoutPicture*{\put(0,0){\includegraphics*{\TitlePDF}}}
    \clearpage\maketitle
    \thispagestyle{empty}
    \newpage
    \include{FrontBackMatter/dedication}
    
    \include{FrontBackMatter/acknowledgements}
    
    \include{FrontBackMatter/abstract}
    
    \include{FrontBackMatter/contents}
    
    \include{FrontBackMatter/abbreviations}
    
    %\include{FrontBackMatter/symbols}
    
    \pagenumbering{arabic}
    
    
    
    \part{Project description}\label{Part:I}
    \include{Projectdescription/Introduction}
    \include{Projectdescription/Background}
    
    
    \part{\texorpdfstring{\MakeUppercase Da}ata validation and 
    \texorpdfstring{\MakeUppercase Li}ifetime Correction method}\label{Part:II}
    \include{Datav_lifetime/Datavalidation} \label{chap:Datavalidation}
    \include{Datav_lifetime/Methodology} \label{chap:Methodology} 
    \include{Datav_lifetime/Results0} \label{chap:Results0}
    
    \part{\texorpdfstring{\MakeUppercase Pr}reliminary analysis}\label{part:III}
    \include{PreliminaryAnalysis/Methodology1} \label{chap:Methodology1}
    \include{PreliminaryAnalysis/CA} \label{chap:Results0} 
    \include{PreliminaryAnalysis/PCA} \label{chap:Results2}
     
    
    \part{\texorpdfstring{\MakeUppercase Ap}ppendices} \label{part:VI}
    \include{Appendices/AppendixA} \label{chap:appendixA}
    \include{Appendices/AppendixB} \label{chap:appendixB}
    
    
    
    \medskip
    
    \printbibliography[
    heading=bibintoc,
    title={Bibliography}
    ] 
    
     
    \clearpage
    
    \end{document}
1
  • Why don't you do the capitalization your self? It is just as easy to type c as it is to type C Oct 19 '20 at 18:14
1

You are losing the first letter as \texorpdfstring takes two arguments, the tex version for the document and the version for the pdf bookmark, so

\texorpdfstring{\MakeUppercase Li}ifetime

is

\texorpdfstring{\MakeUppercase{L}i}{i}fetime

and has no L in the string used for the bookmark, you could use

\texorpdfstring{\MakeUppercase{L}i}{Li}fetime

But (with no test example that shows a problem) it would appear that this is equivalent to simply using

Lifetime

so your \part can be

\part{Data validation and  Lifetime Correction method}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.