\documentclass[11pt]{book}
\usepackage[paperheight=9.5in,paperwidth=7.5in, top=1in, bottom=0.8in]{geometry}
\setlength{\columnseprule}{0.4pt}
\usepackage{amssymb,amsfonts}
\usepackage{mathrsfs}
\usepackage[centertags]{amsmath}
\usepackage{amsthm}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}
\usepackage{epsfig}
\usepackage{float}
\usepackage{graphicx}\graphicspath{{Graphics/}}
\usepackage{mathptmx}
\usepackage[square,sort&compress]{natbib}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usetikzlibrary{arrows}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}\pagestyle{fancy}
\usepackage{xcolor}
\usepackage{setspace}
\usepackage{booktabs}
%\usepackage{fourier}
\usepackage[scale=0.75,opacity=0.5,color=black, angle=-45]{background}
\backgroundsetup{contents=\includegraphics{Capture}}
\usepackage{enumitem}
\setlist[enumerate,2]{label=(\roman*).}
\usepackage{tasks}
\settasks{label=$\circ$}
\usepackage{tikz}
\usetikzlibrary{fit, tikzmark}
\tikzset{FIT/.style = {
draw=black, thick, inner sep=2pt, rounded corners, fit=#1,
node contents={}},
s/.style= {inner xsep=6pt}
}
%\usepackage{hyperref}
\usetikzlibrary{arrows.meta}
\renewcommand{\baselinestretch}{1.5}
\newcommand\aug{\fboxsep=-\fboxrule\!\!\!\fbox{\strut}\!\!\!}
\newcommand{\tarc}{\mbox{\large$\frown$}}
\newcommand{\arc}[1]{\stackrel{\tarc}{#1}}
\theoremstyle{definition}
\newtheorem{Thm}{Theorem}[section]
\newtheorem{lem}[Thm]{Lemma}
\newtheorem{pro}[Thm]{Proposition}
\newtheorem{de}[Thm]{Definition}
\newtheorem{re}[Thm]{Remark}
\newtheorem{ex}[Thm]{Example}
\newtheorem{cor}[Thm]{Corollary}
\numberwithin{equation}{section}
\definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
\begin{document}
\textbf{Given:} In $\triangle ABC, \angle C$ is the obtuse angle. Let $m\overline{BC}=a, m\overline{AC}=b$ and $m\overline{AB}=c.$ $\overline{AD}$ is the perpendicular from $A$ to $\overline{BC}$ so that $\overline{CD}$ is projection of $\overline{AC}$ on $\overline{BC}.$ Let $m\overline{CD}=p$ and $m\overline{AD}=h.$
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(3.8,2.5) rectangle (9.4,6.4);
\draw [line width=1.0pt] (4.,3.)-- (7.,3.);
\draw [line width=1.0pt] (7.,3.)-- (9.,6.);
\draw [line width=1.0pt] (9.,6.)-- (4.,3.);
\draw [line width=1.0pt,dotted] (7.,3.)-- (9.,3.);
\draw [line width=1.0pt,dotted] (9.,3.)-- (9.,6.);
\draw [shift={(7.,3.)},line width=1.0pt] plot[domain=0.9827937232473287:3.141592653589793,variable=\t]({1.*0.6212642197722569*cos(\t r)+0.*0.6212642197722569*sin(\t r)},{0.*0.6212642197722569*cos(\t r)+1.*0.6212642197722569*sin(\t r)});
\draw (8.84,6.5) node[anchor=north west] {$A$};
\draw (3.84,3.05) node[anchor=north west] {$B$};
\draw (6.8,3.05) node[anchor=north west] {$C$};
\draw (8.78,3.1) node[anchor=north west] {$D$};
\draw (5.34,3.05) node[anchor=north west] {$a$};
\draw (7.54,4.78) node[anchor=north west] {$b$};
\draw (6.12,4.9) node[anchor=north west] {$c$};
\draw (9.06,4.86) node[anchor=north west] {$h$};
\draw (7.86,3.05) node[anchor=north west] {$p$};
\draw [line width=1.0pt,dotted] (9.,3.52)-- (8.58,3.52);
\draw [line width=1.0pt,dotted] (8.58,3.52)-- (8.6,3.);
\end{tikzpicture}
\end{document}
我想将文本的起始位置设置为左侧的 tikzpicture 代码,并将 tikzpicture 设置为该文本的右侧。但我不知道如何设置。
答案1
为了使代码编译,我必须注释掉这一行:
\backgroundsetup{contents=\includegraphics{Capture}}
这是原始输出,减去您所考虑的任何背景:
以下是使用@JohnKormylo 提到的 paracol 包修改后的文件:
\documentclass[11pt]{book}
\usepackage[paperheight=9.5in,paperwidth=7.5in, top=1in,
bottom=0.8in]{geometry} \setlength{\columnseprule}{0.4pt}
\usepackage{amssymb,amsfonts} \usepackage{mathrsfs}
\usepackage[centertags]{amsmath} \usepackage{amsthm}
\usepackage{amsmath} \newtheorem{theorem}{Theorem} \usepackage{epsfig}
\usepackage{float}
\usepackage{paracol}
\usepackage{graphicx}\graphicspath{{Graphics/}} \usepackage{mathptmx}
\usepackage[square,sort&compress]{natbib}
\usepackage{pgf,tikz,pgfplots} \pgfplotsset{compat=1.15}
\usetikzlibrary{arrows} \usepackage[T1]{fontenc}
\usepackage{fancyhdr}\pagestyle{fancy} \usepackage{xcolor}
\usepackage{setspace} \usepackage{booktabs}
% \usepackage{fourier}
\usepackage[scale=0.75,opacity=0.5,color=black, angle=-45]{background}
% \backgroundsetup{contents=\includegraphics{Capture}}
\usepackage{enumitem} \setlist[enumerate,2]{label=(\roman*).}
\usepackage{tasks} \settasks{label=$\circ$} \usepackage{tikz}
\usetikzlibrary{fit, tikzmark} \tikzset{FIT/.style = { draw=black,
thick, inner sep=2pt, rounded corners, fit=#1, node contents={}},
s/.style= {inner xsep=6pt} }
% \usepackage{hyperref}
\usetikzlibrary{arrows.meta} \renewcommand{\baselinestretch}{1.5}
\newcommand\aug{\fboxsep=-\fboxrule\!\!\!\fbox{\strut}\!\!\!}
\newcommand{\tarc}{\mbox{\large$\frown$}}
\newcommand{\arc}[1]{\stackrel{\tarc}{#1}}
\theoremstyle{definition} \newtheorem{Thm}{Theorem}[section]
\newtheorem{lem}[Thm]{Lemma} \newtheorem{pro}[Thm]{Proposition}
\newtheorem{de}[Thm]{Definition} \newtheorem{re}[Thm]{Remark}
\newtheorem{ex}[Thm]{Example} \newtheorem{cor}[Thm]{Corollary}
\numberwithin{equation}{section}
\definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
\begin{document}
% \begin{paracol}{2}
\textbf{Given:} In $\triangle ABC, \angle C$ is the obtuse angle. Let
$m\overline{BC}=a, m\overline{AC}=b$ and $m\overline{AB}=c.$
$\overline{AD}$ is the perpendicular from $A$ to $\overline{BC}$ so
that $\overline{CD}$ is projection of $\overline{AC}$ on
$\overline{BC}.$ Let $m\overline{CD}=p$ and $m\overline{AD}=h.$
% \switchcolumn
\begin{tikzpicture}[line cap=round,line join=round,>=triangle
45,x=1.0cm,y=1.0cm]
\clip(3.8,2.5) rectangle (9.4,6.4); \draw [line width=1.0pt]
(4.,3.)-- (7.,3.); \draw [line width=1.0pt] (7.,3.)-- (9.,6.); \draw
[line width=1.0pt] (9.,6.)-- (4.,3.); \draw [line
width=1.0pt,dotted] (7.,3.)-- (9.,3.); \draw [line
width=1.0pt,dotted] (9.,3.)-- (9.,6.); \draw [shift={(7.,3.)},line
width=1.0pt]
plot[domain=0.9827937232473287:3.141592653589793,variable=\t]({1.*0.6212642197722569*cos(\t
r)+0.*0.6212642197722569*sin(\t r)},{0.*0.6212642197722569*cos(\t
r)+1.*0.6212642197722569*sin(\t r)}); \draw (8.84,6.5)
node[anchor=north west] {$A$}; \draw (3.84,3.05) node[anchor=north
west] {$B$}; \draw (6.8,3.05) node[anchor=north west] {$C$}; \draw
(8.78,3.1) node[anchor=north west] {$D$}; \draw (5.34,3.05)
node[anchor=north west] {$a$}; \draw (7.54,4.78) node[anchor=north
west] {$b$}; \draw (6.12,4.9) node[anchor=north west] {$c$}; \draw
(9.06,4.86) node[anchor=north west] {$h$}; \draw (7.86,3.05)
node[anchor=north west] {$p$}; \draw [line width=1.0pt,dotted]
(9.,3.52)-- (8.58,3.52); \draw [line width=1.0pt,dotted]
(8.58,3.52)-- (8.6,3.);
\end{tikzpicture}
% \end{paracol}
以下是修改后的文件的输出: