tikzpicture 线原点太靠右

tikzpicture 线原点太靠右

我试图做到这一点,这样我就可以在页面上绘制一个箭头。我希望它从页面边缘的左侧开始,但它似乎添加了额外的填充,将其推得太靠右了。我为此奋斗了几个小时,但似乎没有什么能把它推到左边,除非改变整个页面的边距(如果我能避免的话,这是不可取的)。以下是一些基本代码(箭头在第 3 页上):

\documentclass[12pt]{report}
\usepackage[final]{pdfpages}
\usepackage{fancyhdr}
\usepackage[letterpaper, margin=1in]{geometry}
\usepackage{subcaption}
\usepackage{tocloft}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning}

\pdfoptionpdfminorversion 7

\pagestyle{fancy}
\lfoot{\today}
\rfoot{\thepage}
\cfoot{}
\rhead{}
\lhead{\leftmark}
\renewcommand {\headrulewidth}{0.4pt}
\renewcommand {\footrulewidth}{0.4pt}
%
\makeatletter
\setlength{\@fptop}{0pt}
\makeatother
%

\usepackage[hypertexnames=false]{hyperref}

\begin{document}\thispagestyle{empty}
ion
\tableofcontents
\includepdfset{pagecommand=\thispagestyle{fancy}}
\clearpage\phantomsection
\addcontentsline{toc}{chapter}{P-1}\markboth{P-1}{}
\begin{center}
\Huge
P-1
\end{center}
\clearpage\phantomsection
\label{page408964}
\addcontentsline{toc}{section}{AS 3043001.020 WHT MADERA ADA BOWL 1-1/2TS FLOOR MOUNT}
\begin{tikzpicture}[x=1pt,y=1pt,red,ultra thick]\draw[-{Stealth[red,scale=1.3,angle'=45]},ultra thick] (0,0) -- (468pt,-647pt);\end{tikzpicture}
\end{document}

答案1

添加\noindent就足以从文本区域的西北角开始箭头,如下图所示:

无缩进

如果将其进一步向左移动,它将不再位于文本区域内,而是从左边距开始。

我也整理了一下你的代码,尽管不是很多:

\documentclass[12pt]{report}
\usepackage{fancyhdr}
\usepackage[letterpaper, margin=1in, headheight=15pt, showframe]{geometry}% headheight=15pt is from fancyhdr -READ THE CONSOLE OUTPUT: it sometimes tells you things you NEED to know; showframe is just for testing
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning}
\pdfoptionpdfminorversion 7
\pagestyle{fancy}
\lfoot{\today}
\rfoot{\thepage}
\cfoot{}
\rhead{}
\lhead{\leftmark}
\renewcommand {\headrulewidth}{0.4pt}
\renewcommand {\footrulewidth}{0.4pt}
\usepackage[hypertexnames=false]{hyperref}
\usepackage{bookmark}% better bookmarks, fewer compilations
% if you want to customise the format of chapters, sections etc. you can use titlesec
\begin{document}
\thispagestyle{empty}
ion
\tableofcontents
\clearpage\markboth{}{}% clear the ToC header from headers/footers (\chapter won't do this if starred)
\chapter*{P-1}\addcontentsline{toc}{chapter}{P~1}% replace manual formatting of section headings and chapter titles!!
\clearpage
\phantomsection
\label{page408964}
\addcontentsline{toc}{section}{AS 3043001.020 WHT MADERA ADA BOWL 1-1/2TS FLOOR MOUNT}
\noindent
\begin{tikzpicture}[x=1pt,y=1pt,red,ultra thick]
  \draw[-{Stealth[red,scale=1.3,angle'=45]},ultra thick] (0,0) -- (468pt,-647pt);
\end{tikzpicture}
\end{document}

相关内容