lstinline은 점 앞에 공백을 둡니다.

Oct 31 2020

\lstinline내 문서에서 파일 이름에 스타일을 지정 하는 데 사용하려고 하는데 점 앞에 임의의 공백이 있습니다. 구두점 자동 설정과 관련이 있다고 생각합니까?

목록에서 이것을 비활성화 할 수 있습니까? 아니면 일반 라텍스 제품입니까?

MWE :

\documentclass[11pt]{scrreprt}
\usepackage{color}
\usepackage{listings}
\lstset{basicstyle=\color{blue}} % just to demo

\begin{document}

    I use the file \lstinline{file.ext}, which is nice.

\end{document}

답변

Cube Nov 03 2020 at 14:24

점을 문자로 만들기 위해 leandriis 제안을 사용하면 expretion 내부의 공간이 제거되지만 뒤에 이상한 공간이 생성됩니다. 어떤 아이디어?

\documentclass[11pt]{scrreprt}
\usepackage{color}
\usepackage{listings}
\lstset{
    basicstyle=\color{blue},
    alsoletter={.}
} % just to demo

\begin{document}

    I use the file \lstinline{file.ext}, which is nice.

\end{document}
Cube Nov 03 2020 at 17:58

고정 폭 글꼴을 사용하면 문제가 해결됩니다. 이유에 대한 질문은 답해주지 않지만 작동합니다.

\documentclass[11pt]{scrreprt}
\usepackage{color}
\usepackage{listings}
\lstset{basicstyle=\color{blue}\ttfamily}

\begin{document}

    I use the file \lstinline{file.ext}, which is nice.

\end{document}