【阿卡乐谱】《茉莉花》的简谱Latex语法

阿卡乐谱语法

3 3_5_ (6_1u_) 1u_6_ |
#[0]好一朵美 丽的

5 (5_6_) 5 - |
#[1]茉莉 花

3 3_5_ (6_1u_) 1u_6_ |
#[2]好一朵美 丽的

5 (5_6_) 5 - |
#[3]茉莉 花

5 5 5 (3_5_) |
#[4]芬芳美丽

6 (6_5_) 5 - |
#[5]满枝 桠

3 (2_3_) 5 (3_2_) |
#[6]又香 又白

1 (1_2_) 1 - |
#[7]人人 夸

(3_2_) (1_3_) 2. 3_ |
#[8]让 我 来将

5 (6_1u_) 5 - |
#[9]你摘 下

2 (3_5_) (2_3_) (1_6d_) |
#[10]送给 别 人

5d - 6d (6d_1_) |
#[11]家茉莉

2. 3_ (1_2_) (1_6d_) |
#[12]花呀茉 莉

[1. 5d - - - ] :||
#[13][2. 5d - 6d (6d_1_) |
#[14]花呀茉莉

2. 3_ (1_2_) (1_6d_) |
#[15]花呀茉 莉

5d - - - ] _||
#[16]

Latex语法

通过阿卡乐谱语法生成的latex语法
需要先安装专用字体akfonts.ttf。

使用重直盒子进行拼装,实现基本的自动排版。

\documentclass{article}

\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}

\usepackage{ctex}
\usepackage{float}
\usepackage{arydshln}
\usepackage{amsmath} 
\usepackage{amssymb}

\usepackage{fontspec}
\newcommand{\akfonts}{\fontspec{akfonts.ttf}}


\begin{document}



\title{阿卡简谱}

\author{阿卡}
% QQ交流群: 263600549(阿卡乐谱)

\maketitle


\section{简谱}

% ------------------------------------------------
%  star of [标题部分]

\begin{center}
\zihao{2}{\textbf{茉莉花}}

\zihao{5}
\begin{tabular}{lp{10em}cp{10em}r}
1= {\rm E} \zihao{3}{$\frac{4}{4}$}  & \   & 江苏民歌  & \   & 江苏民歌 词曲  \\


♩=100


\end{tabular}

\end{center}
%  end of [标题部分]
% ------------------------------------------------


% ------------------------------------------------
% start of [ 乐谱部分]
\zihao{5}
\begin{flushleft}
\begin{akfonts}


