使用 $\mathbb{C}$ 和使用逗号时出现问题

使用 $\mathbb{C}$ 和使用逗号时出现问题

我是 TeX 图表绘制新手。我有两个主要问题:1. 假设我想写$L(s,\chi)$“Dirichlet L-function”,则会出错。问题似乎出在“,”上,因为如果我写的话,$L(s \chi)$ 就不会出错。

  1. 由于某种原因,我无法用 来$\mathbb{C}$表示复数。相反,我必须写“C”。

这是我的代码:

% Hierarchical diagram
% Author: cfr
\documentclass[tikz,border=10pt]{standalone}
\usepackage{forest}
\usetikzlibrary{arrows.meta, shapes.geometric, calc, shadows}

\colorlet{mygreen}{green!75!black}
\colorlet{col1in}{red!30}
\colorlet{col1out}{red!40}
\colorlet{col2in}{mygreen!40}
\colorlet{col2out}{mygreen!50}
\colorlet{col3in}{blue!30}
\colorlet{col3out}{blue!40}
\colorlet{col4in}{mygreen!20}
\colorlet{col4out}{mygreen!30}
\colorlet{col5in}{blue!10}
\colorlet{col5out}{blue!20}
\colorlet{col6in}{blue!20}
\colorlet{col6out}{blue!30}
\colorlet{col7out}{orange}
\colorlet{col7in}{orange!50}
\colorlet{col8out}{orange!40}
\colorlet{col8in}{orange!20}
\colorlet{linecol}{blue!60}

\newcommand{\CC}{\mathbb{C}}
\begin{document}
\pgfkeys{/forest,
  rect/.append style   = {rectangle, rounded corners = 2pt,
                         inner color = col6in, outer color = col6out},
  ellip/.append style  = {ellipse, inner color = col5in,
                          outer color = col5out},
  orect/.append style  = {rect, font = \sffamily\bfseries\LARGE,
                         text width = 325pt, text centered,
                         minimum height = 10pt, outer color = col7out,
                         inner color=col7in},
  oellip/.append style = {ellip, inner color = col8in, outer color = col8out,
                          font = \sffamily\bfseries\large, text centered}}
\begin{forest}
  for tree={
      font=\sffamily\bfseries,
      line width=1pt,
      draw=linecol,
      ellip,
      align=center,
      child anchor=north,
      parent anchor=south,
      drop shadow,
      l sep+=12.5pt,
      edge path={
        \noexpand\path[color=linecol, rounded corners=5pt,
          >={Stealth[length=10pt]}, line width=1pt, ->, \forestoption{edge}]
          (!u.parent anchor) -- +(0,-5pt) -|
          (.child anchor)\forestoption{edge label};
        },
      where level={3}{tier=tier3}{},
      where level={0}{l sep-=15pt}{},
      where level={1}{
        if n={1}{
          edge path={
            \noexpand\path[color=linecol, rounded corners=5pt,
              >={Stealth[length=10pt]}, line width=1pt, ->,
              \forestoption{edge}]
              (!u.west) -| (.child anchor)\forestoption{edge label};
            },
        }{
          edge path={
            \noexpand\path[color=linecol, rounded corners=5pt,
              >={Stealth[length=10pt]}, line width=1pt, ->,
              \forestoption{edge}]
              (!u.east) -| (.child anchor)\forestoption{edge label};
            },
        }
      }{},
  }
  [Dirichlet L-functions, inner color=col1in, outer color=col1out
    [Functional equation of\\ Dirichlet L-functions, inner color=col2in, outer color=col2out
      [Counting the zeros of\\ Dirichlet L-functions, inner color=col3in, outer color=col3out
         [Trivial zeros, inner color=col7in, outer color=col7out
             [$-2n$ $\in N$ \\(even characters), inner color=red, outer color=red
             ]  
             [$-2n+1 \in N$ \\ (odd characters), inner color=red, outer color=red
             ]           
          ]            
         [Non-trivial zeros, inner color=col7in, outer color=col7out
            [Approximation $\#$ zeros $\rho \in C$ \\ with $0 \leq \Re(\rho) \leq 1$ \\ $|\Im(\rho)|\leq T$, inner color=red, outer color=red
                [Link between zeros of\\ $\zeta(s)$ and behavior of $\pi(x)$, inner color=magenta, outer color=magenta
                ] 
             ]
         ]                
      ] 
    ]
%    [Fonctional equation of\\ $L(s \chi)$, inner color=col3in, outer color=col3out
   %   [, phantom, calign with current
    %    [A\\B, phantom
%         [Our Work, orect, name=us
%          ]
       % ]
     % ]
  %  ]
  ]
  \begin{scope}[color = linecol, rounded corners = 5pt]
  \end{scope}
