经过几个小时毫无意义的谷歌搜索,我还是没能找到方法...我是 LaTeX 模板的新手,现在我正尝试进行简单的(?)修改,以便我可以让段落级标题显示为边注。段落级标题应该位于下一段的左侧,就像某些简历样式一样。
可以用 article + titlesec 来完成吗?
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[bindingoffset=2cm,includeheadfoot,margin=1.5cm]{geometry}
\usepackage[bf,pagestyles,raggedright]{titlesec}
\usepackage{blindtext}
\usepackage{sidenotes}
% Setup for page layout (titlesec)
\newpagestyle{main}{%
\headrule
\sethead[\thepage][][\thesubsecton\quad\subsectiontitle]{\thesection\quad\sectiontitle}{}{\thepage}
\setfoot[][][]{}{}{}
}
\widenhead*{2cm}{0cm}
\pagestyle{main}
% Setup for headings (titlesec)
\titleformat{\section}{\normalfont\Large\bfseries}{\makebox[30pt][r]{\thesection}}{15pt}{}
\titleformat{\subsection}{\normalfont\large\bfseries}{\makebox[30pt][r]{\thesubsection}}{15pt}{}
\titleformat{\subsubsection}{\normalfont\normalsize\bfseries}{\makebox[30pt][r]{\thesubsubsection}}{15pt}{}
\titleformat{\paragraph}{\normalfont\normalsize\bfseries}{\makebox[30pt][r]{\theparagraph}}{15pt}{}
\titlespacing*{\section}{-45pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\titlespacing*{\subsection}{-45pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\subsubsection}{-45pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\paragraph}{-45pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\begin{document}
\blinddocument
\end{document}
答案1
您必须使用该leftmargin
选项。
因此,对于您的paragraph
定义,类似于,
\titleformat{\paragraph}[leftmargin]{\normalfont\normalsize\bfseries\filleft}{\theparagraph}{15pt}{}
和
\titlespacing*{\paragraph}{65pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
梅威瑟:
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[bindingoffset=2cm,includeheadfoot,margin=2cm]{geometry}
\usepackage[bf,pagestyles,raggedright]{titlesec}
\usepackage{blindtext}
\usepackage{sidenotes}
% Setup for page layout (titlesec)
\newpagestyle{main}{%
\headrule
\sethead[\thepage][][\thesubsecton\quad\subsectiontitle]{\thesection\quad\sectiontitle}{}{\thepage}
\setfoot[][][]{}{}{}
}
\widenhead*{2cm}{0cm}
\pagestyle{main}
% Setup for headings (titlesec)
\titleformat{\section}{\normalfont\Large\bfseries}{\makebox[30pt][r]{\thesection}}{15pt}{}
\titleformat{\subsection}{\normalfont\large\bfseries}{\makebox[30pt][r]{\thesubsection}}{15pt}{}
\titleformat{\subsubsection}{\normalfont\normalsize\bfseries}{\makebox[30pt][r]{\thesubsubsection}}{15pt}{}
\titleformat{\paragraph}[leftmargin]{\normalfont\normalsize\bfseries\filleft}{\theparagraph}{15pt}{}
\titlespacing*{\section}{-45pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\titlespacing*{\subsection}{-45pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\subsubsection}{-45pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\paragraph}{65pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\begin{document}
\blinddocument
\end{document}
输出
替换filleft
你filright
得到