\parbox[t]{1em}{ \Large{l3l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l3\_l\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_5\_l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l6\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I1'\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l1'\_l\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_6\_l} \footnotesize{} } 
\parbox[t]{1em}{ | } % end of 第【0】小节
\parbox[t]{1em}{ \Large{l5l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l5\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I6\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l5} \footnotesize{} } 
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{ | } % end of 第【1】小节
\parbox[t]{1em}{ \Large{l3l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l3\_l\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_5\_l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l6\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I1'\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l1'\_l\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_6\_l} \footnotesize{} } 
\parbox[t]{1em}{ | } % end of 第【2】小节
\parbox[t]{1em}{ \Large{l5l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l5\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I6\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l5} \footnotesize{} } 
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{ | } % end of 第【3】小节
\parbox[t]{1em}{ \Large{l5l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l5l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l5l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l3\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I5\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ | } % end of 第【4】小节
\parbox[t]{1em}{ \Large{l6l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l6\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I5\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l5} \footnotesize{} } 
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{ | } % end of 第【5】小节
\parbox[t]{1em}{ \Large{l3l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l2\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I3\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l5l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l3\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I2\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ | } % end of 第【6】小节
\parbox[t]{1em}{ \Large{l1l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l1\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I2\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l1} \footnotesize{} } 
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{ | } % end of 第【7】小节
\parbox[t]{1em}{ \Large{l3\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I2\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l1\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I3\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l2.l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l3\_l} \footnotesize{} } 
\parbox[t]{1em}{ | } % end of 第【8】小节
\parbox[t]{1em}{ \Large{l5l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l6\_Ul\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_I1'\_Pl} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l5} \footnotesize{} } 
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{ | } % end of 第【9】小节
\parbox[t]{1em}{ \Large{l2l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l3\_Jl\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_K5\_:l} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l2\_Jl\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_K3\_:l} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l1\_Jl\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_K6w:l} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ | } % end of 第【10】小节
\parbox[t]{1em}{ \Large{l5q} \footnotesize{} } 
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{ \Large{l6ql} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l6wJl\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_K1\_:l} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ | } % end of 第【11】小节
\parbox[t]{1em}{ \Large{l2.l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l3\_l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l1\_Jl\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_K2\_:l} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l1\_Jl\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_K6w:l} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ |Z! } % end of 第【12】小节
\parbox[t]{1em}{ \Large{l5q} \footnotesize{} } 
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{ C]Z@ } % end of 第【13】小节
\parbox[t]{1em}{ \Large{l5q} \footnotesize{} } 
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{ \Large{l6ql} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l6wJl\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_K1\_:l} \footnotesize{} } 
\parbox[t]{1em}{ | } % end of 第【14】小节
\parbox[t]{1em}{ \Large{l2.l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l3\_l} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l1\_Jl\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_K2\_:l} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ \Large{l1\_Jl\_} \footnotesize{} } 
\parbox[t]{1em}{ \Large{l\_K6w:l} \footnotesize{\char"3000} } 
\parbox[t]{1em}{ | } % end of 第【15】小节
\parbox[t]{1em}{ \Large{l5q} \footnotesize{} } 
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{\Large{l-l} \footnotesize{\char"3000}}
\parbox[t]{1em}{ C+ } % end of 第【16】小节


\

\end{akfonts}
%  end of [乐谱部分]
% ------------------------------------------------
\end{flushleft}

\end{document} 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
好的,我可以为您提供一个示例代码,来实现这个功能。由于您要求使用BKDRHash方法,我将使用它来进行字符串的哈希。 首先,我们需要定义一个结构体来存储诅咒的名称和效果: ``` struct Curse { string name; string effect; }; ``` 然后,我们定义一个哈希函数,使用BKDRHash方法: ``` unsigned int BKDRHash(const string& str) { unsigned int seed = 131; // 31 131 1313 13131 131313 etc.. unsigned int hash = 0; for (int i = 0; i < str.length(); i++) { hash = hash * seed + str[i]; } return hash; } ``` 接下来,我们使用哈希表来存储所有的诅咒: ``` const int MAXN = 100005; vector<Curse> curseTable[MAXN]; int main() { // 读入诅咒 string line; while (getline(cin, line)) { if (line == "END") break; int pos = line.find(" "); string name = line.substr(1, pos - 1); string effect = line.substr(pos + 1); unsigned int hash = BKDRHash(name); curseTable[hash].push_back({name, effect}); } // 处理查询 int n; cin >> n; getchar(); // 读取换行符 for (int i = 0; i < n; i++) { getline(cin, line); if (line[0] == '[') { // 查询名称 string name = line.substr(1, line.length() - 2); unsigned int hash = BKDRHash(name); for (auto& curse : curseTable[hash]) { if (curse.name == name) { cout << curse.effect << endl; goto found; } } cout << "沉默" << endl; } else { // 查询效果 for (int j = 0; j < MAXN; j++) { for (auto& curse : curseTable[j]) { if (curse.effect == line) { cout << "[" << curse.name << "]" << endl; goto found; } } } cout << "沉默" << endl; } found:; } return 0; } ``` 代码中使用了一个哈希表来存储所有的诅咒。对于查询,如果查询的是名称,则根据名称的哈希值在哈希表中查找所有名称为该值的诅咒,并输出其效果;如果查询的是效果,则遍历所有诅咒,找到效果匹配的诅咒,并输出其名称。 需要注意的一点是,由于查询的时候可能会有多个诅咒的名称或效果相同,因此在哈希表中我们使用了一个vector来存储所有的诅咒。 希望这个示例代码可以帮助您解决问题。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

遗落尘污

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值