자동 참조 이름을 변경하면 헤더에 공백이 삽입됩니다.

자동 참조 이름을 변경하면 헤더에 공백이 삽입됩니다.

나는 hyperrefand 를 사용 autoref하지만 자동 참조 이름을 재정의합니다. 를 사용하여 페이지 헤더에 장과 섹션 이름을 넣습니다 scrlayer-scrpage. 불필요한 공간이 항상 헤드라인 왼쪽에 있습니다. 짝수 페이지인지 홀수 페이지인지는 중요하지 않습니다. 장이나 섹션 이름이 너무 길어 헤드라인에 맞지 않을 때 특히 그렇습니다. 이 예에서는 원칙적으로 적합할 수 있지만 공간 때문에 적합하지 않습니다.

s의 이름을 바꾸지 않으면 autoref모든 것이 정상입니다. 여기서 무슨 일이 일어나고 있으며 어떻게 해결할 수 있습니까?

난 노력 했어"중얼거리다", new 전후에 있지만 \...autorefname도움이되지 않습니다.

\documentclass[pdfa,a4paper,
               11pt,
               bibliography=totoc,
               numbers=noenddot,
               twoside,openright,
               parskip=half]{scrbook}
\usepackage{lipsum}
% ********************************************************************
% Languages, Typesetting
% ******************************************************************** 
\usepackage[ngerman, english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}         %windows: latin9, linux: utf8

