其他文件中引用的项目列表

其他文件中引用的项目列表

我要提交一份附有补充信息的科学论文,即我要发送两份文件:一份(简短的)主文件和一份包含主文件中引用的文本、表格和图形的第二份文件。在主文件的末尾,我想列出第二份文件中的项目(章节、图形、表格)并附上简短说明。我认为这很好,这样我也可以从主文件中引用这些项目。

但是这些物品占用了很大的空间,我想知道如何获得更简洁的东西。

梅威瑟:

\documentclass[english]{article}

\usepackage[figurename=Fig.,labelfont=bf,labelsep=space,justification=justified]{caption}
\usepackage{refstyle}

\newref{stab}{refcmd = {Supporting Information Table~S\ref{#1}}}
\newref{fig}{refcmd = {Fig.~\ref{#1}}}
\newref{sfig}{refcmd = {Supporting Information Fig.~S\ref{#1}}}
\newref{supsubsec}{refcmd = {Supporting Information, \nameref{#1}}}
\DeclareCaptionLabelFormat{support}{#1 S#2}

\begin{document}

\section*{Main text}

Here I'd like to refer to some items in the supplement, such as  \stabref{RNAseq-primary-stats} and \sfigref{coverage-masking}.

\section*{Supporting Information}
\setcounter{figure}{0}
Additional supporting information may be found in the online version of this article.

\subsection*{\label{supsubsec:Materials-and-Methods}Materials and Methods S1}

\begin{table}[h]
\captionsetup{labelformat=support} 
\caption{\label{stab:RNAseq-primary-stats}RNAseq statistics. }
\end{table}

\begin{table}[h]
\captionsetup{labelformat=support} 
\caption{\label{stab:mappop_stats}Read depths for the individuals from the
F1 family.}
\end{table}

\subsection*{\label{supsubsec:Results}Results S1}

\begin{table}
\captionsetup{labelformat=support} 
\caption{\label{stab:Summary}Summary of sex-linkage inference.}
\end{table}

\begin{figure}[h]
\captionsetup{labelformat=support} 
\caption{\label{sfig:coverage-masking}Masking of putative W- and Z-specifirregions.}
\end{figure}

\end{document}

似乎主要是虚拟图形以某种方式继承了浮动首选项并需要自己的页面。另外,我希望短标题左对齐,而不是居中。

“黄金”解决方案是自动在第一个文档末尾添加第二个文档中引用项目的列表,并附上简短版本的标题。但我不知道从哪里开始才能实现这一目标。

答案1

找到了一种使用 xr 的半自动化解决方法。

我有两个文件,补充了我想要参考的附加信息(文件 second.tex):

\documentclass[english]{article}

\usepackage{refstyle}
\usepackage{nameref}

\usepackage[figurename=Fig.,labelfont=bf,labelsep=space,justification=justified]{caption}
\DeclareCaptionLabelFormat{support}{#1 S#2}

\begin{document}

Additional supporting information

\subsection*{\label{supsubsec:Materials-and-Methods}Materials and Methods S1}

\begin{table}[h]
\captionsetup{labelformat=support} 
\caption{\label{stab:RNAseq-primary-stats} RNAseq statistics. }
\end{table}

\begin{table}[h]
\captionsetup{labelformat=support} 
\caption{\label{stab:mappop_stats} Read depths for the individuals from the
F1 family.}
\end{table}

\subsection*{\label{supsubsec:Results} Results S1}

\begin{table}
\captionsetup{labelformat=support} 
\caption{\label{stab:Summary}Summary of sex-linkage inference.}
\end{table}

\begin{figure}[h]
\captionsetup{labelformat=support} 
\caption{\label{sfig:coverage-masking}Masking of putative W- and Z-specifirregions.}
\end{figure}

\end{document}

在主文档中,我使用包\externaldocument{second}中的xr文件,并手动列出我想要列出的所有项目:

\documentclass[english]{article}

\usepackage[figurename=Fig.,labelfont=bf,labelsep=space,justification=justified]{caption}
\usepackage{refstyle}
\usepackage{nameref}

\usepackage{xr}
\externaldocument{second}

\newref{stab}{refcmd = {Supporting Information Table~S\ref{#1}}}
\newref{sfig}{refcmd = {Supporting Information Fig.~S\ref{#1}}}
\newref{supsubsec}{refcmd = {Supporting Information, \nameref{#1}}}

\begin{document}

\section*{Main text}

Here I'd like to refer to some items in the supplement, such as \stabref{RNAseq-primary-stats} and \sfigref{coverage-masking}.

\section*{Supporting Information}

\newref{stab}{refcmd = {Table~S\ref{#1}}}
\newref{sfig}{refcmd = {Fig.~S\ref{#1}}}

\nameref{supsubsec:Materials-and-Methods}: Additional materials and methods

\stabref{RNAseq-primary-stats}: RNAseq statistics.

\stabref{mappop_stats}: Read depths for the individuals from the
F1 family.

\nameref{supsubsec:Results}: Additional results

\stabref{Summary}: Summary of sex-linkage inference.

\sfigref{coverage-masking}: Masking of putative W- and Z-specific regions.

\end{document}

可能还有更优雅的方法,但是现在这对我有用。

相关内容