1 Star 0 Fork 3

善衡/eda

forked from 连享会/eda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
edaentry.ado 5.85 KB
一键复制 编辑 原始数据 按行查看 历史
wbuchanan 提交于 2018-07-09 09:20 . Merge branch 'master' into gh-pages
/*******************************************************************************
This is completely experimental and not intended for distribution with
eda at this time. It is an attempt at refactoring some of the functionality
of the internals in eda to maintain LaTeX entries for specific captions,
titling, and reference entries outside of individual sub routines and/or
the main program.
*******************************************************************************/
*! edaentry
*! v 0.0.0
*! 07JUL2018
cap prog drop edaentry
prog def edaentry
version 14
syntax , id(string asis) XVar(varname) Type(string asis) ///
[ YVar(varname) AUXvar(varname) ]
// Remove LaTeX Special Characters from variable name
texclean "`xvar'", r
// Store in local macro
loc xref `r(clntex)'
// Get label info
texclean "`: var l `xvar''"
// Set title/caption info
loc xlab `r(clntex)'
// If yvar is passed
if "`yvar'" != "" {
// Remove LaTeX Special Characters from variable name
texclean "`yvar'", r
// Store variable name for use in references
loc yref `r(clntex)'
// Get label info
texclean "`: var l `xvar''"
// Set title/caption info
loc xlab `r(clntex)'
} // End IF Block for yvars
// If auxvar passed create macros
if "`auxvar'" != "" {
// Remove LaTeX Special Characters from variable name
texclean "`auxvar'", r
// Store variable name for use in references
loc auxref `r(clntex)'
// Get label info
texclean "`: var l `auxvar''"
// Set title/caption info
loc auxlab `r(clntex)'
} // End IF Block for auxvars
// Check the type of the entry to add
if "`type'" == "bar" {
// Add the graph to the LaTeX file
file write doc "\begin{figure}" _n
file write doc `"\caption{`xlab' \label{fig:`type'`xref'}}"' _n // Add Identifier
file write doc `"\includegraphics{`type'`xvar'.pdf}"' _n // Add Identifier
file write doc "\end{figure} \newpage\clearpage" _n
} // End IF Block for bar graphs
// If the type is
else if "`type'" == "pie" {
// Add the graph to the LaTeX file
file write doc "\begin{figure}" _n
file write doc `"\caption{`: char `v'[title]' \label{fig:`type'}}"' _n // Add Identifier
file write doc `"\includegraphics{`type'`xvar'.pdf}"' _n // Add Identifier
file write doc "\end{figure} \newpage\clearpage" _n
} // End ELSEIF Block for
// If the type is
else if "`type'" == "" {
// Add the graph to the LaTeX file
file write doc "\begin{figure}" _n
file write doc `"\caption{`: char `v'[title]' \label{fig:`type'}}"' _n // Add Identifier
file write doc `"\includegraphics{`type'.pdf}"' _n // Add Identifier
file write doc "\end{figure} \newpage\clearpage" _n
} // End ELSEIF Block for
// If the type is
else if "`type'" == "" {
// Add the graph to the LaTeX file
file write doc "\begin{figure}" _n
file write doc `"\caption{`: char `v'[title]' \label{fig:`type'}}"' _n // Add Identifier
file write doc `"\includegraphics{`type'.pdf}"' _n // Add Identifier
file write doc "\end{figure} \newpage\clearpage" _n
} // End ELSEIF Block for
// If the type is
else if "`type'" == "" {
// Add the graph to the LaTeX file
file write doc "\begin{figure}" _n
file write doc `"\caption{`: char `v'[title]' \label{fig:`type'}}"' _n // Add Identifier
file write doc `"\includegraphics{`type'.pdf}"' _n // Add Identifier
file write doc "\end{figure} \newpage\clearpage" _n
} // End ELSEIF Block for
// If the type is
else if "`type'" == "" {
// Add the graph to the LaTeX file
file write doc "\begin{figure}" _n
file write doc `"\caption{`: char `v'[title]' \label{fig:`type'}}"' _n // Add Identifier
file write doc `"\includegraphics{`type'.pdf}"' _n // Add Identifier
file write doc "\end{figure} \newpage\clearpage" _n
} // End ELSEIF Block for
// If the type is
else if "`type'" == "" {
// Add the graph to the LaTeX file
file write doc "\begin{figure}" _n
file write doc `"\caption{`: char `v'[title]' \label{fig:`type'}}"' _n // Add Identifier
file write doc `"\includegraphics{`type'.pdf}"' _n // Add Identifier
file write doc "\end{figure} \newpage\clearpage" _n
} // End ELSEIF Block for
// If the type is
else if "`type'" == "" {
// Add the graph to the LaTeX file
file write doc "\begin{figure}" _n
file write doc `"\caption{`: char `v'[title]' \label{fig:`type'}}"' _n // Add Identifier
file write doc `"\includegraphics{`type'.pdf}"' _n // Add Identifier
file write doc "\end{figure} \newpage\clearpage" _n
} // End ELSEIF Block for
// If the type is
else if "`type'" == "" {
// Add the graph to the LaTeX file
file write doc "\begin{figure}" _n
file write doc `"\caption{`: char `v'[title]' \label{fig:`type'}}"' _n // Add Identifier
file write doc `"\includegraphics{`type'.pdf}"' _n // Add Identifier
file write doc "\end{figure} \newpage\clearpage" _n
} // End ELSEIF Block for
// If the type is
else if "`type'" == "" {
// Add the graph to the LaTeX file
file write doc "\begin{figure}" _n
file write doc `"\caption{`: char `v'[title]' \label{fig:`type'}}"' _n // Add Identifier
file write doc `"\includegraphics{`type'.pdf}"' _n // Add Identifier
file write doc "\end{figure} \newpage\clearpage" _n
} // End ELSEIF Block for
// If the type is
else if "`type'" == "" {
// Add the graph to the LaTeX file
file write doc "\begin{figure}" _n
file write doc `"\caption{`: char `v'[title]' \label{fig:`type'}}"' _n // Add Identifier
file write doc `"\includegraphics{`type'.pdf}"' _n // Add Identifier
file write doc "\end{figure} \newpage\clearpage" _n
} // End ELSEIF Block for
// For any other case
else {
} // End ELSE Block for other cases
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jerryyang66/eda.git
git@gitee.com:jerryyang66/eda.git
jerryyang66
eda
eda
master

搜索帮助