TransWikia.com

Endnotes at the same line

TeX - LaTeX Asked on September 5, 2021

I’m struggling to make every endnote entry not take a new line. I read this answer, which explained a lot, but didn’t answer my doubt, as said, how can I make endnotes entries not start a new line.
For example:

1- entry 1 2- entry 2

Instead of

1- entry 1

2- entry 2

2 Answers

In endnotes.sty, theendnotes is defined as follows:

deftheendnotes{immediatecloseout@enotes global@enotesopenfalse
  begingroup
    makeatletter
    edef@tempa{`string >}%
    ifnumcatcode@tempa=12%
      let@ResetGTrelax
    else
      edef@ResetGT{noexpandcatcode@tempa=thecatcode@tempa}%
      @makeother>%
    fi
    def@doanenote##1##2>{def@theenmark{##1}parbegingroup
        @ResetGT
        edef@currentlabel{csname p@endnoteendcsname@theenmark}%
        enoteformat}
    def@endanenote{parendgroup}%
    enoteheading
    enotesize
    input{jobname.ent}%
  endgroup}

All you need to do is to hack this to remove the pars inside the definition. Here is the MWE, where two pars are just removed:

documentclass{article}
usepackage{endnotes}
makeatletter
deftheendnotes{immediatecloseout@enotes global@enotesopenfalse
  begingroup
    makeatletter
    edef@tempa{`string >}%
    ifnumcatcode@tempa=12%
      let@ResetGTrelax
    else
      edef@ResetGT{noexpandcatcode@tempa=thecatcode@tempa}%
      @makeother>%
    fi
    def@doanenote##1##2>{def@theenmark{##1}begingroup
        @ResetGT
        edef@currentlabel{csname p@endnoteendcsname@theenmark}%
        enoteformat}
    def@endanenote{hspace{1em}endgroup}%
    enoteheading
    enotesize
    input{jobname.ent}%
  endgroup}
makeatother
begin{document}
Oneendnote{this is the first endnote. this is the first endnote.} twoendnote{this is the second endnote. this is the second endnote.} three endnote{this is the third endnote.} 

theendnotes
end{document}

You can change the space between endnotes by modifying the amount of hspace{1em}.

Result

Correct answer by domperor on September 5, 2021

You can use enotez together with enumitem.

documentclass{article}
usepackage{enotez}
usepackage[inline]{enumitem}

DeclareInstance{enotez-list}{itemize*}{list}{list-type = itemize*}
setlist[itemize]{itemjoin={qquad}}

begin{document}

Aendnote{entry one}
Bendnote{entry two}
Aendnote{entry one}
Bendnote{entry two}
Aendnote{entry one}
Bendnote{entry two}
Aendnote{entry one}
Bendnote{entry two}
Aendnote{entry one}
Bendnote{entry two}
Aendnote{entry one}
Bendnote{entry two}
Aendnote{entry one}
Bendnote{entry two}
Aendnote{entry one}
Bendnote{entry two}
Aendnote{entry one}
Bendnote{entry two}

printendnotes[itemize*]

end{document}

enter image description here

Answered by egreg on September 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP