
私は、AMS 形式の Latex ドキュメント内で画像を algin に表示しようとしています。
\documentclass[10pt,reqno]{amsart}
私の写真はここにあるはずです:
\documentclass[10pt,reqno]{amsart}
\usepackage{pstricks,pst-node,pst-plot,pst-grad}
\usepackage{amssymb,amsfonts,amsmath}
\usepackage{pst-coil}
\usepackage[dvips]{graphicx}
%\usepackage{dsfont}
%\usepackage{graphicx}
%\usepackage{pictex}
%\usepackage{mathrsfs}
\usepackage[colorlinks]{hyperref}
\usepackage{amsmath}
\usepackage{amssymb}
%\usepackage{amsthm}
%\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{booktabs}
\usepackage{tikz-cd}
\usepackage[T1]{fontenc}
\usepackage{color} %May be necessary if you want to color links
\newtheorem{theorem}{{\bf Theorem}}[section]
\newtheorem*{maintheorem}{{\bf Main Theorem}}
\newtheorem{proposition}[theorem]{{\bf Proposition}}
\newtheorem*{proposition*}{{\bf Proposition}}
\newtheorem{definition}[theorem]{{\bf Definition}}
\newtheorem{lemma}[theorem]{{\bf Lemma}}
\newtheorem{lemma*}{{\bf Lemma}}
\newtheorem{notation}[theorem]{{\bf Notation}}
\newtheorem{convention}[theorem]{{\bf Convention}}
\newtheorem{terminology}[theorem]{{\bf Terminology}}
\newtheorem{example}[theorem]{{\bf Example}}
\newtheorem{corollary}[theorem]{{\bf Corollary}}
\newtheorem{remark}[theorem]{{\bf Remark}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% #############################################
%
% Title, Authors, etc
%
% #############################################
\title[ titles]%
{ Homology Structures }
%\subjclass{%
% Primary 52C15; Secondary 30F99, 57M50}
\author[X]{X} %
\date{March 03, 2024}
%\thanks{}
\begin{abstract}
We study
\end{abstract}
\maketitle
\vskip 48pt
\section{Introduction}
\begin{definition}
This is a definition.
\end{definition}
% <Canonical Examples>
\begin{figure}
\begin{center}
\fbox{\includegraphics[width=0.05\textwidth]{IMG_2.jpg}}
\caption{Caption here}
% \label{fig:figure_label}
\end{center}
\end{figure}
\end{document}
しかし、どのように試しても、スケールが大きすぎて中心からずれています。スケール、幅などを繰り返し調整しましたが、効果はありませんでした。スタック上の修正の多くは、私の問題に対処していないようです。ファイル サイズを縮小しましたが、機能していないようです。これを修正する方法はありますか?
編集: fbox を追加しました。また、画像はドキュメント クラスの記事で通常どおり実行されます。これらの問題が発生するのは、このドキュメント クラスで実行された場合のみです。
答え1
\documentclass{article}
\usepackage[dvips]{graphicx}
\begin{document}
\fbox{\includegraphics{example-image.jpg}}
\end{document}
dvips
画像の処理を明示的に指定しています
\usepackage[dvips]{graphicx}
通常はこれを指定せず、システムに最適なオプションを選択させることをお勧めしますが、この場合、他の設定により、latex+dvips が唯一のオプションになります。
あなたはpstricksを持っています:
\usepackage{pstricks,pst-node,pst-plot,pst-grad}
そのため、pdflatex は使用できず、8 ビット フォント設定になっています。
\usepackage[T1]{fontenc}
したがって、lualatex または xelatex は使用できません。
LaTex/dvipsはjpgファイルを含めることができないので、エラーが発生するはずです。
! LaTeX Error: Cannot determine size of graphic in example-image.jpg (no Boundi
ngBox).
例えば.bb
ファイル内や
\includegraphics[bb=0 0 100 100]{example-image.jpg}
すると、LaTeX ではエラーは発生しませんが、JPG ファイルは EPS ファイルであるかのように結果の PostScript にインライン化され、PostScript レンダラーでエラーが発生します。
したがって、出力には画像はまったく表示されません。