gpt4 book ai didi

latex - 将 .sty 文件的内容插入 latex .tex 文件中

转载 作者:行者123 更新时间:2023-12-05 06:07:47 24 4
gpt4 key购买 nike

我想知道是否有办法将 .sty 文件的内容直接放入 latex .tex 文件中。我在文件 myfile.sty 中有少量(TeX?)宏定义,我更愿意将它们集成到我的 latex 文件中,而不是将它们保存在单独的包中并使用 \usepackage{myfile}.有办法做到这一点吗?

最佳答案

通常,您只需将 .sty 文件的内容复制到您的文档即可。

  • 注释掉任何特定的包,如 \ProvidesPackage{myfile}

  • 如果您的包在宏名称中使用@,您必须将其包装在\makeatletter ...\makeatother

\documentclass{article}

\makeatletter

%\ProvidesPackage{myfile}

\newcommand{\foo}{bar}

\makeatother


\begin{document}

\foo

\end{document}

关于latex - 将 .sty 文件的内容插入 latex .tex 文件中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65344959/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com