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

  • Remove \raggedright. – egreg Jan 29 '15 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 '15 at 19:03
  • The problem is, of course, that you're missing \noindent before \makebox. – egreg Jan 29 '15 at 19:04
  • Of course... :) – user41063 Jan 29 '15 at 19:26
  • @egreg Perhaps turn your comment into an answer? – Gonzalo Medina Jan 29 '15 at 19:35
2

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

|improve this answer|||||
  • 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 '15 at 21:04

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.