烟华幻梦
烟华幻梦
数学系咸鱼一枚!

注册于 1 year ago

回答
4
文章
1
关注者
2

好的,我马上改,主要是抄的外国人的代码,所以可能问题很多-_-!!

\documentclass[fontset=ubuntu]{ctexart}
\usepackage{graphicx,tabularray,subfig}
\usepackage[export]{adjustbox}
\usepackage[margin=1cm]{geometry}
\usepackage{xcolor}
\usepackage{alphalph}

\renewcommand*{\thesubfigure}{(\thefigure.\arabic{subfigure})}
\renewcommand*{\thesubfigure}{%
\alphalph{\value{subfigure}}%
}%
\begin{document}
\begin{figure}[htbp]
       \centering
\subfloat[fig1][]{\begin{tblr}{width=.3\textwidth,colspec={Q[l,t]X[l,t]},column{2}={font=\small},cell{Z}{1}={c=2}{c},row{Z}={gray7},columns={leftsep=0pt}}
       
\subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}} \label{fig:sub1}
    & Lorem ipsum dolor sit amet, consectetur \\[-2ex]
\subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}}\label{fig:sub2}
        & Lorem ipsum dolor sit amet, consectetur \\
        Fig 1 Test & \\
       \end{tblr}}
       \hfill 
       \subfloat[fig2][]{\begin{tblr}{width=.3\textwidth,colspec={Q[l,t]X[l,t]},column{2}={font=\small},cell{Z}{1}={c=2}{c},row{Z}={gray7},columns={leftsep=0pt}}
       \subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}} 
    & Lorem ipsum dolor sit amet, consectetur \\[-2ex]
       \subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}}
        & Lorem ipsum dolor sit amet, consectetur \\
        Fig 1 Test & \\
       \end{tblr}}
       \hfill 
       \subfloat[fig3][]{\begin{tblr}{width=.3\textwidth,colspec={Q[l,t]X[l,t]},column{2}={font=\small},cell{Z}{1}={c=2}{c},row{Z}={gray7},columns={leftsep=0pt}}
       \subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}} 
    & Lorem ipsum dolor sit amet, consectetur \\[-2ex]
       \subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}}
        & Lorem ipsum dolor sit amet, consectetur \\
        Fig 1 Test & \\
       \end{tblr}}
       \hfill 
       \subfloat[fig4][]{\begin{tblr}{width=.3\textwidth,colspec={Q[l,t]X[l,t]},column{2}={font=\small},cell{Z}{1}={c=2}{c},row{Z}={gray7},columns={leftsep=0pt}}
       \subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}} 
    & Lorem ipsum dolor sit amet, consectetur \\[-2ex]
       \subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}}
        & Lorem ipsum dolor sit amet, consectetur \\
        Fig 1 Test & \\
       \end{tblr}}
       \hfill 
       \subfloat[fig5][]{\begin{tblr}{width=.3\textwidth,colspec={Q[l,t]X[l,t]},column{2}={font=\small},cell{Z}{1}={c=2}{c},row{Z}={gray7},columns={leftsep=0pt}}
       \subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}} 
    & Lorem ipsum dolor sit amet, consectetur \\[-2ex]
       \subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}}
        & Lorem ipsum dolor sit amet, consectetur \\
        Fig 1 Test & \\
       \end{tblr}}
       \hfill 
       \subfloat[]{\begin{tblr}{width=.3\textwidth,colspec={Q[l,t]X[l,t]},column{2}={font=\small},cell{Z}{1}={c=2}{c},row{Z}={gray7},columns={leftsep=0pt}}
       \subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}} 
    & Lorem ipsum dolor sit amet, consectetur \\[-2ex]
       \subfloat{\includegraphics[width=.15\textwidth,valign=t]{example-image}}
        & Lorem ipsum dolor sit amet, consectetur \\
        Fig 1 Test & \\
       \end{tblr}}
       \caption{很好}
       \label{fig2111}
\end{figure}
\end{document}

image.png

除了编号不对以外都满足要求了,编号什么原因导致的错乱还不清楚

这里是另一种实现

