想要在页边空白处添加一个图形。没有\centering
图形时,图形在左边,标题向右移动,甚至无法完全看到。\centering
添加图形时,图形向右移动,标题粘贴在那里。我该如何解决这个问题?
\leavevmode\marginpar{
\begin{figure}[H]
%\centering
\includegraphics[scale=0.1]{ThiSulfat2D.png}
\caption{Thiosulfat, \ch{(S2O^{2-}3)}}
\label{fig4}
\end{figure}
}
我的序言
\documentclass[a4paper,10pt,fleqn,reqno]{article}
\usepackage{parskip}
\usepackage{geometry}
\geometry{
textwidth = 280pt,
marginparwidth=178pt,
marginparsep = 40pt,
lmargin = 90pt
}
\usepackage{multicol}
\setlength{\columnsep}{0.9cm}
\usepackage{supertabular}
\usepackage[utf8]{inputenc}
\usepackage{wrapfig}
\usepackage{subfigure}
\usepackage{float}
\usepackage[swedish]{babel}
\usepackage{hyperref}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black,
pdfborder = {0 0 0}
}
\usepackage{enumitem}
\usepackage{verbatimbox}
\usepackage{fancyvrb}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage[leqno]{amsmath}
\usepackage{listings}
\usepackage{tikz}
\usepackage{cancel}
\usepackage{steinmetz}
\newcommand*\mycirc[1]{%
\begin{tikzpicture}[baseline={(0,-0.1)}]
\node[draw,circle,inner sep=1pt] {#1};
\end{tikzpicture}}
\usepackage{graphicx}
\usepackage{caption}
\captionsetup{
font=small,
labelfont=bf,
tableposition=top
}
\usepackage{chemfig}
\usepackage{chemformula}
%\usepackage{chemmacros}
%\chemsetup{modules=all}
\usepackage{elements}
\usepackage{mathtools}
\usepackage{tabularx}
\usepackage{marginnote}
\usepackage{layout}
答案1
不太清楚您的问题是什么。也许以下 MWE 给出了所寻找的内容:
\documentclass[a4paper,10pt,fleqn,reqno]{article}
\usepackage[textwidth = 280pt,
marginparwidth=178pt,
marginparsep = 40pt,
lmargin = 90pt
]{geometry}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{chemfig}
\usepackage{chemformula}
\usepackage{graphicx}
\usepackage[font=small,
labelfont=bf,
tableposition=top
]{caption}
\usepackage{lipsum}
\begin{document}
\leavevmode\marginpar{
\centering
\includegraphics[width=\linewidth]{example-image-duck}
\captionof{figure}{Thiosulfat, \ch{(S2O^{2-}3)}}
\label{fig4}
}
\lipsum[1-3]
\end{document}
(红线表示页面布局)