I am trying to typeset a long line from CSV file, that contains special characters but no whitespaces. Since I would like it to be visually different from surrounding text, I am using verbatim
environment.
The problematic line looks somthing like this:
"%TIME_STAMP%","%TIME_SERIES_NAME_(metric)%","%ENTITY%","%FIRST_TAG_VALUE%","%SECOND_TAG_VALUE%","%THIRD_TAG_VALUE%","VALUE"
I already tried verbatim
and spverbatim
environment (from package spverbatim
), which worked well with special symbols, but didn't wrap lines (even when I artificially added whitespace just for sake of experimenting). I attempted to use listings
but presence of special characters made my file impossible to compile (even when I escaped underscores and percent symbols using backslash)
So my question is - how to make latex wrap lines on both whitespace and some special character - like comma - inside environments like verbatim or spverbatim? If it is not possible, would using listings help? If yes, how to escape special characters?
Here is what fails to compile with listings
\documentclass[12pt, oneside]{book}
\usepackage[a4paper,top=2.5cm,bottom=2.5cm,left=3.5cm,right=2cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{url}
\usepackage[hidelinks,breaklinks]{hyperref}
\usepackage[slovak]{babel}
\usepackage{amsthm}
\usepackage{spverbatim}
\usepackage{listings} %dlhe csv riadky
\lstset{
breaklines=true,
basicstyle=\ttfamily}
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
\linespread{1.25}
\begin{document}
\begin{lstlisting}
"%ČASOVÁ_PEČIATKA%","%NÁZOV_ČASOVÉHO_RADU%", "%ENTITA%","%HODNOTA_TAGU%","%ÚDAJ%"
\end{lstlisting}
\end{document}
listings
does not care about special characters. Could you show us, what you have tried (compilable document)?