如何用较小的字体显示小数点后零位的(int)角度值?

如何用较小的字体显示小数点后零位的(int)角度值?

我怎样才能从角度中删除小数点 0?

\documentclass[11pt,a4paper,dutch]{article}
\usepackage[per-mode=symbol,mode=text,per-mode=symbol,exponent-product=\cdot]{siunitx}
\usepackage[T1]{fontenc}
\usepackage[left=1.2cm,right=3.6cm,top=1.8cm,bottom=2.0cm,marginparwidth=2.4cm]{geometry}
\usepackage{amsmath}
\usepackage{contour}
\usepackage{physics}
\usepackage{xparse}
\usepackage{amssymb}
\usepackage{xcolor}
\usepackage{rotating}
\usepackage{float}
\usepackage{subcaption}
\usepackage{caption}
\usepackage{pgfplots}
\usepackage{tikz}
\tikzset{every picture/.style={line width=0.75pt}}
\usetikzlibrary{arrows.meta,calc,math,quotes,angles}
\usepackage{fancyhdr}
\tikzset{>=latex} % for LaTeX arrow head
\usepackage{xcolor}
\colorlet{veccol}{green!70!black}
\colorlet{vcol}{green!70!black}
\colorlet{xcol}{blue!85!black}
\colorlet{projcol}{xcol!60}
\colorlet{unitcol}{xcol!60!black!85}
\colorlet{myblue}{blue!70!black}
\colorlet{myred}{red!90!black}
\colorlet{mypurple}{blue!50!red!80!black!80}
\tikzstyle{vector}=[->,very thick,xcol]
\sisetup
{
  input-decimal-markers={.},
  output-decimal-marker = {.},
   exponent-to-prefix = true,
   round-mode = figures,
   round-precision = 3,
   scientific-notation = engineering
}

\begin{document}
\begin{figure}[h]
\centering
\begin{minipage}
[h]{0.4\textwidth}
\centering
\begin{tikzpicture}
[x=0.75pt,y=0.75pt]
\def\R{154.483}
\def\ul{0.52}
\def\az{15}
\coordinate (O) at (0,0);
\coordinate (A) at (0,100);
\draw[dashed] (A) -- (0,-100);
\path (O)  node[left=4] {A};
\begin{scope}[xscale=1,yscale=1,rotate around={-\az:(O)}] ;
\coordinate (B) at (0,100);
\draw[gray, fill=green!30!white] (O)--(0,100)--(-5,100)--(-5,-100)--(0,-100)--cycle;
\draw pic[<-,"$\textbf{\small{\ang{\az}}}$",draw=black,angle radius=60,angle eccentricity=1.1]{angle=B--O--A};
\coordinate (R) at (\az:\R);
\coordinate (X) at ({\R*cos(\az)},0);
\coordinate (Y) at (0,{\R*sin(\az)});
\draw[projcol,dashed] (X) -- (R);
\draw[projcol,dashed] (Y) -- (R);
\draw[vector,red] (O) -- (R) node[right] {$\SI{835.974}{\newton}$};
\draw[vector,<->,projcol](X) node[scale=0.9, below =-1,right] {$\SI{807.48}{\newton}$} -- (O) -- (Y) node[scale=0.9,below=4, left] {$\SI{216.365}{\newton}$};
\end{scope}
\end{tikzpicture}
\end{minipage}
\end{figure}
\end{document}

答案1

对于手头的用例,我认为指定希尼奇选项round-mode = figuresround-precision = 3。最好写成\SI{835}{\newton}而不是\SI{835.974}{\newton},等等。哦,而且没有必要将\SI指令包含在$数学模式移位器中。进行此更改的副作用是,您不必担心将“15.0”而不是“15”排版为旋转角度。

顺便说一句,\SI是一个最终会消失的遗留宏。请习惯用\qty代替\SI

在此处输入图片描述

另外:你也可能想考虑更换

  node[scale=0.9, below = 4, left]  {\qty{216}{\newton}\kern0.4em};

  node[scale=0.9, above=4, right] {\qty{216}{\newton}};

\documentclass[11pt,a4paper,dutch]{article}
\usepackage[T1]{fontenc}
\usepackage[left=1.2cm, right=3.6cm,
            top=1.8cm, bottom=2.0cm,
            marginparwidth=2.4cm] % are you sure you need this option?
           {geometry}

%% The following packages aren't needed for this example
%\usepackage{amsmath}
%\usepackage{contour}
%\usepackage{physics}
%\usepackage{xparse}
%\usepackage{amssymb}
%\usepackage{xcolor}
%\usepackage{rotating}
%\usepackage{float}
%\usepackage{subcaption}
%\usepackage{caption}
%\usepackage{fancyhdr}

\usepackage{xcolor}
\colorlet{veccol}{green!70!black}
\colorlet{vcol}{green!70!black}
\colorlet{xcol}{blue!85!black}
\colorlet{projcol}{xcol!60}
\colorlet{unitcol}{xcol!60!black!85}
\colorlet{myblue}{blue!70!black}
\colorlet{myred}{red!90!black}
\colorlet{mypurple}{blue!50!red!80!black!80}

\usepackage{pgfplots}
\usepackage{tikz}
\tikzset{every picture/.style={line width=0.75pt}}
\usetikzlibrary{arrows.meta,calc,math,quotes,angles}
\tikzset{>=latex} % for LaTeX arrow head
\tikzstyle{vector}=[->,very thick,xcol]

\usepackage{siunitx}
\sisetup{per-mode = symbol,
         mode     = text,
         exponent-product   = \cdot,
         exponent-to-prefix = true,
         % the following options are unnecessary or counterproductive:
         %per-mode = symbol, % redundant
         %input-decimal-markers = {.},
         %output-decimal-marker = {.}, 
         %round-mode             = figures,
         %round-precision        = 3,
         %scientific-notation    = engineering
}

\begin{document}
%\begin{figure}[ht]

\begin{center}
%\begin{minipage}[h]{0.4\textwidth}
%\centering
\begin{tikzpicture}[x=0.75pt,y=0.75pt]
\def\R{154.483}
\def\ul{0.52}
\def\az{15}
\coordinate (O) at (0,0);
\coordinate (A) at (0,100);
\draw[dashed] (A) -- (0,-100);
\path (O) node[left=4] {A};
\begin{scope}[xscale=1,yscale=1,
              rotate around={-\az:(O)}] ;
\coordinate (B) at (0,100);
\draw[gray, fill=green!30!white] 
   (O)--(0,100)--(-5,100)--(-5,-100)--(0,-100)--cycle;
\draw pic[<-,"\small\ang{\az}",
          draw=black,
          angle radius=70, % use 70, not 60
          angle eccentricity=1.1]{angle=B--O--A};
\coordinate (R) at (\az:\R);
\coordinate (X) at ({\R*cos(\az)},0);
\coordinate (Y) at (0,{\R*sin(\az)});
\draw[projcol,dashed] (X) -- (R);
\draw[projcol,dashed] (Y) -- (R);
\draw[vector,red] (O) -- (R) 
   node[right] {\qty{836}{\newton}};
\draw[vector,<->,projcol](X) 
   %% Why 'below=-1" in the following line? Why not "below=1"?
   node[scale=0.9, below =-1, right] {\qty{807}{\newton}} -- (O) -- (Y) 
   node[scale=0.9, below = 4, left]  {\qty{216}{\newton}\kern0.4em};
\end{scope}
\end{tikzpicture}
%\end{minipage}
\end{center}
%\end{figure}
\end{document}

相关内容