4

I updated my MiKTeX today. Now, I do not get any error without packages but it can not compile my latex files with packages.

Uninstalling and reinstalling both Texmaker and Miktex did not work. I could not find l3regex.sty file on internet.

LaTeX Error: File `l3regex.sty' not found.

My packages:

\usepackage[colorlinks=true, linkcolor = blue, urlcolor  = blue, citecolor = blue, anchorcolor = red]{hyperref}  
\usepackage[utf8]{inputenc}  
\usepackage[top=1cm, bottom=2cm, left=1.5cm, right=1.5cm]{geometry}  
\usepackage{amsfonts}  
\usepackage{amsmath}  
\usepackage{amssymb}  
\usepackage{graphicx}  
\usepackage{microtype}  
\DisableLigatures{encoding = *, family = * }  
\usepackage{coloring}  
\pagenumbering{gobble}
AndréC
  • 24,137
  • Update MikTeX in both admin and user mode. See https://tex.stackexchange.com/q/55437/35864 and https://tex.stackexchange.com/q/108447/35864 – moewe Mar 15 '19 at 14:54
  • I think there was a change to how l3regex was distributed a while ago. If I understand correctly it should be part of expl3.sty which should be installed by MikTeX's l3kernel package. So you should make sure that l3kernel is installed an up to date. I assume, though, that the real culprit is an older version of a different package that tries to use the old name to load the module. If the full update in both modes does not help, please try to prepare a so-called MWE (https://tex.meta.stackexchange.com/q/228/35864) and upload the full .log file to a text-sharing website (e.g. pastebin) – moewe Mar 15 '19 at 15:02
  • Aha! https://tex.stackexchange.com/q/468973/35864 mentions changes in the distribution of l3regex. – moewe Mar 15 '19 at 16:38
  • Any news here? Could you fix your issue? – siracusa May 17 '19 at 09:13
  • I just had the same error when compiling nox's solution that was working a year ago: https://tex.stackexchange.com/a/442654/138900 – AndréC Oct 06 '19 at 08:22
  • 1
    @AndréC l3regex has been integrated into the kernel. For documents explicitly loading l3regex it should be enough not to load it (make sure that at least expl3 or xparse is loaded). In the code you link, just change \usepackage{xparse,l3regex} to \usepackage{xparse}. But with the preamble shown in this question it is much more likely that not all involved packages were updated correctly (the classic MikTeX update in Admin and User mode issue). – moewe Oct 06 '19 at 08:41
  • If this question was to be reopened it should be closed as a duplicate of https://tex.stackexchange.com/q/468973/35864 – moewe Oct 06 '19 at 08:41
  • @moewe Agreed: done – Joseph Wright Oct 06 '19 at 09:04
  • @moewe It would have been clearer to turn your comment into a answer. – AndréC Oct 06 '19 at 09:23
  • @JosephWright It would have been clearer to turn the moewe comment into a answer. – AndréC Oct 06 '19 at 09:28
  • 1
    @AndréC That would be an answer on the question I've duped to: the entire point of marking-as-dupe is to avoid answers spread out all over the place – Joseph Wright Oct 06 '19 at 09:45
  • @JosephWright The title of the other question is not identical and your answer is not identical to moewe's comment that explains that it is enough to load xparse without loading l3regex.sty – AndréC Oct 06 '19 at 15:29

1 Answers1

12

I solved this problem by adding this in preamble:

\usepackage{expl3}
\expandafter\def\csname ver@l3regex.sty\endcsname{} 
  • 6
    Just to make other people aware of this. This is also the workaround proposed by Joseph in https://tex.stackexchange.com/a/468975/35864. It will pretend that the package l3regex has been loaded (the package was merged into the expl3 kernel so need not be loaded separately any more). Most packages should have been updated to use the new syntax. But if you are stuck with code that can't be updated for some reason this might be reasonable. – moewe May 18 '19 at 12:35