
私は非常に単純な TeX ファイルを作成しています。これを使用して、ページに多くのメモを配置していますが、まず最初に、右上に約 1 インチ x インチの余白ボックスが必要です (それ以外の余白は、すべての側面ではるかに小さくなっています)。
これを実現するにはどうすればよいでしょうか。理想的には、最初のページのみにその状態が維持され、ファイルの他の部分を変更したり、単語数などを編集しても変化しません。
ここにコードがあります:
\documentclass[8pt, letter, twocolumn]{extarticle}
\usepackage[bottom=0.5cm, right=0.5cm, left=0.5cm, top=0.5cm]{geometry}
\usepackage{titlesec}
\titleformat{\section}
{\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}
\begin{document}
Name and stuff
\section{something}
Long long sprawling thing that goes on for about 10 pages
\end{document}
答え1
オーバーラップ マージン (特に長方形以外のマージン) を設定するよりも簡単です。これは、tikzpicture のオーバーレイ オプション (2 回実行) を使用します。
\documentclass[8pt, letter, twocolumn]{extarticle}
\usepackage[bottom=0.5cm, right=0.5cm, left=0.5cm, top=0.5cm]{geometry}
\usepackage{titlesec}
\titleformat{\section}
{\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}
\usepackage{tikz}
\begin{document}
Name and stuff
\begin{tikzpicture}[overlay,remember picture]% anywhere on the first page
\draw (current page.north east) rectangle ++(-1in,-1in);
\path (current page.north east) ++(-0.5in,-0.5in)
node{\parbox{0.9in}{\centering this is a test}};
\end{tikzpicture}
\section{something}
Long long sprawling thing that goes on for about 10 pages
\end{document}
このバージョンでは LaTeX フックを使用します。
\documentclass[8pt, letter, twocolumn]{extarticle}
\usepackage[bottom=0.5cm, right=0.5cm, left=0.5cm, top=0.5cm]{geometry}
\usepackage{titlesec}
\titleformat{\section}
{\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}
\AddToHookNext{shipout/background}{\put (\dimexpr \paperwidth-1in\relax,-0.5in) {%
\dimen0=\dimexpr 1in-2\fboxsep-2\fboxrule\relax
\fbox{\parbox[c][\dimen0][c]{\dimen0}{\centering
this is a test}}}}
\begin{document}
Name and stuff
\section{something}
Long long sprawling thing that goes on for about 10 pages
\end{document}
これは、不規則な余白を作成するために flowfram を使用します。frowfram の問題は、2 つのフレーム間の境界で段落の幅が変わらないことです。
\documentclass[8pt, letter, twocolumn]{extarticle}
\usepackage[bottom=0.5cm, right=0.5cm, left=0.5cm, top=0.5cm]{geometry}
\usepackage{titlesec}
\titleformat{\section}
{\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}
\usepackage{flowfram}
\newflowframe[1]{\dimexpr \textwidth+0.5cm-1in}% width
{\dimexpr 1in-0.5cm}% height
{0pt}% left edge
{\dimexpr \textheight+0.5cm-1in}% bottom
\newflowframe[1]{\textwidth}% width
{\dimexpr \textheight+0.5cm-1in}% height
{0pt}{0pt}
\usepackage{lipsum}% random text
\begin{document}
\lipsum[1-2]
\section{something}
Long long sprawling thing that goes on for about 10 pages
\end{document}