我正在使用最近安装的 TeXLive 2021。我有一个带Tikz
图片的文档,其中包含\ref{}
引用文本部分的命令。使用 pdfLaTeX 进行编译可以解决交叉引用问题。但是,应该出现在交叉引用上方的(默认)红色框放错了位置。我尝试更改align
中节点的选项Tikz
,但这只会将红色框移动到其他不合适的位置。欢迎提出任何有关如何解决此问题的建议。MWE 如下:
% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode
% This is a simple template for a LaTeX document using the "article" class.
% See "book", "report", "letter" for other types of document.
\documentclass[11pt]{article} % use larger type; default would be 10pt
\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
%%% Examples of Article customizations
% These packages are optional, depending whether you want the features they provide.
% See the LaTeX Companion or other references for full information.
%%% PAGE DIMENSIONS
\usepackage{geometry} % to change the page dimensions
\geometry{a4paper} % or letterpaper (US) or a5paper or....
\usepackage{tikz}
\usetikzlibrary{arrows,matrix,positioning,shapes}
\usetikzlibrary{fit}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathmorphing,backgrounds,decorations.pathreplacing, decorations.markings}
\usepackage{hyperref}
\usepackage{ntheorem}
\newtheorem{definition}{Definition}
%%% END Article customizations
%%% The "real" document content comes below...
\title{Brief Article}
\author{The Author}
%\date{} % Activate to display a given date or no date (if empty),
% otherwise the current date is printed
\begin{document}
\maketitle
\section{First section} \label{s:S1}
\begin{definition} \label{def:synonyms}
Test defn.
\end{definition}
Your text goes here.
\section{Second section} \label{s:S2}
Why are the hyperref boxes in the tikzpicture below not located over the ref commands? \\
Changing the align option for nodes does not help. \\
\vspace{10pt}
\begin{tikzpicture}[scale=0.7, transform shape]
% Give us a centre to work around with node placement
\node[] (centre) at + (0,0) {};
\node[draw, text width=26mm, text centered, minimum height=5mm,font=\normalsize,
trapezium,
trapezium left angle = 65,
trapezium right angle = 115,
trapezium stretches] (S1trap) {Intro:
(Defn~\ref{def:synonyms}, Sect. \ref{s:S1})};
\node[right=1cm of S1trap.east, draw, text centered, text width=32mm, align=center](S2box) {More stuff (Sect.~\ref{s:S2})};
\end{tikzpicture}
\end{document}