\documentclass[12pt,oneside]{book}
\usepackage[dvipsnames,svgnames,x11names,table]{xcolor}
\definecolor{nuanbai}{HTML}{F5F5F5}
\pagecolor{nuanbai!20}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage[left=1.5cm,right=1.5cm,top=2cm,bottom=3.3cm,head=18.85004pt]{geometry}
\usepackage[fontset=ubuntu]{ctex}
\usepackage[automark]{scrlayer-scrpage}%页面设置宏包,隶属于koma-script文档类
\usepackage{tikz}
\usetikzlibrary{calc,shadows}
\usepackage[most]{tcolorbox}
\usepackage{fontawesome5}

\makeatletter
\newcommand*\footimage[1]{\def\@footimage{#1}}
\newcommand*\foottext[1]{\def\@foottext{#1}}
\ihead{}
\ohead{}
\chead{}
%%页脚
\ifoot{}
\cfoot{}
\ofoot{\footstyle}
\newlength\tipslen
\setlength\tipslen{13mm}
\setlength\footheight{50pt}
\newcommand{\footstyle}{%
  \begin{tikzpicture}[remember picture,overlay]
    \fill[red!25] 
    ([xshift=1cm]current page.south west) rectangle ([yshift=3cm]current page.south east);
    \fill[red!50] ([xshift=1cm,yshift=1cm]current page.south west) --++(0,2) -- ++(2,0)--cycle;
    \fill[red!50] ([xshift=-2cm]current page.south east) -- ++(2,0) -- ++(0,2)--cycle;
    \node[anchor=west] at ([shift={(1.2,1.5)}]current page.south west){\includegraphics[width=1.8cm,height=2.4cm]{\@footimage}};
    \node[font=\bfseries,text=white,rectangle,rounded corners,fill=red!50] at ([shift={(-0.5,0.5)}]current page.south east){\thepage};
    \node[anchor=north west] at ([shift={(3.5,2.8)}]current page.south west)
    {
      \begin{minipage}{\dimeval{\paperwidth-4.5cm}}
        \textcolor{red!50}{\faBook}\hspace{1em}\tikz[baseline]{\node[anchor=base,rounded corners=2.5pt,text=black,fill=red!50,inner sep=.3mm]{物理学史};}\hspace{1em}\@foottext
      \end{minipage}
    };
  \end{tikzpicture}
}
\makeatother

\begin{document}
\footimage{figures/newton.jpg}
\foottext{爱情既是友谊的代名词,又是我们为共同的事业而奋斗的可靠保证,爱情是人生的良伴,你和心爱的女子同床共眠是因为共同的理想把两颗心紧紧系在一起。\hfill ------ 法拉第}
\section{算法整理}
\newpage
\end{document}






%%---------------------------------------CHAPTER TOC STYLE--------------------------------------%%
\def\ChapterName{ \thecontentslabel}
\titlecontents{chapter}%标题名
            [30pt]%左间距
            {\bf \large\addvspace{1pc}}%标题格式
            {\contentsmargin{0pt}%
            \tikz[overlay] \shade[left color=LightSkyBlue!80,right color=LightSkyBlue!10!white,rounded corners=1pt] (-2.5em,-1ex) rectangle (.95\textwidth,1em);%
            \hspace*{-30pt}\raisebox{-.8ex}{\begin{tikzpicture}[remember picture]
                \node[rectangle, %opacity=.3,
                    text=white,
                    drop shadow={opacity=.3, color=black!40!white,shadow xshift=0.06cm,shadow yshift=-0.06cm},
                    inner sep=1mm,fill=teal,
                    %anchor=west,
                    rounded corners=1pt,
                    font=\normalsize] at (0,0) {\ChapterName};
            \end{tikzpicture}}\hspace*{3pt}%
             \tikz[overlay] \shade[top color=teal!30!white,bottom color=teal!80!white,rounded corners=.3pt] (0,-1ex) rectangle (2.4pt,1em);%
            \hspace*{5pt}%
            }%标题标志
            {}%无序号标题
            {\titlerule*[1000pc]{$\cdot$}\contentspage\hspace*{0cm}\vspace*{.7ex}}  %指引线与页码
%%-----------------------------------------CHAPTER TOC STYLE---------------------------------------%%

发布
问题