\end{forest}
\end{document}

答案1

我认为通常最好在选项的第一个块中用括号括起来[,这样文本中的逗号就不会被误认为是选项分隔符。

或者,只用括号括住逗号部分,因此

{$L(s,\chi)$}

以下是示例

% Hierarchical diagram
% Author: cfr
\documentclass[tikz,border=10pt]{standalone}
\usepackage{forest}
\usetikzlibrary{arrows.meta, shapes.geometric, calc, shadows}

\colorlet{mygreen}{green!75!black}
\colorlet{col1in}{red!30}
\colorlet{col1out}{red!40}
\colorlet{col2in}{mygreen!40}
\colorlet{col2out}{mygreen!50}
\colorlet{col3in}{blue!30}
\colorlet{col3out}{blue!40}
\colorlet{col4in}{mygreen!20}
\colorlet{col4out}{mygreen!30}
\colorlet{col5in}{blue!10}
\colorlet{col5out}{blue!20}
\colorlet{col6in}{blue!20}
\colorlet{col6out}{blue!30}
\colorlet{col7out}{orange}
\colorlet{col7in}{orange!50}
\colorlet{col8out}{orange!40}
\colorlet{col8in}{orange!20}
\colorlet{linecol}{blue!60}

\newcommand{\CC}{\mathbb{C}}
\begin{document}
\pgfkeys{/forest,
  rect/.append style   = {rectangle, rounded corners = 2pt,
                         inner color = col6in, outer color = col6out},
  ellip/.append style  = {ellipse, inner color = col5in,
                          outer color = col5out},
  orect/.append style  = {rect, font = \sffamily\bfseries\LARGE,
                         text width = 325pt, text centered,
                         minimum height = 10pt, outer color = col7out,
                         inner color=col7in},
  oellip/.append style = {ellip, inner color = col8in, outer color = col8out,
                          font = \sffamily\bfseries\large, text centered}}
\begin{forest}
  for tree={
      font=\sffamily\bfseries,
      line width=1pt,
      draw=linecol,
      ellip,
      align=center,
      child anchor=north,
      parent anchor=south,
      drop shadow,
      l sep+=12.5pt,
      edge path={
        \noexpand\path[color=linecol, rounded corners=5pt,
          >={Stealth[length=10pt]}, line width=1pt, ->, \forestoption{edge}]
          (!u.parent anchor) -- +(0,-5pt) -|
          (.child anchor)\forestoption{edge label};
        },
      where level={3}{tier=tier3}{},
      where level={0}{l sep-=15pt}{},
      where level={1}{
        if n={1}{
          edge path={
            \noexpand\path[color=linecol, rounded corners=5pt,
              >={Stealth[length=10pt]}, line width=1pt, ->,
              \forestoption{edge}]
              (!u.west) -| (.child anchor)\forestoption{edge label};
            },
        }{
          edge path={
            \noexpand\path[color=linecol, rounded corners=5pt,
              >={Stealth[length=10pt]}, line width=1pt, ->,
              \forestoption{edge}]
              (!u.east) -| (.child anchor)\forestoption{edge label};
            },
        }
      }{},
  }
  [{Dirichlet L-functions}, inner color=col1in, outer color=col1out
    [{Functional equation of\\ Dirichlet L-functions}, inner color=col2in, outer color=col2out
      [{Counting the zeros of\\ Dirichlet L-functions}, inner color=col3in, outer color=col3out
         [{Trivial zeros}, inner color=col7in, outer color=col7out
             [{$-2n$ $\in N$ \\(even characters)}, inner color=red, outer color=red
             ]  
             [{$-2n+1 \in N$ \\ (odd characters)}, inner color=red, outer color=red
             ]           
          ]            
         [{Non-trivial zeros}, inner color=col7in, outer color=col7out
            [{Approximation $\#$ zeros $\rho \in C$ \\ with $0 \leq \Re(\rho) \leq 1$ \\ $|\Im(\rho)|\leq T$}, inner color=red, outer color=red
                [{Link between zeros of\\ $\zeta(s)$ and behavior of $\pi(x)$}, inner color=magenta, outer color=magenta
                ] 
             ]
         ]                
      ] 
    ]
    [{Functional equation of\\ $L(s,\chi)$}, inner color=col3in, outer color=col3out
      [, phantom, calign with current
        [{A\\B}, phantom
         [{Our Work}, orect, name=us
          ]
        ]
      ]
    ]
  ]
  \begin{scope}[color = linecol, rounded corners = 5pt]
  \end{scope}
\end{forest}
\end{document}

在此处输入图片描述

对于\mathbb{C}您需要\usepackage{amsfonts}或(更好)\usepackage{amssymb}

相关内容