2

I've this code:

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{endnotes}
\let\footnote=\endnote
\usepackage{etoolbox}
\preto{\theendnotes}{%
\renewcommand{\makeenmark}{\textsuperscript{\theenmark}\enspace}%
}
\renewcommand\enoteformat{%
  \raggedright
  \leftskip=1.8em
  \makebox[0pt][r]{\textsuperscript\theenmark\enspace %
\rule{0pt}{\dimexpr\ht\strutbox}}%
}

\begin{document}
Bla bla\footnote{\lipsum[1]} Bla bla\footnote{\lipsum[2]}

\theendnotes

\end{document}

Which setting have I to add or change to have notes text justified, preserving the other customized settings? Thanx

5
  • Remove \raggedright.
    – egreg
    Jan 29, 2015 at 18:42
  • No, because removing \raggedright I lost the other customizations. Please, compile my code: you'll realize that the note number is no more protruding on the left and so on
    – user41063
    Jan 29, 2015 at 19:03
  • The problem is, of course, that you're missing \noindent before \makebox.
    – egreg
    Jan 29, 2015 at 19:04
  • Of course... :)
    – user41063
    Jan 29, 2015 at 19:26
  • @egreg Perhaps turn your comment into an answer? Jan 29, 2015 at 19:35

1 Answer 1

3

You should remove \raggedright and add \noindent before \makebox.

But there's a slicker way, that makes it possible to also have lists in the endnotes (which would behave badly in a \leftskip context).

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{endnotes}
\usepackage{etoolbox}

%%% Customize endnotes
\let\footnote=\endnote
\makeatletter
% remove the useless part
\renewcommand{\enoteheading}{%
  \section*{\notesname
    \@mkboth{\MakeUppercase{\notesname}}{\MakeUppercase{\notesname}}}%
}
\makeatother

% change the endnote mark
\preto{\theendnotes}{%
  \renewcommand{\makeenmark}{\textsuperscript{\theenmark}\enspace}%
}
% the notes are typeset as a list
\patchcmd{\theendnotes}{\input}{\noteslist\input}{}{}
\patchcmd{\theendnotes}{\endgroup}{\endnoteslist\endgroup}{}{}
% \enoteformat issues \item
\renewcommand\enoteformat{%
  \item[\textsuperscript\theenmark\rule{0pt}{\dimexpr\ht\strutbox}]%
}
% the list
\newenvironment{noteslist}
 {\list{}{%
   \leftmargin=1.8em
   \topsep=0pt
   \partopsep=0pt
   \itemindent=0pt
   \itemsep=0pt}}
 {\endlist}

\begin{document}

Bla bla\footnote{\lipsum*[1]} Bla bla\footnote{\lipsum*[2]}

\theendnotes

\end{document}

enter image description here

1
  • sorry for delaying. the second solution is more complex and not necessary for my actual text, but I register it for possible future uses. thanx!
    – user41063
    Jan 30, 2015 at 21:04

You must log in to answer this question.

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