我使用vim和tagbar来编写我的latex文件。在latex源代码中,图形的输入如下所示:
\includegraphics[width=0.70\textwidth]{../../figures/mechanical_diffusion/plate_hole/plate_hole_fem_elas_cd_map}我希望在标记栏中只获取文件名,在本例中为"plate_hole_fem_elas_cd_map“。我在家里创建了一个.ctags,它包含以下代码行(从标记栏文档中的原始代码行修改而来):
--regex-latex=/^[\t]*\\includegraphics[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{[\.{2}\/]*[[a-zA-Z0-9_]+\/]*([^}]+)\}/\3/g,graphic+listing/但是我不能只得到文件名。我尝试了其他方法,但有时我只删除"../",有时我只得到"plate_hole"..我做错了什么?
谢谢
发布于 2013-05-26 12:28:29
这个方法对我很有效:
--regex-latex=/^[\t]*\\includegraphics[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+\/)?([^}\/]+)\}/\4/g,graphic+listing/https://stackoverflow.com/questions/16421188
复制相似问题