As an extension to file ended while scanning use of \path, I tried using path with \iftoggle from etoolbox package.

Below is the error I get

File ended while scanning use of \etb@tgl@BuildC.

Here is MWE:

\documentclass[oneside, a4paper, onecolumn]{memoir}
\usepackage{etoolbox, xcolor}

\let\path\relax \DeclareUrlCommand\path{\color{black!70}\urlstyle{tt}}



            \item ABC
                \item Copy to \path{C:\Applications\}
            \item DEF
                \item Copy to \path{~/Applications/}

This happens only when I use \path within \iftoggle. The document compiles without errors if I remove \path.


Sorry about this edit. It changes things a lot. The MWE and the error has been updated to include file paths. This edit also prevents this question from being a duplicate.

  • It does not seem to have anything to do with \iftoggle but rather your use of \color in the new definition of \url. You have not loaded any packages that provide color. Adding xcolor and your MWE compiles for me.
    – daleif
    Commented Aug 8, 2017 at 12:59
  • You still need color access in order to use \color! The main issue here is that \path seems to be interpreting \} in the ABC part. Removing the trailing \ or using \ } and it compiles fine.
    – daleif
    Commented Aug 8, 2017 at 13:42
  • damn!! One of these days, I'm gonna need a paramedic to pry my foot outta my mouth.
    – abyshukla
    Commented Aug 8, 2017 at 13:47

1 Answer 1


The main issue in the updated question is

  1. You still ought to use xcolor in order for \color to work, else it is ignored
  2. Using \path inside the argument to other commands may behave strangely. \path{...\} works outside macros but not inside. Here is a simpler example


    fails with the same error.

     \test{\path{C:\Applications\ }}

    seems to work. So I'm guessing that the \part argument parsing is stumped by \} and thus the scanning for argument never ends.

  • Sorry about the edit...
    – abyshukla
    Commented Aug 8, 2017 at 13:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .