防止脚注变成大写

防止脚注变成大写

我使用 创建了一个新命令\MakeUppercase。当此命令中有脚注时,其文本也会更改为大写。如何避免大小写变化?我的 MWE 如下:

\documentclass{book}


\begin{document}

\def\localtest#1{\noindent\MakeUppercase{#1}}

\localtest{Rotavator tiller is mainly used in agriculture for loosening of upper layer soil to create seedbed.\protect\footnote{Footnote inside local command}}

Rotavator tiller is mainly used in agriculture for loosening\footnote{Normal footnotes} of upper layer soil to create seedbed. The rotavator has higher soil mixing capacity compared with other plough machine and it has good weed cutting capability and it leads to the water-air, thermal and nutrient of the soil is improved. The rotavator can be easily adjusted for various working depths for soil bed preparation. The rotavator tiller is suitable for all type of soil preparation no matter about the soil type, soil conditions and Service life of the blade may vary depends upon the property of soil and moisture content in the soil. Normally the heavy loam soil consumes more energy and subjected more wear when compared to other soils. Now a day's Indian farmers are unhappy about money spent for soil bed preparation because of raise in fuel price and rotavator blade replacement cost. So the farmers focused more in reducing the land preparation cost and increase in yield. Blades are the main parts of rotavator tiller (Fig.1), which directly engaged with the soil to prepare the seed bed for cultivation land


Rotavator tiller is mainly used in agriculture for loosening of upper layer soil to create seedbed. The rotavator has higher soil mixing capacity compared with other plough machine and it has good weed cutting capability and it leads to the water-air, thermal and nutrient of the soil is improved. The rotavator can be easily adjusted for various working depths for soil bed preparation. The rotavator tiller is suitable for all type of soil preparation no matter about the soil type, soil conditions and Service life of the blade may vary depends upon the property of soil and moisture content in the soil. Normally the heavy loam soil consumes more energy and subjected more wear when compared to other soils. Now a day's Indian farmers are unhappy about money spent for soil bed preparation because of raise in fuel price and rotavator blade replacement cost. So the farmers focused more in reducing the land preparation cost and increase in yield. Blades are the main parts of rotavator tiller (Fig.1), which directly engaged with the soil to prepare the seed bed for cultivation land

Rotavator tiller is mainly used in agriculture for loosening of upper layer soil to create seedbed. The rotavator has higher soil mixing capacity compared with other plough machine and it has good weed cutting capability and it leads to the water-air, thermal and nutrient of the soil is improved. The rotavator can be easily adjusted for various working depths for soil bed preparation. The rotavator tiller is suitable for all type of soil preparation no matter about the soil type, soil conditions and Service life of the blade may vary depends upon the property of soil and moisture content in the soil. Normally the heavy loam soil consumes more energy and subjected more wear when compared to other soils. Now a day's Indian farmers are unhappy about money spent for soil bed preparation because of raise in fuel price and rotavator blade replacement cost. So the farmers focused more in reducing the land preparation cost and increase in yield. Blades are the main parts of rotavator tiller (Fig.1), which directly engaged with the soil to prepare the seed bed for cultivation land


\end{document}

答案1

这是一个使用 的解决方案。您可以考虑使用expl3而不是,因为它更具可定制性。然后可以通过将其添加到 来局部排除大写。\MakeUppercase\text_uppercase:n\footnote\l_text_case_exclude_arg_tl

\group_begin:
\tl_put_right:Nn \l_text_case_exclude_arg_tl { \footnote }
\text_uppercase:n { #1 }
\group_end:

以下是完整的代码。

\documentclass{book}


\begin{document}

\ExplSyntaxOn

\def\localtest#1{
    \noindent
    \group_begin:
    \tl_put_right:Nn \l_text_case_exclude_arg_tl { \footnote }
    \text_uppercase:n { #1 }
    \group_end:
}

\ExplSyntaxOff

% **\def\localtest#1{\noindent\MakeUppercase{#1}}**

\localtest{Rotavator tiller is mainly used in agriculture for loosening of upper layer soil to create seedbed.**\protect\footnote{Footnote inside local command}**}

Rotavator tiller is mainly used in agriculture for loosening\footnote{Normal footnotes} of upper layer soil to create seedbed. The rotavator has higher soil mixing capacity compared with other plough machine and it has good weed cutting capability and it leads to the water-air, thermal and nutrient of the soil is improved. The rotavator can be easily adjusted for various working depths for soil bed preparation. The rotavator tiller is suitable for all type of soil preparation no matter about the soil type, soil conditions and Service life of the blade may vary depends upon the property of soil and moisture content in the soil. Normally the heavy loam soil consumes more energy and subjected more wear when compared to other soils. Now a day's Indian farmers are unhappy about money spent for soil bed preparation because of raise in fuel price and rotavator blade replacement cost. So the farmers focused more in reducing the land preparation cost and increase in yield. Blades are the main parts of rotavator tiller (Fig.1), which directly engaged with the soil to prepare the seed bed for cultivation land


Rotavator tiller is mainly used in agriculture for loosening of upper layer soil to create seedbed. The rotavator has higher soil mixing capacity compared with other plough machine and it has good weed cutting capability and it leads to the water-air, thermal and nutrient of the soil is improved. The rotavator can be easily adjusted for various working depths for soil bed preparation. The rotavator tiller is suitable for all type of soil preparation no matter about the soil type, soil conditions and Service life of the blade may vary depends upon the property of soil and moisture content in the soil. Normally the heavy loam soil consumes more energy and subjected more wear when compared to other soils. Now a day's Indian farmers are unhappy about money spent for soil bed preparation because of raise in fuel price and rotavator blade replacement cost. So the farmers focused more in reducing the land preparation cost and increase in yield. Blades are the main parts of rotavator tiller (Fig.1), which directly engaged with the soil to prepare the seed bed for cultivation land

Rotavator tiller is mainly used in agriculture for loosening of upper layer soil to create seedbed. The rotavator has higher soil mixing capacity compared with other plough machine and it has good weed cutting capability and it leads to the water-air, thermal and nutrient of the soil is improved. The rotavator can be easily adjusted for various working depths for soil bed preparation. The rotavator tiller is suitable for all type of soil preparation no matter about the soil type, soil conditions and Service life of the blade may vary depends upon the property of soil and moisture content in the soil. Normally the heavy loam soil consumes more energy and subjected more wear when compared to other soils. Now a day's Indian farmers are unhappy about money spent for soil bed preparation because of raise in fuel price and rotavator blade replacement cost. So the farmers focused more in reducing the land preparation cost and increase in yield. Blades are the main parts of rotavator tiller (Fig.1), which directly engaged with the soil to prepare the seed bed for cultivation land


\end{document}

相关内容