请提供你的LaTeX
代码,而不只是一个word
截图,论坛的作用是帮助你修改你的代码,而不是像接单一样替你实现你的排版效果。
请展示你使用tabularray
宏包进行的尝试以及效果(体现你的付出和工作量),并提供规范的MWE。
请提供你的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
非常不搭.嗯..我找不到你所谓的cmex.pfb
字体文件,只能用yhcmex.pfb
代替
经过测试..似乎如下图设置可行【view】-【Fit to font bounding box】
你对各种字体真的很执着?此外,本问题与latex实际上可以说并无确切关联,是否应发到论坛上(?)
另外,有个问题希望你顺便补充一下,这个回答中 https://ask.latexstudio.net/ask/question/17415.html
"想要所有的数学符号,如int,sum,langle,rangle, sqrt等等,都变成Computer Modern math的字体" 什么是所有的数学符号,既然你想用所有的默认"cmu"数学符号,那为什么又要使用sitx数学字体呢?你上面指的所有数学符号列表是否是有限的呢?
参考TSE上的回答:https://tex.stackexchange.com/questions/14386/importing-a-single-symbol-from-a-different-font。基本思路也是“偷”,我不觉得你用的上那么多的数学符号。能否更确切地描述你另一个问题的需求,Eureka在交流群中也提出了类似的疑问。
您好,我不太确定这个问题的best practice是什么,但也许可以考虑unicode-math
提供的range
选项.
如下图所示,由于我找不到这个代码了,暂无法提供文本形式的代码...
你好,请提供最小工作示例的文本
你上面的代码并不能直接复制就可以编译得到效果。
另一方面,我进行类似测试是完全可以实现你的需求的,你需要提供最小的一份可以复现你的问题的代码。
可以考虑使用\scriptscriptstyle
减小字号或者使用\!
插入负间距,如下mwe:
\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath}
\begin{document}
\[ g_{ijk} (\mathbf{R}_j,\mathbf{R}) \]
\[ g_{IJK} (\mathbf{R}_j,\mathbf{R}) \]
\[ g_{\scriptscriptstyle {IJK}} (\mathbf{R}_j,\mathbf{R}) \]
\[ g_{\text{IJK}} (\mathbf{R}_j,\mathbf{R}) \]
\[ g_{I,J,K} (\mathbf{R}_j,\mathbf{R}) \]
\[ g_{\scriptscriptstyle {I,J,K}} (\mathbf{R}_j,\mathbf{R}) \]
\[ g_{I\!J\!K} (\mathbf{R}_j,\mathbf{R}) \]
\[ g_{I\!\!J\!\!K} (\mathbf{R}_j,\mathbf{R}) \]
\end{document}
我比较笨...
也不擅长TiKZ...
只能给出一条线一条线慢慢画的回答
..下面的代码其实还有很对可以改进的地方,比如一些代码复用,部分定位仍需要手动调整,部分连接处似乎是因为浮点误差有些小瑕疵等,部分位置的微调你自己看texdoc tikz
文档调整吧
我不喜欢TiKZ!
\documentclass[margin=1.5cm]{standalone}
\usepackage{tikz}
\usepackage{amsmath}
\usetikzlibrary{positioning,calc,intersections}
\begin{document}
\begin{tikzpicture}[
every node/.style = {circle,outer sep=0pt,inner sep=.1pt},
lineleft/.style = {color = red!80,dashed,line cap=round},
lineright/.style = {color = green!70!black,line cap=round},
]
\node (node-22) {$a_{22}$};
\node (node-21) [left = of node-22] {$a_{21}$};
\node (node-23) [right = of node-22] {$a_{23}$};
\node (node-12) [above = of node-22] {$a_{12}$};
\node (node-11) [left = of node-12] {$a_{11}$};
\node (node-13) [right = of node-12] {$a_{13}$};
\node (node-32) [below = of node-22] {$a_{32}$};
\node (node-31) [left = of node-32] {$a_{31}$};
\node (node-33) [right = of node-32] {$a_{33}$};
\node (extra-north) [above = of node-12] {\phantom{$a_{12}$}};
\node (extra-east) [right = of node-23] {\phantom{$a_{23}$}};
\node (extra-west) [left = of node-21] {\phantom{$a_{21}$}};
\node (extra-south) [below = of node-32] {\phantom{$a_{32}$}};
\node (extra-southeast) [right = of node-33] {\phantom{$a_{31}$}};
\node (extra-southwest) [left = of node-31] {\phantom{$a_{31}$}};
\node (M1) at ($(node-11)!.5!(extra-west)$) {};
\node (M2) at ($(node-11)!.5!(extra-north)$) {};
\node (N1) at ($(node-13)!.5!(extra-east)$) {};
\node (N2) at ($(node-13)!.5!(extra-north)$) {};
\draw[lineright]
(extra-north.center) -- (node-13) -- (extra-east.center)
(M2.center) -- (node-12) -- (node-23) -- (extra-southeast)
(node-11) -- (node-22) -- (node-33)
(M1.center) -- (node-21) -- (node-32)
(extra-west.center) -- (node-31) -- (extra-south.center)
;
\draw[lineleft]
(extra-west.center) -- (node-11) -- (extra-north.center)
(N2.center) -- (node-12) -- (node-21) -- (extra-southwest)
(node-31) -- (node-22) -- (node-13)
(N1.center) -- (node-23) -- (node-32)
(extra-south.center) -- (node-33) -- (extra-east.center)
;
\draw[lineright,name path=circ1] let \p1 = ($(M2.center) - (extra-west.center)$),
\n{radius} = {veclen(\x1,\y1)/2}
in
(M2.center) arc (45:225:\n{radius});
\draw[lineright,name path=circ2] let \p1 = ($(M1.center) - (extra-north.center)$),
\n{radius} = {veclen(\x1,\y1)/2}
in
(extra-north.center) arc (45:225:\n{radius});
\draw[lineleft,name path=circ3] let \p1 = ($(N2.center) - (extra-east.center)$),
\n{radius} = {veclen(\x1,\y1)/2}
in
(N2.center) arc (135:-45:\n{radius});
\draw[lineleft,name path=circ4] let \p1 = ($(N1.center) - (extra-north.center)$),
\n{radius} = {veclen(\x1,\y1)/2}
in
(extra-north.center) arc (135:-45:\n{radius});
\draw[lineright,line cap=round,name intersections={of=circ1 and circ2}] (intersection-1)-- (node-11);
\draw[lineleft,line cap=round,name intersections={of=circ3 and circ4}] (intersection-1)-- (node-13);
\node[rectangle] (text1) [below left=.8cm of extra-west,xshift=1.05cm] {\textcolor{red!80}{$-a_{1,1}a_{2,3}a_{3,2}$}};
\draw[lineleft] (text1.north) -- (extra-west.center);
\node[rectangle,xshift=.1cm] (text2) at (extra-southwest) {\textcolor{red!80}{{$-a_{1,2}a_{2,1}a_{3,3}$}}};
%\draw[lineleft] (text2.north) -- (node-21);
\node[rectangle] (text3) [below left=.5cm of node-31,xshift=1cm] {\textcolor{red!80}{$-a_{1,3}a_{2,3}a_{3,1}$}};
\draw[lineleft] (text3.north) -- (node-31);
\node[rectangle] (text4) [below right=.8cm of extra-east,xshift=-1cm] {\textcolor{green!70!black}{$+a_{1,3}a_{2,1}a_{3,2}$}};
\draw[lineright] (text4.north) -- (extra-east.center);
\node[rectangle,xshift=.1cm] (text5) at (extra-southeast) {\textcolor{green!70!black}{$+a_{1,2}a_{2,3}a_{3,1}$}};
% %\draw[lineright] (text5.north) -- (node-23);
\node[rectangle] (text6) [below right=.5cm of node-33,xshift=-1cm] {\textcolor{green!70!black}{$+a_{1,1}a_{2,2}a_{3,3}$}};
\draw[lineright] (text6.north) -- (node-33);
\end{tikzpicture}
\end{document}
效果如下:
提供mwe还是要完整...
tocbibind
宏包会将由thebibliography
生成的参考文献加入目录,但是你也不应该同时使用\section*{参考文献}
新增一个section
,这样会在参考文献处出现两行“参考文献”。
所以,你还是需要提供完整的mwe才好防止可能出现的其他问题...
问 多个不同列数的panel合并成一个长表格