这就是LaTeX浮动体的特色,不要尝试去固定"浮动"的图片/表格的位置,在行文中避免使用上图,下表等方式来指代,而改用图3.1,表1-2的方式来指代。
同时,强烈不建议使用float宏包的H参数来实现,有可能出现出乎意料的排版结果。使用LaTeX,就应该接纳他这种"浮动"的特色。在我看来,需要改变的应该是使用LaTeX排版的你对图片/表格位置应该"固定"的看法。
另外,你的MWE代码不规范。请参照下图。
这就是LaTeX浮动体的特色,不要尝试去固定"浮动"的图片/表格的位置,在行文中避免使用上图,下表等方式来指代,而改用图3.1,表1-2的方式来指代。
同时,强烈不建议使用float宏包的H参数来实现,有可能出现出乎意料的排版结果。使用LaTeX,就应该接纳他这种"浮动"的特色。在我看来,需要改变的应该是使用LaTeX排版的你对图片/表格位置应该"固定"的看法。
另外,你的MWE代码不规范。请参照下图。
在lshort-zh-cn中对文档结构有如下的说明:
你的MWE中,你想要编号的部分都被放置在了\frontmatter之后而\mainmatter之间,此时属于前言部分,不计入文章正文,因此会出现0.1,0.3.1的情况;
另外,你的MWE不规范,你使用了elegantbook模板,因此必须在相同目录下放置elegantbook.cls文件才行,而你提供的压缩包中仅有总笔记.tex文件,这违背了MWE中在别人的电脑上直接编译即可复现你的问题的原则,另外你的鸽子.png也并未提供,还需要复习一下MWE的定义,争取下次规范提问。
另,强烈建议在使用模板之前认真学习一下上面提到的lshort-zh-cn文档,对于入门非常有帮助。
下面是MWE,只要更改\mainmatter的位置即可:
\documentclass[lang=cn,newtx,10pt,scheme=chinese,titlestyle=hang]{elegantbook}
\title{大学期间笔记}
\author{cql}
\date{\today}
\version{1.0}
\extrainfo{别问为什么用英文,问就是锻炼自己}
% \cover{鸽子.jpg}
\definecolor{structurecolor}{RGB}{0,0,0}
\definecolor{main}{RGB}{70,70,70}
\definecolor{second}{RGB}{115,45,2}
\definecolor{third}{RGB}{0,80,80}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{extarrows}
\usepackage{stmaryrd}
\usepackage{tikz-cd}
\usetikzlibrary{cd}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{multicol} %导入multicols包
\usepackage{CJKfntef}
\usepackage{rotating} %用于旋转对象(旋转包)
\usepackage{color}
\usepackage{hyperref}
\usepackage{ctex}
\usepackage{hyperref}
\usepackage{comment}
\usepackage{array}
%\usepackage{tasks}
\usepackage{tikz}
\usetikzlibrary{positioning}
\setcounter{tocdepth}{3}
\usepackage{fancyhdr}
\begin{document}
\frontmatter
\maketitle
\mainmatter
\tableofcontents
\chapter{Analysis}
\section{Mathmatical Anlysis}
\subsection{Fundamental Theorem of Real Number System}
\subsection{Univariate differential calculus}
\subsubsection{Differentaable definition}
\section{Real Analysis}
\section{Complex Analysis}
\subsection{Basic properties of complex numbers}
\section{Function Analysis}
\section{Fourier Analysis}
\chapter{Algebar}
\section{Advanced Algebra}
\subsection{matrix}
\section{Abstract Algebra}
\section{Repersentation Theory}
\section{Commutative Algebra}
\section{Lie Algebra}
\section{Homological Algebra}
\chapter{Topology}
\chapter{Differential Equation}
\section{Ordinary Differential Equation}
\section{Partial Differential Equation}
\chapter{Geometry}
\chapter{Probability and Statistics}
\end{document}
按照惯例自答一下,非常感谢@Eureka 和@u19850 的倾情帮助。
首先分析下错因:
对于CASEA的写法,是使用自行在外部使用\keys_set:nn {<module>}{options}的方式定义默认值,实际上这等价于在\keys_define:nn内部使用<key>.initial定义其赋值方式,这两种做法均会给option赋值初始值;
对于CASEB的写法,是使用<key>.code:n会接受名为#1的由<key>.default定义的初始值<value>,并执行code的内容;但<key>.default:n方法定义的default值仅仅是在value缺失时的默认值,如果option不被指定是不会被赋值的。
下面附interface3中对这两个函数的介绍原文:
⟨key⟩ .default:n = {⟨default⟩}
Creates a ⟨default⟩ value for ⟨key⟩, which is used if no value is given. This will be used if only the key name is given, but not if a blank ⟨value⟩ is given.
key .default:n = xxx, 是 value 缺失时的默认值
例如 key .default:n = xxx,那么\keys_set:nn {mew}{key} 等价于\keys_set:nn {mew}{key = xxx}
⟨key⟩ .initial:n = {⟨value⟩}
Initialises the ⟨key⟩ with the ⟨value⟩, equivalent to\keys_set:nn {⟨module⟩} { ⟨key⟩ = ⟨value⟩ }
key .initial:n = xxx, 等价于执行了 \keys_set:nn{mwe}{key = xxx}
鱼老师随便一句话就是标准的文档啊,无敌了!
作为一名learner,自然要分析下为什么上面的代码都不得行:
对于CASEA:
\cmd{Explorer}输出了\l_mwe_opa_tl以及\l_mwe_opb_tl的默认值,因此首先输出了正常的结果。\cmd[opa=opa,opb=opb]{Explorer}进入了\IfNoValueF的条件逻辑中,此时(\l_mwe_opa_tl,\l_mwe_opb_tl)=(opa,opb),同时正常输出(opa,opb,Explorer)的内容\cmd[opa=opa]只是制定了赋值\l_mwe_opa_tl=opa,但由于\l_mwe_opa_tl在上一个判断中已经被永久地赋值为了opb,因此后文中并未将其恢复为defaultb.(第31行同理)此时已经不难发现是一个变量作用域的问题,可以在自定义的命令\cmd内使用\begin_group:以及\end_group:。事实上鱼老师再次一阵见血地指出:
"这种一般都要加group限制"
对于CASEA,此时只要加上限制,则可以解决上述问题。
而对于CASEB,可以如上分析:
\cmd{Explorer}没有指定opa和opb,因此 此时default值不会被赋值给key,code的内容也不会输出,因此只输出了必须参数Exploreropa=opa,opb=opb,default值赋值之后被用于的opa=opa覆盖,因此输出了(opa,opb,Explorer)opa=opa,此时opa经历了先被赋值为defaulta之后被用户选项覆盖为opa,而opb并未被invoked,因此只输出了(opa,Explorer);第24行同理只输出了(opb,Explorer).更改方式类似,加上group后,用指定option而不赋值的方式调用,如下图:
暂时的最后(其实还要测试下雾月给出的lttemplates方法),最后一下Eureka老师给出的一段代码(结合了CASEA与CASEB的做法):

本来还想分析的,凡是如果你有耐心看完上面一大段的话,是显然可以实现要求的。
自己给一个基于kayval的解答。
\documentclass[12pt]{ctexart}
\usepackage[margin=1in]{geometry}
\setlength{\parindent}{0pt}
\usepackage{keyval}
\makeatletter
\def\mwe@vala{defaulta}
\define@key{mwe}{opa}{\def\mwe@vala{#1}}
\def\mwe@valb{defaultb}
\define@key{mwe}{opb}{\def\mwe@valb{#1}}
\newcommand\foo[2][]{
\begingroup
\setkeys{mwe}{#1}%
The opa is: \mwe@vala. \par
The opb is: \mwe@valb. \par
The Parameter is: #2. \par
\endgroup
}
\makeatother
\begin{document}
\foo{Explorer}
\foo[opa=opa,opb=opb]{Explorer}
\foo[opb=opb]{Explorer}
\foo[opa=opa]{Explorer}
\end{document}
请提供文本形式的代码,并用围栏代码块包裹,以方便调试。
另外,请你同步提供的learnlatex.bib文件,以便可以让潜在的回答者一下载/复制就可以编译。
另附有关文档内容,你是否使用pdflatex-pdflatex-bibtex-pdflatex方法编译?
使用\c_colon_str替换即可,参考链接
\documentclass{article}
\usepackage{tikz}
\ExplSyntaxOn
\fp_new:N \l__skyrmion_rotate_fp
\fp_set:Nn \l__skyrmion_rotate_fp {30}
\cs_new_protected_nopar:Nn \l__skyrmion_tmp_cs:
{
\draw (0,0) -- (1,1)
node [ rotate~around = { \fp_use:N \l__skyrmion_rotate_fp \c_colon_str (0,0) } ] {test};
}
\ExplSyntaxOff
\begin{document}
\ExplSyntaxOn
\tikz { \l__skyrmion_tmp_cs: }
\ExplSyntaxOff
\end{document}白嫖快乐~

请提供你的LaTeX代码,而不只是一个word截图,论坛的作用是帮助你修改你的代码,而不是像接单一样替你实现你的排版效果。
请展示你使用tabularray宏包进行的尝试以及效果(体现你的付出和工作量),并提供规范的MWE。

在你的代码中涉及@的内容前后加上\makeatletter和\makeatother,以处理@的catcode的问题
\documentclass[openany]{book}
\usepackage{geometry}
\geometry{
papersize={10.5cm,14.85cm},
%showframe,
margin=1cm,
}
\makeatletter
\renewcommand{\part}{%
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\thispagestyle{empty}%
\if@twocolumn
\onecolumn
\@tempswatrue
\else
\@tempswafalse
\fi
\null\vfil
\secdef\@part\@spart}
\makeatother
\begin{document}
\setlength{\parindent}{2em}
\title{title}
\author{author}
\date{date}
\maketitle
\tableofcontents
\part{}
\chapter{}
Hello\TeX{}!
\part{}
\chapter{}
Hello\TeX{}!
\end{document}
另一种等价的更优雅的是使用\patchcmd:
\usepackage{etoolbox}%
\patchcmd{\part}{\thispagestyle{plain}}{\thispagestyle{empty}}{}{}我是不懂这个代码的,both 数学原理 and LaTeX Tikz实现
我只是个轮子的搬运工
参考(copy)自下面的链接John Kormylo‘s brilliant solution on TSE
\documentclass[tikz,border=2pt]{standalone}
\usetikzlibrary{calc,intersections}
\newlength{\bigenough}
\newcount\total
% locates both points on a closed shape tangent to a point outside the shape.
% \tangent{pathname}{center}{point}{first}{second}
\newcommand{\tangent}[5]% #1=path name for shape, #2=coordinate name for center, #3=cordinate name for outside point
{\begingroup% #4=coordinate name for first tangent point, #5=coordinate name for second coordinate point
\setlength{\bigenough}{1cm}
\loop% loop until big enough
\path[name path=temp] ($(#2)!\bigenough!-90:(#3)$)--($(#2)!\bigenough!90:(#3)$);
\path[name intersections={of = #1 and temp, total=\t}]%
\pgfextra{\global\total=\t};%
\ifnum\total<2 \global\bigenough=2\bigenough\repeat%
\endgroup
\coordinate (#4) at (intersection-1);% initial guess
\coordinate (#5) at (intersection-2);%
\tangentsearch{#1}{#2}{#3}{#4}%
\tangentsearch{#1}{#2}{#3}{#5}}
% find tangent using binary search
\newcommand{\tangentsearch}[4]% #1=path name for shape, #2=coordinate name for center, #3=cordinate name for outside point
{\begingroup% #4=coordinate name for tangent point (initail guess -> final)
\loop% loop until only 1 intersection
\path[name path=temp] (#3)--($(#4)!-\bigenough!(#3)$);
\path[name intersections={of = #1 and temp, total=\t}]%
\pgfextra{\global\total=\t};%
\ifnum\total=2 \coordinate (#4) at ($(intersection-1)!0.5!(intersection-2)$);
%\draw[pink] (intersection-1)--(intersection-2);% included only for debugging purposes
\path[name path=temp] (#4)--($(#4)!-\bigenough!(#2)$);
\path[name intersections={of = #1 and temp}];%
\coordinate (#4) at (intersection-1);%
\repeat%
\endgroup}
\begin{document}
\begin{tikzpicture}
\draw [gray!70] (-4,-4) grid (4,4);
\draw [->] (-4,0) -- (4,0) node [below left] {$x$};
\draw [->] (0,-4) -- (0,4) node [below left] {$y$};
\draw[name path=ellipse,thick,fill=gray!30,opacity=0.5] (0,0) ellipse (2 and 1);
% \draw [thick] (2,0) arc (0:360:2 and 1);
%\coordinate (O) at (0,0);
%\node at (O) [below left] {$O$};
%这里可以缩行
\coordinate[label={below left:$O$}] (O);
% \coordinate (P) at (1,2);
% \fill (P) at (1,2) circle (1pt) node [above right] {$P$};
%这里也可以缩行
\node[label={above right:$P$},circle, fill, inner sep=1pt] (P) at (1,2) {};
\tangent{ellipse}{O}{P}{X}{Y}
\draw (X)--(P)--(Y);
\end{tikzpicture}
\end{document}
不得不再次强调你的提问仍然存在一些可以改进的地方:
profcollege,而不是我想要图片中的这种效果,为啥代码输出的只有MP字母呢....提醒好多遍了;由于我的lualatex还没整好,我决定拾人牙慧 @u79794 ,补充一下这个回答。
根据profcollege文档内容可见,你所用代码需使用lualatex引擎编译。
@u79794 老师的编译结果如下:

虽然我不太了解tikz-3d这个包,但参照文档内容(如下图)略加修改一下视线的夹角 theta 和 phi可以实现类似效果:
下面是mwe和效果:
\documentclass[tikz,border=1cm]{standalone}
\usepackage{tikz-3dplot}
% \usetikzlibrary{calc}
% \usetikzlibrary{3d}
\begin{document}
\tdplotsetmaincoords{70}{120}
\begin{tikzpicture}[tdplot_main_coords]
\draw[->,red] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
\draw[->,green] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
\draw[->,blue] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};
\end{tikzpicture}
\end{document}
请注意MWE的定义,以及上一个回答里让你注意的几点问题:

label设置还是不对,可以加上tabularray等更为相关的tag内容经过测试,你的Large (No-)Working Example的问题是:
Line 214行
Line 269行
Line 336行
的\tweek命令,缺少必选参数,修改为\tweek{#1}可以解决你的问题
另外,制作Minimal Working Example的过程可以有效提高你的debug能力,是可以很快找到这个错误的
用latex3的循环语法练习了一下,基本上大大缩短了你的代码长度(大概缩了一半吧...)
遇到比较大的问题是tabularray的expand展开选项在遇到l3时有点不好处理...
非常感谢鱼先生 @u19850 给出的使用\expandafter方法展开拼接字符串的方法,同时也感谢外国友人Ulrike Fischer提供的莫大帮助和提示
% trick to concat the items
\def\mycontent{}
\expandafter\def\expandafter\mycontent\expandafter{
\mycontent
<codes want to put together>
}下面是缩行成功的MWE:
\documentclass[twoside]{book}
\usepackage[
letterpaper,
bindingoffset=15mm,
textheight=250mm,
textwidth=175mm,
top=1in,
bottom=20mm,
footskip=0.5in,
marginparwidth=0mm,
marginparsep=0mm,
margin = .6in
]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{kpfonts}
\usepackage{tabularray}
\pagestyle{plain}
\raggedright
\raggedbottom
\begin{document}
\ExplSyntaxOn
\clist_const:Nn \c_wwws_clist { What, Who, How, When, Where, Why }
\clist_const:Nn \c_questions_clist {
{What~do~I~want~to~achieve?},
{Who~benefits?~Whose~help~do~I~need?},
{Which~skills~do~I~need?},
{What~is~my~timeline?},
{Where~will~I~accomplish~this?},
{Why~is~this~goal~important~to~me?}
}
\clist_const:Nn \c_goals_clist {
{Annual~Goal},
{Monthly~Sub-Goals~for~Annual~Goal},
}
\int_step_inline:nn {7}
{
\int_step_inline:nn {2}
{
\newpage
\begin{center}
{
\Large \textbf{{\clist_item:Nn \c_goals_clist {##1}}~\#~#1~}
}
\end{center}
\vspace{5mm}
\noindent
\def\mycontent{}
\int_step_inline:nn {6}
{
%迭代合并\mycontent内容的trick
\int_compare:nTF{##1=1}{
\expandafter\def\expandafter\mycontent\expandafter{
\mycontent
\SetCell[r=4]{c}{\clist_item:Nn \c_wwws_clist {####1}} & {\clist_item:Nn \c_questions_clist {####1}} \\
& \\ & \\ & \\
}
}{
\expandafter\def\expandafter\mycontent\expandafter{
\mycontent
\SetCell[r=4]{c}{Sub-Goal\\~\#~####1} & {} \\
& \\ & \\ & \\
}
}
}
\begin{tblr}[expand=\mycontent]{
width=175mm,
colspec={ X[1,c] X[8,l] },
vlines,hlines,
rows={7mm, m, rowsep=1.0pt},
font=\bfseries,
}
\mycontent
\end{tblr}
\newpage
}
}
\ExplSyntaxOff
\end{document}效果如下:
另外,需要注意的是:
.tex文件,并且说明是在forloop中插入第二个tblr会导致\item错误label(标签)应尽量是<package name>,<keyword of your question>等对问题有概括性/便于分类的tag,请问下这个文件为啥去掉后面这几行能运行 有这几行就会报错呢 把后面这几行拿出来又能运行这些label非常不搭.
问 怎么解决表格乱跑问题,表格应该在段落下方却乱跑?