0

I don't understand why my includegraphics does not work with this document. This is my MWE:

\documentclass[hidelinks,12pt,twoside,openright,a4paper]{book}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{float}
\usepackage{lipsum}
\setlength{\headheight}{14.49998pt}
\addtolength{\topmargin}{-2.49998pt}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{setspace}
 \linespread{1.1}
%%%%%%%%%%%%%%%%pas de bold%%%%%%%%%%
\let\bfseries\mdseries
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[french]{babel}
\usepackage{fontspec}
\usepackage[left=5.5cm,right=5.5cm,top=6.5cm,bottom=6.5cm]{geometry}
\setmainfont{Arial}
\frenchspacing
%\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}
\usepackage{titlesec}
\usepackage{titling}
\titleformat*{\section}{\normalsize\itshape}
\titleformat*{\subsection}{\normalsize\itshape}
\titleformat*{\subsubsection}{\normalsize\itshape}
%%%%%%%points pour chapitres dans toc%%%%%%%%%%
\usepackage{tocloft}
\setlength{\cftbeforechapskip}{3pt}%espace entre chapitres
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{hyperref}
%\usepackage[numberedbib,nosectionbib]{apacite}
\usepackage[makeindex]{imakeidx}
\makeindex[name=pers, title=Index des personnes]
\makeindex[name=mat, title=Index des matières]

\usepackage{fancyhdr}

\pagestyle{fancy}
% We don’t want chapter and section numbers
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{} % sets both header and footer to nothing
\fancyfoot{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[CE]{\textit{Un titre}} % even pages: chapter title
\fancyhead[CO]{\textit\leftmark} % odd pages: book title


%%%%%%%%%%%%Pas de N° de chapitres%%%%%%%%%%%%%%%%%%%%
\usepackage{titlesec}
\titleformat{\chapter}[display]%
    {\centering\Large\bfseries}% format of chapter
    {\large\normalfont\MakeUppercase{\chaptertitlename}\enskip\thechapter}% format of the label
    {.5\baselineskip}{} % space between the two
\titlespacing*{\chapter}{0pt}{25pt}{35pt} % spaces around \chapter{}, {left}{before}{after}
 
%\titleformat{\chapter}[display]
  %{\normalfont\bfseries}{}{0pt}{\Huge}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%épigraphe%%%%%%%%%%%%
\makeatletter
\renewcommand{\@chapapp}{}% Not necessary...
\newenvironment{chapquote}[2][2em]
  {\setlength{\@tempdima}{#1}%
   \def\chapquote@author{#2}%
   \parshape 1 \@tempdima \dimexpr\textwidth-2\@tempdima\relax%
   \itshape}
  {\par\normalfont\hfill---\ 
 \chapquote@author\hspace{\@tempdima}\par\bigskip\par\bigskip}
\makeatother

%%%%%%%%%%%%%Numérotation en chiffres arabes%%%%%%%%%%%%%%%%%%%
\makeatletter
\renewcommand\frontmatter{%
  \cleardoublepage
  \@mainmatterfalse
  %\pagenumbering{roman}% Don’t reset
}
\renewcommand\mainmatter{%
  \cleardoublepage
  \@mainmattertrue
  %\pagenumbering{arabic}% Don’t reset
}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\chapter{A chapter}

\lipsum



\begin{figure}[H] 
    \centering
\includegraphics{chalet.jpg}
\caption{Un chalet à la montagne}
\label{Chalet}
\end{figure}
\end{document}
3
  • 3
    Could you elaborate on the manner of "does not work"? Maybe show the error message and/or the log file? Commented Aug 18, 2021 at 16:34
  • If I try with lualatex the document works other than the file is missing, what does your log file say. Commented Aug 18, 2021 at 16:34
  • 3
    that isn't really a "minimal" example. Commented Aug 18, 2021 at 16:37

1 Answer 1

4

I cannot reproduce the issue. Your example compiles OK with lualatex and \includegraphics works fine:

enter image description here

2
  • 2
    that's not really an answer to the question (not that the question can have an answer in the current form) Commented Aug 18, 2021 at 17:44
  • @DavidCarlisle, indeed. It's more like a long comment for OP with visual support.
    – citsahcots
    Commented Aug 18, 2021 at 19:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .