如何以奇怪的日记风格放置图表和表格

如何以奇怪的日记风格放置图表和表格

我的同事正在为本期刊。他们使用一种相当奇怪的格式,左边距很宽,并结合双面页眉,例如:这张纸。他们给她发送了一个 LaTeX 模板,该模板通过将白色放入\lipsum...来wraptable创建左边距。

奇怪的是,模板可以工作,只是我不知道如何放置图形和表格,以便它们留在文本列中 - 正常的浮动环境跨越整个textwidth,而已发表的论文的图形与文本列对齐,如在提及的论文。(不过我也见过其他论文使用全宽表格,所以如果表格对于列来说太宽,这也是可以接受的。)

在这里,我发布了一个带有模板编辑版本的 MWE,并尽我所能在其中放置了一个图形:

\documentclass[a4 paper,11pt,twoside]{article}
\usepackage{fullpage}                           % Makes the page margins smaller to a predefined one.
\usepackage[lmargin=0.6in,rmargin=0.6in,tmargin=0.6in,headsep=.2in]{geometry}
\usepackage{wrapfig,lipsum,booktabs} % To produce the empty space on the left
\usepackage{xtab} % To produce the empty space on the left
\usepackage[dvipsnames]{xcolor}
\usepackage[normalem]{ulem}
\usepackage{amsfonts,graphicx}

\usepackage{mwe}
\usepackage[tableposition=top]{caption}
\captionsetup{labelfont+={bf,color=Brown},singlelinecheck=off}

\usepackage{sectsty}% http://ctan.org/pkg/sectsty
\allsectionsfont{\color{Brown}}
\makeatletter
\def\@seccntformat#1{\@ifundefined{#1@cntformat}%
{\csname the#1\endcsname\;}%  default
{\csname #1@cntformat\endcsname}% individual control
}
\def\section@cntformat{\thesection.\;} % Dot after the section number
\def\subsection@cntformat{\thesubsection.\;} % Dot after the subsection number
\makeatother

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    urlcolor=blue,
    linkcolor=black,
    citecolor = black}
\urlstyle{same}

