축어적 환경에서 할 일 메모를 추가하는 방법은 무엇입니까?

축어적 환경에서 할 일 메모를 추가하는 방법은 무엇입니까?

파일 의 헤더를 설명해야 합니다 .ctl. 이를 위해 헤더를 표시하기 위해 축어적 패키지를 사용하고 있습니다. 내 명령줄은 다음과 같습니다.

\begin{verbatim}
dset ^newcase_d01_2612.dat
options  byteswapped
undef 1.e30
title  OUTPUT FROM WRF V3.4 MODEL
\end{verbatim}

이제 각 줄에 할 일 메모를 추가하고 싶습니다. 환경이 모든 명령을 지우 면 verbatim어떻게 문자 그대로 "속임수"하고 할일 메모 환경을 사용할 수 있습니까?

답변1

당신은의 기능을 사용해 볼 수 있습니다listings:

여기에 이미지 설명을 입력하세요

\documentclass{article}

\usepackage{listings,todonotes}

\lstnewenvironment{todoverbatim}[1][]
  {\lstset{
     basicstyle=\ttfamily,
     columns=flexible,
     escapeinside = {/*}{*/}
   }}
  {}

\begin{document}

\begin{verbatim}
dset ^newcase_d01_2612.dat
options  byteswapped
undef 1.e30
title  OUTPUT FROM WRF V3.4 MODEL
\end{verbatim}

\begin{todoverbatim}
dset ^newcase_d01_2612.dat /*\todo{something 1}*/
options  byteswapped /*\todo{something 2}*/
undef 1.e30 /*\todo{something 3}*/
title  OUTPUT FROM WRF V3.4 MODEL /*\todo{something 4}*/
\end{todoverbatim}

\end{document}

를 사용하는 대신 verbatim을 사용합니다 todoverbatim. 레이아웃은 약간 다르며 이스케이프 문자를 수정할 수 있습니다.

관련 정보