2

I am using the nice package verbatimbox which allows verbatim as second argument to href. This works

\begin{verbbox}https://some_url_1/report.htm\end{verbbox}
\theverbbox

But when I put the above inside enumeration list, it stops working. i.e. nothing is printed.

MWE

\documentclass[12pt,notitlepage]{article}
\usepackage{hyperref}
\usepackage{verbatimbox}
    
\begin{document} 

\begin{verbbox}https://some_url_1/report.htm\end{verbbox}
\theverbbox

\begin{verbbox}https://some_url_2/report.htm\end{verbbox}
\theverbbox
\end{document}

Compiled with lualatex gives

enter image description here

But now

\documentclass[12pt,notitlepage]{article}
\usepackage{hyperref}
\usepackage{verbatimbox}
    
\begin{document} 

\begin{enumerate}
\item \begin{verbbox}https://some_url_1/report.htm\end{verbbox}
      \theverbbox
\item \begin{verbbox}https://some_url_12report.htm\end{verbbox}
      \theverbbox
\end{enumerate}

\end{document}

Compiling with lualatex now gives blank PDF page. Nothing on it at all.

Why is that? And how to make it print same as before but in enumeration list?

TL 2023, and updated to latest now.

1 Answer 1

3

LaTeX is in a particular state after \item and verbbox doesn't take care of this.

\documentclass[12pt,notitlepage]{article}
\usepackage{verbatimbox}
\usepackage{hyperref}

\newcommand{\theverbboxitem}{%
  \kern-\labelwidth\kern-\labelsep
  \theverbbox
  \kern\labelwidth\kern\labelsep
}

\begin{document}

\noindent
\begin{verbbox}https://some_url_1/report.htm\end{verbbox}
\fbox{\theverbbox}

\begin{enumerate}
\item \leavevmode\begin{verbbox}https://some_url_1/report.htm\end{verbbox}
\fbox{\theverbboxitem}
\item Something else
\end{enumerate}

\showoutput

\end{document}

enter image description here

I used \fbox just to make sure that the dimensions are right. What happens, among other problems, that the list indentation is inserted in front of the verbatim material.

You must log in to answer this question.

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