如何格式化文档?

如何格式化文档?

我有一份文件。这是我的代码

\documentclass[a4paper, 12pt]{article}
\usepackage{fouriernc}
\usepackage{amsmath,amsfonts,enumerate,tabularx,calrsfs,esvect, multicol}
\usepackage{graphics}
\usepackage[left=15mm,right=20mm,top=15mm,bottom=10mm]{geometry}
\usepackage[thmmarks,standard,thref]{ntheorem}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\pagestyle{empty}

\theoremseparator{.}
\theorembodyfont{\upshape}
%\theorembodyfont{\normalfont}
\newtheorem{pro}{Problem}
\renewcommand{\baselinestretch}{1.5}
\begin{document}

\thispagestyle{empty}
\begin{pro}
Solve  the following equations:
\begin{enumerate}[\quad 1)]
\item $\dfrac{\cos^2 2x}{\cos x + \cos\dfrac{\pi}{4}} = \cos x - \cos\dfrac{\pi}{4}$;
\item $\dfrac{\cos^2 2x}{\cos x + \cos\dfrac{\pi}{4}} = \cos x - \cos\dfrac{\pi}{4}$;

\item $(\sqrt{3}\sin x + 2\cos x)\cdot (1 - \cos x) = \sin^2 x$.
\end{enumerate}
\end{pro}


\begin{pro}
\begin{minipage}[b]{0.3\textwidth}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(-0.5,-0.5) rectangle (4.3,4.5);
\draw (0,0)-- (4,0);
\draw (4,0)-- (2,3.46);
\draw (2,3.46)-- (0,0);
\begin{scriptsize}
\fill [color=black] (0,0) circle (1.5pt);
\draw[color=black] (-0.03,-0.19) node {$B$};
\fill [color=black] (4,0) circle (1.5pt);
\draw[color=black] (4.1,-0.19) node {$C$};
\fill [color=black] (2,3.46) circle (1.5pt);
\draw[color=black] (1.99,3.72) node {$A$};
\end{scriptsize}
\end{tikzpicture}
\end{minipage}
\begin{minipage}[b]{0.615\textwidth}
Write the equation of the plane which passes the point and perpendicular to the line $\Delta$ 
\end{minipage}
\end{pro}
\end{document} 

我想要上面的问题 2,左边是等边三角形,右边是问题内容。而且,两个小纸片的总宽度等于页面宽度。我该怎么做?谢谢。

答案1

这是一种可能性;我使用t来作为 s 的可选参数minipage(以获得顶部垂直对齐)和baseline=(current bounding box.north)tikzpicture我还删除了第一个 s 后面的虚假空白,\end{minipage}这样现在两个 s 的宽度minipage加起来就可以达到\linewidth。我还使用font=\scriptsize来作为图表的节点。根据标签“问题”的所需位置,可以获得不同的替代方案;以下代码显示了两种可能性:

\documentclass[a4paper, 12pt]{article}
\usepackage{fouriernc}
\usepackage{amsmath,amsfonts,enumerate,tabularx,calrsfs,esvect, multicol}
\usepackage{graphics}
\usepackage[left=15mm,right=20mm,top=15mm,bottom=10mm]{geometry}
\usepackage[thmmarks,standard,thref]{ntheorem}
\usepackage{pgf,tikz,lipsum}
\usetikzlibrary{arrows}
\pagestyle{empty}

\theoremseparator{.}
\theorembodyfont{\upshape}
%\theorembodyfont{\normalfont}
\newtheorem{pro}{Problem}
\renewcommand{\baselinestretch}{1.5}
\begin{document}

\thispagestyle{empty}
\lipsum[2]
\begin{pro}
Solve  the following equations:
\begin{enumerate}[\quad 1)]
\item $\dfrac{\cos^2 2x}{\cos x + \cos\dfrac{\pi}{4}} = \cos x - \cos\dfrac{\pi}{4}$;
\item $\dfrac{\cos^2 2x}{\cos x + \cos\dfrac{\pi}{4}} = \cos x - \cos\dfrac{\pi}{4}$;

