회고록에서 소문자 작은 대문자를 사용하는 번호 하위 부록

회고록에서 소문자 작은 대문자를 사용하는 번호 하위 부록

subappendices에서 소문자 작은 대문자를 사용하여 섹션에 번호를 매기고 싶습니다 memoir. 즉, 이 섹션에 대한 모든 참조는 소문자 작은 대문자를 사용하기를 원합니다. 내 머리 꼭대기에는 다음이 포함됩니다.

  1. 섹션 제목\section{An appendix\label{an_appendix}}
  2. 섹션에 대한 참조\ref{an_appendix}
  3. 목차 항목
  4. 섹션 내에서 부동
  5. 섹션 내의 부동 소수점에 대한 참조

아마도 제가 생각하지 못하는 것이 더 있을 것입니다.

memoir의 환경 내부에서 사용되는 섹션 카운터를 변경하면 이 문제를 가장 잘 해결할 수 있을 것으로 생각됩니다 subappendices. 하지만 어떻게 해야 할지 모르겠습니다.

아래 MWE에서는 (1) 섹션 제목 번호, (3) 부동 캡션 번호 및 (4) TOC 번호를 처리하는 일부 부분 수정 사항을 주석 처리했습니다.

나는 하위 부록 섹션에 대한 카운터를 변경하는 깔끔한 솔루션(또는 볼 수 없는 더욱 깔끔한 솔루션)을 선호하지만 참조를 수정하는 것으로 만족합니다.

대신 나는 무엇을 해야 합니까?

\documentclass{memoir}
\usepackage{amsmath}
\usepackage{fontspec}
\setmainfont{EBGaramond-Regular}[
  BoldFont = EBGaramond-Bold,
  ItalicFont = EBGaramond-Italic,
  BoldItalicFont = EBGaramond-BoldItalic,
  Numbers={Proportional, OldStyle},
]
\AtBeginEnvironment{subappendices}{
  \numberwithin{table}{section}
}
\setsecnumformat{\textsc{\csname the#1\endcsname}\quad}
% \setsecnumformat{\textsc{\MakeLowercase{\csname the#1\endcsname}}\quad} % (1) Make numbers in section headings lowercase small caps
\usepackage{caption}
\DeclareCaptionLabelFormat{lowercase}{\MakeLowercase{#1}~#2}
% \DeclareCaptionLabelFormat{lowercase}{\MakeLowercase{#1~#2} % (3) Make numbers in float captions lowercase small caps
\captionsetup{
  labelfont=sc,
  labelformat=lowercase,
}
% \makeatletter % (4) Make numbers in the table of contents lowercase small caps
% \patchcmd\numberline{\@cftbsnum #1\@cftasnum}{\@cftbsnum{#1}\@cftasnum}{}{\ERROR}
% \makeatother
% \renewcommand\cftsectionpresnum{\scshape\MakeLowercase}
\begin{document}
  \tableofcontents*

  \chapter{A chapter}
  \section{A section}
  See table~\ref{tab:a_table} in appendix~\ref{an_appendix}.

  \begin{subappendices}
    \section{An appendix\label{an_appendix}}
    \begin{table}[h]
      \caption{A table\protect\label{tab:a_table}}
      \centering
      \begin{tabular}{lcc}
        & Column A & Column B \\
        First row & 123 & 456 \\
        Second row & 123 & 456 \\
      \end{tabular}
    \end{table}
  \end{subappendices}
\end{document}

원하지 않는 기능 주위에 빨간색 직사각형이 추가된 출력

답변1

둘 다 한 줄로 해결할 수 있습니다

\renewcommand{\setthesection}{\thechapter.\alph{section}}

처음에는 subappendices이 명령을 실행합니다.

\newcommand{\@resets@ppsub}{
  \par
  \setcounter{section}{0}
  \renewcommand{\thesection}{\setthesection}
  \def\theHsection{\theHchapter.\Alph{section}}
}

~와 함께

\newcommand{\setthesection}{\thechapter.\Alph{section}}

그래서 그것을 엉망으로 만드는 것으로 충분합니다.

그런 다음 toc는 outcommented를 사용하여 수정됩니다.

\renewcommand\cftsectionpresnum{\scshape\MakeLowercase}

이것은 참조 문제를 해결합니다. 그것은 hyperref또한 작동합니다. 에 선택적 인수를 추가하는 패키지가 있는 경우 \ref해당 패키지도 선택해야 합니다. 대신 사용할 수 있는 후크 콘이 있는지 여전히 궁금합니다.

\AtBeginDocument{
  \NewCommandCopy\oldref\ref
  \RenewDocumentCommand\ref{sm}{%
    \textsc{%
      \IfBooleanTF{#1}%
      {\oldref*{#2}}%
      {\oldref{#2}}%
    }%
  }
}

관련 정보