\usepackage{fancyhdr}
\pagestyle{fancy}
%  ---------------   Normal Headers  ------------------
\fancyhf{} % clear all fields
\fancyhead[LE,RO]{\textsf{W. S. Khedr}}
%\fancyhead[C]{Paper Title: Running Title}
\fancyfoot[LO,RE]{Scientific Research Publishing}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{1pt} % to remove line on header
\renewcommand{\footrulewidth}{1pt} % to remove line on footer
% ------------------ Header for first page -----------------
\fancypagestyle{first}{%
  \fancyhf{}% clear all header and footer fields
  \fancyhead[L]{Scientific Research Publishing}%
  \fancyfoot[L]{{\footnotesize \textsf{DOI: \href{10.4236/***.2024.*****}{\color{blue}\uline{10.4236/***.2024.*****}} $\;$**** **, 2024}}}%
  \fancyhead[R]{{\bf\small \textsf{Journal of ****, 2024, *, *-*}}\\
\href{http://www.scirp.org/journal/***}{\color{blue}\uline{\textsf{http://www.scirp.org/journal/***}}}\\
\textsf{ISSN Online:****-****}\\
\textsf{ISSN Print:****-****}}%
  \renewcommand{\headrulewidth}{0pt}% to remove line on header
  \renewcommand{\footrulewidth}{0pt}% to remove line on footer
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\thispagestyle{first}
\vspace*{3cm}
%%%%%%%%%  TITLE %%%%%%%%%%%%%%%%%
{\noindent\huge\bf Classical Fundamental Unique Solution for the Incompressible Navier-Stokes Equation in $\mathbb{R}^N$}\\[1cm]
%%%%%%%%%%%%%%%%  Author Data %%%%%%%%%%%%%%%%%%%
{\bf\large Waleed S. Khedr}\\[0.5cm]
Independent Researcher, Cairo, Egypt\\
Email: [email protected]\\
%%%%%%%%%%%   The Information Bar on the Left %%%%%%%%%%%
\begin{wraptable}{l}{5.1cm}
{\footnotesize
\begin{xtabular*}{0.3\textwidth}{p{5cm}}
\noindent{\bf How to cite this paper:} Khedr, W. S. (2024) Classical Fundamental Unique Solution for the Incompressible Navier-Stokes Equation in $\mathbb{R}^N$, Journal of ***, {\bf *},    *-*.\\
\url{http://dx.doi.org/10.4236/***.2024.*****}\\
{\bf Received: **** **, ***}\\
{\bf Accepted: **** **, ***}\\
{\bf Published: **** **, ***}\\
Copyright \copyright$\;$2024 by author(s) and Scientific Research Publishing Inc.\\
This work is licensed under the Creative Commons Attribution International License (CC BY 4.0).\\
\url{http://creativecommons.org/licenses/by/4.0/}\\
%%%%%%%%%%%%%%%%%%% IMPORTANT FOR AUTHORS %%%%%%%%
% Copy and paste the following line depending on the number of full pages in your document (i.e. before using the template)
{\color{white}\lipsum[1-60]}% If the number of pages is less than 15
%{\color{white}\lipsum[1-60]}% uncomment if the number of pages is more than 15 and less than 30
%{\color{white}\lipsum[1-60]}% uncomment if the number of pages is more than 30 and less than 45
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{xtabular*}
}
\end{wraptable}
%%%%%%%%%%%%%%%  The Abstract and Keywords %%%%%%%%%%%%%%%%%%%%%%%%
{\color{Brown}\rule{0.7\textwidth}{2pt}}\\[0.2cm]
{\color{Brown}\bf\large Abstract}\\
\lipsum[1]

%%%%%%%%%%%%%%%%%  The Document Starts Here %%%%%%%%%%%%%%
\section{Introduction}

\lipsum[1-2]

\begin{figure}
    \includegraphics[width=\linewidth]{example-image-16x9}
    \caption{Image ‘example-image-16x9’ from package mwe.}
    \label{fig:1}
\end{figure}

We can see that Fig~\ref{fig:1} spans the whole width of the page\dots
\lipsum[1-1]

\noindent
\includegraphics[width=\linewidth]{example-image-a}

Image ‘example-image-a’ has the correct width, but no caption\dots
\lipsum[1-1]

\begin{minipage}[b]{\linewidth}
    \includegraphics[width=\linewidth]{example-image-b}
    \captionof{figure}{Image ‘example-image-b’ from package mwe.}
    \label{fig:b}
\end{minipage}

Fig.~\ref{fig:b} is using minipage. It has the correct width, but does not respect the column\dots
\lipsum[1-1]

\noindent
\parbox{\linewidth}{%
    \includegraphics[width=\linewidth]{example-image-c}
    \captionof{figure}{Image ‘example-image-b’ from package mwe.}
    \label{fig:c}
    \bigskip
}

Fig.~\ref{fig:c} is using parbox and respects the column -- but one has to be careful with placement\dots
\lipsum[1-1]

\noindent
\parbox{\linewidth}{%
    \medskip
    \captionof{table}{Dummy table with caption}
    \label{tbl:test}
    \centering
    \vspace{-1ex}
    \begin{tabular}{cc}
        \toprule
        abc & def \\
        qwerty & asdfg \\
        \bottomrule
    \end{tabular}
    \bigskip
}

Table~\ref{tbl:test} is also using parbox\dots
\lipsum[1-1]

\end{document}

在那里,你可以看到我能做的最好的事情就是将图形放在\parbox- 但这需要仔细地放置在页面边框周围,否则会浪费很多垂直空间。从这个意义上讲,最好使用浮动的东西来做到这一点...

另一种选择是忽略模板的解决方案并使用可变边距和标题定义复制设计,但我没能做到这一点。最大的问题是:

  • 确保第一页正确,包括左侧部分
  • 文本带有左侧边距,但页眉和页脚跨越整个宽度,并且在奇数页和偶数页上有交替格式

相关内容