如何调整 itemize 和 enumerate 环境以获得较小的左边距?

如何调整 itemize 和 enumerate 环境以获得较小的左边距?

我使用这个模板,但是 item 和 itemize 的左边距太大了,如果我在幻灯片中插入图形,看起来就像这样

在此处输入图片描述

    \documentclass[dvipsnames,mathserif]{beamer}
    \setbeamertemplate{footline}[frame number]
    \setbeamercolor{footline}{fg=black}
    \setbeamerfont{footline}{series=\bfseries}
    \usepackage{tikz}
    \usepackage{graphicx}
    %\usetheme{Frankfurt}%1
    \usetheme{Darmstadt}%1
    \usepackage{multicol}
    % for RTL liste
    \makeatletter
    \newcommand{\RTListe}{\raggedleft\rightskip\leftm}
    \newcommand{\leftm}{\@totalleftmargin}
    \makeatother
    
    % RTL frame title
    \setbeamertemplate{frametitle}
    {\vspace*{-1mm}
      \nointerlineskip
        \begin{beamercolorbox}[sep=0.3cm,ht=2.2em,wd=\paperwidth]{frametitle}
            \vbox{}\vskip-2ex%
            \strut\hskip1ex\insertframetitle\strut
            \vskip-0.8ex%
        \end{beamercolorbox}
    }
    % align subsection in toc
    \makeatletter
    \setbeamertemplate{subsection in toc}
    {\leavevmode\rightskip=5ex%
      \llap{\raise0.1ex\beamer@usesphere{subsection number projected}{bigsphere}\kern1ex}%
      \inserttocsubsection\par%
    }
    \makeatother
    
    % RTL triangle for itemize
    \setbeamertemplate{itemize item}{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths$\blacktriangleleft$}} 
    
    %\setbeamertemplate{itemize item}{\rule{4pt}{4pt}}
    
    \defbeamertemplate{enumerate item}{square2}
    {\LR{
        %
        \hbox{%
        \usebeamerfont*{item projected}%
        \usebeamercolor[bg]{item projected}%
        \vrule width2.25ex height1.85ex depth.4ex%
        \hskip-2.25ex%
        \hbox to2.25ex{%
          \hfil%
          {\color{fg}\insertenumlabel}%
          \hfil}%
      }%
    }}
    
    \setbeamertemplate{enumerate item}[square2]
    \setbeamertemplate{navigation symbols}{}
    
    
    \titlegraphic { 
    \begin{tikzpicture}[overlay,remember picture, opacity=0.1,]
    \node[] at (0, 5){
        \includegraphics[width=0.63\textwidth]{Conference Logo.png}
    };\end{tikzpicture}}
    \setbeamertemplate{caption}[numbered]
    \setbeamertemplate{itemize/enumerate body begin}{\vspace{-0.5ex}\leftskip=1ex}

\begin{frame}
\maketitle
\end{frame}

\begin{frame}{Summary} 
\footnotesize \tableofcontents 
\end{frame}

\section{Introduction}

\begin{frame}{Motivation}
\scriptsize
\begin{columns}
\begin{column}{0.5\textwidth}
\begin{itemize} [<+-| alert@+>]

\scriptsize
\item Curved beams are popular structural elements in various engineering fields
\begin{itemize}
\item They offer high stiffness-to-weight ratio, making them an efficient choice for load-bearing structures
\item they provide esthetic appeal and enable the creation of complex, free-form shapes in architectural designs
\item Their ability to distribute loads efficiently and resist bending moments makes them suitable for applications such as bridges, roofs, and aircraft structures
\end{itemize}

\item Curved beams often experience large deformations under various loading conditions, necessitating the use of nonlinear analysis calculation.
\item Developing accurate and efficient nonlinear beam elements for large deformation is challenging
\begin{itemize}
\item Capturing the accurate response of curved beams under large deformations is crucial for ensuring the safety and reliability of structures
\item Developing efficient and accurate nonlinear beam elements poses significant challenges due to the complex nature of the problem
\end{itemize}
\end{itemize}
\end{column}
\begin{column}{0.5\textwidth}
\includegraphics[width=\textwidth]
{curved2.jpg}
\end{column}
\end{columns}
\end{frame}

答案1

  • document缺少环境

  • mathserif选项已过时,请使用\usefonttheme[onlymath]{serif}。日志文件中的警告会告诉您这一点。请不要忽略警告。

  • 你不需要加载graphicx,beamer 会自动完成

  • 加载multicol。Beamer 有自己的列机制

  • 如果你更改了第一级项目的字体大小,你也应该更改第二级(和第三级)项目的字体大小

  • 将整个框架设置为两列会浪费大量空间

  • 如果您要向观众展示一张包含如此多文字的幻灯片,请再考虑一下。

...然后对于您实际询问的内容:您可以使用等更改项目的左边距\setlength{\leftmargini}{0cm}


\documentclass[dvipsnames]{beamer}
\usefonttheme[onlymath]{serif}

%\usepackage{graphicx}
\usetheme{Darmstadt}%1
%\usepackage{multicol}

% RTL triangle for itemize
\setbeamertemplate{itemize item}{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths$\blacktriangleleft$}} 
\setbeamertemplate{navigation symbols}{}

\setlength{\leftmargini}{0cm}
\setlength{\leftmarginii}{0.5cm}

\begin{document}

\begin{frame}
\frametitle{Motivation}
\setbeamerfont{itemize/enumerate body}{size=\scriptsize}
\setbeamerfont{itemize/enumerate subbody}{size=\scriptsize}
\begin{itemize}[<+-| alert@+>]
\item Curved beams are popular structural elements in various engineering fields
\begin{itemize}
\item They offer high stiffness-to-weight ratio, making them an efficient choice for load-bearing structures
\item they provide esthetic appeal and enable the creation of complex, free-form shapes in architectural designs
\item Their ability to distribute loads efficiently and resist bending moments makes them suitable for applications such as bridges, roofs, and aircraft structures
\end{itemize}

\item Curved beams often experience large deformations under various loading conditions, necessitating the use of nonlinear analysis calculation.
\item Developing accurate and efficient nonlinear beam elements for large deformation is challenging
\end{itemize}
\vskip-.5\baselineskip
\begin{columns}[onlytextwidth,T]
\begin{column}{0.5\textwidth}
\begin{itemize}
\item[] 
\begin{itemize}[<+-| alert@+>]
\item Capturing the accurate response of curved beams under large deformations is crucial for ensuring the safety and reliability of structures
\item Developing efficient and accurate nonlinear beam elements poses significant challenges due to the complex nature of the problem
\end{itemize}
\end{itemize}
\end{column}
\begin{column}{0.5\textwidth}
\includegraphics[width=\textwidth]
{example-image-duck}
\end{column}
\end{columns}
\end{frame}
\end{document}

在此处输入图片描述

相关内容