minipage 语法

minipage 语法

你能向我解释一下小页面的语法吗?

例如这里:

 \begin{minipage}[c]{0.45\linewidth}

0.45 是什么意思?

先感谢您

编辑:

\documentclass{svjour3}      
\usepackage[utf8]{inputenc}
\inputencoding{latin1}
\usepackage{lmodern,textcomp}
\usepackage[a4paper,top=2cm,bottom=3.2cm,left=1.25cm,right=1.25cm]{geometry}

% Citation of the figure 
is shown in \ref{fig:metal}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}

\begin{minipage}[c]{0.5\linewidth}
\begin{tabular}{|l|l|l|l|}
\hline
ff & ff   & ff & ff \\ \hline
dd & ddd  & ff & jj \\ \hline
ss & xxtt & l  & jj \\ \hline
hh & gg   & ll & ll \\ \hline
\end{tabular}

\end{minipage}
\begin{minipage}[c]{0.3\linewidth}
\sidesubfloat[]{\includegraphics[width=4.5cm,height=4.1cm]{Image.jpg}\label{fig:im1}}
\end{minipage}

\begin{minipage}[c]{0.45\linewidth}
\sidesubfloat[]{\includegraphics[width=11cm,height=6cm]{spectra.jpg}\label{fig:spectra}}
\end{minipage}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% I would like to make the figure after 10 cm from the beginning of the line and not just after the `tabular`. What shall I do please?
\end{document}

答案1

在您的 mwe 中您有更多问题:

  • graphicx序言中缺少包
  • 缺少的是\begin{document}
  • 您在包含图形时有拼写错误:应该\include graphics{}拼写为\includegraphics{}
  • 如果您希望将所有三个minipages 放在一行中,那么它们的宽度总和应该等于或小于\textwidth或在您的情况下linewidth,现在您有0.5\linewidth+ 0.3\linewidth+ 0.45\linewidth= 1.25\linewidth,因此第三个minipage移动到下一行。

更正了您的 mwe 并添加了lipsum用于生成虚拟文本的内容:

\documentclass{article}%{svjour3}
%\usepackage[utf8]{inputenc}
%\inputencoding{latin1}
%\usepackage{lmodern,textcomp}
\usepackage[a4paper,top=2cm,bottom=3.2cm,left=1.25cm,right=1.25cm]{geometry}

\usepackage[demo]{graphicx}% for including images

\usepackage{lipsum}% for demo only

\begin{document}
% Citation of the figure is shown in \ref{fig:metal}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lipsum[1]
    \begin{figure}[ht]
\begin{minipage}[c]{0.3\linewidth}
\begin{tabular}{ccc}
a & b & c
\end{tabular}
\end{minipage}\hfill
\begin{minipage}[c]{0.3\linewidth}
\includegraphics{}
\end{minipage}\hfill
\begin{minipage}[c]{0.3\linewidth}
\begin{tabular}{ccc}
a & b & c
\end{tabular}
\end{minipage}
    \end{figure}
\lipsum[2]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}

我使用是article因为我没有安装svjour3,但是所描述的问题与所使用的文档类无关。

在此处输入图片描述

相关内容