运用正当理由

运用正当理由

我使用了以下 Latex 源文件:

\RequirePackage{lineno}   
\documentclass[aps,prl]{revtex4}
\usepackage{graphicx}% Include figure files   
\usepackage{epstopdf}   % this graphic package converts eps to pdf for easier usage of eps files  
\usepackage{lpic}  
\usepackage{amsmath,amssymb}
\usepackage{nicefrac}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}   
\usepackage{xcolor} 
\usepackage{listingsutf8}  
\usepackage[section]{placeins}  
\lstset{mathescape=true} 
\newcommand{\ket}[1]{\left|{#1}\right\rangle} 
\newcommand{\bra}[1]{\left\langle{#1}\right|} 
\newcommand{\is}[1]{{\color{blue} #1}}
\usepackage{subcaption}

\captionsetup{compatibility=false}  
\begin{document}

\textbf{Corresponding author information}\\
Ad van der Ven, email: [email protected]

\begin{figure}

  \begin{subfigure}{0.50\textwidth}

{\bf Figure}

  \caption{Based on the observed data sets}

  \label{fig:RegressionFixedObservedN4451}

\end{subfigure}

\captionsetup{justification=raggedright,singlelinecheck=false}

\caption{Regression plot for the fixed condition of the ACT (N = 445). The
 x-axis represents the natural logarithm of the absolute value of the minimum
 residual score belonging to the sequence of 14 consecutive bars with the
 smallest MSE. The y-axis represents the smallest MSE. The top line is the
 line $y = 2x + \ln{10}$. The bottom line is the line $y = 2x-\ln{10}$. The
 line exactly in between is the line $y=2x$.}
\label{fig:observedfixedcondion}

\end{figure}

\end{document}

但是我不想有justification=raggedrightjustification=raggedleft。我只是希望标题左右对齐。对齐似乎没有该选项。我在“可能已经有答案的问题”中找不到答案。

答案1

使用

[...]
\usepackage{ragged2e}
\usepackage{subcaption}   
\DeclareCaptionJustification{justified}{\justifying}
\captionsetup{compatibility=false,justification=justified}  
[...]

在此处输入图片描述

答案2

格式(以行为中心的标题)源自revtex4文档类。在这里,我使用 创建自己的标题对齐选项\DeclareCaptionJustification{myjust}{\fulljustify}

\fulljustify通过从caption包定义开始\centerlast并对其进行修改来定义,以摆脱居中的最后一行。

选项justification=justified通常会在其他文档类中使用,但它实际上是一个空选项,没有添加任何附加代码,因此假定文档类默认值是完全合理的(但事实并非如此revtex4)。

\RequirePackage{lineno}
\documentclass[aps,prl]{revtex4}
\usepackage{graphicx}% Include figure files
\usepackage{epstopdf}   % this graphic package converts eps to pdf for easier usage of eps files
\usepackage{lpic}
\usepackage{amsmath,amssymb}
\usepackage{nicefrac}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{listingsutf8}
\usepackage[section]{placeins}
\lstset{mathescape=true}
\newcommand{\ket}[1]{\left|{#1}\right\rangle}
\newcommand{\bra}[1]{\left\langle{#1}\right|}
\newcommand{\is}[1]{{\color{blue} #1}}
\usepackage{subcaption}
\captionsetup{compatibility=false}
\DeclareCaptionJustification{myjust}{\fulljustify}

\makeatletter
\providecommand\fulljustify{%
  \let\\\@centercr
  \leftskip\z@%
  \rightskip\z@%
  \parfillskip\z@\@plus 1fill\relax%
}
\makeatother

\begin{document}
\textbf{Corresponding author information}\\
Ad van der Ven, email: [email protected]
\begin{figure}
  \begin{subfigure}{0.50\textwidth}
{\bf Figure}
  \caption{Based on the observed data sets}
  \label{fig:RegressionFixedObservedN4451}
\end{subfigure}
\captionsetup{justification=myjust,singlelinecheck=false}
\caption{Regression plot for the fixed condition of the ACT (N = 445). The
 x-axis represents the natural logarithm of the absolute value of the minimum
 residual score belonging to the sequence of 14 consecutive bars with the
 smallest MSE. The y-axis represents the smallest MSE. The top line is the
 line $y = 2x + \ln{10}$. The bottom line is the line $y = 2x-\ln{10}$. The
 line exactly in between is the line $y=2x$.}
\label{fig:observedfixedcondion}
\end{figure}
\end{document}

在此处输入图片描述

相关内容