非英语标题参考不打印名称

非英语标题参考不打印名称

当我尝试引用标题时,它只显示图形的编号,而没有名称。例如,它打印1代替火焰 1。我正在使用 babel 并输入保加利亚语。这是不是某种错误,因为它不是英文文本?我该如何修复它?这是我的序言:

\usepackage[utf8]{inputenc} 
\usepackage[english,bulgarian]{babel} 
\usepackage{blindtext} 
\usepackage{enumitem} 
\usepackage{amsmath} 
\usepackage{tikz} 
\usepackage{pgf} 
\usepackage{caption} 
\usetikzlibrary{arrows} 

这是图:

\begin{figure}
             \centering
             \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
                 \clip(-0.38,-0.44) rectangle (3.25,5.2);
                 \draw [shift={(0,0)},fill=black,fill opacity=0.1] (0,0) -- (0:0.6) arc (0:61.07:0.6) -- cycle;
                 \draw (0,0)-- (2.68,0);
                 \draw (2.68,4.85)-- (2.68,0);
                 \draw (2.68,4.85)-- (0,0);
                 \begin{scriptsize}
                     \fill [color=black] (0,0) circle (1.5pt);
                     \draw[color=black] (0.17,0.26) node {$A$};
                     \fill [color=black] (2.68,0) circle (1.5pt);
                     \draw[color=black] (2.83,0.26) node {$B$};
                     \draw[color=black] (1.41,-0.18) node {$a$};
                     \fill [color=black] (2.68,4.85) circle (1.5pt);
                     \draw[color=black] (2.83,5.1) node {$C$};
                     \draw[color=black] (2.43,2.57) node {$b$};
                     \draw[color=black] (1.11,2.73) node {$c$};
                     \draw[color=black] (0.61,0.22) node {$\alpha$};
                     \fill [color=black] (1.34,2.42) circle (1.5pt);
                     \draw[color=black] (1.51,2.69) node {$D$};
                 \end{scriptsize}
             \end{tikzpicture} \caption{}\label{fig:triangle}
\end{figure}

我是这样引用标题的:

 Нека тази точка бъде средата на
 хипотенузата на правоъгълен триъгълник,
 точка $D$ от \ref{fig:triangle}

这也不起作用:

\end{tikzpicture} \caption{\label{fig:triangle}}

答案1

这与语言无关:\ref只打印数字。

您可以自行添加 Фигура,也可以使用更高级别的包,例如cleveref。但是,此包不支持保加利亚语,因此您需要教它与计数器相关的名称。

第一个选项的文本应该是

Нека тази точка бъде средата на
хипотенузата на правоъгълен триъгълник,
точка $D$ от Фигура~\ref{fig:triangle}

cleveref可以像这样:

\documentclass{article}

\usepackage[utf8]{inputenc} 
\usepackage[english,bulgarian]{babel} 
\usepackage{blindtext} 
\usepackage{enumitem} 
\usepackage{amsmath} 
\usepackage{tikz} 
\usepackage{pgf} 
\usepackage{caption} 

\usepackage{cleveref} % after hyperref if you use it

\usetikzlibrary{arrows}

\crefname{figure}{Фигура}{Фигури} % singular and plural

\begin{document}

\begin{figure}[htp]
\centering

\scriptsize
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
  \clip(-0.38,-0.44) rectangle (3.25,5.2);
  \draw [shift={(0,0)},fill=black,fill opacity=0.1] (0,0) -- (0:0.6) arc (0:61.07:0.6) -- cycle;
  \draw (0,0)-- (2.68,0);
  \draw (2.68,4.85)-- (2.68,0);
  \draw (2.68,4.85)-- (0,0);
  \fill [color=black] (0,0) circle (1.5pt);
  \draw[color=black] (0.17,0.26) node {$A$};
  \fill [color=black] (2.68,0) circle (1.5pt);
  \draw[color=black] (2.83,0.26) node {$B$};
  \draw[color=black] (1.41,-0.18) node {$a$};
  \fill [color=black] (2.68,4.85) circle (1.5pt);
  \draw[color=black] (2.83,5.1) node {$C$};
  \draw[color=black] (2.43,2.57) node {$b$};
  \draw[color=black] (1.11,2.73) node {$c$};
  \draw[color=black] (0.61,0.22) node {$\alpha$};
  \fill [color=black] (1.34,2.42) circle (1.5pt);
  \draw[color=black] (1.51,2.69) node {$D$};
\end{tikzpicture}

\caption{}\label{fig:triangle}

\end{figure}

Нека тази точка бъде средата на
хипотенузата на правоъгълен триъгълник,
точка $D$ от \cref{fig:triangle}

\end{document}

在此处输入图片描述

相关内容