-1

I use Biblatex (biber 2.12), XeLaTeX (XeteX 3.1415) and the packages abntex2 and biblatx-abntex2 on macOS High Sierra 10.13.6. [I also use Linux]

At this image, notice the < > where the URLs are not there or disappeared.

example of disappeared links

Here is a minmal code (you can get my full zipped file attached in the end):

% !TeX program = xelatex
\documentclass[10pt, a4paper, brazil]{abntex2}

\usepackage[alf]{abntex2cite}
\usepackage[autostyle]{csquotes}
\usepackage[backend = biber, alldates=long, hyperref, justify, language = brazil, scbib, sorting = none, style = abnt, url = true]{biblatex}
\usepackage[brazil]{babel}
\usepackage[math-style=ISO, bold-style=ISO, mathrm=sym]{unicode-math}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{caption}
\usepackage{color}
\usepackage{comment}
\usepackage{environ}
\usepackage{filecontents}
\usepackage{fixltx2e}
\usepackage{fontspec}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{indentfirst}
\usepackage{lastpage}
\usepackage{lipsum}
\usepackage{listings}
\usepackage{mfirstuc}
\usepackage{microtype}
\usepackage{minted}
\usepackage{multicol}
\usepackage{nomencl}
\usepackage{polyglossia}
\usepackage{svg}
\usepackage{xcolor}

% ...

\addbibresource{referencias.bib}

\begin{filecontents}{referencias.bib}
@Book{IAEA_est_2050,
  publisher = {International Atomic Energy Agency},
  title     = {Energy, Electricity and Nuclear Power Estimates for the Period up to 2050},
  year      = {2015},
  series    = {Reference Data Series 1},
  edition   = {2015},
  note      = {RDS - 1/35},
  isbn      = {978-92-0-105915-4},
  groups    = {IAEA},
  url       = {http://www-pub.iaea.org/books/IAEABooks/7857/Estimation-of-Global-Inventories-of-Radioactive-Waste-and-Other-Radioactive-Materials},
  urldate   = {2015-10-15},
}

@thesis{eliseu84,
    title       = {Verbos ergativos do Português},
    subtitle    = {descrição e análise},
    author      = {André Manuel Godinho Simões Eliseu},
    type        = {Dissertação (Mestrado em Linguística)},
    institution = {Universidade de Lisboa},
    location    = {Lisboa},
    eventyear   = {1985},
}

@online{google,
    doi             = {docs},
    organization    = {Google},
    title           = {Documentação do Google Cloud SDK},
    url             = {https://cloud.google.com/sdk/docs},
    urldate         = {2018-10-26}
}
\end{filecontents}

% ...

\begin{document}
\selectlanguage{brazil}
\frenchspacing
\maketitle
\pagenumbering{gobble}
\newpage
\pagenumbering{arabic}

\textual

\section{Configurar a conta do Google e o Google Cloud Platform}

% ...

\citetitle{google}
\cite{IAEA_est_2050}
\cite{eliseu84}

\section{Configurar a executar os \textit{containers} do Docker no mecnaismo de \textit{containers} do Google}

\bookmarksetup{startatroot}% 
\postextual

\printbibliography

\end{document}

I ran like:

xelatex -synctex=1 -interaction=nonstopmode -file-line-error -shell-escape relatório
biber relatorio
xelatex -synctex=1 -interaction=nonstopmode -file-line-error -shell-escape relatorio
xelatex -synctex=1 -interaction=nonstopmode -file-line-error -shell-escape relatório

I also made a test of minimal basic code taken from @xR2 and URLs worked, but my “relatório” file did not work. Here are the codes which worked:

\documentclass[a4paper]{abntex2}
\usepackage[autostyle]{csquotes}
\usepackage[backend=biber,style=abnt,language=brazilian,alldates=long,sorting=none,scbib,hyperref]{biblatex}
\usepackage[brazil]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{filecontents}
\usepackage{hyperref}
\usepackage{lmodern}

\addbibresource{shortbib.bib}

\begin{filecontents}{shortbib.bib}
@Book{IAEA_est_2050,
  publisher = {International Atomic Energy Agency},
  title     = {Energy, Electricity and Nuclear Power Estimates for the Period up to 2050},
  year      = {2015},
  series    = {Reference Data Series 1},
  edition   = {2015},
  note      = {RDS - 1/35},
  isbn      = {978-92-0-105915-4},
  groups    = {IAEA},
  url       = {http://www-pub.iaea.org/books/IAEABooks/7857/Estimation-of-Global-Inventories-of-Radioactive-Waste-and-Other-Radioactive-Materials},
  urldate   = {2015-10-15},
}
@thesis{eliseu84,
    title       = {Verbos ergativos do Português},
    subtitle    = {descrição e análise},
    author      = {André Manuel Godinho Simões Eliseu},
    type        = {Dissertação (Mestrado em Linguística)},
    institution = {Universidade de Lisboa},
    location    = {Lisboa},
    eventyear   = {1985},
}
\end{filecontents}
\begin{document}

    \cite{eliseu84}

    \cite{IAEA_est_2050}
    \printbibliography
\end{document}

You can get my full zipped file: My project

Oo'-
  • 269
  • Welcome to TeX.SX! Please provide a compilable MWE that reproduces your problem. –  Nov 17 '18 at 06:36
  • You need to provide us with code that reproduces your problem. The code you have posted outputs URLs fine but looks very different to your screenshot. – David Purton Nov 17 '18 at 07:58
  • 1
    Also, you usually wouldn't use inputenc or fontenc with xelatex. – David Purton Nov 17 '18 at 07:59
  • inn the terminal, there were no shown errors, it is all OK, I just do not know why the URLs have disappeared. As for the different, the moderator required me to apply MWE, therefore, I changed a lot of code t make them minimal. As someone was going to ask me to put full code, therefore, I linked a file. – Oo'- Nov 17 '18 at 08:05
  • 1
    If I load xstring (see https://github.com/abntex/biblatex-abnt/issues/39), your second, smaller MWE compiles fine, even though lmodern, fontenc and inputenc are a bad idea for XeLaTeX. Your other, longer MWE, however, produces a multitude of error messages and does not compile at all. Never ignore errors! A first issue is caused by loading abntex2cite and biblatex: The packages are incompatible. You are also loading babel and polyglossia - load only one of them (preferably babel). Indeed you are loading a great number of packages, I doubt you need all of them. – moewe Nov 17 '18 at 10:27
  • 2
    Don't use \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} and \usepackage{lmodern} with xelatex. This is wrong. – Ulrike Fischer Nov 17 '18 at 10:27
  • Ah, as you've suggested, I've just removed the unnecessary packages and tested, the URLs returned to the normal. How do I know if I can or can't use certain packages in XeLaTeX? In my project, I need all, because I will make maths formulae (amsmath), figure caption (caption), set colours (color), set scale for equation (environ), set bibliography file (filecontents), set external fonts (fontspec), load images (graphicx), set hypersetup (hyperref), set indentation (indentfirst), listings and minted for syntax highlighting, tcolorbox, tikz for rounded rects, etc – Oo'- Nov 17 '18 at 10:51
  • If I want to write in several languages, which package is certain in XeLaTeX: babel or polyglossia, but without conflicting the biblatex-abnt? – Oo'- Nov 17 '18 at 10:52

1 Answers1

3

As mentioned in the comments your second, smaller code example compiles without errors and shows fine if xstring is loaded (see https://github.com/abntex/biblatex-abnt/issues/39, this is only necessary because of changes in biblatex 3.12 and should not be necessary for too long, biblatex-abnt already has code lined up to deal with that).

It still is wrong to load lmodern, fontenc and inputenc if you compile with XeLaTeX and you should definitely remove the call to those packages, but at least on my machine the output seemed OK. See also Frequently loaded packages: Differences between pdfLaTeX and XeLaTeX (though I disagree about polyglossia and babel: babel is perfectly fine with XeLaTeX).

Your first, longer example, on the other hand, produced a multitude of error messages. Never ignore errors! Whenever TeX encounters an error, it goes into an error recovery mode and tries to make the best of what it got to at least check the syntax of the remaining file. You are not guaranteed to get any useful output (or any output at all), if your document has errors. Compiling with -interaction=nonstopmode tempts you to simply ignore error messages since TeX scrolls past them (What is the difference between "-interaction=nonstopmode" and "-halt-on-error"?), but they are still there and really should be fixed. Remember than one error can cause further knock-on effects and other errors and warnings later on, so you should always deal with the first error first. Fix all errors you get, starting from the very first.

  • abntex2cite and biblatex are incompatible. You can only use one of the two packages. Using both (in the order abntex2cite, biblatex) causes amongst others, the error

    ! LaTeX Error: Command \biblabelsep already defined.
    

    The solution is to remove \usepackage[alf]{abntex2cite}.

  • You should not be loading \usepackage[T1]{fontenc} with XeLaTeX. Indeed, it seems that removing this package from the preamble makes the URLs appear. When the package is loaded in the WE you get the error

    ! Math formula deleted: Insufficient symbol fonts.
    \Url@FormatString ...\Url@String \UrlRight \m@th $
    

    whenever TeX tries to typeset a URL.

  • Don't load \usepackage[utf8]{inputenc} with XeLaTeX.

  • Don't load color when you also load xcolor later. Loading xcolor is enough.

  • unicode-math should be loaded after amsmath and other font packages. The documentation says on page 4

    [unicode-math] should be loaded after any other maths or font-related package in case it needs to overwrite their definitions.

  • fixltx2e has not been necessary for three years and the package tells you so in a warning

    Package fixltx2e Warning: fixltx2e is not required with releases after 2015
    (fixltx2e)                All fixes are now in the LaTeX kernel.
    (fixltx2e)                See the latexrelease package for details.
    
  • hyperref should usually be the last package you load (there are a few documented(!) exceptions like cleveref that need to be loaded after hyperref, but the general rule of thumb says that hyperref should be the last).

  • lipsum is probably not a package you need in your actual document.

  • Loading listings and minted seems excessive on first glance, I suggest you pick one of the two for your source code listings.

  • You can't load babel and polyglossia together. Those packages fulfil roughly the same task and loading both will cause incompatibilities and fights over which package controls localisation. You should only load one of the two packages. I suggest you use babel, since polyglossia development seems to have stalled in recent years. (The fact that many packages have trouble picking up language versions with poylglossia - sometimes even polyglossia has this problem - could be relevant for Brazilian Portuguese, in which case picking babel instead becomes even more attractive.)

    • I'd also suggest to load babel fairly early - certainly before csquotes and biblatex, but that is just my personal taste.
  • You are loading a lot of other packages: Do you really need all of them? environ, comment, indentfirst, lastpages, mfirstuc, svg ... I strongly suggest to load packages only when you really need them and if you know (at least roughly) what they do.

  • The memoir class (on which abntex2 is based) warns about using caption. It is not an error to load caption, but memoir already has some facilities to deal with captions and you should only be loading caption if those are not sufficient for you. If you load caption you should be aware of the fact that memoir's caption settings will probably not work as expected any more.

I'd also be wary of using file names with non-ASCII chars in them even with a Unicode machine such as XeLaTeX, but that is probably a matter of taste. Biber for example used to have (still has?) issues with non-ASCII file names on some systems.

As far as biblatex goes the option language = brazil should be unnecessary when you load babel and the option hyperref does nothing more than the default hyperref=auto when hyperef is loaded, so it can be dropped as well.

moewe
  • 175,683
  • When I want to write in several languages, babel or polyglossia, but in XeLaTeX and without conflicting the abntex packages? As for listings and minted, for example, see https://tex.stackexchange.com/questions/452249/how-do-i-set-a-background-color-and-font-for-inline-verb-text. I wanted to round the rectange of syntax highlighting. – Oo'- Nov 17 '18 at 11:18
  • @GustavoReis As I said: Pick one of babel or polyglossia. (I would use babel.) But you can't have both. As to listings and minted: I'm no expert in that area, I would have thought it should be possible to use only one of the two, but if you say you need both, fine. – moewe Nov 17 '18 at 11:19
  • I will create a new question about mintinline, making rounded corners without depending on listings. Or I will request feature to the author of minted at GitHub. – Oo'- Nov 17 '18 at 11:35
  • @GustavoReis Good. As I say: I'm no expert in matters of listings and minted and so it may well be that there are (good) reasons to use both packages side by side. Don't get too caught up in that one question, though, there are several other issues in your preamble that should be addressed. – moewe Nov 17 '18 at 11:41