ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 레이텍을 이용하여 Tagged PDF 만들기
    TeX과 친구들 2023. 12. 18. 16:45

    동료가 레이텍을 이용하여 tagged PDF를 만들 수 있는지 내게 물었다. 그 사양은 2001년에 발표된 PDF 1.4에 이미 포함되어 있었지만, 나는 2106 년에야 비로소 그 존재를 인식했다. 당시에 그것을 지원하는 레이텍 패키지가 있는지 살펴보았으나 찾지 못했다. 지금은 어떨까?

    큰 기대 없이 챗지피티에게 물어보니, tagpdf 패키지를 사용하는 예시를 보여준다. 늘 그렇듯이, 챗지피티는 최신 업데이트를 알지 못하기 때문에, 기대한 결과를 얻지 못했다. 하지만 다행히도 이 경우에 챗지피티가 완전한 거짓말쟁이가 아니어서, 두어 시간 동안의 여러 시도 끝에 성공했다. 이를 통해 \DocumentMetadata가 latex.ltx에 정의되어 있음을 알게 되었다.

    아무튼 tagged PDF를 만드는 것은 몹시 괴로운 작업이다. 아크로뱃의 자동 태그 지정 기능은 완벽하지 않고, 따라서 수정본을 만들 때마다 이미지를 위한 대체 텍스트를 입력하고, 읽기 순서를 손봐야 한다. 인디자인에서 태그를 얼마나 쉽게 지정하고 조작할 수 있는지 모르겠다. 분명한 건 그런 작업은 위지윅 프로그램보다 마크업 언어에서 처리하는 것이 합리적이고 효율적이다.

    \DocumentMetadata{
        pdfversion=1.7,
        testphase={phase-III,math},
        lang=en-US}
    \documentclass{article}
    \usepackage{tagpdf}
    \tagpdfsetup{
        activate-all=true,
        uncompress
    }
    \usepackage{graphicx}

    \begin{document}
    \title{Tagged PDF Example}
    \author{Yi Hoze}
    \maketitle

    \section{Introduction}
    \tagstructbegin{tag=Section}
    This is a simple example of a Tagged PDF created with \LaTeX.
    \tagstructend

    \section{Lists}
    \tagstructbegin{tag=Section}
    \begin{itemize}
        \item First item
        \item Second item
    \end{itemize}
    \tagstructend

    \section{Math}
    \tagstructbegin{tag=Section}
    An inline math equation: $E=mc^2$.
    \tagstructend

    \section{Images}
    \tagstructbegin{tag=Section}
    \begin{figure}[h]
        \centering
        \includegraphics[alt={You are so beautiful}, width=0.5\linewidth]{uncertain}
        \caption{An example image}
    \end{figure}
    \tagstructend
    \end{document}

     

    'TeX과 친구들' 카테고리의 다른 글

    와일드카드로서의 대괄호(square brackets)  (0) 2024.04.04
    Zapfino 폰트  (0) 2024.03.28
    Hunspell을 이용한 한글 맞춤법 검사  (0) 2023.11.06
    Noto Serif & Sans  (0) 2023.09.06
    텍에서 사용되는 단위들  (0) 2023.08.30

    댓글

Designed by Tistory.