also maybe related:
texdoc tkzexamplealso maybe related:
texdoc tkzexample很有趣的问题...
不知是否如此?
\documentclass[fontset=fandol]{ctexart}
\usepackage[scale=.85,centering,showframe]{geometry}
% https://tex.stackexchange.com/a/231860/322482
\newcounter{mypara}
\AtBeginDocument{\everypar{\refstepcounter{mypara}}}
\newcounter{noteinpar}[mypara]
\NewDocumentCommand{\noteinpar}{ m m }{%
\refstepcounter{noteinpar}%
\textbf{#1}\,\ignorespaces%
% ${}^{\refstepcounter{noteinpar}\thenoteinpar}$%
% \textsuperscript{\thenoteinpar}%
\textsuperscript{\arabic{noteinpar}}%
{\fangsong(#2)}%
}
\begin{document}
劳仑衣\noteinpar{普}{桑},认至将指点效\noteinpar{则}{机},最你\noteinpar{更}{枝}。想极整月正进好志次回总般,段然取向使张规军证回,世市总李率英茄持伴。用阶千样响领交出,器程办管据家元写,名其直金团。化达书据始价算每百青,金低给天济办作照明,取路豆学丽适市确。
如提单各样备再成农\noteinpar{各}{政},设头律走克美技\noteinpar{说}{没},体交才路此\noteinpar{在}{杠}。响育油命转处他住有,一须通给对非交矿今该,花象更面据压来。与花断第然调,很处己队音,程承明邮。常系单要外史按机速引也书,个此少管品务美直管战,子大标蠢主盯写族般本。农现离门亲事以响规,局观先示从开示,动和导便命复机李,办队呆等需杯。见何细线名必子适取米制近,内信时型系节新候节好当我,队农否志杏空适花。又我具料划每地,对算由那基高放,育天孝。派则指细流金义月无采列,走压看计和眼提问接,作半极水红素支花。果都济素各半走,意红接器长标,等杏近乱共。层题提万任号,信来查段格,农张雨。省着素科程建持色被什,所界走置派农难取眼,并细杆至志本。
\end{document}
...
既然你的问题是:
请问除了用raisebox使文本和图片垂直居中外,还有其它方法吗?
自行学习总结吧...
P.S.最好把效果图以「图片」形式贴上去而不是仅以「.PDF」的形式,可方便别人直接在网页上查看。
maybe related:
矛盾点在于:
\left\{和\right.」要被视为一个整体equation x」与「a,b,c」要被视为两个(列)部分不是很优雅的做法,并没有解决上面的矛盾,借助了tag...
\documentclass[12pt]{ctexart}
\usepackage{showframe}
\usepackage{amsmath,amsfonts}
\usepackage{empheq}
\usepackage{lipsum}
\usepackage{mathtools}
\begin{document}
balabala
\begin{equation}
a^2+b^2=c^2
\end{equation}
\lipsum[2]
\newtagform{myempty}{}{}
\usetagform{myempty}
\begin{empheq}[left=\empheqlbrace]{align}
a^2+b^2=c^2, \tag{a} \\
a^2+b^2=c^2, \tag{b} \\
a^2+b^2=c^2, \tag{c}
\end{empheq}
\usetagform{default}%
\lipsum[2]
\begin{equation}
a^2+b^2=c^2
\end{equation}
\end{document} 或者更优雅一点写成:
\documentclass[12pt]{ctexart}
\usepackage{showframe}
\usepackage{amsmath,amsfonts}
\usepackage{empheq}
\usepackage{lipsum}
\usepackage{mathtools}
\newtagform{myempty}{}{}
\AddToHook{env/empheq/before}{\usetagform{myempty}}
\AddToHook{env/empheq/after}{\usetagform{default}}
\begin{document}
balabala
\begin{equation}
a^2+b^2=c^2
\end{equation}
\lipsum[2]
\begin{empheq}[left=\empheqlbrace]{align}
a^2+b^2=c^2, \tag{a} \\
a^2+b^2=c^2, \tag{b} \\
a^2+b^2=c^2, \tag{c}
\end{empheq}
\lipsum[2]
\begin{equation}
a^2+b^2=c^2
\end{equation}
\end{document} 
请提供一份能体现你问题的完整代码。
\documentclass开始到\end{document}结束就是使用之后所有段都没有了缩进
\documentclass{article}
\usepackage{tcolorbox}
\usepackage{lipsum}
\newtcolorbox{graypara}{
colback=gray!20,
colframe=white,
boxrule=0pt,
left=5pt, right=5pt,
top=3pt, bottom=3pt,
arc=2pt,
before=\par\noindent,
after=\par\noindent
}
\begin{document}%
\lipsum[2]
\begin{graypara}%
\noindent hour = int(input('Please enter the current hour from 0 to 23: '))
\noindent if hour < 12:
\hangindent=4em
print('Good morning!')
print('Have a nice day.')
\noindent elif hour < 18:
print('Good afternoon!')
\noindent else:
print('Good evening!')
\noindent print('Have a good night.')
\end{graypara}% %注意这里后面的空行
\lipsum[2]
\end{document}这将得到:

其实是有缩进的。
你在设置中写到:
before=\par\noindent,
after=\par\noindent,前者可以让你的整个盒子不缩进,而后者直接让你的盒子后的下一段不缩进(如果你不用空行表示新的一段的话)...
另外,你不需要写那么多的\noindent,似乎也不应该写\hangindent=4em,另外,如果要实现「代码盒子」,你可以看一下文档里的tcblistings环境,最好使用等宽字体。
我不知道你的最终目标是什么(你可以做补充),但我如果是我的话,我会修改成:
\documentclass{article}
\usepackage{showframe}
\usepackage{tcolorbox}
\tcbuselibrary{listings}
\usepackage{lipsum}
\newtcblisting{graypara}{
listing only,
colback=gray!20,
colframe=white,
boxrule=0pt,arc=2pt,
left=5pt, right=5pt,
top=3pt, bottom=3pt,
before=\par\noindent,
after=\par,
}
\begin{document}%
\lipsum[2]
% 注意tcblistings中的代码会与你源代码中的缩进保持一致
\begin{graypara}
hour = int(input('Please enter the current hour from 0 to 23: '))
if hour < 12:
print('Good morning!')
print('Have a nice day.')
elif hour < 18:
print('Good afternoon!')
else:
print('Good evening!')
print('Have a good night.')
\end{graypara}
\lipsum[2]
\lipsum[2]
\end{document}
我希望用pgfkeys构造一个绘图命令:\mydraw,为了简化问题,它只带一个键值对:color = <line color>, 但我希望它还允许其他的 "\draw的参数" (键值对)加入。以下是它的定义过程:
总觉得上面的实现是为了用pgfkeys而用,而从整体思路来看有些许绕...
我个人觉得更直接的方式是:
\documentclass[tikz,border=5pt]{standalone}
\tikzset{
mycmd/.style={
color=black,#1
}
}
\newcommand{\mydraw}[1][]{%
\draw[mycmd={#1}] (0,0) -- (2,0);
}
\begin{document}
\begin{tikzpicture}
\mydraw[color=blue, line width=1mm]
\begin{scope}[yshift=-0.5cm]
\mydraw[line width=2pt, ->, rounded corners, magenta]
\end{scope}
\begin{scope}[yshift=-1cm]
\mydraw[<-latex,semithick]
\end{scope}
\end{tikzpicture}
\end{document}或者展开\tikzset的定义:
\documentclass[tikz,border=5pt]{standalone}
\pgfkeys{
tikz/.cd,
mycmd/.style={
color=black,#1
}
}
\newcommand{\mydraw}[1][]{%
\draw[mycmd={#1}] (0,0) -- (2,0);
}
\begin{document}
\begin{tikzpicture}
\mydraw[color=blue, line width=1mm]
\begin{scope}[yshift=-0.5cm]
\mydraw[line width=2pt, ->, rounded corners, magenta]
\end{scope}
\begin{scope}[yshift=-1cm]
\mydraw[<-latex,semithick]
\end{scope}
\end{tikzpicture}
\end{document}
我个人认为是不需要的。
If Elsevier wanted a particular format, surely their document class should implement it. Depending on their workflow it may actually be counterproductive to introduce the (unquestionably) required additional markup commands for the links as they may throw off tools that parse the TeX source.
慕子老师有过这样一个评论(但我一时找不到了)
文章投稿时的样式和文章发表出来的样式不同是很正常的,按照「模板的说明文档」使用即可
啸行老师也提到过
你别学 elsevier 家正式刊登的论文……
综上,这个需求对于「投稿者」来说是不必须的。
我假定你是在使用 CTAN 上最新的「cas-dc」文档类来实现类似的排版。其中指出:

其模板自带的示例的效果也不需要「将超链接设置为蓝色的可点击形式」

因此该问题基本可以视为"伪需求"...
elegantbook-cn 默认的后端是biber而不是bibtex

所以你需要的编译命令是:
xelatex-biber-xelatex-xelatex (不是bibtex)
或者
latexmk -pdfxe
也许可行的方法:
1.打开终端
2.输入latexmk -C回车
3.输入latexmk -pdfxe mathmode回车
理论上不应该有问题...(只要你的文件没大问题....)
如果你对上面的知识感到困惑,十有八九是没有仔细阅读过lshort-zh-cn的6.1节....
建议你仔细阅读,区分好下面两套不同「参考文献」方案的区别:
bibtexbiblatex与biber再结合上面的文档信息做理解。
如果用默认的bibend=biber,那么你需要xe-biber-xe-xe
如果你用bibend=bibtex,那么你需要xe-bibtex-xe-xe(但后者的功能会受到一定的限制...)
maybe related: https://tex.stackexchange.com/questions/142296/tikz-tree-fork-down-edge-labels
但我看不太懂....
在tikz-ext库中有很方便的<spec>:|-|和-|-等

\documentclass[border=2pt,tikz]{standalone}
\usetikzlibrary{trees,ext.paths.ortho}
\tikzset{
every node/.style={draw,inner sep=2pt},
level/.style={level distance=1.5cm},
level 1/.style={sibling distance=4.5cm},
level 2/.style={sibling distance=2cm}
}
\begin{document}
\begin{tikzpicture}
\node (A) {A}
[edge from parent fork down]
child {node (A1) {A.1}
child {node {A.1.1}}
child {node {A.1.2}}
}
child {node {A.2}
child {node {A.2.1}}
child {node {A.2.2}}
}
;
\path[magenta,draw] (A1.north) |-| (A.south)
node[pos=.25] {.25}
node[pos=.5] {.5}
node[pos=.75] {.75}
node[pos=.875] {.875}
coordinate[pos=.875] (P)
;
\node[inner sep=0pt,circle,pin=above right:P] at (P) {};
\end{tikzpicture}
\end{document}
这个模板的文件没有跟上时代...
(1)删去WileyNJDv5.cls中的usepackage{etex}以及\reserveinserts{28}
根据这个链接,这两个宏包在当下已经完全过时....
You should remove it. – Ulrike Fischerit is not useful even with pdflatex on any system released since 2015. – David Carlisle
有「Ulrike Fischer」和「David Carlisle」做背书,这么做是稳健的、妥当的、合理的😀
% WileyNJDv5.cls Line 356
% \usepackage{etex}% 注释这一行
% \reserveinserts{28}% 注释这一行
% included etex package and \reserveinserts{...} to avoid no room for \newinserts, \newcounts or \newskips etc.
\RequirePackage{graphicx,multicol}%
\RequirePackage{multirow}%(2)根据这个链接,注意到需要特定版本的listings宏包,自行补充到根目录即可,或者如果不需要插入listings...那么断舍离,注释去\usepackage{listings}
% wileyNJDv5_AMA.tex Line 6821
\usepackage{algorithm, algorithmicx, algpseudocode}
% \usepackage{listings}%% 注释这一行
\usepackage{alltt}%同时注释去wileyNJDv5_AMA.tex中的
% wileyNJDv5_AMA.tex Line 664
% \begin{lstlisting}[caption={Descriptive caption text},label=DescriptiveLabel, basicstyle=\fontsize{8}{10}\selectfont\ttfamily]
% for i:=maxint to 0 do
% begin
% { do nothing }
% end;
% Write('Case insensitive ');
% WritE('Pascal keywords.');
% \end{lstlisting}若如此做,在TL2025下使用latexmk -pdfxe wileyNJDv5_AMA.tex编译主文件wileyNJDv5_AMA.tex可以顺利编译得到:




当然,关于这份模板,一切使用务必严格按照Author-guideline_Wiley.pdf。

基于慕子老师的这个回答,不借助任何已有的轮子(如borderline等),基于subskin可以把整个边框路径视为一个整体,可以有如下的实现:
\documentclass{article}
\usepackage[papersize={15cm, 6cm}, margin=.3in]{geometry}
\usepackage{lipsum}
\usepackage{tcolorbox}
\tcbuselibrary{breakable, skins, theorems}
\tikzset{
mybox frame/.style={
tcbcolframe, line width=1.5pt, line cap=round
}
}
\tcbsubskin{mybox}{empty}{
frame engine=path,
enlarge top by=1ex,
fonttitle=\bfseries\Large\sffamily,
% make title another tcolorbox, in natual width
attach boxed title to top left={
xshift=3em,
yshift=-\tcboxedtitleheight/2+2pt,
yshifttext=-\tcboxedtitleheight/2+2pt
},
boxed title style={
skin=empty,
% frame code={
% \draw[red] (frame.north west) rectangle (frame.south east);
% }
},
% frame code specific for unbroken boxes
frame code={
\draw[mybox frame]
([yshift=-2pt]title.west) -| (frame.south west) -| (frame.north east)
([yshift=-2pt]title.east) -- ++(3em,0)
;
},
% frame code for broken boxes
skin first is subskin of={emptyfirst}{
frame code={
\draw[mybox frame]
([yshift=-2pt]title.west) -| (frame.south west)
(frame.south east) -- (frame.north east)
([yshift=-2pt]title.east) -- ++(3em,0)
;
}
},
skin middle is subskin of={emptymiddle}{
frame code={
\draw[mybox frame]
(frame.north east) -- (frame.south east)
(frame.north west) -- (frame.south west);
}
},
skin last is subskin of={emptylast}{
frame code={
\draw[mybox frame]
(frame.north east)
-- (frame.south east)
-- (frame.south west)
-- (frame.north west);
}
}
}
\NewTColorBox[
auto counter,
number within=chapter
]{mytcbbox}{O{black}m}{
breakable,
skin=mybox,
colframe=#1,
coltitle=#1,
title=#2,
}
\begin{document}
\section{Using subskin, unbroken box}
\begin{mytcbbox}{This is a theorem}
\lipsum[1][1-5]
\end{mytcbbox}
\section{Using subskin, broken box}
\begin{mytcbbox}[violet]{This is another theorem}
\lipsum[1-2]
\end{mytcbbox}
\end{document}
至于\Cref或者\Doubleref的问题,不是本问题的重点,应该开新的提问。
0.作为例子,请用example-image而不是photo/层次分析法图1.jpg
前者在每个安装了TL的电脑上都有,后者只有你有
1.读一下lshort-zh-cn

默认是t-b-p
2.你可以试着显式写为h:
\documentclass{article}
\usepackage{showframe}
\usepackage{graphicx}
\usepackage{ctex}
\title{层次分析法暑期练习}
\author{qiao xinkai}
\date{\today}
\begin{document}
\maketitle
\section{模型建立}
\subsection{建立系统的递阶层次结构}
\begin{figure}[h]
\centering
\includegraphics[width=1.2\textwidth,height=0.9\textwidth]{example-image}
\caption{图1.1.饲养地选择层次结构图}
\label{fig:cengci}
\end{figure}
\end{document}
3.可以试着调一下图片高度
\documentclass{article}
\usepackage{showframe}
\usepackage{graphicx}
\usepackage{ctex}
\title{层次分析法暑期练习}
\author{qiao xinkai}
\date{\today}
\begin{document}
\maketitle
\section{模型建立}
\subsection{建立系统的递阶层次结构}
\begin{figure}[h]
\centering
\includegraphics[width=1.2\textwidth,height=.85\textwidth]{example-image}
\caption{图1.1.饲养地选择层次结构图}
\label{fig:cengci}
\end{figure}
\end{document}
P.S. showframe是为了显示页面layout,进一步说明「位置不够」....
在命令行输入:
texdoc mpfonts这将得到:
mpfonts
Maintained by Daniel Benjamin Miller
January 30, 2020
***
The Computer Modern fonts are available in Type 1 format, but these renditions
are somewhat thin and spindly, and produce much lighter results than the
originals. It is alternatively possible to use METAFONT bitmaps, but this has
its disadvantages in comparison with vector fonts.
These fonts are conversions to Type 3 fonts, done entirely in METAPOST;
they are vector fonts which are a direct conversion from the original METAFONT
files, so they are the design most authentic to the originals.
However, these fonts, because they are PostScript Type 3 fonts, are not
suitable for on-screen reading, and should probably only be used for printing.
In order to produce a document using these fonts, first produce a DVI with
TeX or LaTeX, and then run dvips as follows:
dvips -D 10000 -u +mpfonts.map myfile.dvi
This will output a PostScript file using these fonts. It is recommended to keep
the resolution at 10000 DPI, since this allows for the most accurate glyph
positioning. As the fonts are vector fonts, this will not increase file size
in comparison with lower DPI settings.
***
The following font sets are supported:
* Computer Modern (cm)
* LaTeX fonts (latex-fonts)
* Frege symbols (fge)
* Extra logic symbols (cmll)
* Fraktur (cmfrak)
* AMS fonts (amsfonts)
* IPA (tipa)
Note that the T1 encoding is not directly supported. When using this package,
use the classic OT1 encoding (this is the default encoding, and will be used
unless you choose to change it).丢进AI:
mpfonts
由 Daniel Benjamin Miller 维护
2020年1月30日
***
Computer Modern 字体虽提供 Type 1 格式,但这些版本略显纤细单薄,输出效果较原版更为轻淡。虽然也可使用 METAFONT 点阵字体,但与矢量字体相比存在固有缺陷。
本套字体通过 METAPOST 完全转换为 Type 3 格式,是从原始 METAFONT 文件直接转换的矢量字体,因此最大程度保留了原版的设计精髓。
需要注意的是,由于采用 PostScript Type 3 格式,这些字体不适合屏幕阅读,建议仅用于印刷场景。
使用步骤:
1. 先用 TeX 或 LaTeX 生成 DVI 文件
2. 执行以下 dvips 命令:`dvips -D 10000 -u +mpfonts.map myfile.dvi`
将生成采用本字体的 PostScript 文件。推荐保持 10000 DPI 分辨率以确保字形定位精确。由于是矢量字体,较高分辨率不会导致文件体积增大。
***
支持以下字体集:
* Computer Modern (cm)
* LaTeX fonts (latex-fonts)
* Frege symbols (fge)
* Extra logic symbols (cmll)
* Fraktur (cmfrak)
* AMS fonts (amsfonts)
* IPA (tipa)
特别说明:本包不直接支持 T1 编码,使用时请采用经典 OT1 编码(此为默认编码,除非手动更改)。所谓type3字体是该怎么用啊
此事在「使用步骤」中亦有说明....
\documentclass{standalone}
\usepackage{tkz-base}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}[scale=1.2]
% ===== 1. 绘制平面直角坐标系 =====
\tkzInit[xmin=-3, xmax=5, ymin=-3, ymax=2]
\tkzGrid[color=gray!30, line width=0.5pt]
\tkzLabelX[orig=false, below=8pt]
\tkzLabelY[orig=false, left=8pt]
\tkzDrawXY[noticks, >=latex]
% ===== 2. 定义并标记点P(1,1)、点A(0,-2) =====
\tkzDefPoints{1/1/P, 0/-2/A, 0/0/O}
\tkzDrawPoints[fill=blue, size=4](P,A)
\tkzLabelPoints[above right](P)
\tkzLabelPoints[below left](A,O)
% ===== 3. 在x轴正半轴找点B满足 PA = PB =====
\tkzDefPoints{0/0/O,4/0/X}
\tkzInterLC(O,X)(P,A) % 圆与x轴的交点
\tkzGetPoints{C}{B} % 获取两个交点(取正半轴的点)
\tkzDrawPoint[fill=red, size=4](B)
\tkzLabelPoint[above](B){$B$}
% ===== 4. 连接线段并添加标注 =====
\tkzDrawSegments[thick](P,A P,B)
\end{tikzpicture}
\end{document}
享受看着文档一步步学东西的乐趣,而不是全部丢进AI,得到一份(可能)有多处暗病的回答,当一份代码里有3~5个bug,你修起来的时间成本并不比自己读文档低....
问 如何实现 pgfmanual(pgf-tikz 官方手册)中代码与结果共存的效果('side-by-side' code examples)