如何将一个乳胶文件中的标签与另一个进行引用



我有两个文件,a.tex和b.tex。在a.tex中,我有一个标签\label{stuff}。在b.tex中,我需要参考这个标签\ref{stuff}。

我还有一个main.tex文件。无论我是使用\include{a}\include{b}还是使用\input{a}\input{b},引用都不包括在从main.tex生成的pdf中。

main.tex的文档类型是簇状书。

想法?主要.tex

% Tufte-Style Book (Documentation Template)
% LaTeX Template
% Version 1.0 (5/1/13)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% The Tufte-LaTeX Developers (tufte-latex.googlecode.com)
%
% License:
% Apache License (Version 2.0)
%
% IMPORTANT NOTE:
% In addition to running BibTeX to compile the reference list from the .bib
% file, you will need to run MakeIndex to compile the index at the end of the
% document.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
documentclass{tufte-book} % Use the tufte-book class which in turn uses the tufte-common class
hypersetup{colorlinks} % Comment this line if you don't wish to have colored links
usepackage{microtype} % Improves character and word spacing
usepackage{lipsum} % Inserts dummy text
usepackage{booktabs} % Better horizontal rules in tables
usepackage{amsmath}
usepackage{tikz,pgfplots}
usepackage{graphicx} % Needed to insert images into the document
graphicspath{{graphics/}} % Sets the default location of pictures
setkeys{Gin}{width=linewidth,totalheight=textheight,keepaspectratio} % Improves figure scaling
usepackage{fancyvrb} % Allows customization of verbatim environments
fvset{fontsize=normalsize} % The font size of all verbatim text can be changed here
newcommandwhen{  when }
newcommandotherwise{  otherwise }
newcommanddoubleplus{+kern-1.3ex+kern0.8ex}
newcommandmdoubleplus{ensuremath{mathbin{+mkern-10mu+}}}
newcommand{false}{fkern-0.25ex{alse}}
newcommandmfalse{ensuremath{mathbin{fmkern-5mu alse}}}
newcommandf{textit{f}}
newcommand{hangp}[1]{makebox[0pt][r]{(}#1makebox[0pt][l]{)}} % New command to create parentheses around text in tables which take up no horizontal space - this improves column spacing
newcommand{hangstar}{makebox[0pt][l]{*}} % New command to create asterisks in tables which take up no horizontal space - this improves column spacing
usepackage{xspace} % Used for printing a trailing space better than using a tilde (~) using the xspace command
newcommand{monthyear}{ifcasemonthor Januaryor Februaryor Marchor Aprilor Mayor Juneor Julyor Augustor Septemberor Octoberor Novemberor Decemberfispacenumberyear} % A command to print the current month and year
newcommand{openepigraph}[2]{ % This block sets up a command for printing an epigraph with 2 arguments - the quote and the author
begin{fullwidth}
sffamilylarge
begin{doublespace}
noindentallcaps{#1}\ % The quote
noindentallcaps{#2} % The author
end{doublespace}
end{fullwidth}
}
newcommand{blankpage}{newpagehbox{}thispagestyle{empty}newpage} % Command to insert a blank page
usepackage{units} % Used for printing standard units
newcommand{hlred}[1]{textcolor{Maroon}{#1}} % Print text in maroon
newcommand{hangleft}[1]{makebox[0pt][r]{#1}} % Used for printing commands in the index, moves the slash left so the command name aligns with the rest of the text in the index 
newcommand{hairsp}{hspace{1pt}} % Command to print a very short space
newcommand{ie}{textit{i.hairsp{}e.}xspace} % Command to print i.e.
newcommand{eg}{textit{e.hairsp{}g.}xspace} % Command to print e.g.
newcommand{na}{quad--} % Used in tables for N/A cells
newcommand{measure}[3]{#1/#2$times$unit[#3]{pc}} % Typesets the font size, leading, and measure in the form of: 10/12x26 pc.
newcommand{tuftebs}{symbol{'134}} % Command to print a backslash in tt type in OT1/T1
providecommand{XeLaTeX}{Xlower.5exhbox{kern-0.15emreflectbox{E}}kern-0.1emLaTeX}
newcommand{tXeLaTeX}{XeLaTeXindex{XeLaTeX@protectXeLaTeX}} % Command to print the XeLaTeX logo while simultaneously adding the position to the index
newcommand{doccmdnoindex}[2][]{texttt{tuftebs#2}} % Command to print a command in texttt with a backslash of tt type without inserting the command into the index
newcommand{doccmddef}[2][]{hlred{texttt{tuftebs#2}}label{cmd:#2}ifthenelse{isempty{#1}} % Command to define a command in red and add it to the index
{ % If no package is specified, add the command to the index
index{#2 command@protecthangleft{texttt{tuftebs}}texttt{#2}}% Command name
}
{ % If a package is also specified as a second argument, add the command and package to the index
index{#2 command@protecthangleft{texttt{tuftebs}}texttt{#2} (texttt{#1} package)}% Command name
index{#1 package@texttt{#1} package}index{packages!#1@texttt{#1}}% Package name
}}
newcommand{doccmd}[2][]{% Command to define a command and add it to the index
texttt{tuftebs#2}%
ifthenelse{isempty{#1}}% If no package is specified, add the command to the index
{%
index{#2 command@protecthangleft{texttt{tuftebs}}texttt{#2}}% Command name
}
{%
index{#2 command@protecthangleft{texttt{tuftebs}}texttt{#2} (texttt{#1} package)}% Command name
index{#1 package@texttt{#1} package}index{packages!#1@texttt{#1}}% Package name
}}
% A bunch of new commands to print commands, arguments, environments, classes, etc within the text using the correct formatting
newcommand{docopt}[1]{ensuremath{langle}textrm{textit{#1}}ensuremath{rangle}}
newcommand{docarg}[1]{textrm{textit{#1}}}
newenvironment{docspec}{begin{quotation}ttfamilyparskip0ptparindent0ptignorespaces}{end{quotation}}
newcommand{docenv}[1]{texttt{#1}index{#1 environment@texttt{#1} environment}index{environments!#1@texttt{#1}}}
newcommand{docenvdef}[1]{hlred{texttt{#1}}label{env:#1}index{#1 environment@texttt{#1} environment}index{environments!#1@texttt{#1}}}
newcommand{docpkg}[1]{texttt{#1}index{#1 package@texttt{#1} package}index{packages!#1@texttt{#1}}}
newcommand{doccls}[1]{texttt{#1}}
newcommand{docclsopt}[1]{texttt{#1}index{#1 class option@texttt{#1} class option}index{class options!#1@texttt{#1}}}
newcommand{docclsoptdef}[1]{hlred{texttt{#1}}label{clsopt:#1}index{#1 class option@texttt{#1} class option}index{class options!#1@texttt{#1}}}
newcommand{docmsg}[2]{bigskipbegin{fullwidth}noindentttfamily#1end{fullwidth}medskipparnoindent#2}
newcommand{docfilehook}[2]{texttt{#1}index{file hooks!#2}index{#1@texttt{#1}}}
newcommand{doccounter}[1]{texttt{#1}index{#1 counter@texttt{#1} counter}}
usepackage{makeidx} % Used to generate the index
makeindex % Generate the index which is printed at the end of the document
% This block contains a number of shortcuts used throughout the book
newcommand{vdqi}{textit{VDQI}xspace}
newcommand{ei}{textit{EI}xspace}
newcommand{ve}{textit{VE}xspace}
newcommand{be}{textit{BE}xspace}
newcommand{VDQI}{textit{The Visual Display of Quantitative Information}xspace}
newcommand{EI}{textit{Envisioning Information}xspace}
newcommand{VE}{textit{Visual Explanations}xspace}
newcommand{BE}{textit{Beautiful Evidence}xspace}
newcommand{TL}{Tufte-LaTeXxspace}
%----------------------------------------------------------------------------------------
%   BOOK META-INFORMATION
%----------------------------------------------------------------------------------------
title{A Study in Algorithms} % Title of the book
author[Lee Barney]{Lee Barney} % Author
%publisher{Lee S. Barney} % Publisher
%----------------------------------------------------------------------------------------
begin{document}
frontmatter
maketitle % Print the title page
%----------------------------------------------------------------------------------------
%   COPYRIGHT PAGE
%----------------------------------------------------------------------------------------
newpage
begin{fullwidth}
~vfill
thispagestyle{empty}
setlength{parindent}{0pt}
setlength{parskip}{baselineskip}
Copyright copyright theyear thanklessauthor
%parsmallcaps{Published by thanklesspublisher}
%parsmallcaps{tufte-latex.googlecode.com}
par All rights reserved. index{license}
partextit{First printing, monthyear}
end{fullwidth}
%----------------------------------------------------------------------------------------
tableofcontents % Print the table of contents
%----------------------------------------------------------------------------------------
%listoffigures % Print a list of figures
%----------------------------------------------------------------------------------------
%listoftables % Print a list of tables
%----------------------------------------------------------------------------------------
%   INTRODUCTION
%----------------------------------------------------------------------------------------
cleardoublepage
include{intro}
%----------------------------------------------------------------------------------------
mainmatter
include{a}
include{b}
%----------------------------------------------------------------------------------------
backmatter
%----------------------------------------------------------------------------------------
%   BIBLIOGRAPHY
%----------------------------------------------------------------------------------------
bibliography{algorithms} % Use the bibliography.bib file for the bibliography
bibliographystyle{plainnat} % Use the plainnat style of referencing
%----------------------------------------------------------------------------------------
printindex % Print the index at the very end of the document
end{document}```

我在论文中使用了类似的东西。在文本中使用\hyperref[label]{您想要显示的文本}对我很有用。别忘了包含包hyperref。

label{ab:PCL} % this is inside my abbreviations file
---
hyperref[ab:PCL]{polycaprolactone} % this is in my text file

相关内容

  • 没有找到相关文章

最新更新