% ********************************************************************
% page layout
% ********************************************************************
\usepackage[]{scrlayer-scrpage}
\renewcommand{\chapterpagestyle}{empty} % no headings or footings on first chapter page
\renewcommand{\chaptermark}[1]{\markboth{{#1}}{{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\upshape{\thesection}\enspace{#1}}}
\lehead{\mbox{\llap{\small\upshape\thepage\kern2em}\scshape\headmark\hfil}}
\rohead{\mbox{\hfil{\scshape\headmark}\rlap{\small\kern2em\upshape\thepage}}}
\chead{}\ifoot{}\cfoot{}\ofoot{}
\pagestyle{scrheadings}

% ********************************************************************
% Hyperreferences, always load last
% ********************************************************************
\usepackage[]{hyperref}
% Commenting this whole block fixes the problem
\makeatletter
\@ifpackageloaded{babel}
{
    \addto\extrasenglish{
        \renewcommand*{\figureautorefname}{Figure}
        \renewcommand*{\tableautorefname}{Table}
        \renewcommand*{\partautorefname}{Part}
        \renewcommand*{\chapterautorefname}{Chapter}
        \renewcommand*{\sectionautorefname}{Section}
        \renewcommand*{\subsectionautorefname}{Section}
        \renewcommand*{\subsubsectionautorefname}{Section}
        \renewcommand*{\appendixautorefname}{Appendix}
    }
}{\relax}
\makeatother


\begin{document}
\part{Intro}
\chapter{Short chapter name}
\lipsum[1]
\section{Short section name}
\lipsum
\lipsum
\chapter{Very long chapter name just not fitting into the headline}
\lipsum[1]
\section{Very long section name just not fitting into the headline}
\lipsum
\lipsum
\end{document}

답변1

당신이 사용할 수있는

\AfterPackage*{babel}
{
  \renewcaptionname{english}{\figureautorefname}{Figure}
  \renewcaptionname{english}{\tableautorefname}{Table}
  \renewcaptionname{english}{\partautorefname}{Part}
  \renewcaptionname{english}{\chapterautorefname}{Chapter}
  \renewcaptionname{english}{\sectionautorefname}{Section}
  \renewcaptionname{english}{\subsectionautorefname}{Section}
  \renewcaptionname{english}{\subsubsectionautorefname}{Section}
  \renewcaptionname{english}{\appendixautorefname}{Appendix}
}

\AfterPackage*scrlfileKOMA-Script 클래스에 의해 자동으로 로드되는 패키지에 의해 정의됩니다 . \renewcaptionnameKOMA 스크립트 명령이기도 합니다.

또한 페이지 레이아웃 설정을 다음으로 변경합니다.

\renewcommand{\chapterpagestyle}{empty} % no headers or footers on first chapter page
\usepackage[]{scrlayer-scrpage}
\automark[chapter]{chapter}
\automark*[section]{}
\renewcommand\chaptermarkformat{}% no chapter number in header/footer
\addtokomafont{pagehead}{\scshape}
\addtokomafont{pagenumber}{\small}
\clearmainofpairofpagestyles
\lehead{\mbox{\llap{\pagemark\kern2em}\headmark}}
\rohead{\mbox{{\ifstr{\leftmark}{\rightmark}{}{\upshape}\headmark}\rlap{\kern2em\pagemark}}}

예:

\documentclass[pdfa,a4paper,
               11pt,
               bibliography=totoc,
               numbers=noenddot,
               twoside,openright,
               parskip=half]{scrbook}
\usepackage{lipsum}
% ********************************************************************
% Languages, Typesetting
% ******************************************************************** 
\usepackage[ngerman, english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

% ********************************************************************
% page layout
% ********************************************************************
\renewcommand{\chapterpagestyle}{empty} % no headers or footers on first chapter page
\usepackage[]{scrlayer-scrpage}
\automark[chapter]{chapter}
\automark*[section]{}
\renewcommand\chaptermarkformat{}%  no chapter number in header/footer
\addtokomafont{pagehead}{\scshape}
\addtokomafont{pagenumber}{\small}
\clearmainofpairofpagestyles
\lehead{\mbox{\llap{\pagemark\kern2em}\headmark}}
\rohead{\mbox{{\ifstr{\leftmark}{\rightmark}{}{\upshape}\headmark}\rlap{\kern2em\pagemark}}}

% ********************************************************************
% Hyperreferences, always load last
% ********************************************************************
\usepackage[]{hyperref}

\AfterPackage*{babel}
{
  \renewcaptionname{english}{\figureautorefname}{Figure}
  \renewcaptionname{english}{\tableautorefname}{Table}
  \renewcaptionname{english}{\partautorefname}{Part}
  \renewcaptionname{english}{\chapterautorefname}{Chapter}
  \renewcaptionname{english}{\sectionautorefname}{Section}
  \renewcaptionname{english}{\subsectionautorefname}{Section}
  \renewcaptionname{english}{\subsubsectionautorefname}{Section}
  \renewcaptionname{english}{\appendixautorefname}{Appendix}
}

\begin{document}
\part{Intro}
\chapter{Short chapter name}
\lipsum[1]
\section{Short section name}
\lipsum
\lipsum
\chapter{Very long chapter name just not fitting into the headline}
\lipsum[1]
\section{Very long section name just not fitting into the headline}
\lipsum
\lipsum
\end{document}

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


업데이트:댓글에 관한 또 다른 예:

\documentclass[pdfa,a4paper,
               11pt,
               bibliography=totoc,
               numbers=noenddot,
               twoside,openright,
               parskip=half]{scrbook}
\usepackage{lipsum}
% ********************************************************************
% Languages, Typesetting
% ******************************************************************** 
\usepackage[ngerman, english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{microtype}

\usepackage{textcase}
\DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textls[80]{\scshape\MakeTextLowercase{#1}}}
% ********************************************************************
% page layout
% ********************************************************************
\renewcommand{\chapterpagestyle}{empty} % no headers or footers on first chapter page
\usepackage[]{scrlayer-scrpage}
\automark[chapter]{chapter}
\automark*[section]{}
\renewcommand*\chaptermarkformat{}%  no chapter number in header/footer
\renewcommand*\sectionmarkformat{{\small\thesection\autodot\enskip}}% section number using \small
\addtokomafont{pagenumber}{\small}% page number using \small
\clearmainofpairofpagestyles% remove all default entries for page style scrheadings
\lehead{\mbox{\llap{\pagemark\kern2em}\spacedlowsmallcaps{\headmark}}}
\rohead{\mbox{\spacedlowsmallcaps{\headmark}\rlap{\kern2em\pagemark}}}

% ********************************************************************
% Hyperreferences, always load last
% ********************************************************************
\usepackage[]{hyperref}

\AfterPackage*{babel}
{
  \renewcaptionname{english}{\figureautorefname}{Figure}
  \renewcaptionname{english}{\tableautorefname}{Table}
  \renewcaptionname{english}{\partautorefname}{Part}
  \renewcaptionname{english}{\chapterautorefname}{Chapter}
  \renewcaptionname{english}{\sectionautorefname}{Section}
  \renewcaptionname{english}{\subsectionautorefname}{Section}
  \renewcaptionname{english}{\subsubsectionautorefname}{Section}
  \renewcaptionname{english}{\appendixautorefname}{Appendix}
}

\begin{document}
\part{Intro}
\chapter{Short chapter name}
\lipsum[1]
\section{Short section name}
\lipsum
\lipsum
\chapter{Very long chapter name just not fitting into the headline}
\lipsum[1]
\section{Very long section name just not fitting into the headline}
\lipsum
\lipsum
\end{document}

또는 \MakeTextLowercase에서는 사용할 수 없습니다 . 그러므로 아무 곳에 나 삽입해야 합니다 .\setkomafont\addtokomafont\spacedlowsmallcaps\lehead\rohead

답변2

모든 명령문은 이미 서문이 아닌 조판 중에 호출되는 \renewcommand*{\....autorefname}{...}추가 공백 문자를 발생시킵니다 .\extraenglish

%각 줄의 끝에 를 추가하세요 .

\documentclass[pdfa,a4paper,
               11pt,
               bibliography=totoc,
               numbers=noenddot,
               twoside,openright,
               parskip=half]{scrbook}
\usepackage{lipsum}
% ********************************************************************
% Languages, Typesetting
% ******************************************************************** 
\usepackage[ngerman, english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}         %windows: latin9, linux: utf8

% ********************************************************************
% page layout
% ********************************************************************
\usepackage[]{scrlayer-scrpage}
\renewcommand{\chapterpagestyle}{empty} % no headings or footings on first chapter page
\renewcommand{\chaptermark}[1]{\markboth{{#1}}{{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\upshape{\thesection}\enspace{#1}}}
\lehead{\mbox{\llap{\small\upshape\thepage\kern2em}\scshape\headmark\hfil}}
\rohead{\mbox{\hfil{\scshape\headmark}\rlap{\small\kern2em\upshape\thepage}}}
\chead{}\ifoot{}\cfoot{}\ofoot{}
\pagestyle{scrheadings}

% ********************************************************************
% Hyperreferences, always load last
% ********************************************************************
\usepackage[]{hyperref}
% Commenting this whole block fixes the problem
\makeatletter
\@ifpackageloaded{babel}
{
  \addto\extrasenglish{%
    \renewcommand*{\figureautorefname}{Figure}%
    \renewcommand*{\tableautorefname}{Table}%
    \renewcommand*{\partautorefname}{Part}%
    \renewcommand*{\chapterautorefname}{Chapter}%
    \renewcommand*{\sectionautorefname}{Section}%
    \renewcommand*{\subsectionautorefname}{Section}%
    \renewcommand*{\subsubsectionautorefname}{Section}%
    \renewcommand*{\appendixautorefname}{Appendix}%
  }%
}{\relax}
\makeatother


\begin{document}
\part{Intro}
\chapter{Short chapter name}
\lipsum[1]
\section{Short section name}
\lipsum
\lipsum
\chapter{Very long chapter name just not fitting into the headline}
\lipsum[1]
\section{Very long section name just not fitting into the headline}
\lipsum
\lipsum
\end{document}

관련 정보