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 Aug 8 '17 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 Aug 8 '17 at 13:42
  • damn!! One of these days, I'm gonna need a paramedic to pry my foot outta my mouth. – abyshukla Aug 8 '17 at 13:47

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 Aug 8 '17 at 13:31

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.