远方不远
远方不远
这家伙很懒,什么也没写!

注册于 1年前

回答
5
文章
0
关注者
0

我更喜欢纯Tikz的画法。

\documentclass[border=2pt,tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\fill [black] 
    (60:1cm) arc (120:240:1cm) 
             arc (0:120:1cm) 
             arc (-120:0:1cm) -- cycle;
\fill [black,rotate=60] 
    (60:1cm) arc (120:240:1cm) 
             arc (0:120:1cm) 
             arc (-120:0:1cm) -- cycle;
\end{tikzpicture}
\end{document}

感谢群友@香港-小狮子提出了一种较为简单的几何画法!其余参与讨论的大家,一并感谢您们的指导!
方法肯定不止这一种,后续我将继续整理讨论结果,同时十分欢迎提出新的回答!

\documentclass[tikz,border=2pt]{standalone}
\usetikzlibrary{calc,intersections}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}[scale=2]

    \draw [->] (-3,0) -- (3,0) node [below left] {$x$};
    \draw [->] (0,-3) -- (0,3) node [below left] {$y$};
    \draw [help lines] (-3,-3) grid (3,3);
    \clip (-3.1,-3.1) rectangle (3.1,3.1);
    \draw [thick] (2,0) arc (0:360:2 and 1) node at (-2,-2) {$\dfrac{x^2}{4}+y^2=1$};

    \node (O) at (0,0) [below left] {$O$};
    \fill (1,2)                circle (1pt) coordinate (P)  node [above right] {$P(1,2)$};
    \fill ({-sqrt(3)*1cm},0cm) circle (1pt) coordinate (F1) node [below]       {$F_1$};
    \fill ({sqrt(3)*1cm},0cm)  circle (1pt) coordinate (F2) node [below]       {$F_2$};

    \path let \p1=($(P)-(F2)$),\n1={veclen(\x1,\y1)}
          in [dotted,name path=cirP] (P) circle (\n1);

    \path [dotted,name path=cirF1] (F1) circle (4);

    \path [name intersections={of=cirP and cirF1,by={J1,J2}},dashed] (J1)--(F2) (J2)--(F2);

    \draw let \p1=(J1),\p2=(F2),\n1={\y2-\y1},\n2={\x2-\x1},\n3={atan{\n1/\n2}-90}
          in [ultra thick,red] (P)--++(\n3:4cm);

    \draw let \p1=(J2),\p2=(F2),\n1={\y2-\y1},\n2={\x2-\x1},\n3={atan{\n1/\n2}-90}
          in [ultra thick,red] (P)--++(\n3:3cm);

\end{tikzpicture}
\end{document}

emmm

你的文档最主要的问题是 \textbf{...\\...} 有问题

建议用编辑器查找 \SetCell[r=4]{c} \textbf

全部替换为空,即删除

然后在 tblr<格式说明> 里的 rows={7mm, m, rowsep=1.0pt} 后面追加

,cell{1,5,9,13,17,21}{1}={r=4}{font=\bfseries}

其实非常简单,只要把合并单元格挪到下面一格就行了,multirow支持反向合并,而tabularray完全都是另一种思路了,针灸无脑推...

\documentclass[12pt]{ctexart}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{tabularray}
\begin{document}
    \begin{tabular}{|c|*{3}{>{\columncolor[gray]{.9}}c|}}
        \hline
        \rowcolor{cyan}
        $\beta$ & $50$ & $100$ & $150$ \\
        \hiderowcolors
        \hline
        \cellcolor{orange!60}
        & AAA & BBB & CCC \\
        \arrayrulecolor{red}
        \cline{2-4}
        \arrayrulecolor{black}
        \cellcolor{orange!60}% difficulty with multirow...
        \multirow{-2}{*}{静态工作点} & DDD & EEE & FFF \\
        \hline
        \multirow{2}{*}{动态工作点} & AAA & BBB & CCC \\
        \arrayrulecolor{cyan}
        \cline{2-4}
        \arrayrulecolor{black}
        & DDD & EEE & FFF \\
        \hline
        \multirow{2}{*}{等离子态工作点} & AAA & BBB & CCC \\
        \arrayrulecolor{violet}
        \cline{2-4}
        \arrayrulecolor{black}
        & DDD & EEE & FFF \\
        \hline
    \end{tabular}
\end{document}

我是这么理解的:三个 TikZ 环境相当于三个水平盒子,由于长度问题不能放在同一行,所以该自定义命令总体是按照段落模式确定基线的,所以产生了你说的垂直空白。

以下给出一种思路以参考:mwe-1.png

以下为代码:

\documentclass[UTF8]{ctexart}
\usepackage{tikz}
    \usetikzlibrary{calc}
\usepackage{geometry}
    \geometry{showframe,margin=.5cm,papersize={16cm,20cm}}
\newcommand\nicetitleA[1]{\vskip1.5ex
    \centerline{\tikz
       {\node (#1) at (.5\textwidth,0) [align=center] {\Huge\bfseries #1};
        \draw [dashed,red,thick]  
            (.1\textwidth,0 |- #1.north west) -- 
            (#1.north east -| .9\textwidth,0);
        \draw [dashed,cyan,thick] 
            (.1\textwidth,0 |- #1.south west) -- 
            (#1.south east -| .9\textwidth,0);
       }%
    }
} 
\newcommand\nicetitleB[1]{\vskip1.5ex
    \centerline{\tikz
       {\node (#1) at (.5\textwidth,0) 
            [text width=.65\textwidth,align=center] {\Huge\bfseries #1};
        \draw [dashed,red,thick]  
            ($(.1\textwidth,0 |- #1.north west)+(0,.5cm)$) -- 
            ($(#1.north east -| .9\textwidth,0)+(0,.5cm)$);
        \draw [dashed,cyan,thick] 
            ($(.1\textwidth,0 |- #1.south west)+(0,-.5cm)$) -- 
            ($(#1.south east -| .9\textwidth,0)+(0,-.5cm)$);
       }%
    }
} 
\newcommand\zhlipsumX{劳仑衣普桑,认至将指点效则机,最你更枝。想极整月正进好志次回总般,段然取向使张规军证回,世市总李率英茄持伴。用阶千样响领交出,器程办管据家元写,名其直金团。化达书据始价算每百青,金低给天济办作照明,取路豆学丽适市确。}
\begin{document}
\zhlipsumX

\nicetitleA{去吧,皮卡丘!}

\zhlipsumX

\nicetitleA{回来吧,皮卡丘!}

\zhlipsumX

\nicetitleB{该你上场了,妙蛙种子!}

\zhlipsumX

\nicetitleB{Come back soon!我亲爱的妙蛙种子!}

\zhlipsumX
\end{document}

发布
问题