更改圓 tikz 節點的大小

更改圓 tikz 節點的大小

我想減少小圓的大小,即我希望它的邊界更接近內部的方程式。我嘗試使用所附程式碼中的幾個免費參數,但沒有發生任何好事。你有什麼建議嗎?

\documentclass[8pt,dvipsnames]{beamer}
\usepackage{tikz}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usefonttheme{serif}
\usetikzlibrary{positioning}
\usepackage{import}
\usepackage{ragged2e}
\usepackage{tikz}

\usetheme{metropolis}
\usepackage{appendixnumberbeamer}

\usepackage{booktabs}
\usepackage[scale=2]{ccicons}

\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}

\usepackage{xspace}
\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}



\setbeamertemplate{itemize items}{\textbullet}

\begin{document}

\begin{frame}[fragile]
\frametitle{What do we want to compute?}
    \begin{tikzpicture}[
    bigcircle/.style={ % style for the circles
        text width=2.8cm, %1.6cm % diameter
        align=center, % center align
        line width=2mm, % thickness of border
        draw, % draw the border
        circle, % shape
        font=\sffamily%\footnotesize % font of the year
    },
    desc/.style 2 args={ % style for the list nodes
        text width=3.2cm, % means the node will be kind of like a 4cm wide minipage, and if the
        font=\sffamily\small\RaggedRight, % set the font in the list
        label={[#1,yshift=-1.5ex,font=\sffamily]above:#2} % add the title as a label
    },
    desc/.style 2 args={ % style for the list nodes
        text width=3.2cm, % means the node will be kind of like a 4cm wide minipage, and if the
        font=\sffamily\small\RaggedRight, % set the font in the list
        label={[#1,yshift=-1.5ex,font=\sffamily]above:#2} % add the title as a label
    },
    node distance=10mm and 3mm % vertical and horizontal separation of nodes, when positioned with e.g. above=of othernode
    ]
\node [desc={olive}{Poisson problem}] (list1) {
};
\node [bigcircle,olive, below=0.1cm of list1] (circ1) {
    \small  \textcolor{black}{
    \begin{align*}
        -\Delta u = f,\quad&\text{in}\;\Omega,\\
        +\text{b.c.},\quad&\text{on}\;\Gamma.
\end{align*}}
}; 
\end{tikzpicture} 
\end{frame}

\end{document}

答案1

您的 MWE 的背景未知。您是否僅在本範例中使用此圓圈,或者其樣式定義應該更加通用,即:其大小可以在每次使用時進行本地調整?

在後一種情況下,您應該將節點樣式變更為:

bigcircle/.style args = {#1/#2/#3}{% circle style
        circle,         % shape
        text width=#1,  % for locally determined diameter
        draw=#2,        % draw the border
        line width=2mm, % thickness of border
        align=center,   % for center align of text
        font=#3  % used font
                    },

並將節點的程式碼編寫為:

\node [bigcircle=2.4cm/olive/\small, 
       below=0.1cm of list1
       ] (circ1) 
{
\begin{align*}
    -\Delta u = f,\quad &\text{in}\;\Omega,\\
    +\text{b.c.},\quad  &\text{on}\;\Gamma.
\end{align*}
};

此變更將產生以下結果:

在此輸入影像描述

相關內容