Flushedleft 标题,maketitle 与 marginparwidth 的右边距对齐

Flushedleft 标题,maketitle 与 marginparwidth 的右边距对齐

修好我的之后脚注问题我负责标题布局。

期刊需要带有左对齐内容的标题,但“标题框”本身应与区域的右边缘对齐marginparwidth。期刊的布局具有非常宽的边距。

My MWE 提供了标题内容所需的布局:

\documentclass[a4paper,12pt,
twoside,%
]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{noto}

\usepackage{geometry}
\geometry{%
    inner=2cm,
    outer=4cm,
    top=2.5cm,
    bottom=2.5cm,
    marginparwidth=3cm,
}

\usepackage[dvipsnames]{xcolor}
\definecolor{jogagray}{RGB}{81, 83, 74}

\usepackage{etoolbox}
\makeatletter
\providecommand{\subtitle}[1]{% add subtitle to \maketitle
    \apptocmd{\@title}{\par \vskip 0.5em {\large #1 \par}}{}{}
}
\def\@maketitle{%
    \newpage
    \null
    \vskip 2em%
    \begin{flushright}%
        \begin{minipage}[t]{0.8\textwidth}%
            \begin{flushleft}%
                \let \footnote \thanks
                {%\begin{spacing}{1.5} 
                \large \color{jogagray} \@author 
                %\end{spacing}
                }%
                \vskip 1em
                {\color{jogagray} \hrule \@width\columnwidth height 10pt \par}%
                \vskip 1em%
                {\Huge \color{jogagray} \sffamily \@title \par}%
                \vskip 1.5em%
            \end{flushleft}%
        \end{minipage}%
    \end{flushright}%
    \par
    \vskip 8em}
\makeatother

\usepackage{blindtext}

\title{A very very very very very very very very very very very very very very very very very very long Title}
\subtitle{A Subtitle}
\author{An Author, Another Author, A Third Author, A Last Author}

\begin{document}
    \maketitle
    
    \blindtext[3]
\end{document}

但标题本身应该与右边距对齐marginparwidth,就像图中箭头所示的那样:

标题的位置

所使用的代码可能应该主要使用基本命令和/或原语,因为它必须能够与不同的 Latex 类一起使用。

提前感谢可能的解决方案。

答案1

您可以在小页面前添加水平空间,总宽度为,0.2\textwidth + \marginparsep + \marginparwidth以将“标题框”偏移到边距空间的右边距。

请注意%后面的\hspace*(...}以避免出现不必要的空格。

C

% !TeX TS-program = pdflatex
\documentclass[a4paper,12pt,
twoside,
]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{noto}

\usepackage{geometry}
\geometry{%
    inner=2cm,
    outer=4cm,
    top=2.5cm,
    bottom=2.5cm,
    marginparwidth=3cm,
    showframe % to show the margins <<<<<<<
}

\usepackage[dvipsnames]{xcolor}
\definecolor{jogagray}{RGB}{81, 83, 74}

\usepackage{etoolbox}
\makeatletter
\providecommand{\subtitle}[1]{% add subtitle to \maketitle
    \apptocmd{\@title}{\par \vskip 0.5em {\large #1 \par}}{}{}
}
\def\@maketitle{%
    \newpage
    \null
    \vskip 2em%
    \begin{flushright}%
        \hspace*{\dimexpr 0.2\textwidth+\marginparsep+\marginparwidth}% added <<<<<<<<<<<<<<    
            \begin{minipage}[t]{0.8\textwidth}%
                \parindent0pt
            \begin{flushleft}%
                \let \footnote \thanks
                {%\begin{spacing}{1.5} 
                    \large \color{jogagray} \@author 
                    %\end{spacing}
                }%
                \vskip 1em
                {\color{jogagray} \hrule\@width\textwidth height 10pt \par}%%changed <<<<
                \vskip 1em%
                {\Huge \color{jogagray} \sffamily \@title \par}%
                \vskip 1.5em%
            \end{flushleft}%
        \end{minipage}%
    \end{flushright}%
    \par
    \vskip 8em}
\makeatother

\usepackage{blindtext}

\title{A very very very very very very very very very very very very very very very very very very long Title}
\subtitle{A Subtitle}
\author{An Author, Another Author, A Third Author, A Last Author}

\begin{document}
    \maketitle
    
    \blindtext[3]
\end{document}

相关内容