\item $(\sqrt{3}\sin x + 2\cos x)\cdot (1 - \cos x) = \sin^2 x$.
\end{enumerate}
\end{pro}


\begin{pro}\mbox{}\\
\begin{minipage}[t]{0.3\linewidth}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm,baseline=(current bounding box.north),every node/.append style={font=\scriptsize}]
\clip(-0.5,-0.5) rectangle (4.3,4.5);
\draw (0,0)-- (4,0);
\draw (4,0)-- (2,3.46);
\draw (2,3.46)-- (0,0);
\fill [color=black] (0,0) circle (1.5pt);
\draw[color=black] (-0.03,-0.19) node {$B$};
\fill [color=black] (4,0) circle (1.5pt);
\draw[color=black] (4.1,-0.19) node {$C$};
\fill [color=black] (2,3.46) circle (1.5pt);
\draw[color=black] (1.99,3.72) node {$A$};
\end{tikzpicture}
\end{minipage}%
\begin{minipage}[t]{0.7\linewidth}
Write the equation of the plane which passes the point and perpendicular to the line $\Delta$ 
\end{minipage}
\end{pro}

\noindent\begin{minipage}[t]{0.3\linewidth}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm,baseline=(current bounding box.north),every node/.append style={font=\scriptsize}]
\clip(-0.5,-0.5) rectangle (4.3,4.5);
\draw (0,0)-- (4,0);
\draw (4,0)-- (2,3.46);
\draw (2,3.46)-- (0,0);
\fill [color=black] (0,0) circle (1.5pt);
\draw[color=black] (-0.03,-0.19) node {$B$};
\fill [color=black] (4,0) circle (1.5pt);
\draw[color=black] (4.1,-0.19) node {$C$};
\fill [color=black] (2,3.46) circle (1.5pt);
\draw[color=black] (1.99,3.72) node {$A$};
\end{tikzpicture}
\end{minipage}%
\begin{minipage}[t]{0.7\linewidth}
\begin{pro}
Write the equation of the plane which passes the point and perpendicular to the line $\Delta$ 
\end{pro}
\end{minipage}

\end{document} 

在此处输入图片描述

作为个人说明,也许您可​​以重新考虑更改\baselinestretch

评论中又提出了一个请求:左边的问题,右边的图:

\documentclass[a4paper, 12pt]{article}
\usepackage{fouriernc}
\usepackage{amsmath,amsfonts,enumerate,tabularx,calrsfs,esvect, multicol}
\usepackage{graphics}
\usepackage[left=15mm,right=20mm,top=15mm,bottom=10mm]{geometry}
\usepackage[thmmarks,standard,thref]{ntheorem}
\usepackage{pgf,tikz,lipsum}
\usetikzlibrary{arrows}
\pagestyle{empty}

\theoremseparator{.}
\theorembodyfont{\upshape}
%\theorembodyfont{\normalfont}
\newtheorem{pro}{Problem}
\renewcommand{\baselinestretch}{1.5}
\begin{document}

\thispagestyle{empty}

\noindent\begin{minipage}[t]{0.7\linewidth}
\begin{pro}
Write the equation of the plane which passes the point and perpendicular to the line $\Delta$ 
\end{pro}
\end{minipage}%
\begin{minipage}[t]{0.3\linewidth}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm,baseline=(current bounding box.north),every node/.append style={font=\scriptsize}]
\clip(-0.5,-0.5) rectangle (4.3,4.5);
\draw (0,0)-- (4,0);
\draw (4,0)-- (2,3.46);
\draw (2,3.46)-- (0,0);
\fill [color=black] (0,0) circle (1.5pt);
\draw[color=black] (-0.03,-0.19) node {$B$};
\fill [color=black] (4,0) circle (1.5pt);
\draw[color=black] (4.1,-0.19) node {$C$};
\fill [color=black] (2,3.46) circle (1.5pt);
\draw[color=black] (1.99,3.72) node {$A$};
\end{tikzpicture}
\end{minipage}

\end{document}

在此处输入图片描述

相关内容