1

I try to get in the last line of all my document a black square to mark the end of article.

So, this is my MWE:

\documentclass{article}
%\usepackage[french]{babel}
%\useppackage{lipsum}
\usepackage{MnSymbol}%
\newcommand\finisarticulus{\,$\blacksquare$}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.\finisarticulus{}
\end{document}

So, I get a good rendering:

enter image description here

But this simple and idealistic situation don’t always appear.

If I use, TOC, bibliography, or glossary at the end, I can’t control where the finis articulus will appear.

For example, with bibliography, I have the following main.tex as MWE:

\documentclass{article}
\usepackage[backend=bibtex]{biblatex}
\usepackage{filecontents}
\usepackage{MnSymbol}%

\newcommand\finisarticulus{\,$\blacksquare$}

\bibliography{bibli.bib}

\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.

\nocite{*}

\printbibliography\finisarticulus{}
\end{document}

And this is his bibli.bib:

@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
        [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
}

@book{latexcompanion,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

@misc{knuthwebsite,
    author    = "Donald Knuth",
    title     = "Knuth: Computers and Typesetting",
    url       = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}

I compile the project with xelatex main.tex; bibtex main ; xelatex main.tex, then I get this ugly rendering:

enter image description here

When I was wondering something like:

enter image description here

So, is it possible to force LaTeX to add something just after the last word of the document as if this word was produced by the TOC, the bibliography, the glossary or other kind of macro? And then how?

  • 1
    The main problem is that the paragraph is formatted before it is added to the page. \AtEndDocument will start a new paragraph, and \everypar adds stuff to the beginning of a paragraph, not the end. – John Kormylo Aug 4 '17 at 20:09
  • If you don't add an empty line between the last paragraph of regular text and `\ – Michael Palmer Aug 4 '17 at 22:31
  • If you don't add an empty line between the last paragraph of regular text and \end{document}, then \AtEndDocument will not start a new paragraph, so you could say, in the preamble, \AtDocument{\finisarticulus}. However, that won't work with a bibtex-generated bibliography, since it consists of a list of \bibitems. Here, the only way I can see is to manually edit the generated .bbl file. Append the \finisarticulus to the last entry. If you don't run bibtex afterwards, your manual edit will not be overwritten. – Michael Palmer Aug 4 '17 at 22:37

Your Answer

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

Browse other questions tagged or ask your own question.