这些是我正在使用的软件包:
\usepackage[margin=1in]{geometry}
% use times new roman for main text
\usepackage{fontspec}
\usepackage{graphicx}
\usepackage{wrapfig, framed, caption}
\usepackage{wrapfig}
\usepackage{amssymb,amsthm,amsmath,amsfonts}
\usepackage{tikz}
\usepackage{enumitem}
\setmainfont{Times New Roman}
% use cambria for math
\usepackage{unicode-math}
\setmathfont{[Cambria-Math.ttf]}
% single line spacing
\usepackage{setspace}
\singlespacing
\begin{wrapfigure}{l}{0.4\textwidth}
\begin{framed}
\centering
\scalebox{0.5}{\input{Dukes}}
\caption{Corresponding graphs to combinatorial objects.}
\label{fig:my_label}
\end{framed}
\end{wrapfigure}
有没有办法减少图形上方和下方的空间?
提前致谢!
答案1
您还可以这样做:
\documentclass[10pt,a4paper]{article}
\usepackage{graphicx}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian,ukrainian]{babel}
\usepackage{wrapfig, framed, caption}
\usepackage{lipsum}
\begin{document}
\begin{wrapfigure}{l}{0.5\textwidth}
\centering
\begin{framed}
\includegraphics[width=0.5\textwidth]{example-image-a.png}
\caption{Corresponding graphs to combinatorial objects.}
\label{fig:my_label}
\end{framed}
\vspace{-20pt}%<----- added
\end{wrapfigure}
\lipsum[1-5]
\end{document}
答案2
您可以将其定义为wrapfigure
跨越的文本行数的选项,并将其高度提高到2ex
与第一行文本的顶部对齐:
\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{framed}
\usepackage{wrapfig}
\usepackage{lipsum}
\begin{document}
\begin{wrapfigure}[13]{l}{0.5\textwidth} % <---
\vspace{-2ex} % <---
\begin{framed}
\includegraphics[width=\linewidth]{example-image-duck}
\caption{Corresponding graphs to combinatorial objects.}
\label{fig:my_label}
\end{framed}
\end{wrapfigure}
\lipsum[1]
\end{document}