2

I use lualatex. I write in french.

The compilation process is :

lualatex myfile.tex && makeindex myfile.idx && biber myfile.cbf && lualatex myfile.tex && lualatex myfile.tex

I have to cite a url in my work with the character "é" in it :

https://fr.scoutwiki.org/Cérémonial_de_la_totémisation

I have his reference in my file "biblio.bib" :

    @online{scoutopediaceretotem,
    keywords = {site},
    author = {{SCOUTOPEDIA, l'encyclopédie scoute !}},
    title ={Article consacré au cérémonial de totémisation},
    url ={https://fr.scoutwiki.org/Cérémonial_de_la_totémisation},
    urldate = {2020-03-31}
    }

I load my class with a cls file myfile.cls (with a lot of stuff in it). The begining is this :

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{bpmemoire}[14/11/2018 v3.0]

% !TeX program = lualatex
% !TeX encoding = utf8 % !TeX spellcheck = french %% %% %%============================== Document Class ==========================%% % \LoadClass[12pt,a4paper,openany]{book} %%% pour le mémoire % %% \RequirePackage{ifluatex} %% %% %%========================================================================%%

\ifluatex \RequirePackage{fontspec} \setsansfont{CMU Sans Serif}%{Arial} \setmainfont{CMU Serif}%{Times New Roman} \setmonofont{CMU Typewriter Text}%{Consolas} \defaultfontfeatures{Ligatures={TeX}} \RequirePackage{polyglossia} \setmainlanguage{french} %\setdefaultlanguage{french} %
\setotherlanguages{english,russian,thai}

\else \RequirePackage[utf8]{inputenc} \RequirePackage[T1]{fontenc} \RequirePackage[french]{babel} \fi

Everything works well, except for the url, who replace "é" or other letters by codes (with percent signs) :

SCOUTOPEDIA « Article consacré au cérémonial de totémisation » url : https ://fr.scoutwi- ki.org/C%C3%A9r%C3%A9monial_de_la_tot%C3%A9misation (visité le 31/03/2020).

I tried a lot of things with inputenc, polyglossia, {'/e} instead of "é", etc. found on this site, but nothing works. Do you have an idea. I know, that an url with "é" is a problèm, but I have to deal with it...

Thanks

  • Possible duplicate: https://tex.stackexchange.com/questions/355136/how-to-disable-percent-encoding-in-urls . – Javier Bezos May 29 '21 at 11:50
  • 1
    It works for the percent sign. But it change the font and the color of the url in the document. (first it was the same font than other tex. Now it's another one) – tramberlimpe May 29 '21 at 12:42

1 Answers1

2

with lualatex this here should work:

\documentclass{article}
\usepackage[colorlinks]{hyperref}
\usepackage{biblatex}

\DeclareFieldFormat{url}{% \mkbibacro{URL}\addcolon\space \href{#1}{\nolinkurl{\thefield{urlraw}}}}

\DeclareFieldFormat{citeurl}{% \href{#1}{\nolinkurl{\thefield{urlraw}}}}

\addbibresource{test.bib} \begin{document} \cite{scoutopediaceretotem}

\citeurl{scoutopediaceretotem}

\printbibliography

\end{document}

enter image description here

You can change the style of the url with \urlstyle, see the documentation of the url package. E.g. with \urlstyle{rm} it will look like this:

enter image description here

Ulrike Fischer
  • 327,261