我想在 latex 中使用 minipage,并且我想要如下输入
我使用了答案的 cfg 模板,但它与图片不一样。我希望有人能帮忙。谢谢!
\documentclass[15pt,a4paper,openany,oneside]{book}
\usepackage{amsmath,amsxtra,amssymb,latexsym, amscd,amsthm,exscale, commath}
\usepackage{mathrsfs}
\usepackage[left=3cm, right=2.2cm, top=2.5cm, bottom=2cm]{geometry}
\begin{document}
\pagestyle{empty}
\begin{center}
\fontsize{13pt}{13pt}\selectfont SOCIALIST REPUBLIC OF VIETNAM\\ {\bf
\underline{Independence-Freedom-Happiness}}
\end{center}
\vspace*{0.3cm}
\begin{minipage}{0.87\textwidth}
\begin{center}
{\bf \fontsize{17pt}{16pt}\selectfont \flushleft Curriculum vitae}
\end{center}
\end{minipage}
\begin{minipage}{0.1\textwidth}
\flushright{\rule{2.5cm}{3cm}}
\end{minipage}
\end{document}
答案1
希望下面的代码可以帮助到你:
\documentclass[15pt,a4paper,openany,oneside]{book}
\usepackage{amsmath,amsxtra,amssymb,latexsym, amscd,amsthm,exscale, commath}
\usepackage{mathrsfs}
\usepackage[left=3cm, right=2.2cm, top=2.5cm, bottom=2cm]{geometry}
\begin{document}
\pagestyle{empty}
\hbox to \textwidth{
\begin{minipage}{20pc}
\begin{center}
\fontsize{13pt}{13pt}\selectfont SOCIALIST REPUBLIC OF VIETNAM\\ {\bf
\underline{Independence-Freedom-Happiness}}\\[3pc]
{\bf \fontsize{17pt}{16pt}\selectfont \flushleft Curriculum vitae}
\end{center}
\end{minipage}\hfill
\begin{minipage}{0.1\textwidth}
\flushright{\rule{2.5cm}{3cm}}
\end{minipage}
}
\end{document}
答案2
您的图像不太清晰(没有显示标题和图像的位置)。假设标题(小页面)不会溢出文本边框):
15pt
没有定义字体大小,因此默认字体大小10pt
被视为\bf
不是 latex 命令。您应该使用\bfseries
或 `\textbf{...}- 定义字体大小时,您可以使用
\large
,\Large
,huge
... 所用字体的版本 flushleft
是剩余的- ...
上面的文档图像是通过以下方式获得的姆韦:
\documentclass[12pt,a4paper,oneside]{book}
\usepackage{amsmath,amsxtra,amssymb,latexsym, amscd, amsthm, exscale, commath}
\usepackage{mathrsfs}
\usepackage[showframe,
left=3cm, right=2.2cm, top=2.5cm, bottom=2cm]{geometry}
\usepackage{tabularx} % <--- added, use instead of minipages
\usepackage[demo]{graphicx} % <--- added, for inserting of images
\usepackage[export]{adjustbox} % <--- added, for positioning image in table
\usepackage{lipsum} % for dummy text
\begin{document}
\pagestyle{empty}
\noindent%
{\setlength\tabcolsep{0pt}
\begin{tabularx}{\linewidth}{p{25mm}
>{\centering\let\\\newline}X
p{25mm}
}
&
\Large
SOCIALIST REPUBLIC OF VIETNAM
\underline{\textbf{Independence-Freedom-Happiness}}
\vspace{\baselineskip}
\large
\textbf{Curriculum vitae}
& \includegraphics[width=25mm, height=30mm, valign=t]{mypicture}
\end{tabularx}
\vspace{2\baselineskip}
}
\lipsum
\end{document}