File size: 151,559 Bytes
fdbb2bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
#let rtext(content)={
  text(fill: rgb(139,0,0),content)
}
= 模型库(Model)<model>
文档结构化。

在此处,你可以找到用于构建文档结构并与该结构交互的各项功能。包括章节标题、图表、参考文献管理、交叉引用等。

== 资源(asset)<asset>
将自定义文件添加到包中。

此函数从#link(<bytes>)[原始字节数据]创建包中的单个文件。与#link(<document>)[文档]不同,资源将按原样发出,而无需进行编译。

asset函数可以与#link(<read>)[读取]相结合,将文件从项目复制到输出包中。asset的第一个参数定义了bundle中资产的输出路径,而传递给read的路径定义了从项目中的何处读取数据。
```typst
    // Copy the file `styles.css` into the bundle.
    #asset("styles.css", read("styles.css"))
```
也就是说,资源与读无关。您还可以直接生成字节或使用#link(<json_encode>)[json.encode]等函数来发出序列化数据。
```typst
// Emits a JSON file with the number
// of headings in the document.
#context {
  let headings = query(heading)
  let meta = (
    count: headings.len(),
  )
  asset("meta.json", json.encode(meta))
}

#document("doc.pdf")[
  = Introduction
  = Conclusion
]
```
这将在生成的包中输出一个包含以下内容的meta.json文件:
```typst
{
  "count": 2
}
```
此函数仅限在绑定目标中使用。
=== 参数(Parameters)
```typc
    asset(
        path:str,
        data:str bytes,
    ) → content
```
- *path*: str
资源在程序包内的存放路径。

路径中可包含内部斜杠,此时系统会自动创建中间层级目录。
- *data*: str bytes
将写入指定路径文件的原始数据。

如果传入字符串,将使用UTF-8进行编码。

== 参考文献(bibliography)<bibliography>
参考书目/参考文献列表。

您可以通过调用此函数来创建新的参考书目,该函数具有以下两种格式之一的参考书目文件的路径:
#set par(hanging-indent: 1.3cm)
-- Hayagriva.yaml/.yml文件。Hayagriva是一种新的书目文件格式,专为Typst设计。有关更多详细信息,请访问其文档。

-- BibLaTeX.bib文件。
#set par(hanging-indent: 0cm)
一旦你在文档的某个地方添加了参考书目,你就可以开始引用引用语法(```typc @key```)或对引用函数(```typc #cite(<key>)```)的显式调用。参考书目将仅显示文档中引用的作品条目。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
This was already noted by
pirates long ago. @arrgh

Multiple sources say ...
@arrgh @netwok.

#bibliography("works.bib")
    ```
  ],[
    #set align(horizon)
    #image("images/3001.png",width: auto)]
)
=== 风格(Styles)<bibliography_Styles>
Typst提供了多种内置的引文和参考书目样式。除此之外,您还可以添加和使用自定义CSL(引文样式语言)文件。想知道使用哪种风格?以下是一些基于您所从事的学科的良好默认值:
#table(

  columns: (1fr,1fr),
  stroke: none,
  table.header[Fields][Typical Styles],
  table.hline(),
  [Engineering,IT],[\"ieee\"],
  [Psychology,Life Sciences],[\"apa\"],
  [Social sciences],[\"chicago-author-date\"],
  [Humanities],[\"mla\",\"chicago-notes\",\"harvard-cite-them-right\"],
  [Economics],[\"harvard-cite-them-right\"],
  [Physics],[\"american-physics-society\"],
)
=== 多参考书目(Multiple bibliographies)<bibliography_Multiple>
当Typst文档包含多个参考书目时,每个引用都会分配给其中一个。默认情况下,Typst会自动选择一个合适的参考书目(通常是包含引用关键字的最接近的参考书目)。这涵盖了常见的案例,如按章节或主题参考书目。为了进行更精细的控制,引用可以通过目标选择器由参考书目明确地定位。
=== 参数(Parameters)<bibliography_Parameters>
```typc
    bibliography(
        sources:str path bytes array,
        title: none auto content,
        full: bool,
        style: str path bytes,
        target: auto label selector location function,
        group: none auto str,
    ) → content
```
- *sources*:str or path or bytes or array
Hayagriva.yaml和/或BibLaTeX.bib文件的一个或多个路径或原始字节。

这可以是:

-- 加载参考文献目录文件的路径字符串或路径。

-- 应从中解码参考书目的原始字节。

-- 一个数组,其中每个项目都是上述之一。
- *title*: none or auto or content
参考书目的标题。缺省值:#rtext()[auto]。

-- 当设置为#rtext()[auto]时,将使用#link(<text_lang>)[文本语言]的适当标题。这是默认设置。

-- 当设置为#rtext()[none]时,参考书目将没有标题。

-- 可以通过传递内容来设置自定义标题。

默认情况下,参考书目的标题不会编号,但您可以使用show-set规则:```typc show bibliography: set heading(numbering: "1.")```
- *full*: bool
是否包括给定参考书目文件中的所有作品,即使是文档中未引用的作品。缺省值:#rtext()[false]。

要选择性地添加单个引用的作品而不显示它们,您还可以使用表单设置为none的cite函数。
- *style*: str or path or bytes
书目风格。缺省值:#rtext()[ieee]。

这可以是:
#set par(hanging-indent: 1.3cm)
-- 具有内置样式之一名称的字符串(见下文)。下面列出的一些样式会出现两次,一次是全名,一次则是短别名。

-- #link("https://citationstyles.org/")[CSL文件]的路径字符串或#link(<Path>)[路径]。

-- 应从中解码CSL样式的原始字节。
#set par(hanging-indent: 0cm)
选项列表:
#table(

  columns: (1fr,1fr),
  stroke: none,
  table.header[*Variant*][*Details*],
  table.hline(),
 [\"alphanumeric\"],[Alphanumeric],
[\"american-anthropological-association\"],[American Anthropological Association],
[\"american-chemical-society\"],[ACS Guide 2022 revision],
[\"american-geophysical-union\"],[American Geophysical Union],
[\"american-institute-of-aeronautics-and-astronautics\"],[American Institute of Aeronautics and Astronautics],
[\"american-institute-of-physics\"],[AIP Style Manual 4th edition],
[\"american-medical-association\"],[AMA Manual of Style 11th edition],
[\"american-meteorological-society\"],[American Meteorological Society],
[\"american-physics-society\"],[American Physical Society],
[\"american-physiological-society\"],[American Physiological Society],
[\"american-political-science-association\"],[APSA Style Manual revised 2018 edition],
[\"american-psychological-association\"],[APA Style 7th edition],
[\"apa\"],[A short alias of american-psychological-association],
[\"american-society-for-microbiology\"],[American Society for Microbiology],
[\"american-society-of-civil-engineers\"],[American Society of Civil Engineers],
[\"american-society-of-mechanical-engineers\"],[American Society of Mechanical Engineers],
[\"american-sociological-association\"],[ASA Style Guide 6th/7th edition],
[\"angewandte-chemie\"],[Angewandte Chemie International Edition],
[\"annual-reviews\"],[Annual Reviews (sorted by order of appearance)],
[\"annual-reviews-author-date\"],[Annual Reviews (author-date)],
[\"associacao-brasileira-de-normas-tecnicas\"],[Associação Brasileira de Normas Técnicas (Português - Brasil)],
[\"association-for-computing-machinery\"],[Association for Computing Machinery],
[\"biomed-central\"],[BioMed Central],
[\"bristol-university-press\"],[Bristol University Press],
[\"british-medical-journal\"],[BMJ],
[\"bmj\"],[A short alias of british-medical-journal],
[\"cell\"],[Cell],
[\"chicago-author-date\"],[Chicago Manual of Style 18th edition (author-date)],
[\"chicago-notes\"],[Chicago Manual of Style 18th edition (notes and bibliography)],
[\"chicago-fullnotes\"],[A short alias of chicago-notes],
[\"chicago-shortened-notes\"],[Chicago Manual of Style 18th edition (shortened notes and bibliography)],
[\"copernicus\"],[Copernicus Publications],
[\"cse-citation-sequence-brackets-8th-edition\"],[CSE Manual: Scientific Style and Format 8th edition (citation-sequence, brackets)],
[\"council-of-science-editors\"],[A short alias of cse-citation-sequence-brackets-8th-edition],
[\"cse-name-year\"],[CSE Manual: Scientific Style and Format 9th edition (name-year)],
[\"council-of-science-editors-author-date\"],[A short alias of cse-name-year],
[\"current-opinion\"],[Current Opinion journals],
[\"deutsche-gesellschaft-für-psychologie\"],[Deutsche Gesellschaft für Psychologie 5. Auflage (Deutsch)],
[\"deutsche-sprache\"],[Deutsche Sprache (Deutsch)],
[\"elsevier-harvard\"],[Elsevier (author-date/Harvard, with titles)],
[\"elsevier-vancouver\"],[Elsevier - NLM/Vancouver (citation-sequence)],
[\"elsevier-with-titles\"],[Elsevier (numeric, with titles)],
[\"frontiers\"],[Frontiers journals],
[\"future-medicine\"],[Future Medicine journals],
[\"future-science\"],[Future Science Group],
[\"gb-7714-2005-numeric\"],[China National Standard GB/T 7714-2005 (numeric, 中文)],
[\"gb-7714-2015-author-date\"],[China National Standard GB/T 7714-2015 (author-date, 中文)],
[\"gb-7714-2015-note\"],[China National Standard GB/T 7714-2015 (note, 中文)],
[\"gb-7714-2015-numeric\"],[China National Standard GB/T 7714-2015 (numeric, 中文)],
[\"gost-r-705-2008-numeric\"],[Russian GOST R 7.0.5-2008 (numeric)],
[\"harvard-cite-them-right\"],[Cite Them Right 12th edition (author-date/Harvard)],
[\"institute-of-electrical-and-electronics-engineers\"],[IEEE Reference Guide version 11.29.2023],
[\"ieee\"],[A short alias of institute-of-electrical-and-electronics-engineers],
[\"institute-of-physics-numeric\"],[Institute of Physics (numeric)],
[\"iso-690-author-date\"],[ISO-690 (author-date, English)],
[\"iso-690-numeric\"],[ISO-690 (numeric, English)],
[\"karger\"],[Karger journals],
[\"mary-ann-liebert-vancouver\"],[Mary Ann Liebert - NLM/Vancouver],
[\"modern-humanities-research-association-notes\"],[MHRA Style Guide 4th edition (notes)],
[\"modern-humanities-research-association\"],[A short alias of modern-humanities-research-association-notes],
[\"modern-language-association\"],[MLA Handbook 9th edition (in-text citations)],
[\"mla\"],[A short alias of modern-language-association],
[\"modern-language-association-8\"],[A short alias of modern-language-association],
[\"mla-8\"],[A short alias of modern-language-association],
[\"multidisciplinary-digital-publishing-institute\"],[Multidisciplinary Digital Publishing Institute],
[\"nature\"],[Nature],
[\"nlm-citation-sequence\"],[NLM/Vancouver: Citing Medicine 2nd edition (citation-sequence)],
[\"vancouver\"],[A short alias of nlm-citation-sequence],
[\"nlm-citation-sequence-superscript\"],[NLM/Vancouver: Citing Medicine 2nd edition (citation-sequence, superscript)],
[\"vancouver-superscript\"],[A short alias of nlm-citation-sequence-superscript],
[\"pensoft\"],[Pensoft Journals],
[\"public-library-of-science\"],[Public Library of Science],
[\"plos\"],[A short alias of public-library-of-science],
[\"royal-society-of-chemistry\"],[Royal Society of Chemistry],
[\"sage-vancouver\"],[SAGE - NLM/Vancouver],
[\"sist02\"],[SIST02 (日本語)],
[\"spie\"],[SPIE journals],
[\"springer-basic\"],[Springer - Basic (numeric, brackets)],
[\"springer-basic-author-date\"],[Springer - Basic (author-date)],
[\"springer-fachzeitschriften-medizin-psychologie\"],[Springer - Fachzeitschriften Medizin Psychologie (Deutsch)],
[\"springer-humanities-author-date\"],[Springer - Humanities (author-date)],
[\"springer-lecture-notes-in-computer-science\"],[Springer - Lecture Notes in Computer Science],
[\"springer-mathphys\"],[Springer - MathPhys (numeric, brackets)],
[\"springer-socpsych-author-date\"],[Springer - SocPsych (author-date)],
[\"springer-vancouver\"],[Springer - NLM/Vancouver (citation-sequence, brackets)],
[\"taylor-and-francis-chicago-author-date\"],[Taylor & Francis Journals Standard Reference Style Guide: Chicago author-date version 2.0],
[\"taylor-and-francis-national-library-of-medicine\"],[Taylor & Francis - NLM/Vancouver (citation-sequence, brackets)],
[\"the-institution-of-engineering-and-technology\"],[The Institution of Engineering and Technology],
[\"the-lancet\"],[The Lancet],
[\"thieme\"],[Thieme-German (Deutsch)],
[\"trends\"],[Trends journals],
[\"turabian-author-date\"],[Chicago Manual of Style 17th edition (author-date)],
[\"turabian-fullnote-8\"],[Chicago Manual of Style 17th edition (notes and bibliography, subsequent author-title)],
)
- *target*:auto or label or selector or location or function
定义要包含在参考书目中的引用。缺省值:#rtext()[auto]。

Typst会自动将文档中的每个引文分配给一个参考书目。具体来说,引文将按优先顺序分配给
#set par(hanging-indent: 1.3cm)
-- 第一个将其包含在目标选择器中的参考书目;或者,如果不存在这样的参考书目

-- 与target最接近的以下参考书目:包含其关键字的#rtext()[auto];或者如果没有这样的参考书目

-- 与target: #rtext()[auto]最接近的前一个参考书目,其中包含其关键字。
#set par(hanging-indent: 0cm)
#table(

  columns: 1fr,

  stroke: none,

  align: left,

  [

    ```Typst

    #let info(body) = block(
    stroke: (left: 1.5pt + blue),
    fill: aqua.lighten(50%),
    inset: 1em,
    context {
      body
      show divider: set block(spacing: 1.2em)
      divider()
      bibliography(
        "works.bib",
        title: none,
        target: selector(cite).within(here()),
        style: "mla",
      )
    }
  )

  = On the matter of dumplings
  In recent years, we can observe an uptick in
  dumpling consumption across the board. @netwok

  #info[
    Dumplings are particularly enjoyed
    among pirates. @arrgh
  ]

  #bibliography("works.bib")
    ```
  ]
  ,
  [
    #image("images/3002.png")
  ]
)
- *group*: none or auto or str
出于编号目的,从概念上将此参考书目与其他参考书目分组。同一组的参考书目将分配连续的引用号。缺省值:#rtext()[auto]。

这可以是:

-- #rtext()[none]:参考书目将单独编号。

-- #rtext()[auto]:参考书目将与auto组中的所有其他参考书目连续编号。

-- 字符串:参考书目将与具有相同组值的所有其他参考书目连续编号。

自动组的工作方式与任何字符串组一样,但它是规范的默认组。
例1:连续引用编号
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show bibliography: set heading(
  offset: 1,
)

= First part
Starts at one: @netwok @arrgh
#bibliography(

  "works.bib",

  style: "ieee",

)

= Second part
Continues with three: @distress
#bibliography(

  "works.bib",

  style: "nlm-citation-sequence",

)
    ```
  ],[
    #set align(horizon)
    #image("images/3003.png",width: auto)]
)
例2:单独的引用编号
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show bibliography: set heading(
  offset: 1,
)
#set bibliography(group: none)

= First part
Starts at one: @netwok @arrgh
#bibliography(

  "works.bib",

  style: "ieee",

)

= Second part
Resets to one: @distress
#bibliography(

  "works.bib",

  style: "nlm-citation-sequence",

)
    ```
  ],[
    #set align(horizon)
    #image("images/3004.png",width: auto)]
)

== 项目符号列表(list)<list>
项目符号列表。

垂直显示一系列项目,每个项目由一个标记引入。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typc
Normal list.
- Text
- Math
- Layout
- ...

Multiple lines.
- This list item spans multiple
  lines because it is indented.

Function call.
#list(

  [Foundations],

  [Calculate],

  [Construct],

  [Data Loading],

)
    ```
  ],[
    #set align(horizon)
    #image("images/3005.png",width: auto)]
)
=== 语法(Syntax)
此函数还具有专用语法:用连字符开始一行,后跟空格以创建列表项。列表项可以包含多个段落和其他块级内容。所有缩进超过项目标记的内容都将成为该项目的一部分。
=== 参数(Parameters)
```typc
list(
    tight: bool,
    marker: content array function,
    indent: length,
    body-indent: length,
    spacing: auto length,
    marker-align: alignment,
    ..content,
) → content
```
- *tight*: bool<list_tight>
定义列表的默认间距。如果为#rtext()[false],则以段落间距分隔项目。如果是#rtext()[true],他们会使用段落引导。这使得列表更加紧凑,如果项目较短,看起来会更好。缺省值:#rtext()[true]。

在标记模式下,此参数的值取决于项目是否用空行分隔。如果项目直接相互跟随,则设置为true;如果项目之间用空行分隔,则设置为false。标记定义的紧密性不能用设定的规则覆盖。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
- If a list has a lot of text, and
  maybe other inline content, it
  should not be tight anymore.

- To make a list wide, simply insert
  a blank line between the items.
    ```
  ],[
    #set align(horizon)
    #image("images/3006.png",width: auto)]
)
- *marker*: content array function<list_marker>
导入每个项目的标记。缺省值:([•], [‣], [–])。

除了纯内容,您还可以传递一个包含多个标记的数组,这些标记应用于嵌套列表。如果列表嵌套深度超过标记数量,则标记将循环。为了实现完全控制,您可以传递一个函数,将列表的嵌套深度(从0开始)映射到所需的标记。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set list(marker: [--])
- A more classic list
- With en-dashes

#set list(marker: ([•], [--]))
- Top-level
  - Nested
  - Items
- Items
    ```
  ],[
    #set align(horizon)
    #image("images/3007.png",width: auto)]
)
- *indent*:length<list_indent>
每个项目的缩进。缺省值:#rtext()[0pt]。
- *body-indent*:length<list_body-indent>
标记和每个项目主体之间的间距。缺省值:#rtext()[0.tem]。
- *spacing*: auto length<list_spacing>
列表中项目之间的间距。缺省值:#rtext()[auto]。

如果设置为自动,则对紧列表使用段落前导,对宽(非紧)列表使用段落间距。
- *marker-align*: alignment<list_marker-align>
用于列表标记的对齐方式。缺省值:end。

垂直对齐总是相对于它们所附加的列表项的高度。默认情况下,它是未指定的,这意味着每个标记将与它所附加的项目的基线垂直对齐(通常是它的第一行文本,否则是它的顶部)。

另一方面,水平对齐是相对于同一列表级别的其他标记的。默认情况下,它设置为end,这意味着标记朝向当前文本方向的末尾排列(LTR为右,RTL为左)。然而,由于每个级别的标记通常是相同的,因此预计水平对齐在大多数情况下没有实际效果。无论如何,在某些情况下,它仍然有可能产生影响,特别是如果标记使用计数器或其他形式的状态来显示每个项目的不同内容。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
- Baseline \
  aligned

#set list(marker-align: horizon)

- Horizon \
  aligned
    ```
  ],[
    #set align(horizon)
    #image("images/3008.png",width: auto)]
)
- *children*: content
项目列表的子列表们。

使用列表语法时,即使通过for循环等构造,相邻项也会自动收集到列表中。
=== 定义(Definition)
- *item*<list_item>
项目列表。
```typc
    list.item(body: content) → content
```
-- body: content

列表项。

== 引用(cite)<cite>
从参考书目中引用一部作品。

在开始引用之前,您需要在文档的某个地方添加一个#link(<bibliography>)[参考文献]。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
This was already noted by
pirates long ago. @arrgh

Multiple sources say ...
@arrgh @netwok.

You can also call `cite`
explicitly. #cite(<arrgh>)

#bibliography("works.bib")
    ```
  ],[
    #set align(horizon)
    #image("images/3009.png",width: auto)]
)
如果源名称包含斜杠等不被<>语法识别的特殊字符,您可以显式调用标签代替。

Computer Modern 是现代主义衬线体字体的一个典范。
引用标签(“DBLP:books/lib/Knuth86a”)。
=== 语法(Syntax)
该函数间接地具有专用语法。可使用引用功能来标注参考文献中的作品。标签随后将与引用键对应。
=== 参数(Parameters)
```typc
    cite(
        key:label,
        supplement: nonecontent,
        form: none str,
        style: auto str path bytes,
    ) → content
```
- *key*: label<cite_key>
用于标识文献引用条目的键值,作为引用标签。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
// All the same
@netwok \
#cite(<netwok>) \
#cite(label("netwok"))
    ```
  ],[
    #set align(horizon)
    #image("images/3010.png",width: auto)]
)
- *supplement*: none content<cite_supplement>
引文的补充,如页码或章节号。缺省值:#rtext()[none]。

在参考语法中,可以在方括号中添加补充:
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
This has been proven. @distress[p.~7]

#bibliography("works.bib")
    ```
  ],[
    #set align(horizon)
    #image("images/3011.png",width: auto)]
)
- *form*: none str<cite_form>
要制作的引文类型。不同的形式在不同的情况下是有用的:正常的引用在句末是有用的,而“散文”引用更适合包含在文本流中。缺省值:#rtext()[\"normal\"]。

如果设置为none,引用的作品将包含在参考书目中,但不会显示任何内容。
#table(

  columns: (0.5fr,2fr),
  align: left,
  stroke: none,
  table.header[*Variant*][*Details*],
  table.hline(),
  [\"normal\"],[Display in the standard way for the active style.],
  [\"prose\"],[Produces a citation that is suitable for inclusion in a sentence.],
  [\"full\"],[Mimics a bibliography entry, with full information about the cited work.],
  [\"author\"],[Shows only the cited work’s author(s).],
  [\"year\"],[Shows only the cited work’s year.],
)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#cite(<netwok>, form: "prose")
show the outsized effects of
pirate life on the human psyche.
    ```
  ],[
    #set align(horizon)
    #image("images/3012.png",width: auto)]
)
- *style*: auto str path bytes<cite_style>
引用风格。缺省值:#rtext()[auto]。

这可以是:

-- auto:自动使用参考书目的引用样式。

-- 具有内置样式之一名称的字符串(见下文)。下面列出的一些样式会出现两次,一次是全名,一次则是短别名。

-- CSL文件的路径字符串或路径。

-- 应从中解码CSL样式的原始字节。

选项列表:
#table(

  columns: (1fr,1.5fr),
  align: left,
  stroke: none,
  table.header[*Variant*][*Details*],
  table.hline(),
  [\"alphanumeric\"],[Alphanumeric],
[\"american-anthropological-association\"],[American Anthropological Association],
[\"american-chemical-society\"],[ACS Guide 2022 revision],
[\"american-geophysical-union\"],[American Geophysical Union],
[\"american-institute-of-aeronautics-and-astronautics\"],[American Institute of Aeronautics and Astronautics],
[\"american-institute-of-physics\"],[AIP Style Manual 4th edition],
[\"american-medical-association\"],[AMA Manual of Style 11th edition],
[\"american-meteorological-society\"],[American Meteorological Society],
[\"american-physics-society\"],[American Physical Society],
[\"american-physiological-society\"],[American Physiological Society],
[\"american-political-science-association\"],[APSA Style Manual revised 2018 edition],
[\"american-psychological-association\"],[APA Style 7th edition],
[\"apa\"],[A short alias of american-psychological-association],
[\"american-society-for-microbiology\"],[American Society for Microbiology],
[\"american-society-of-civil-engineers\"],[American Society of Civil Engineers],
[\"american-society-of-mechanical-engineers\"],[American Society of Mechanical Engineers],
[\"american-sociological-association\"],[ASA Style Guide 6th/7th edition],
[\"angewandte-chemie\"],[Angewandte Chemie International Edition],
[\"annual-reviews\"],[Annual Reviews (sorted by order of appearance)],
[\"annual-reviews-author-date\"],[Annual Reviews (author-date)],
[\"associacao-brasileira-de-normas-tecnicas\"],[Associação Brasileira de Normas Técnicas (Português - Brasil)],
[\"association-for-computing-machinery\"],[Association for Computing Machinery],
[\"biomed-central\"],[BioMed Central],
[\"bristol-university-press\"],[Bristol University Press],
[\"british-medical-journal\"],[BMJ],
[\"bmj\"],[A short alias of british-medical-journal],
[\"cell\"],[Cell],
[\"chicago-author-date\"],[Chicago Manual of Style 18th edition (author-date)],
[\"chicago-notes\"],[Chicago Manual of Style 18th edition (notes and bibliography)],
[\"chicago-fullnotes\"],[A short alias of chicago-notes],
[\"chicago-shortened-notes\"],[Chicago Manual of Style 18th edition (shortened notes and bibliography)],
[\"copernicus\"],[Copernicus Publications],
[\"cse-citation-sequence-brackets-8th-edition\"],[CSE Manual: Scientific Style and Format 8th edition (citation-sequence, brackets)],
[\"council-of-science-editors\"],[A short alias of cse-citation-sequence-brackets-8th-edition],
[\"cse-name-year\"],[CSE Manual: Scientific Style and Format 9th edition (name-year)],
[\"council-of-science-editors-author-date\"],[A short alias of cse-name-year],
[\"current-opinion\"],[Current Opinion journals],
[\"deutsche-gesellschaft-für-psychologie\"],[Deutsche Gesellschaft für Psychologie 5. Auflage (Deutsch)],
[\"deutsche-sprache\"],[Deutsche Sprache (Deutsch)],
[\"elsevier-harvard\"],[Elsevier (author-date/Harvard, with titles)],
[\"elsevier-vancouver\"],[Elsevier - NLM/Vancouver (citation-sequence)],
[\"elsevier-with-titles\"],[Elsevier (numeric, with titles)],
[\"frontiers\"],[Frontiers journals],
[\"future-medicine\"],[Future Medicine journals],
[\"future-science\"],[Future Science Group],
[\"gb-7714-2005-numeric\"],[China National Standard GB/T 7714-2005 (numeric, 中文)],
[\"gb-7714-2015-author-date\"],[China National Standard GB/T 7714-2015 (author-date, 中文)],
[\"gb-7714-2015-note\"],[China National Standard GB/T 7714-2015 (note, 中文)],
[\"gb-7714-2015-numeric\"],[China National Standard GB/T 7714-2015 (numeric, 中文)],
[\"gost-r-705-2008-numeric\"],[Russian GOST R 7.0.5-2008 (numeric)],
[\"harvard-cite-them-right\"],[Cite Them Right 12th edition (author-date/Harvard)],
[\"institute-of-electrical-and-electronics-engineers\"],[IEEE Reference Guide version 11.29.2023],
[\"ieee\"],[A short alias of institute-of-electrical-and-electronics-engineers],
[\"institute-of-physics-numeric\"],[Institute of Physics (numeric)],
[\"iso-690-author-date\"],[ISO-690 (author-date, English)],
[\"iso-690-numeric\"],[ISO-690 (numeric, English)],
[\"karger\"],[Karger journals],
[\"mary-ann-liebert-vancouver\"],[Mary Ann Liebert - NLM/Vancouver],
[\"modern-humanities-research-association-notes\"],[MHRA Style Guide 4th edition (notes)],
[\"modern-humanities-research-association\"],[A short alias of modern-humanities-research-association-notes],
[\"modern-language-association\"],[MLA Handbook 9th edition (in-text citations)],
[\"mla\"],[A short alias of modern-language-association],
[\"modern-language-association-8\"],[A short alias of modern-language-association],
[\"mla-8\"],[A short alias of modern-language-association],
[\"multidisciplinary-digital-publishing-institute\"],[Multidisciplinary Digital Publishing Institute],
[\"nature\"],[Nature],
[\"nlm-citation-sequence\"],[NLM/Vancouver: Citing Medicine 2nd edition (citation-sequence)],
[\"vancouver\"],[A short alias of nlm-citation-sequence],
[\"nlm-citation-sequence-superscript\"],[NLM/Vancouver: Citing Medicine 2nd edition (citation-sequence, superscript)],
[\"vancouver-superscript\"],[A short alias of nlm-citation-sequence-superscript],
[\"pensoft\"],[Pensoft Journals],
[\"public-library-of-science\"],[Public Library of Science],
[\"plos\"],[A short alias of public-library-of-science],
[\"royal-society-of-chemistry\"],[Royal Society of Chemistry],
[\"sage-vancouver\"],[SAGE - NLM/Vancouver],
[\"sist02\"],[SIST02 (日本語)],
[\"spie\"],[SPIE journals],
[\"springer-basic\"],[Springer - Basic (numeric, brackets)],
[\"springer-basic-author-date\"],[Springer - Basic (author-date)],
[\"springer-fachzeitschriften-medizin-psychologie\"],[Springer - Fachzeitschriften Medizin Psychologie (Deutsch)],
[\"springer-humanities-author-date\"],[Springer - Humanities (author-date)],
[\"springer-lecture-notes-in-computer-science\"],[Springer - Lecture Notes in Computer Science],
[\"springer-mathphys\"],[Springer - MathPhys (numeric, brackets)],
[\"springer-socpsych-author-date\"],[Springer - SocPsych (author-date)],
[\"springer-vancouver\"],[Springer - NLM/Vancouver (citation-sequence, brackets)],
[\"taylor-and-francis-chicago-author-date\"],[Taylor & Francis Journals Standard Reference Style Guide: Chicago author-date version 2.0],
[\"taylor-and-francis-national-library-of-medicine\"],[Taylor & Francis - NLM/Vancouver (citation-sequence, brackets)],
[\"the-institution-of-engineering-and-technology\"],[The Institution of Engineering and Technology],
[\"the-lancet\"],[The Lancet],
[\"thieme\"],[Thieme-German (Deutsch)],
[\"trends\"],[Trends journals],
[\"turabian-author-date\"],[Chicago Manual of Style 17th edition (author-date)],
[\"turabian-fullnote-8\"],[Chicago Manual of Style 17th edition (notes and bibliography, subsequent author-title)],
)
== 分割线(divider)<divider>
一个主题分隔符,用于将内容部分隔开。

默认情况下,它呈现为一条水平线,但可以通过显示规则进行自定义。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
She left without a word.
#divider()
Three days later, she returned.
    ```
  ],[
    #set align(horizon)
    #image("images/3013.png",width: auto)]
)
=== 样式(Styling)<divider_Styling>
可以通过展示规则来设置分隔符的样式。

由于默认情况下分隔符显示为一条线,你可以使用一组规则来调整这条线的描边:
#table(

  columns: 1fr,

  align: left,

  stroke: none,

  fill: luma(86.27%),
  [
```typst
#show divider: set line(stroke: 2pt + red)
First part
#divider()
Second part
```
  ],
  [
    #image("images/3014.png",width: auto)
  ]
)
你也可以用自定义内容(如花朵或星号)完全替换分隔符,但之后应将其包裹在一个块中以保留间距:
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show divider: set align(center)
#show divider: block[∗ ∗ ∗]
Chapter 1
#divider()
Chapter 2
    ```
  ],[
    #set align(horizon)
    #image("images/3015.png",width: auto)]
)
=== 参数(Parameters)<divider_Parameters>
```typc
divider() → content
```
== 文档(document)<document>
管理元数据,并用于将文档文件添加到包中。
=== 元数据(Metadata)<document_Metadata>
文档元素是文档元数据的唯一真实来源。通过它,你可以在一个地方指定文档的标题、作者、日期等信息。通常,该元素会与set规则一起使用:
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show divider: set align(center)
#show divider: block[∗ ∗ ∗]
#set document(title: [My doc])

Title is _not_ rendered, but
embedded in PDF metadata.
    ```
  ],[
    #set align(horizon)
    #image("images/3016.png",width: auto)]
)
默认情况下,元数据会嵌入到输出中,但在文档中不会以可见形式呈现。然而,它会在整个文档中#link(<Context>)[上下文可用],并且可以被元素和模板使用。例如,内置的#link(<title>)[标题]元素会自动获取配置的文档标题:
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set document(title: [My doc])

#title()
Title is now rendered _and_
embedded in PDF metadata.
    ```
  ],[
    #set align(horizon)
    #image("images/3017.png",width: auto)]
)
与title元素类似,您也可以使用#link(<Context>)[上下文表达式]自行访问元数据。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
// In the document.
#set document(
  keywords: ("Typst", "Metadata")
)

// Somewhere in your template.
_Keywords:_
#context document.keywords.join(", ")
    ```
  ],[
    #set align(horizon)
    #image("images/3018.png",width: auto)]
)
在单文档导出格式中,此功能仅与#link(<Styling-set>)[set规则]一起使用。此类set规则必须仅出现在顶层,而不能出现在任何布局容器内部。您也可以显式创建一个文档元素,但这仅在#link(<document_bundle-export>)[包导出]中相关。

 *特定格式的考虑因素*

 元数据在不同程度上被嵌入到输出中:
- PDF导出支持全部元数据,并将其纳入PDF文档信息字典以及XMP元数据中。
- HTML导出仅支持标题、描述、作者和关键词属性。由于HTML标准中未提供日期属性,因此不支持该属性。
- SVG和PNG导出格式完全不支持任何元数据。
=== 包导出中的文档(Documents in bundle export)<document_bundle-export>
在包导出中,文档元素代表包输出中的一个单个文件,该文件采用Typst的其他导出格式之一。创建文档时,您必须提供输出路径和一些内容。Typst将编译并提供适当格式的内容。默认情况下,格式会根据您指定的路径的文件扩展名进行推断,但您也可以明确配置[格式]。
```typst
#document("index.html", title: [Home])[
  #title()
  View #link(<list>)[my famous list].
]

#document("list.html", title: [My Famous List])[
  #title()
  - My
  - Famous
  - List
] <list>
```
- 元数据(Metadata)
文档元素从顶层设置中的文档规则中提取元数据。这意味着,为单文档导出编写的文档可以在保留元数据的同时,与明确的文档元素一起使用。
```typst
// Will pick up the title defined in `paper.typ`.
#document("paper.pdf", include "paper.typ")
```
#linebreak()
```typst
// paper.typ
#set document(title: [My Paper])
...
```
请注意,文档中的文档集规则会覆盖传递给文档元素的显式参数。

此外,配置为文档显式参数的属性在上下文中可用:
```typst
#document("index.html", title: [My title])[
  // Both of these will pick up `[My title]`
  #title()
  #context document.title
]
```
=== 参数(Parameters)<document_Parameters>
```typc
document(
  path:str,
  format: auto str,
  title: none content,
  author: str array,
  description: none content,
  keywords: str array,
  date: none auto datetime,
  body:content,
) → content
```
- *path*: str<document_path>
在包中用于放置导出文档的路径。

可能包含内部斜杠,在这种情况下,会自动创建中间目录。

此属性仅在bundle目标中受支持。
- *format*: auto str<document_format>
导出成哪种格式。缺省值:#rtext()[auto]。

如果是自动导出,Typst会尝试根据路径的文件扩展名来推断导出格式。

此属性仅在bundle目标中受支持。
#table(

  columns: (0.5fr,2fr),
  stroke: none,
  align: (left,left),
  table.header[Variant][Details],
  table.hline(),
  [\"pdf\"],[高保真文档和图形格式,注重在打印中的精确再现。],
[\"png\"],[用于插图和透明图形的光栅格式。],
[\"svg\"],[网页的矢量图形格式。],
[\"html\"],[网页的文档格式。]
)
- *title*: none content<document_title>
文档标题。缺省值:#rtext()[none]。

这会被呈现为PDF查看器窗口或页面浏览器标签的标题。

默认情况下,配置的标题在文档中不会以可见形式呈现。您可以使用title元素将标题添加到文档内容中。该元素会自动获取此处配置的标题。

添加标题对于可访问性至关重要,因为它有助于用户更轻松地导航到您的文档,并在其他打开的文档中轻松识别它。在导出为PDF/UA格式时,必须提供标题。

虽然这可以是任意内容,但PDF查看器仅支持纯文本标题,因此转换可能会造成信息丢失。
- author:str or array
该文档的作者。
- description:none or content
该文档的描述。
- keywords:str or array
文档的关键词。
- date:none or auto or datetime
该文档的创建日期。

如果设置为auto(默认),Typst将使用当前日期和时间。将其设置为无,则Typst不会将任何创建日期嵌入到PDF元数据中。

年份部分必须至少为零才能嵌入到PDF中。

如果您希望创建逐字节可复现的PDF文件,请将其设置为非auto模式。
- body:content
构成文档的内容。

此属性仅在bundle目标中受支持。

== 强调(emph)<Emphasis>
通过切换斜体来强调内容。

-- 如果当前#link(<text_style>)[文本样式]为```typc "normal"```,则将其更改为```typc "italic"```。

-- 如果它已经是```typc "italic"```或```typc "oblique"```,则将其恢复为```typc "normal"```。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
This is _emphasized._ \
This is #emph[too.]

#show emph: it => {
  text(blue, it.body)
}

This is _emphasized_ differently.
    ```
  ],[
    #set align(horizon)
    #image("images/3019.png",width: auto)]
)
=== 语法(Syntax)
此函数也有专门的语法:要强调内容,只需将其用下划线(\_)括起来。请注意,这仅在单词边界处有效。要强调单词的一部分,则必须使用该函数。
=== 参数(Parameters)
```typc
emph(body:content) → content
```
== 图形(figure)<figure>
一个带有可选说明文字的图形。

自动检测其类型以选择正确的计数轨迹。例如,包含图像的图表将与包含表格的图表分开编号。
=== 示例(Examples)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
@glacier shows a glacier. Glaciers
are complex systems.

#figure(

  image("glacier.jpg", width: 80%),
  caption: [A curious figure.],
) <glacier>

    ```
  ],[
    #set align(horizon)
    #image("images/3020.png",width: auto)]
)
您还可以在图表中插入#link(<table>)[表格],并为它们添加标题。图表将检测到这一操作,并自动使用单独的计数器。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#figure(

  table(

    columns: 4,

    [t], [1], [2], [3],

    [y], [0.3s], [0.4s], [0.8s],

  ),
  caption: [Timing results],
)

    ```
  ],[
    #set align(horizon)
    #image("images/3021.png",width: auto)]
)
通过明确指定图形的种类,可以覆盖此行为。所有同类图形共享一个公共计数器。
=== 图形行为(Figure behaviour)<Figure_behaviour>
默认情况下,图表会置于内容流中。若要使其浮动到页面顶部或底部,可以使用#link(<Figure_placement>)[placement]参数。

如果您的图表过大,且其内容(如包含大表格)容易跨页,那么您可以通过以下show规则,使图表本身也能跨页:
```typst
#show figure: set block(breakable: true)
```
有关可破坏块和不可破坏块的更多信息,请参阅块文档。
=== 标题自定义(Caption customization)<figure_Caption_customization>
你可以使用与图相关的#link(<title>)[标题]函数来修改图标题的外观。在下面的示例中,我们强调了所有标题:
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show figure.caption: emph

#figure(

  rect[Hello],

  caption: [I am emphasized!],

)

    ```
  ],[
    #set align(horizon)
    #image("images/3022.png",width: auto)]
)
通过使用#link(<Function_where>)[where]选择器,我们可以将这些规则限定在特定类型的图表上。例如,要将表格上方的标题定位,但将其保持在所有其他类型图表下方,我们可以编写以下展示集规则:
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show figure.where(
  kind: table
): set figure.caption(position: top)

#figure(

  table(columns: 2)[A][B][C][D],
  caption: [I'm up here],
)

    ```
  ],[
    #set align(horizon)
    #image("images/3023.png",width: auto)]
)
=== 无障碍(Accessibility)<Figure_Accessibility>
您可以使用#link(<figure_alt>)[alt]参数为屏幕阅读器和其他辅助技术(AT)提供图形的替代描述。请#link(<figure_alt>)[参阅其文档]以了解更多信息。

您可以使用图形为没有自身alt参数的路径、形状或可视化效果添加替代描述。如果您的图形纯属装饰性,且没有语义含义,请考虑将其封装在pdf.artifact中,这样在导出为PDF时,AT将无法识别它。

无论图表在文档中的位置如何,AT(自动表格识别)总是会读取它在文档中出现的那个#link(<Figure_placement>)[位置]的图表。请将它的标记放在阅读顺序中最合理的地方。
=== 参数(Parameters)<Figure_Parameters>
```typc
figure(
  body:content,
  alt: none str,
  placement: none auto alignment,
  scope: str,
  caption: none content,
  kind: auto str function,
  supplement: none auto content function,
  numbering: none str function,
  gap: length,
  outlined: bool,
) → content
```
- *body*: content<figure_body>
插图的内容。通常是一幅图像。
- *alt*: none str<figure_alt>
该图的一个替代描述。缺省值:#rtext()[none]。

当你添加一个备选描述时,AT会同时读取该描述和图注(如果有的话)。但是,图表本身的内容将被跳过。

当您的插图主体是一个已设置替代文本的图像时,不应在此插图元素上使用此参数。同样,当插图包含表格、代码或其他已可访问的内容时,也不应使用此参数。在这种情况下,AT会读取插图的内容,而添加替代描述会导致信息丢失。

你可以在《无障碍指南》中学习如何撰写优秀的替代描述。
- *placement*:none auto alignment<Figure_placement>
图形在页面上的位置。缺省值:#rtext()[none]。

-- none:该图形会像其他内容一样,精确地保持在指定的流入位置。

-- auto:该图形根据哪个更近来选择顶部或底部。

-- top: 该图形浮于页面顶部。

-- bottom: 该图形浮于页面底部。

主流程内容与浮动图形之间的间距是通过place函数中的#link(<place_clearance>)[clearance]参数来控制的。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set page(height: 200pt)
#show figure: set place(
  clearance: 1em,
)

= Introduction
#figure(

  placement: bottom,

  caption: [A glacier],

  image("glacier.jpg", width: 60%),
)
#lorem(60)

    ```
  ],[
    #set align(horizon)
    #image("images/3024.png",width: auto)
    #image("images/3025.png",width: auto)]
)
- *scope*: str
相对于图形所在的包含范围。缺省值:```typc "column"```。

将其设置为```typc "parent"```可在两栏文档中创建全宽插图。

如果未进行放置,则无效果。
#table(

  columns: (0.5fr,2fr),
  stroke: none,
  align: (left,left),
  table.header[Variant][Details],
  table.hline(),
  [```typc "column"```],[放入当前列。],
  [```typc "parent"```],[相对于父元素放置,让内容跨过所有列。],
)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set page(height: 250pt, columns: 2)

= Introduction
#figure(

  placement: bottom,

  scope: "parent",

  caption: [A glacier],

  image("glacier.jpg", width: 60%),
)
#lorem(60)

    ```
  ],[
    #set align(horizon)
    #image("images/3026.png",width: auto)
    #image("images/3027.png",width: auto)]
)
- *caption*: none content
图表的说明文字。缺省值:#rtext()[none]。
- *kind*: auto str function<figure_kind>
图形是什么类型。缺省值:#rtext()[auto]。

同类图形共享一个计数器。

如果设置为#rtext()[auto],该图形将尝试根据其主体的类型自动确定其类型。自动检测到的类型是#link(<table>)[表格]和#link(<raw>)[代码]。在其他情况下,推断出的类型是图像。

将其设置为非“自动”选项将覆盖自动检测。这在某些情况下可能很有用

-- 你想创建一个自定义图形类型,它既不是#link(<image>)[图像],也不是#link(<table>)[表格]或#link(<raw>)[代码],

-- 你想强制图形使用特定的计数器,而不管其内容如何。

你可以将类型设置为元素函数或字符串。如果将其设置为除#link(<table>)[table]、#link(<raw>)[raw]或#link(<image>)[image]以外的元素函数,则需要手动指定图形的补充信息。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#figure(

  circle(radius: 10pt),
  caption: [A curious atom.],
  kind: "atom",
  supplement: [Atom],
)

    ```
  ],[
    #set align(horizon)
    #image("images/3028.png",width: auto)]
)
如果你想修改计数器以跳过某个数字或重置计数器,可以使用where选择器访问每种图形的计数器:

-- 对于表格:```typc counter(figure.where(kind: table))```

-- 对于图像:```typc counter(figure.where(kind: image))```

--对于自定义类型:```typc counter(figure.where(kind: kind))```
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#figure(

  table(columns: 2, $n$, $1$),
  caption: [The first table.],
)

#counter(

  figure.where(kind: table)
).update(41)

#figure(

  table(columns: 2, $n$, $42$),
  caption: [The 42nd table],
)

#figure(

  rect[Image],

  caption: [Does not affect images],

)

    ```
  ],[
    #set align(horizon)
    #image("images/3029.png",width: auto)]
)
为了在show规则中方便地使用正确的计数器,您可以访问计数器字段。figure.caption元素的body#link(<figure_Definitions_caption>)[字段的文档中有一个相关示例]。
- *supplement*: none auto content function<figure_supplement>
该图形的补充。缺省值:#rtext()[auto]。

如果设置为自动,图表将尝试根据种类和活动文本语言自动确定正确的补充内容。如果您使用的是自定义图表类型,则需要手动指定补充内容。

如果指定了函数,则将指定种类的第一个后代(通常是图形的主体)传递给该函数,该函数应返回内容。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#figure(

  [The contents of my figure!],

  caption: [My custom figure],

  supplement: [Bar],

  kind: "foo",

)

    ```
  ],[
    #set align(horizon)
    #image("images/3030.png",width: auto)]
)
- *numbering*: none str function
如何为图表编号。接受一个编号模式或接受单个数字的函数。缺省值:```typc "1"```。
- *gap*: length
正文与标题之间的垂直间距。缺省值:#rtext()[0.68em]。
- *outlined*: bool
该图形是否应出现在图形目录中。缺省值:#rtext()[true]。
=== 定义(Definitions)<figure_Definitions>
- *caption*<figure_Definitions_caption>
图表的标题。此元素可用于设置和显示规则中,以自定义所有图表或特定类型图表的标题外观。

除了位置和主体外,标题还提供了图表的类型、补充信息、计数器和编号作为字段。这些部分可用于#link(<Function_where>)[where]选择器和显示规则,以构建一个完全自定义的标题。

#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show figure.caption: emph

#figure(

  rect[Hello],

  caption: [A rectangle],

)

    ```
  ],[
    #set align(horizon)
    #image("images/3031.png",width: auto)]
)

```typst
figure.caption(
  position: alignment,
  separator: auto content,
  body:content,
) → content
```
-- *position*: alignment

标题在图中的位置。可以是顶部或底部。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show figure.where(
  kind: table
): set figure.caption(position: top)

#figure(

  table(columns: 2)[A][B],
  caption: [I'm up here],
)

#figure(

  rect[Hi],

  caption: [I'm down here],

)

#figure(

  table(columns: 2)[A][B],
  caption: figure.caption(
    position: bottom,
    [I'm down here too!]
  )
)

    ```
  ],[
    #set align(horizon)
    #image("images/3032.png",width: auto)]
)
-- *separator*: auto content

数字和正文之间将出现的分隔符。

如果设置为#rtext()[auto],分隔符将根据当前的#link(<text_lang>)[语言]和#link(<text_region>)[地区]进行调整。
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
#set figure.caption(separator: [ --- ])

#figure(

  rect[Hello],

  caption: [A rectangle],

)

    ```
  ],[
    #image("images/3033.png",width: auto)]
)
-- *body*: content

标题的正文。

可与种类、补充、计数器、编号和位置一起使用,以完全自定义标题。
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
#show figure.caption: it => [
  #underline(it.body) |
  #it.supplement
  #context it.counter.display(it.numbering)
]

#figure(

  rect[Hello],

  caption: [A rectangle],

)

    ```
  ],[
    #image("images/3034.png",width: auto)]
)
== 脚注(footnote)<footnote>
一个脚注。

在同一页上包含额外的备注和参考文献,并带有脚注。脚注会插入一个上标数字,该数字会链接到页面底部的备注。备注在整篇文档中按顺序编号,并可以跨页。

要自定义脚注列表中条目的外观,请参阅#link(<footnote_entry>)[footnote.entry]。脚注本身以普通上标的形式呈现,因此您可以在super函数上使用set规则来对其进行自定义。您还可以应用一个show规则,仅自定义正文中脚注标记(上标数字)。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
Check the docs for more details.
#footnote[https://typst.app/docs]

    ```
  ],[
    #set align(horizon)
    #image("images/3035.png",width: auto)]
)
脚注会自动附加到前一个单词上,即使标记中它前面有空格。若要强制添加空格,可以使用字符串 ```typc #" "``` 或显式的#link(<spacing_h>)[水平间距]。

通过给脚注添加标签,你可以多次引用它。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
You can edit Typst documents online.
#footnote[https://typst.app/app] <fn>
Checkout Typst's website. @fn
And the online app. #footnote(<fn>)

    ```
  ],[
    #set align(horizon)
    #image("images/3036.png",width: auto)]
)
注意:在调用脚注的范围内set和show规则可能不适用于脚注的内容。更多信息请见#link("https://github.com/typst/typst/issues/1467#issuecomment-1588799440")[此处]。
=== 无障碍(Accessibility)
脚注将在文本中引用它们的位置之后立即通过辅助技术(AT)进行朗读,就像它们在标记中所呈现的那样。
=== 参数(Parameters)<footnote_Parameters>
```typc
footnote(
  numbering: str function,
  body:label content,
) → content
```
- *numbering*: str function<footnote_numbering>
如何为脚注编号。接受一个编号模式或接受单个数字的函数。缺省值:```typc "1"```。

默认情况下,脚注编号会在整个文档中连续。如果您更喜欢每页单独编号,可以在页眉中重置脚注计数器。将来可能会有更简单的方法来实现这一点。
#table(

  columns: (1fr,1fr),
  align: left,
  stroke: none,
  [
    ```typc
#set footnote(numbering: "*")

Footnotes:
#footnote[Star],
#footnote[Dagger]
    ```
  ],
  [
    #set align(horizon)
    #image("images/3118.png",width: 100%)
  ]
)
- *body*: label content
要放入脚注中的内容。也可以是本脚注需要指向的另一个脚注的标记。
=== 定义(Definitions)<footnote_Definitions>
- *entry*<footnote_entry>
脚注列表中的一条条目。

该函数不建议直接调用。它用于set和show规则中,实现脚注列表的自定义。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show footnote.entry: set text(red)

My footnote listing
#footnote[It's down here]
has red text!

    ```
  ],[
    #set align(horizon)
    #image("images/3037.png",width: auto)]
)
注意:脚注条目的属性在每个页面序列(页面序列是指中间没有明确分页符的一系列页面)中必须保持一致。因此,应在任何页面内容之前,通常在文档的最开始,定义脚注条目的set和show规则。
```typc
  footnote.entry(
    note:content,
    separator: content,
    clearance: length,
    gap: length,
    indent: length,
  ) → content
```
-- *note*: content

该条目的脚注。可通过其位置确定脚注计数器的状态。
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
#show footnote.entry: it => {
  let loc = it.note.location()
  counter(footnote).display(at: loc, "1: ")
  it.note.body
}

Customized #footnote[Hello]
listing #footnote[World! 🌏]

    ```
  ],[
    #image("images/3038.png",width: auto)]
)
-- *separator*: content

文档正文与脚注列表之间的分隔符。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set footnote.entry(
  separator: repeat[.]
)

Testing a different separator.
#footnote[
  Unconventional, but maybe
  not that bad?
]

    ```
  ],[
    #set align(horizon)
    #image("images/3039.png",width: auto)]
)
-- *clearance*: length

文档主体与分隔件之间的间隙量
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set footnote.entry(clearance: 3em)

Footnotes also need ...
#footnote[
  ... some space to breathe.
]
```
  ],[
    #set align(horizon)
    #image("images/3040.png",width: auto)]
)
-- *gap*: length

脚注条目之间的间距。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set footnote.entry(gap: 0.8em)

Footnotes:
#footnote[Spaced],
#footnote[Apart]

```
  ],[
    #set align(horizon)
    #image("images/3041.png",width: auto)]
)
-- *indent*: length

每条脚注条目的缩进。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set footnote.entry(indent: 0em)

Footnotes:
#footnote[No],
#footnote[Indent]

```
  ],[
    #set align(horizon)
    #image("images/3042.png",width: auto)]
)
== 标题(heading)<heading>
一个章节标题。

使用标题,你可以将文档结构化为多个部分。每个标题都有一个级别,级别从1开始,并且级别没有上限。这个级别表示以下内容(节、小节等)的逻辑角色。顶级标题表示文档的顶级部分(不是文档的标题)。要插入标题,请使用#link(<title>)[title]元素。

Typst可以自动为您的标题编号。要启用编号功能,请指定您希望标题使用哪种#link(<numbering>)[编号模式或函数]进行编号。

Typst不仅能根据编号自动生成大纲,还能为您生成所有标题的目录。若要从此目录中排除一个或多个标题,您可以将outlined参数设置为false。

在编写一个#link(<Styling-show>)[show规则]以访问#link(<heading_Parameters>)[body类型]来为标题创建完全自定义的外观时,请确保将内容包裹在一个块中(通过内置的展示集规则,该块对标题具有隐式粘性)。这样可以防止标题变成“孤岛”,即标题留在页面末尾,而后续内容出现在下一页。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set heading(numbering: "1.a)")

= Introduction
In recent years, ...

== Preliminaries
To start, ...

```
  ],[
    #set align(horizon)
    #image("images/3043.png",width: auto)]
)
=== 语法(Syntax)
标题有专门的语法规则:可以通过在行首添加一个或多个等号,后跟一个空格来创建。等号的数量决定了标题的逻辑嵌套深度。可以设置偏移字段来配置起始深度。
=== 无障碍(Accessibility)
标题对于可访问性至关重要,因为它们有助于使用辅助技术(AT)的用户(如屏幕阅读器)在文档中导航。屏幕阅读器用户可以跳过标题直接跳到下一个标题,或者获取文档中所有标题的概览。

为了使标题易于访问,您不应跳过标题级别。这意味着您应该从一级标题开始。此外,当前一个标题为三级时,下一个标题应为三级(保持相同深度)、四级(恰好深一级)或一级或二级(新的层次更高的标题)。
=== HTML导出(HTML export)
如上所述,顶级标题表示文档的顶级部分,而非其标题。这与HTML中的\<h1\>元素形成对比,每个文档中\<h1\>元素应仅有一个。

因此,在HTML导出中,title元素将转换为\<h1\>,标题将转换为\<h2\>及更低层级(即一级标题转换为\<h2\>,二级标题转换为\<h3\>,以此类推)。
=== 参数(Parameters)<heading_Parameters>
```typc
  heading(
    level: auto int,
    depth: int,
    offset: int,
    numbering: none str function,
    supplement: none auto content function,
    outlined: bool,
    bookmarked: auto bool,
    hanging-indent: auto length,
    body:content,
  ) → content
```
- *level*: auto int<heading_level>
标题的绝对嵌套深度,从1开始计数。如果设置为#rtext()[auto],则由偏移量+深度计算得出。缺省值:#rtext()[auto]。

这主要适用于在#link(<Styling-show>)[show规则]中使用(可通过 #link(<Function_where>)[where] 选择器使用,或直接在显示的标题上访问层级)。
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
#show heading.where(level: 2): set text(red)

= Level 1
== Level 2

#set heading(offset: 1)
= Also level 2
== Level 3

    ```
  ],[
    #image("images/3044.png",width: auto)]
)
- *depth*: int<heading_depth>
标题的相对嵌套深度,从1开始计数。该值会与偏移量结合,用于计算实际层级。缺省值:#rtext()[1]。

该参数由标题语法设定,例如 ```typc == Heading``` 会生成逻辑深度为2的标题,其实际层级为偏移量#rtext()[+2]。如果手动构建标题,通常建议使用该方式,而非直接设置绝对层级。
- offset:int
每个标题层级的起始偏移量,用于将其相对深度转换为绝对层级。缺省值:#rtext()[0]。
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
= Level 1

#set heading(offset: 1, numbering: "1.1")
= Level 2

#heading(offset: 2, depth: 2)[
  I'm level 4
]

    ```
  ],[
    #image("images/3045.png",width: auto)]
)
- *numbering*: none str function<heading_numbering>
如何为标题编号。可接收编号样式或可传入多个数字的函数。缺省值:#rtext()[none]。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set heading(numbering: "1.a.")

= A section
== A subsection
=== A sub-subsection

```
  ],[
    #set align(horizon)
    #image("images/3046.png",width: auto)]
)
- *supplement*: none auto content function<heading_supplement>
标题的补充内容。缺省值:#rtext()[auto]。

在引用标题时,该内容会添加到引用编号之前。

如果指定了函数,该函数会接收被引用的标题,并应当返回内容。
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
#set heading(numbering: "1.", supplement: [Chapter])

= Introduction <intro>
In @intro, we see how to turn
Sections into Chapters. And
in @intro[Part], it is done
manually.

    ```
  ],[
    #image("images/3047.png",width: auto)]
)
- *outlined*: bool<heading_outlined>
标题是否应显示在目录中。缺省值:#rtext()[true]。

请注意:如果将此属性设为true,可确保该标题在导出PDF时,同时作为书签显示在PDF的目录里。若要更改该效果,请使用bookmarked属性。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#outline()

#heading[Normal]
This is a normal heading.

#heading(outlined: false)[Hidden]
This heading does not appear
in the outline.

```
  ],[
    #set align(horizon)
    #image("images/3048.png",width: auto)]
)
- *bookmarked*: auto bool<heading_bookmarked>
标题是否在导出PDF的目录中显示为书签。该设置不影响PNG等其他导出格式。缺省值:#rtext()[auto]。

默认值#rtext()[auto]表示:仅当标题的大纲属性设置为#rtext()[true](即该标题也会在Typst目录中列出)时,它才会出现在导出PDF的#link(<outline>)[目录]书签里。将此属性设置为#rtext()[true](添加书签)或#rtext()[false](不添加书签),将覆盖上述默认逻辑。
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
#heading[Normal heading]
This heading will be shown in
the PDF's bookmark outline.

#heading(bookmarked: false)[Not bookmarked]
This heading won't be
bookmarked in the resulting
PDF.

    ```
  ],[
    #image("images/3049.png",width: 80%)]
)
- *hanging-indent*: auto length<heading_hanging-indent>
标题除首行外所有行应设置的缩进。缺省值:#rtext()[auto]。

自动的默认值规则:如果标题沿文本方向起始端对齐,则使用编号的宽度作为缩进;对于居中以及其他对齐方式,则不设置缩进。
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
#set heading(numbering: "1.")
= A very, very, very, very, very, very long heading

#show heading: set align(center)
== A very long heading\ with center alignment

    ```
  ],[
    #image("images/3050.png",width: 80%)]
)
- *body*: content
标题的内容。
== 链接(link)<link>
指向统一资源定位符(URL)或文档内位置的链接。

默认情况下,链接和普通文本在外观上没有区别。不过,你可以通过显示规则轻松应用自选样式。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show link: underline

https://example.com \

#link("https://example.com") \
#link("https://example.com")[
  See example.com
]

```
  ],[
    #set align(horizon)
    #image("images/3051.png",width: auto)]
)
=== 语法(Syntax)
该函数还有专用语法:以 http:// 或 https:// 开头的文本会自动转换为链接。
=== 断字(Hyphenation)
如果启用断字或对齐功能,默认情况下,它不会应用于链接,以防止在网址中出现不必要的断字。您可以通过```typc show link: set text(hyphenate: true)```来选择退出此默认设置。
=== 无障碍(Accessibility)
链接的目的地应能从链接文本本身,或至少能从其紧邻的文本中清晰看出。在PDF导出时,Typst会根据链接的目的地自动为链接生成一个工具提示描述。对于指向URL的链接,URL本身将用作工具提示。
=== HTML导出中的链接(Links in HTML export)
在HTML导出中,指向#link(<label>)[标签]或#link(<location>)[位置]的链接将被转换为指向命名锚点的片段链接。为了支持这一点,没有现有ID的目标将在DOM中自动获得一个ID。具体实现方式因链接目标转换为哪种HTML节点而异:
#set par(hanging-indent: 1.3cm)
-- 如果链接目标变为一个单独的HTML元素,那么该元素将获得ID。例如,当链接到顶级标题时(该标题将变为一个单独的\<h2\>元素),通常就会出现这种情况。

-- 如果链接目标变为单个文本节点,该节点将被包裹在一个\<span\>中,该\<span\>随后将获得ID。

-- 如果链接目标变为多个节点,则第一个节点将接收ID。

-- 如果链接目标变为没有任何节点,则会生成一个空跨度作为链接目标。
#set par(hanging-indent: 0cm)
如果你依赖于特定的DOM结构,那么你应该确保链接目标会转化为一个或多个元素,因为编译器并不保证能将文本精确分割成文本节点。

如果存在,自动ID生成会尝试重用链接目标的标签来创建人类可读的ID。在以下情况下,标签可以被重用:

-- 根据Unicode标准,所有字符均为字母、数字、连字符或下划线。

-- 标签不是以数字或连字符开头。

这些规则确保标签既是有效的CSS标识符,又是用于链接的有效URL片段。

由于在DOM中ID必须是唯一的,因此在将重复的标签作为ID重新使用时,可能需要对其进行消歧处理。具体规则如下:
#set par(hanging-indent: 1.3cm)
-- 如果一个标签可以重复使用并且在文档中是唯一的,那么它将被直接用作ID。

-- 如果它是可重复使用的,但不是唯一的,则会添加一个由连字符和整数组成的后缀。例如,如果标签\<mylabel\>出现了两次,它就会变成mylabel-1和mylabel-2。

-- 否则,将生成一个格式为“loc-”后跟一个整数的唯一ID。
#set par(hanging-indent: 0cm)
=== 包导出中的链接(Links in bundle export)
在包导出中,链接功能仍能正常使用。例如,如果你在一个文档中的某个元素上附加了一个标签,其他文档中的链接就可以引用该标签。此外,文档和资源也可以直接链接。要链接到完整的文档或资源,你可以为其附加一个标签,或者通过#link(<query>)[查询]找到并提取其#link(<location>)[位置]。
```typst
#document("index.html")[
  // Link to document.
  #link(<appendix>)[To appendix]

  // Link into document.
  See the #link(<glossary>)[Glossary]
  for more information.
]

#document("appendix.html")[
  = Definitions
  ...

  = Glossary <glossary>
  ...
] <appendix>
```
跨文档链接以相对路径(可能包含片段)的形式生成。Typst会根据与HTML导出相同的规则为每个文档自动分配锚点名称。在HTML和SVG文档中,这些锚点名称会作为元素的id属性生成。在PDF文档中,它们会作为命名目标生成。PNG文档不支持链接。
请注意,链接总是使用完整的相对路径。在某些场景下(主要是对于多页面网站),这可能并不理想。例如,您可能希望生成一个 /blog/index.html 文档,但只想用 /blog 作为链接。此外,您的网络服务器可能会将 /blog
  和 /blog/ 视为可互换的,并为两者都提供 /blog/index.html。如果用户随后导航到 /blog,则 Typst 生成的其他页面的相对链接将不再有效。目前,Typst
  无法直接挂接到内置的链接处理机制上。尽管如此,在 HTML 导出中,根据您的使用场景,可以通过在 html.elem.where(tag: "a") 上使用 show 规则来调整内置的链接处理。
=== 参数(Parameters)
```typc
    link(
        dest:str label location dictionary,
        body:content,
    ) → content
```
- *dest*: str label location dictionary\
   链接指向的目的地。

  - 要链接到网页,dest 应为有效的 URL 字符串。如果 URL 采用 mailto: 或 tel: 方案且省略了 body 参数,则电子邮件地址或电话号码将成为链接的正文,且不包含方案。

  - 要链接到文档的其他部分,dest可以采用以下三种形式之一:
    - 附加到某个元素上的#link(<label>)[标签]。如果你还希望根据该元素为链接自动生成文本,可以考虑使用#link(<ref>)[引用]。
    - 一个#link(<location>)[位置](通常从#link(<here>)[here]、#link(<locate>)[locate]或#link(<query>)[query]中检索得到)。
    - 一个字典,其页面键为#link(<Integer>)[整数]类型,x和y坐标为长度类型。页面从1开始计数,坐标相对于页面的左上角。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
= Introduction <intro>
#link("mailto:hello@typst.app") \
#link(<intro>)[Go to intro] \
#link((page: 1, x: 0pt, y: 0pt))[
  Go to top
]

```
  ],[
    #set align(horizon)
    #image("images/3052.png",width: auto)]
)
- *body*: content
应成为链接的内容。

如果dest是一个URL字符串,则可以省略该参数。在这种情况下,URL将作为链接显示。

== 编号列表(enum)<enum>
一个编号列表。

垂直展示一系列项目,并对其连续编号。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
Automatically numbered:
+ Preparations
+ Analysis
+ Conclusions

Manually numbered:
2. What is the first step?
5. I am confused.
+  Moving on ...

Multiple lines:
+ This enum item has multiple
  lines because the next line
  is indented.

Function call.
#enum[First][Second]

```
  ],[
    #set align(horizon)
    #image("images/3053.png",width: auto)]
)
借助一条set规则,你可以轻松将所有编号项目切换为另一种编号样式。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set enum(numbering: "a)")

+ Starting off ...
+ Don't forget step two

```
  ],[
    #set align(horizon)
    #image("images/3054.png",width: auto)]
)
你也可以使用#link(<enum_item>)[enum.item],通过编程方式自定义枚举中每个项的编号:
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#enum(

  enum.item(1)[First step],
  enum.item(5)[Fifth step],
  enum.item(10)[Tenth step]
)

```
  ],[
    #set align(horizon)
    #image("images/3055.png",width: auto)]
)
=== 语法(Syntax)
该函数还有专门的语法:

-- 行首使用加号,可创建自动编号的列表项。

-- 行首使用数字加句点,可创建显式编号的列表项。

列表项可包含多个段落以及其他块级内容。所有缩进程度大于列表项标记的内容,都属于该列表项的一部分。

=== 参数(Parameters)
```typc
enum(
    tight: bool,
    numbering: str function,
    start: auto int,
    full: bool,
    reversed: bool,
    indent: length,
    body-indent: length,
    spacing: auto length,
    number-align: alignment,
    children:content array,
) → content
```
- *tight*: bool
定义枚举列表的默认#link(<enum>)[间距]。若该值为#rtext()[false],列表项使用#link(<Paragraph_spacing>)[段落间距]分隔。若该值为#rtext()[true],则改用#link(<Paragraph_leading>)[段落行间距]。这会让列表更紧凑,当列表项内容较短时,视觉效果更佳。

在标记模式下,该参数的值由条目之间是否以空行分隔决定。如果条目直接相连,该值设为#rtext()[true];如果条目之间用空行分隔,该值设为#rtext()[false]。标记定义的紧凑性无法通过set规则覆盖。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
+ If an enum has a lot of text, and
  maybe other inline content, it
  should not be tight anymore.

+ To make an enum wide, simply
  insert a blank line between the
  items.

```
  ],[
    #set align(horizon)
    #image("images/3056.png",width: auto)]
)
- *numbering*: str function
如何对枚举项编号。可接收#link(<numbering>)[编号模式或函数]。缺省值:```typc "1"```。

若编号模式包含多个计数符号,它们将作用于嵌套枚举。如果传入函数,当full为#rtext()[false]时该函数接收一个参数;当full为#rtext()[true]时则接收多个参数。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set enum(numbering: "1.a)")
+ Different
+ Numbering
  + Nested
  + Items
+ Style

#set enum(numbering: n => super[#n])
+ Superscript
+ Numbering!

```
  ],[
    #set align(horizon)
    #image("images/3057.png",width: auto)]
)
- *start*: auto int
列表项从哪个数字开始。缺省值:#rtext()[auto]。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#enum(

  start: 3,

  [Skipping],

  [Ahead],

)

```
  ],[
    #set align(horizon)
    #image("images/3058.png",width: auto)]
)
- *full*: bool
是否显示完整编号,包含所有上级枚举项的编号。缺省值:#rtext()[false]。
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
#set enum(numbering: "1.a)", full: true)
+ Cook
  + Heat water
  + Add ingredients
+ Eat

    ```
  ],[
    #image("images/3059.png",width: 80%)]
)
- *reversed*: bool
是否要对该编号列表反向编号。缺省值:#rtext()[false]。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set enum(reversed: true)
+ Coffee
+ Tea
+ Milk

```
  ],[
    #set align(horizon)
    #image("images/3060.png",width: auto)]
)
- *indent*: length
每个条目的缩进。缺省值:#rtext()[0pt]。
- *body-indent*: length
编号与每个条目正文之间的间距。缺省值:#rtext()[0.5em]。
- *spacing*: auto length
列表项之间的间距。缺省值:#rtext()[auto]。

若设置为#rtext()[auto],紧凑枚举将使用#link(<Paragraph_leading>)[段落行距],宽松(非紧凑)枚举使用#link(<Paragraph_spacing>)[段落间距]。
- *number-align*: alignment
列表编号应采用的对齐方式。缺省值:end。

默认情况下,该值设为 end,会将列表编号沿当前文本方向水平向末端对齐(例如,在从左到右的文字排版中,等同于右对齐)。此外,由于未设置垂直对齐,每个编号在垂直方向上刚好位于项目基线之上,如同属于该行文本的首行内容。

列表编号的水平对齐一般优先选择 end,因为这样编号会向远离文本的方向延伸,而非朝向文本。不过,你可以通过该选项更改这一默认行为。

至于垂直对齐方式,如果不需要基线对齐,可以对其进行覆盖。例如,采用末端+顶部的对齐方式会始终将标记垂直放置在项目靠近顶部的位置,而末端+底部则会将其移至靠近底部的位置。

另外需要注意,#link(<list>)[无序列表]有一个类似的选项,名为marker-align,它同样可以控制标记在两个轴向上的对齐,工作方式与列表数值完全相同。
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
#set enum(number-align: start + bottom)

Here are some powers of two:
1. One
2. Two
4. Four
8. Eight
16. Sixteen
32. Thirty two

    ```
  ],[
    #image("images/3061.png",width: 80%)]
)
- *children*: content array
编号列表的条目。

使用枚举语法时,相邻条目会自动归集为枚举项,即便在for循环这类结构中也是如此。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#for phase in (
   "Launch",
   "Orbit",
   "Descent",
) [+ #phase]

```
  ],[
    #set align(horizon)
    #image("images/3062.png",width: auto)]
)
=== 定义(Definitions)
- item<enum_item>
列表项。
```typc
enum.item(
    number:auto int,
    body:content,
) → content
```
    --  *number*: auto int

项编号。

-- *body*: content

项内容。

== 编号规则(numbering)<numbering>
对数字序列应用编号规则。

编号规则定义了数字序列该如何作为内容展示。它可以通过模式字符串或者自定义函数来定义。

编号模式由计数符号(会替换为实际数字)、计数符号的前缀以及一个后缀组成。前缀和后缀将按原样显示。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#numbering("1.1)", 1, 2, 3) \
#numbering("1.a.i", 1, 2) \
#numbering("I – 1", 12, 2) \
#numbering(

  (..nums) => nums
    .pos()
    .map(str)
    .join(".") + ")",
  1, 2, 3,
)

```
  ],[
    #set align(horizon)
    #image("images/3063.png",width: auto)]
)
=== 编号模式与编号函数(Numbering patterns and numbering functions)
在Typst中,有多处地方可以设置编号样式或编号函数。例如,定义#link(<heading>)[标题]或#link(<figure>)[图表]的编号规则时。无论哪种场景,所要求的格式都与下文针对#link(<numbering_numbering>)[编号参数]所描述的格式一致。

下面这个示例说明:编号函数只是一个普通函数,接收数字并返回内容。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#let unary(.., last) = "|" * last
#set heading(numbering: unary)
= First heading
= Second heading
= Third heading

```
  ],[
    #set align(horizon)
    #image("images/3064.png",width: auto)]
)
=== 参数(Parameters)
```typc
numbering(
    numbering:str function,
    numbers:int,
) → any
```
- *numbering*: str function<numbering_numbering>
定义编号的工作方式。

计数符号包括1、a、A、i、I、α、Α、一、壹、あ、い、ア、イ、א、가、ㄱ、\*、١、۱、१、১、ক、①和⓵。它们被替换为序列中的数字,同时保留原始大小写。

\*符号表示应使用符号进行计数,顺序为\*、†、‡、§、¶、‖。如果项目超过六个,则使用重复符号表示数字。

后缀是最后一个计数符号之后的所有字符。它们会原样显示在任意渲染数字的末尾。

前缀指所有既非计数符号、也非后缀的字符。它们会原样显示在对应计数符号渲染结果的前方。

该参数也可以是一个任意函数,它将每个数字作为独立参数传入。当传入一个函数时,编号函数仅会把参数转发给该函数。虽然这一点本身并没有太大用处,但这意味着你可以直接向编号函数传入任意编号形式,而无需关心这些编号是定义为模式还是函数。
- *numbers*: int
需要进行编号的数字,必须为非负数。

一般来说,数字从1开始计数。数字0代表首个元素尚未出现。

如果编号采用模式形式,且给出的数字数量多于计数符号,则重复使用带有前缀的最后一个计数符号。

== 目录(outline)<outline>
内容、图表或其他元素的列表。

该功能会生成文档内某类元素所有实例的列表,最大层级可自定义。在目录中,这类元素的编号与页码会连同其标题或图注一同显示。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set heading(numbering: "1.")
#outline()

= Introduction
#lorem(5)

= Methods
== Setup
#lorem(10)
```
  ],[
    #set align(horizon)
    #image("images/3065.png",width: auto)]
)
=== 替代目录(Alternative outlines)<Alternative_outlines>
在默认配置下,该函数会生成目录。通过设置目标参数,可使用该目录生成标题以外其他类型元素的列表。

在下面的示例中,我们将目标设置为```typc figure.where(kind: image)```,以此列出所有包含图片的图。同理,我们也可以将其设置为 ```typc figure.where(kind: table)``` 来生成表格列表。

我们也可以直接将其设置为 figure,不使用 #link(<Function_where>)[where] 选择器,但这样列表会包含所有图,无论是包含图片、表格还是其他内容的图。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#outline(

  title: [List of Figures],

  target: figure.where(kind: image),
)

#figure(

  image("tiger.jpg"),
  caption: [A nice figure!],
)
```
  ],[
    #set align(horizon)
    #image("images/3066.png",width: auto)]
)
=== 排版目录(Styling the outline)<Styling_the_outline>
在最基础的层面,你可以通过设置目录及其条目的属性来设置目录样式。通过这种方式,你可以自定义目录#link(<outline_title>)[标题]、目录条目的#link(<outline_indent>)[缩进]方式,以及条目文本与其页码之间空白的填充形式。

通过配置目录#link(<outline_entry>)[条目],还可以实现更丰富的自定义效果。目录会为每一个被标记进目录的元素生成一个条目。
- 条目间距调整
目录条目属于#link(<block>)[块元素],因此你可以使用常规的块间距规则调整它们之间的间距:
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show outline.entry.where(
  level: 1
): set block(above: 1.2em)

#outline()

= About ACME Corp.
== History
=== Origins
= Products
== ACME Tools
```
  ],[
    #set align(horizon)
    #image("images/3067.png",width: auto)]
)
- *由各组成部分构建目录条目(Building an outline entry from its parts)*
如需完全自主控制,你也可以为 outline.entry 编写转换show规则。不过,对目录条目进行正确格式化与缩进的逻辑相当复杂,且目录条目本身仅包含两个字段:层级与被目录标记的元素。

为此,系统提供了各类辅助函数。你可以自由组合这些函数,仅选取所需部分来构建条目。

目录条目的默认显示规则如下#footnote[方程目录是该规则的例外情况,因为它没有主体部分,因此不使用缩进布局。]:
```typst
#show outline.entry: it => link(
  it.element.location(),
  it.indented(it.prefix(), it.inner()),
)
```
-- 缩进函数可选地接收前缀和内部内容,并自动为其应用适当的缩进,使不同条目对齐整齐,长标题正确换行。

-- 前缀函数用于格式化元素的编号(如果存在)。它还会为某些元素附加补充内容。

-- 内部函数将元素的主体、填充符和页码组合在一起。

您可以使用这些独立功能以不同方式格式化目录条目。例如,如果您想完全删除占位符和页码,可以编写如下显示规则来实现这一点:
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
#show outline.entry: it => link(
  it.element.location(),
  // Keep just the body, dropping
  // the fill and the page.
  it.indented(it.prefix(), it.body()),
)

#outline()

= About ACME Corp.
== History
    ```
  ],[
    #image("images/3068.png",width: 80%)]
)
=== 参数(Parameters)
```typc
outline(
    title: none auto content,
    target: label selector location function,
    depth: none int,
    indent: auto relative function,
) → content
```
- *title*: none auto  content<outline_title>
目录的标题。缺省值:#rtext()[auto]。

-- 设置为自动时,将使用适配文本语言的标题。

-- 设置为无时,大纲不会显示标题。

-- 可通过传入内容来设置自定义标题。

目录标题默认不会编号,但你可以通过show-set规则强制开启编号:```typc show outline: set heading(numbering: "1.")```

- *target*:label selector location function<outline_target>
要包含在大纲中的元素类型。缺省值:heading。

若要列出包含特定类型元素(例如图片或表格)的图,可以在#link(<Function_where>)[where选择器]中指定所需元素类型。更多详情请参阅#link(<Alternative_outlines>)[替代目录]相关章节。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#outline(

  title: [List of Tables],

  target: figure.where(kind: table),
)

#figure(

  table(

    columns: 4,

    [t], [1], [2], [3],

    [y], [0.3], [0.7], [0.5],

  ),
  caption: [Experiment results],
)
```
  ],[
    #set align(horizon)
    #image("images/3069.png",width: auto)]
)
- *depth*: none int<outline_depth>
目录中包含元素的最高层级。当该参数为#rtext()[none]时,将包含所有元素。缺省值:#rtext()[none]。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set heading(numbering: "1.")
#outline(depth: 2)

= Yes
Top-level section.

== Still
Subsection.

=== Nope
Not included.
```
  ],[
    #set align(horizon)
    #image("images/3070.png",width: auto)]
)
- *indent*:auto relative function<outline_indent>
如何为目录条目设置缩进。缺省值:#rtext()[auto]。
#set par(hanging-indent: 1.3cm)
-- #rtext()[auto]:嵌套条目的编号/前缀会跟随其父条目的标题进行缩进。如果条目没有编号(例如通过#link(<heading_numbering>)[标题编号]功能设置),则会在每一级直接固定增加#rtext()[1.2em]的缩进量。

-- #rtext()[Relative length]:按指定长度为每一层嵌套级别设置条目缩进。例如设置为#rtext()[2em]时,一级标题缩进#rtext()[0em](无嵌套),二级标题缩进#rtext()[2em](嵌套1层),三级标题缩进#rtext()[4em](嵌套2层),以此类推。

-- #rtext()[Function]:你可以使用函数对该设置进行更多自定义。该函数接收嵌套层级作为参数(一级标题/元素从0开始计数),并需要返回一个(相对)长度值。例如,```typc n => n * 2em``` 的效果等同于直接设置#rtext()[2em]。
#set par(hanging-indent: 0cm)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set heading(numbering: "I-I.")
#set outline(title: none)

#outline()
#line(length: 100%)
#outline(indent: 3em)

= Software engineering technologies
== Requirements
== Tools and technologies
=== Code editors
== Analyzing alternatives
= Designing software components
= Testing and integration
```
  ],[
    #set align(horizon)
    #image("images/3071.png",width: auto)]
)
=== 定义(Definitions)
- *entry*<outline_entry>
表示目录中的一行条目。

借助目录条目的显示集与显示规则,你可以对目录外观进行丰富的自定义。有关详情,请参阅#link(<Styling_the_outline>)[目录样式设置章节]。
```typc
outline.entry(
    level:int,
    element:content,
    fill: none content,
) → content
```
#set par(hanging-indent: 1.3cm)
--  *level*: int\
该目录条目的嵌套层级。顶级条目从1开始。

-- *element*: content\
该条目所指向的元素。可通过内容上的#link(<Context_Location>)[定位方法]获取其位置,并可建立#link(<link>)[链接]。

-- *fill*: none content\
用于填充标题与页码之间空白区域的内容。可设置为none以关闭填充效果。

填充内容会放置在一个自适应尺寸的容器内,该容器占据条目正文与页码之间的全部空间。当使用显示规则修改目录条目时,建议将填充内容置于自适应宽度容器中,即 box(width: 1fr, it.fill)。

使用repeat时,可借助间距属性调整填充内容的视觉占比。
#set par(hanging-indent: 0cm)
#table(

  columns: 1,

  align: left,

  stroke: none,

  fill: rgb(250, 250, 250),
  [
    ```typst
#set outline.entry(fill: line(length: 100%))
#outline()

= A New Beginning
    ```
  ],[
    #image("images/3072.png",width: 80%)]
)
*基于entry的定义*
#set par(hanging-indent: 1.3cm)
--  indented\
用于生成带缩进条目布局的辅助函数:以适配缩进的方式布置前缀与条目其余内容。\
如果父级目录的#link(<outline_indent>)[缩进]设为#rtext()[auto],则所有N级条目的内部内容将与N+1级条目的前缀对齐,同时在前缀和内部内容之间保留至少一段间隔。此外,同一层级所有条目的内部内容保持对齐。\
如果目录的缩进为固定值或函数,则前缀会进行缩进,但内部内容仅按照指定间隔相对前缀偏移,不会在整个大纲范围内对齐。可视化说明请参见#link(<outline_indent>)[outline.indent]。

```typc
self.indented(
    prefix:none content,
    inner:content,
    gap: length,
) → content
```
-- *prefix*(上下文)

设置元素的编号格式(如有编号)。

如果是图表或公式,这一操作还会追加元素的补充标识。例如,标题会输出1.1,而图表则输出图1,这也是目录中的常规写法。
```typc
self.prefix() → none content
```
-- *inner*(上下文)

创建条目的默认内部内容。

其中包含正文、填充内容以及页码。
```typc
self.inner() → content
```
-- *body*

在目录条目中替代被引用元素所显示的内容。对于标题,该内容为[标题正文];对于图片,该内容为图注;对于公式,则为空。
```typc
self.body() → content
```
-- *page*

该条目元素的页码,按照引用页面设定的编号格式显示。
```typc
self.page() → content
```
#set par(hanging-indent: 0cm)

== 段落(par)<Paragraph>
文本内容的逻辑细分单元。

Typst 会自动将行内元素归集到段落中。行内元素包含#link(<text>)[文本]、#link(<spacing_h>)[水平间距]、#link(<box>)[盒子]以及#link(<equation>)[行内公式]。

如需分隔段落,请使用空行(或者显式段落分隔符 #link(<parbreak>)[parbreak])。任何块级元素(例如 #link(<block>)[block]、#link(<place>)[place],或是所有表现为块级的元素)也会自动截断当前段落。

par元素主要用于set规则中设置段落属性,也可用于将其参数显式单独展示为一个段落。此时,该段落的主体不能包含任何块级内容。

=== 盒子与块(Boxes and blocks)<Paragraph_Boxes_and_blocks>
如上所述,段落通常仅包含行内级内容。不过,你可以将任意类型的块级内容放置在一个#link(<box>)[盒子容器]内,以此嵌入到段落中。

与之相反,你可以把行内级内容放置在一个#link(<block>)[块容器]内,使其从段落中分离。这种情况下,该内容将完全不属于任何段落。请阅读下一节,了解该操作的意义,以及它和直接在内容前后添加段落分隔符有何区别。
=== 什么构成一个段落?(What becomes a paragraph?)<Paragraph_What-becomes-a-paragraph>
当你向文档中添加行内内容时,Typst 会自动将其包裹在段落中。不过,一份常规文档里也会存在一些在语义上不属于段落的文本,例如标题或图注中的文字。

Typst 将内联级内容包裹在段落中的规则如下:
- 文档根部的所有文本都会被包裹在段落中。
- 容器(如块级元素)中的文本仅在容器包含任何块级内容时才会被包裹在段落中。如果所有内容均为内联级,则不会创建段落。

在排版完成的文档中,无法一眼看出文本是否已经属于某个段落。但区分这一点依然十分重要,原因有多种:

- 首行缩进这类段落样式,仅能作用于规范段落,而不会应用到任意文本。与之类似,段落显示规则当然也只在段落上生效。

- 清晰区分段落与其他文本,能够帮助使用辅助技术(AT)(例如屏幕阅读器)的用户正常浏览和理解文档。

- 导出PDF时,仅会为段落生成P标签。

- 导出HTML时,仅会为段落生成 \<p\> 标签。

在创建自定义可复用组件时,你可以且应当控制 Typst 是否生成段落。将文本包裹在#link(<block>)[块]内,而非仅在文本两侧添加段落分隔符,就能强制不生成段落。与之相反,在容器内的某些内容后添加#link(<parbreak>)[段落分隔符],即便内容只有一个单词,也可强制将其转为段落。例如,#link(<list_tight>)[非紧凑]列表就是通过这种方式,强制列表项成为段落。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set par(
  first-line-indent: 1em,
  spacing: 0.65em,
  justify: true,
)

We proceed by contradiction.
Suppose that there exists a set
of positive integers $a$, $b$, and
$c$ that satisfies the equation
$a^n + b^n = c^n$ for some
integer value of $n > 2$.

Without loss of generality,
let $a$ be the smallest of the
three integers. Then, we ...
```
  ],[
    #set align(horizon)
    #image("images/3073.png",width: auto)]
)
=== 参数(Parameters)
```typc
par(
    leading: length,
    spacing: length,
    justify: bool,
    justification-limits: dictionary,
    linebreaks: auto str,
    first-line-indent: length dictionary,
    hanging-indent: length,
    body: content,
) → content
```
- *leading*: length<Paragraph_leading>
行间距。默认值:#rtext()[0.65em]。

行距(Leading)定义的是一行文字的#link(<text_bottom-edge>)[下边缘]与下一行文字的#link(<text_top-edge>)[上边缘]之间的距离。默认情况下,这两项属性由字体决定,但也可以通过文本设置规则手动配置。

通过设置上边缘、下边缘和行距,你还可以设定统一的基线到基线的距离。例如,你可以将行距设为#rtext()[1em],上边缘设为#rtext()[0.8em],下边缘设为#rtext()[-0.2em],从而得到恰好#rtext()[2em]的基线间距。上边缘和下边缘数值的具体分配会影响首行和末行的边界范围。
#table(

  columns: 1fr,

  align: center,

  stroke: none,

  fill: rgb(250, 250, 250),
  image("images/3074.png",width: 95%)
)
- *spacing*: length<Paragraph_spacing>
段落间距。默认值:#rtext()[1.2em]。

和行间距一样,该属性用于定义一个段落最后一行的底边与下一个段落第一行的顶边之间的距离。间距同时作用于段落的上方和下方,相邻段落的间距会合并,取两者中较大的值。

当段落与一个块元素相邻时,该块元素的上边距或下边距属性优先级高于段落间距。例如,标题默认会减小其下方的间距,以获得更好的视觉效果。
- *justify*: bool<Paragraph_justify>
是否对文本行进行两端对齐。默认值:#rtext()[false]。

如果文本功能的连字符属性设置为“自动”且当前语言已知,两端对齐的段落将启用连字符。

请注意,当前的对齐方式仍会影响最后一行的位置,除非该行以两端对齐的换行符结束。

默认情况下,Typst 仅通过调整单词之间的间距来实现对齐。不过,您也可以使用#link(<Paragraph_justification_limits>)[“对齐限制”]属性允许其调整单个字符之间的间距。
- *justification-limits*: dictionary<Paragraph_justification_limits>
两端对齐时,单词与字符间的间距可调整的幅度。

默认值:```typc (
  spacing: (min: 66.67% + 0pt, max: 150% + 0pt),
  tracking: (min: 0pt, max: 0pt),
)```

在对文本进行两端对齐时,Typst 需要将一行文字拉伸或收缩至版心的完整宽度。为实现该效果,默认情况下它会调整单词之间的间距。此外,它也可以调整单个字符之间的间距。该属性可用于设置这些间距调整的下限与上限。

该属性接收一个包含两项的字典:spacing(词间距)和 tracking(字间距),每项又都是带有 min 和 max 键的字典。min 键规定间距可收缩到的最小值,max 键规定间距可拉伸到的最大值。


#set par(hanging-indent: 1.3cm)
-- 间距设置定义了单词之间空格宽度可调整的范围。它与#link(<text_spacing>)[文本间距]密切相关,其最小值和最大值键接受#link(<relative>)[相对长度],就像间距属性一样。\
最小值为#rtext()[100%]意味着空格应保持正常大小(即不缩小),而#rtext()[90% - 0.01em]的值则表示空格可缩小到其正常宽度的90%减去当前字体大小的0.01倍。同样,最大值为#rtext()[100% + 0.02em]意味着空格宽度可增加当前字体大小的0.02倍。比例部分必须始终为正数。同时,最小值的长度部分不得为正数,最大值的长度部分不得为负数。\
请注意,如果无法通过其他方式对齐行,空格仍可能扩展到超出最大值。然而,其他对齐方式(例如,若已配置跟踪条目,则字符间距)会首先被最大限度地使用。

-- 字间距设置项定义了字母间距可调整的幅度。它与文本的字间距(#link(<text_tracking>)[text.tracking])密切相关,其最小值(min)和最大值(max)键接受#link(<length>)[长度值],这一点与字间距属性类似。与普通间距不同,它不接受相对长度值,因为相对长度的基准会因每个字符而异,这会导致视觉效果不均匀。与普通间距相比,其行为相当于基准为#rtext()[100%]。\
否则,最小值和最大值的作用方式与普通间距相同。最大值为#rtext()[0.01em]意味着可以在每对字符之间插入额外的间距,该间距量为当前字体大小的0.01倍。请注意,这也包括空格与字符之间的间隙,因此对于空格,字间距设置值会在普通间距设置值的基础上额外生效。

#set par(hanging-indent: 0cm)

如果仅指定间距或字距追踪中的一个,另一个将保留其先前设置的值(若未先前设置则使用默认值)。若要启用字符级对齐,min和max键的良好取值范围约为0.01em至0.02em(min为负值)。

为两个键使用相同值可获得良好基准,但单独调整两个值可能产生更均衡的效果,如下例所示。注意不要将范围设置得太宽,否则会很快显得不自然。

字符级对齐是一种具有影响力的微排版技术,可改善对齐文本的外观,尤其适用于窄列。但请注意,字符级对齐并非适用于所有字体或语言。例如,连笔字体的字母会相互连接,使用字符级对齐会导致连接处出现锯齿状。
#table(

  columns: 1fr,

  align: left,

  stroke: none,

  [

    ```typst

#let example(name) = columns(2, gutter: 10pt)[
  #place(top, float: true, scope: "parent", strong(name))
  /* Text from https://en.wikipedia.org/wiki/Anne_Bayley */
]

#set page(width: 440pt, height: 21em, margin: 15pt)
#set par(justify: true)
#set text(size: 0.8em)

#grid(

  columns: (1fr, 1fr),
  gutter: 20pt,
  {
    // These are Typst's default limits.
    set par(justification-limits: (
      spacing: (min: 100% * 2 / 3, max: 150%),
      tracking: (min: 0em, max: 0em),
    ))
    example[Word-level justification]
  },
  {
    // These are our custom character-level limits.
    set par(justification-limits: (
      tracking: (min: -0.01em, max: 0.02em),
    ))
    example[Character-level justification]
  },
)
    ```
  ],
  [
    #rect(

      fill: luma(240),
      width: 100%,
      height: auto,
      image("images/3075.png",width: 100%)
    )
  ]
)
- *linebreaks*: auto str<Paragraph_linebreaks>
如何确定换行。默认值:#rtext()[auto]。

当此属性设置为默认值#rtext()[auto]时,会对对齐段落使用优化的换行。为改善文本外观,对非对齐段落启用优化换行也可能很有价值。
#table(

  columns: (0.5fr,2fr),
  stroke: none,
  align: (left,left),
  table.header[Variant][Details],
  table.hline(),
  [\"simple\"],[以简单的一次适应方式确定换行符。 优化整个段落的换行。],
  [\"optimized\"],[Typst 在计算换行时会考虑整个段落,以生成填充更均匀的文本行。]
)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set page(width: 207pt)
#set par(linebreaks: "simple")
Some texts feature many longer
words. Those are often exceedingly
challenging to break in a visually
pleasing way.

#set par(linebreaks: "optimized")
Some texts feature many longer
words. Those are often exceedingly
challenging to break in a visually
pleasing way.
```
  ],[
    #set align(horizon)
    #image("images/3076.png",width: auto)]
)
- *first-line-indent*: length dictionary<Paragraph_first-line-indent>
段落首行应当设置的缩进。默认值:```typc (amount:0pt,all:false)```。

默认情况下,只有连续段落的首行会缩进(文档或容器中的第一段不缩进,紧跟在其他块级元素后的段落也不缩进)。

如果你希望所有段落都缩进,可以传入一个字典,其中包含缩进长度,同时设置```typc all: true```。如果字典中省略 all 参数,则默认为 #rtext()[false]。

按照排版规范,段落分隔可以采用段间留白,或是首行缩进的方式。请注意

-- 通过```typc set par(spacing: 0.65em)``` 将#link(<Paragraph_spacing>)[段落间距]缩减为#link(<Paragraph_leading>)[行间距]

--通过```typc set block(spacing: 1.2em)``` 将#link(<block_spacing>)[块间距](默认继承段落间距)增大至原始段落间距
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set block(spacing: 1.2em)
#set par(
  first-line-indent: 1.5em,
  spacing: 0.65em,
)

The first paragraph is not affected
by the indent.

But the second paragraph is.

#line(length: 100%)

#set par(first-line-indent: (
  amount: 1.5em,
  all: true,
))

Now all paragraphs are affected
by the first line indent.

Even the first one.
```
  ],[
    #set align(horizon)
    #image("images/3077.png",width: auto)]
)
- *hanging-indent*: length<Paragraph_hanging-indent>
段落中除首行外其余各行应设置的缩进。默认值:#rtext()[0pt]。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set par(hanging-indent: 1em)

#lorem(15)
```
  ],[
    #set align(horizon)
    #image("images/3078.png",width: auto)]
)
- body: content
该段落的内容。
=== 定义(Definitions)
- *line*<Paragraph_line>
一段段落行。

该元素仅用于通过设置规则进行行号配置,不可放置。

编号选项用于通过指定编号格式来启用行号。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set par.line(numbering: "1")

Roses are red. \
Violets are blue. \
Typst is there for you.
```
  ],[
    #set align(horizon)
    #image("images/3079.png",width: auto)]
)
编号选项可以采用预定义的编号样式,或是返回带样式内容的函数。你可以通过 show-set 规则将编号设置为 none,以此对特定元素内的文本关闭行号显示。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
// Styled red line numbers.
#set par.line(
  numbering: n => text(red)[#n]
)

// Disable numbers inside figures.
#show figure: set par.line(
  numbering: none
)

Roses are red. \
Violets are blue.

#figure(

  caption: [Without line numbers.]

)[
  Lorem ipsum \
  dolor sit amet
]

The text above is a sample \
originating from distant times.
```
  ],[
    #set align(horizon)
    #image("images/3080.png",width: auto)]
)
该元素提供更多选项,可用于控制行号的其他属性,例如行号的对齐方式或边距。此外,你可以通过编号范围选项设置是否在每一页重新开始编号。
```typc
par.line(
    numbering: none str function,
    number-align: auto alignment,
    number-margin: alignment,
    number-clearance: auto length,
    numbering-scope: str,
) → content
```
-- *numbering*: none str function<Paragraph_numbering>

如何为每一行编号。默认值:#rtext()[none]。

支持#link(<numbering>)[编号样式],或是接收单个数字参数的函数。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set par.line(numbering: "I")

Roses are red. \
Violets are blue. \
Typst is there for you.
```
  ],[
    #set align(horizon)
    #image("images/3081.png",width: auto)]
)
#table(

  columns: 1fr,

  align: left,

  stroke: none,

  [

    ```typst

#set par.line(

  numbering: i => if calc.rem(i, 5) == 0 or i == 1 { i },
)

#lorem(60)
    ```
  ],
  [
    #rect(

      fill: luma(240),
      width: 100%,
      height: auto,
      image("images/3082.png",width: 80%)
    )
  ]
)
-- *number-align*: auto alignment<Paragraph_number-align>
与每一行相关联的行号的对齐方式。默认值:#rtext()[auto]。

#rtext()[auto] 默认值代表智能默认模式,在此模式下,行号沿着远离文本的水平方向递增,同时会考虑其所在边距以及当前文本方向。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set par.line(
  numbering: "I",
  number-align: left,
)

Hello world! \
Today is a beautiful day \
For exploring the world.
```
  ],[
    #set align(horizon)
    #image("images/3083.png",width: auto)]
)
-- *number-margin*: alignment

行号显示的边距。默认值:start。

注:在多栏文档中,最后一栏内段落的行号将始终显示在末端边距(从左到右文本为右边距,从右到左文本为左边距),不受此项设置影响。该行为目前无法更改。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set par.line(
  numbering: "1",
  number-margin: right,
)

= Report
- Brightness: Dark, yet darker
- Readings: Negative
```
  ],[
    #set align(horizon)
    #image("images/3084.png",width: auto)]
)
-- *number-clearance*: auto length

行号与文本之间的距离。默认值:#rtext()[auto]。

#rtext()[auto]的默认值会生成适配页面宽度的间距,在大多数场景下效果良好。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set par.line(
  numbering: "1",
  number-clearance: 4pt,
)

Typesetting \
Styling \
Layout
```
  ],[
    #set align(horizon)
    #image("images/3085.png",width: auto)]
)
-- *numbering-scope*: str

控制何时重置行号。默认值:```typc "document"```。

注:行号的作用范围在每一组连续页面内必须保持一致(一组连续页面指中间没有显式分页符的一系列页面)。因此,相关设置规则应在任何页面内容之前定义,通常放在文档的最开头。
#table(

  columns: (0.5fr,1.5fr),
  stroke: none,
  align: (left,left),
  table.header[Variant][Details],
  table.hline(),
  [\"document\"],[表示行号计数器作用于整个文档,即不会自动重置。],
  [\"page\"],[表示行号计数器应在每一新页面的起始位置重置。]
)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set par.line(
  numbering: "1",
  numbering-scope: "page",
)

First line \
Second line
#pagebreak()
First line again \
Second line again
```
  ],[
    #set align(horizon)
    #image("images/3086.png",width: auto)\
    #image("images/3086.png",width: auto)]
)
== 段落分隔(parbreak)<parbreak>
分隔段落。

这会开启一个新段落。在循环这类代码中使用时尤为实用。多个连续的段落换行将合并为一个。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#for i in range(3) {
  [Blind text #i: ]
  lorem(5)
  parbreak()
}

```
  ],[
    #set align(horizon)
    #image("images/3088.png",width: auto)]
)
=== 语法(Syntax)
你可以在标记语言中插入空行来实现段落分隔,而不必调用此函数。
=== 参数(Parameters)
```typc
    parbreak() → content
```
== 引述(quote)<quote>
显示一段引语,同时可附带可选的出处说明。
=== 示例(Example)
#table(

  columns: 1fr,

  align: left,

  stroke: none,

  [

    ```typst

Plato is often misquoted as the author of #quote[I know that I know

nothing], however, this is a derivation form his original quote:



#set quote(block: true)

#quote(attribution: [Plato])[
  ... ἔοικα γοῦν τούτου γε σμικρῷ τινι αὐτῷ τούτῳ σοφώτερος εἶναι, ὅτι
  ἃ μὴ οἶδα οὐδὲ οἴομαι εἰδέναι.
]
#quote(attribution: [from the Henry Cary literal translation of 1897])[
  ... I seem, then, in just this little thing to be wiser than this man at
  any rate, that what I do not know I do not think I know either.
]
    ```
  ],
  [
    #set quote(block: true)
    #show quote: set align(center)
    #rect(

      fill: luma(240),
      width: 100%,
      height: auto,
      quote[
      #image("images/3089.png",width: 80%)
    ]
    )
  ]
)
默认情况下,块引用左右两侧有1em的内边距,对齐方式与内边距可通过显示规则进行控制:
#table(

  columns: 1fr,

  align: left,

  stroke: none,

  [

    ```typst

#set quote(block: true)
#show quote: set align(center)
#show quote: set pad(x: 5em)

#quote[
  You cannot pass... I am a servant of the Secret Fire, wielder of the
  flame of Anor. You cannot pass. The dark fire will not avail you,
  flame of Udûn. Go back to the Shadow! You cannot pass.
]
    ```
  ],
  [
    #set quote(block: true)
    #show quote: set align(center)
    #rect(

      fill: luma(240),
      width: 100%,
      height: auto,
      quote[
      #image("images/3090.png",width: 80%)
    ]
    )
  ]
)
=== 参数(Parameters)
```typc
quote(
    block: bool,
    quotes: auto bool,
    attribution: none label content,
    body:content,
) → content
```
- *block*: bool
这是否是块引用。默认值:#rtext()[false]。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
An inline citation would look like
this: #quote(

  attribution: [René Descartes]

)[
  cogito, ergo sum
], and a block equation like this:
#quote(

  block: true,

  attribution: [JFK]

)[
  Ich bin ein Berliner.
]

```
  ],[
    #set align(horizon)
    #image("images/3091.png",width: auto)]
)
- *quotes*: auto bool
是否需要在这段引文两侧添加双引号。默认值:#rtext()[auto]。

所使用的双引号由 smartquote 的 quotes 属性推断得出,该属性会受到文本上 lang 属性的影响。
#set par(hanging-indent: 1.3cm)
-- #rtext()[true]:用双引号包裹这段引文。

-- #rtext()[false]:不用双引号包裹这段引文。

-- #rtext()[auto]:根据 block 属性推断是否用双引号包裹这段引文。若 block 为 false,则自动添加双引号。
#set par(hanging-indent: 0cm)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set text(lang: "de")

Ein deutsch-sprechender Author
zitiert unter umständen JFK:
#quote[Ich bin ein Berliner.]

#set text(lang: "en")

And an english speaking one may
translate the quote:
#quote[I am a Berliner.]

```
  ],[
    #set align(horizon)
    #image("images/3092.png",width: auto)]
)
- *attribution*: none label content
该引文的出处标注,通常指作者或来源。可以是指向参考文献条目的标记,或是任意内容。默认仅在块引用中显示,但可通过show规则修改。默认值:#rtext()[none]。
#table(

  columns: 1fr,

  align: left,

  stroke: none,

  [

    ```typst

#quote(attribution: [René Descartes])[
  cogito, ergo sum
]

#show quote.where(block: false): it => {
  ["] + h(0pt, weak: true) + it.body + h(0pt, weak: true) + ["]
  if it.attribution != none [ (#it.attribution)]
}

#quote(

  attribution: link("https://typst.app/home")[typst.app]
)[
  Compose papers faster
]

#set quote(block: true)

#quote(attribution: <tolkien54>)[
  You cannot pass... I am a servant
  of the Secret Fire, wielder of the
  flame of Anor. You cannot pass. The
  dark fire will not avail you, flame
  of Udûn. Go back to the Shadow! You
  cannot pass.
]

#bibliography("works.bib", style: "apa")

    ```
  ],
  [
    #set quote(block: true)
    #show quote: set align(center)
    #rect(

      fill: luma(240),
      width: 100%,
      height: auto,
      quote[
      #image("images/3093.png",width: 80%)
    ]
    )
  ]
)
- *body*: content
引语。

== 引用(ref)<ref>
对标签或参考文献的引用。

接收一个标签并对其进行交叉引用。引用分为两种类型,由其形式决定:```typc "normal"```引用和```typc "page"```引用。

默认的```typc "normal"```引用会生成指向标签的文本引用。例如,对标题的引用会生成合适的字符串,比如引用第一个标题时会显示“第1节”。“节”这个词由#link(<text_lang>)[语言]设置决定,并会做相应本地化处理。这些引用同时也是指向对应元素的链接。引用语法也可以用于参考文献的引用。

由于默认形式需要补充内容与编号,标签必须附加在可引用元素上。可引用元素包括#link(<heading>)[标题]、#link(<figure>)[图片]、#link(<equation>)[公式]和#link(<footnote>)[脚注]。如果想要创建定理这类自定义可引用元素,可以创建#link(<figure_kind>)[自定义类型的图片]并为其编写show规则。未来或许会有更直接的方式来定义自定义可引用元素。

如果你仅希望链接到带标签的元素,而不需要自动生成文本引用,可以改用#link(<link>)[链接]函数。

```typc "page"```引用会生成指向标签的页面引用,在对应位置显示页码。你可以使用#link(<page_supplement>)[页面补充项]修改页码前的文本。与```typc "normal"```引用不同,只要对应#link(<page_numbering>)[页面的编号]已设置,该标签可以附加到任意元素上。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set page(numbering: "1")
#set heading(numbering: "1.")
#set math.equation(numbering: "(1)")

= Introduction <intro>
Recent developments in
typesetting software have
rekindled hope in previously
frustrated researchers. @distress
As shown in @results (see
#ref(<results>, form: "page")),
we ...

= Results <results>
We discuss our approach in
comparison with others.

== Performance <perf>
@slow demonstrates what slow
software looks like.
$ T(n) = O(2^n) $ <slow>

#bibliography("works.bib")

```
  ],[
    #set align(horizon)
    #image("images/3094.png",width: auto)]
)
=== 语法(Syntax)
该功能还有专用语法:输入\@加上标签名称,即可创建标签的
默认的```typc "normal"```引用(例如 = Introduction <intro> 可以通过输入\@intro来引用)。

若要自定义补充文本,在引用后面的方括号内添加内容即可:\@intro[章节]。
=== 个性化(Customization)
当你只需要引用文档中的图表、表格、标题等内容所在页码时,可以通过set规则,将默认表单字段值修改为```typc "page"```。如果你不想使用```typc"page"```,而希望用简短的“p.”作为补充标识,可以使用 #link(<page_supplement>)[page.supplement] 字段来完成修改:
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set page(
  numbering: "1",
  supplement: "p.",
)
#set ref(form: "page")

#figure(

  stack(

    dir: ltr,

    spacing: 1em,

    circle(),
    square(),
  ),
  caption: [Shapes],
) <shapes>

#pagebreak()

See @shapes for examples
of different shapes.

```
  ],[
    #set align(horizon)
    #image("images/3095.png",width: auto)\
    #image("images/3096.png",width: auto)
    ]
)
如果你为引用编写show规则,可以通过引用的 element 类型访问被引用的元素。即便该元素实际存在,若 Typst 尚未检索到它,element 的值也可能为 #rtext()[none],因此你始终需要在代码中处理这种情况。
#table(

  columns: 1fr,

  align: left,

  stroke: none,

  [

    ```typst

#set heading(numbering: "1.")
#set math.equation(numbering: "(1)")

#show ref: it => {
  let eq = math.equation
  let el = it.element
  // Skip all other references.
  if el == none or el.func() != eq { return it }
  // Override equation references.
  link(el.location(), counter(eq).display(at: el.location()))
}

= Beginnings <beginning>
In @beginning we prove @pythagoras.
$ a^2 + b^2 = c^2 $ <pythagoras>

    ```
  ],
  [
    #set quote(block: true)
    #show quote: set align(center)
    #rect(

      fill: luma(240),
      width: 100%,
      height: auto,
      quote[
      #image("images/3097.png",width: 80%)
    ]
    )
  ]
)
=== 参数(Parameters)
```typc
ref(
target:label,
supplement: none auto content function,
form: str,
) → content
```
- *target*: label<ref_target>
应引用的目标标签。

该标签可以是文档中定义的标签;若表单设置为“普通”,则可以是#link(<bibliography>)[参考文献]列表中的条目。
- *supplement*: none auto content function<ref_supplement>
供参考的补充说明。默认值:#rtext()[auto]。

若#link(<ref_form>)[格式]设置为"```typc "normal"```:

-- 对于标题或图表的引用,该内容会添加在引用编号之前。

-- 对于文献引用,可使用它来添加页码。

若#link(<ref_form>)[格式]设置为```typc "page"```,则该内容会添加在所引用标签的页码之前。

如果指定了函数,该函数会接收被引用元素,并应当返回内容。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set heading(numbering: "1.")
#show ref.where(
  form: "normal"
): set ref(supplement: it => {
  if it.func() == heading {
    "Chapter"
  } else {
    "Thing"
  }
})

= Introduction <intro>
In @intro, we see how to turn
Sections into Chapters. And
in @intro[Part], it is done
manually.

```
  ],[
    #set align(horizon)
    #image("images/3098.png",width: auto)
    ]
)
- *form*: str<ref_form>
要生成的参考文献类型。默认值:```typc "normal"```
#table(

  columns: (0.5fr,1.5fr),
  stroke: none,
  align: (left,left),
  table.header[Variant][Details],
  table.hline(),
  [```typc "normal"```],[生成对标签的文本引用。],
  [```typc "page"```],[生成指向标签的页码引用。]
)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set page(numbering: "1")

Here <here> we are on
#ref(<here>, form: "page").
```
  ],[
    #set align(horizon)
    #image("images/3099.png",width: auto)
    ]
)

== 强调(strong)<strong>
通过增加字体粗细来着重强调内容。

按照给定的增量值增加当前字体粗细。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
This is *strong.* \
This is #strong[too.] \

#show strong: set text(red)
And this is *evermore.*

```
  ],[
    #set align(horizon)
    #image("images/3100.png",width: auto)
    ]
)
=== 语法(Syntax)
该函数还有专用语法:若要对内容进行着重强调,只需将内容放在星号(\*)之间。请注意,该语法仅在单词边界处生效。如果需要强调一个单词的局部内容,则必须使用该函数。
=== 参数(Parameters)
```typc
strong(
    delta: int,
    body: content,
) → content
```
- *delta*: int
要应用在字体粗细上的差值。默认值:#rtext()[300]。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set strong(delta: 0)
No *effect!*

```
  ],[
    #set align(horizon)
    #image("images/3101.png",width: auto)
    ]
)
- *body*: content
需要重点强调的内容。

== 表格(table)<table>
项目表格。

表格用于在单元格内排布内容。单元格可容纳任意内容,包括多个段落,单元格按行优先顺序定义。如果你想实操了解在 Typst 中使用和自定义表格的全部方式,可以查阅《表格指南》。

表格本质上就是网格,只是部分单元格属性(尤其是描边和内边距)的默认值不同。如需了解如何设置表格轨道尺寸以及指定单元格外观属性,请参考#link(<grid>)[网格]相关文档。

如果你不确定应该使用表格还是网格,可以这样判断:你要排布的内容在语义上是否属于一组相关数据点或同类信息,还是仅仅想通过网格排布互不相关的内容来优化展示效果。若是前者,表格是合适的选择;若是后者,网格会更加适用。此外,屏幕阅读器这类辅助技术(AT)会将表格内容识别为表格形式播报,而网格里的内容则和文档流中的多个内容块播报方式无异。辅助技术用户可以按单元格对表格进行二维导航。

请注意,若要覆盖特定单元格的属性或为表格单元格应用显示规则,你可以使用 #link(<table_cell>)[table.cell] 元素。更多信息请参阅其文档。

虽然表格(table)与网格(grid)共享大部分属性,但在其中一方上的set规则和show规则不会影响另一方。建议将大部分样式放在set规则和show规则中,这样能保持表格实际使用代码整洁易读,还支持在一处统一修改所有表格的外观。

如需为表格添加标题并使其#link(<ref>)[可被引用],可将表格放入图块(#link(<figure>)[figure])内。
=== 示例(Example)
下面这个示例展示了部分最常用的表格选项。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#table(

  columns: (1fr, auto, auto),
  inset: 10pt,
  align: horizon,
  table.header(
    [], [*Volume*], [*Parameters*],
  ),
  image("cylinder.svg"),
  $ pi h (D^2 - d^2) / 4 $,
  [
    $h$: height \
    $D$: outer radius \
    $d$: inner radius
  ],
  image("tetrahedron.svg"),
  $ sqrt(2) / 12 a^3 $,
  [$a$: edge length]
)
```
  ],[
    #set align(horizon)
    #image("images/3102.png",width: auto)
    ]
)
和网格用法十分相似,你可以使用 #link(<table_cell>)[table.cell] 来自定义每个单元格的外观和位置。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set table(
  stroke: none,
  gutter: 0.2em,
  fill: (x, y) =>
    if x == 0 or y == 0 { gray },
  inset: (right: 1.5em),
)

#show table.cell: it => {
  if it.x == 0 or it.y == 0 {
    set text(white)
    strong(it)
  } else if it.body == [] {
    // Replace empty cells with 'N/A'
    pad(..it.inset)[_N/A_]
  } else {
    it
  }
}

#let a = table.cell(
  fill: green.lighten(60%),
)[A]
#let b = table.cell(
  fill: aqua.lighten(60%),
)[B]

#table(

  columns: 4,

  [], [Exam 1], [Exam 2], [Exam 3],



  [John], [], a, [],

  [Mary], [], a, a,

  [Robert], b, a, b,

)
```
  ],[
    #set align(horizon)
    #image("images/3103.png",width: auto)
    ]
)
=== 无障碍性(Accessibility)<table_Accessibility>
对于使用辅助技术(AT)的用户来说,表格难以阅读。为方便辅助技术用户,我们强烈建议使用 #link(<table_header>)[table.header] 和 #link(<table_footer>)[table.footer] 标记表格的表头和表尾区域。这样辅助技术就可以播报每个单元格对应的列标签。

由于通过单元格浏览表格比视觉阅读更为繁琐,你还应当考虑将表格中的核心信息以文本形式同步呈现。实现方式是将表格置于图形容器内,并使用图形容器的标题来概括表格内容。
=== 参数(Parameters)
```typc
table(
    columns: auto int relative fraction array,
    rows: auto int relative fraction array,
    gutter: auto int relative fraction array,
    column-gutter: auto int relative fraction array,
    row-gutter: auto int relative fraction array,
    inset: relative array dictionary function,
    align: auto array function alignment,
    fill: none color gradient tiling array function,
    stroke: none length color gradient stroke tiling array dictionary function,
    children: ..content,
) → content
```
- *columns*: auto int relative fraction array<table_columns>
列尺寸。有关轨道尺寸的更多信息,请参阅#link(<grid_columns>)[网格文档]。
- *rows*: auto int relative fraction array
行尺寸。关于轨道尺寸的更多信息,请参阅#link(<grid_rows>)[网格文档]。
- *gutter*: auto int relative fraction array<table_gutter>
行与列之间的间距。这是将列间距和行间距设置为相同值的简写方式。有关间距的更多信息,请参阅#link(<grid_gutter>)[网格文档]。
- *column-gutter*: auto int relative fraction array<table_column-gutter>
列之间的间距。优先级高于槽距。有关槽距的更多信息,请参阅#link(<grid_column-gutter>)[网格文档]。
- *row-gutter*: auto int relative fraction array<table_row-gutter>
行间距。优先级高于槽距。关于槽距的更多信息,请参阅#link(<grid_row-gutter>)[网格文档]。
- *inset*: relative array dictionary function<table_inset>
单元格内容的内边距大小。默认值:#rtext()[0%+5pt]。

如需为所有单元格设置相同的内边距,可使用单个长度值统一设置四边,也可使用长度字典分别设置各边。更多详情请参阅#link(<box_inset>)[盒子相关文档]。

如需为不同单元格设置不同内边距,你可以:\
-- 为所有单元格使用统一的内边距\
-- 为每一列使用一组内边距数组\
-- 使用函数,将单元格的横纵坐标(均从0开始)映射为对应的内边距

更多详情请查阅#link(<grid_Styling-the-grid>)[网格文档]。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#table(

  columns: 2,

  inset: 10pt,

  [Hello],

  [World],

)

#table(

  columns: 2,

  inset: (x: 20pt, y: 10pt),
  [Hello],
  [World],
)

```
  ],[
    #set align(horizon)
    #image("images/3104.png",width: auto)
    ]
)
- *align*: auto array function alignment<table_align>
如何对齐单元格内容。默认值:#rtext()[auto]。

如果设置为auto,则使用外部对齐方式。

你可以通过以下任意一种方式指定对齐方式:
#set par(hanging-indent: 1.3cm)
-- 为所有单元格设置统一的对齐方式

-- 使用与每一列对应的对齐方式数组

-- 使用函数,将单元格的X/Y坐标(均从0开始)映射为对应对齐方式
#set par(hanging-indent: 0cm)
详细信息请参阅#link(<table_guide-align-the-contents-of-the-cells>)[表格指南]。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#table(

  columns: 3,

  align: (left, center, right),
  [Hello], [Hello], [Hello],
  [A], [B], [C],
)

```
  ],[
    #set align(horizon)
    #image("images/3105.png",width: auto)
    ]
)
- *fill*:none color gradient tiling array function
如何填充单元格。默认值:#rtext()[none]。

填充方式可以是:\
-- 适用于所有单元格的单一填充样式\
-- 与每一列对应的填充样式数组\
-- 可根据单元格位置确定填充样式的函数

值得注意的是,数组和函数非常适合用来创建条纹表格。更多信息请参阅#link(<table_guide-get-a-striped-table>)[表格指南]。
#table(

  columns: 1fr,

  align: left,

  stroke: none,

  [

    ```typst

#table(

  fill: (x, _) =>
    if calc.odd(x) { luma(240) }
    else { white },
  align: (x, y) =>
    if y == 0 { center }
    else if x == 0 { left }
    else { right },
  columns: 4,
  [], [*Q1*], [*Q2*], [*Q3*],
  [Revenue:], [1000 €], [2000 €], [3000 €],
  [Expenses:], [500 €], [1000 €], [1500 €],
  [Profit:], [500 €], [1000 €], [1500 €],
)
    ```
  ],
  [
    #set quote(block: true)
    #show quote: set align(center)
    #rect(

      fill: luma(240),
      width: 100%,
      height: auto,
      quote[
      #image("images/3106.png",width: 80%)
    ]
    )
  ]
)
- *stroke*: none length color gradient stroke tiling array dictionary function<table_stroke>
如何#link(<stroke>)[绘制]单元格描边。默认值:#rtext()[1pt+]black。

将此项设置为#rtext()[none]可以关闭描边。

如果需要绘制线条,使其能够跨越由边距选项产生的单元格#link(<table_guide>)[间距],或是覆盖多个特定单元格之间的描边,可以考虑在表格单元格配置之外,设置#link(<table_hline>)[table.hline]和#link(<table_vline>)[table.vline]中的一项或多项。

如需为所有单元格设置相同描边,可以使用单条#link(<stroke>)[描边]作用于全部边,或是使用描边字典分别定义各个边。更多详情请参阅#link(<rect_stroke>)[矩形相关文档]。

如需为不同单元格设置不同描边,可采用以下方式:\
-- 使用单条描边应用于全部单元格\
-- 使用描边数组,每一项对应一列\
-- 使用函数,根据单元格位置返回对应的描边

更多详情请查阅#link(<table_guide-document-wide-stroke-functions>)[表格指南]。
- *children*: content
表格单元格内的内容,以及通过 table.hline 和 table.vline 元素指定的所有额外表格线条。
=== 定义(Definitions)
- *cell*<table_cell>
表格中的单元格。可使用它手动定位单元格,或是设置样式。后者有两种实现方式:调用该函数覆盖特定单元格的属性,或是在显示规则中使用它,一次性为多个单元格应用指定样式。

table.cell 最重要的用途,或许就是通过 colspan(列合并)与 rowspan(行合并)字段,让一个单元格跨越多列和/或多行。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show table.cell.where(y: 0): strong
#set table(
  stroke: (x, y) => if y == 0 {
    (bottom: 0.7pt + black)
  },
  align: (x, y) => (
    if x > 0 { center }
    else { left }
  )
)

#table(

  columns: 3,

  table.header(

    [Substance],

    [Subcritical °C],

    [Supercritical °C],

  ),
  [Hydrochloric Acid],
  [12.0], [92.1],
  [Sodium Myreth Sulfate],
  [16.6], [104],
  [Potassium Hydroxide],
  table.cell(colspan: 2)[24.7],
)

```
  ],[
    #set align(horizon)
    #image("images/3107.png",width: auto)
    ]
)
你也可以对 table.cell 应用show规则,一次性为所有单元格设置样式。搭配选择器,你可以根据单元格的位置来应用样式:
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#show table.cell.where(x: 0): strong

#table(

  columns: 3,

  gutter: 3pt,

  [Name], [Age], [Strength],

  [Hannes], [36], [Grace],

  [Irma], [50], [Resourcefulness],

  [Vikram], [49], [Perseverance],

)
```
  ],[
    #set align(horizon)
    #image("images/3108.png",width: auto)
    ]
)
```typc
table.cell(
    body:content,
    x: auto int,
    y: auto int,
    colspan: int,
    rowspan: int,
    inset: auto relative dictionary,
    align: auto alignment,
    fill: none auto color gradient tiling,
    stroke: none length color gradients troke tiling dictionary,
    breakable: auto bool,
) → content
```
-- *body*: content

单元格本体。

-- *x*: auto int

单元格所在列(从零开始索引)。功能与 #link(<grid_cell>)[grid.cell] 中的 x 字段完全一致。默认值:#rtext()[auto]。

-- *y*: auto int

单元格所在的行(从零开始索引)。其功能与 #link(<grid_cell>)[grid.cell] 中的 y 字段完全相同。默认值:#rtext()[auto]。

-- *colspan*: int

此单元格跨越的列数。默认值:#rtext()[1]。

-- *rowspan*: int

此单元格所跨的行数。默认值:#rtext()[1]。

-- *inset*: auto relative dictionary

单元格的#link(<table_inset>)[内嵌]覆盖设置。默认值:#rtext()[auto]。

-- *align*: auto alignment

单元格的对齐方式覆盖设置默认值:#rtext()[auto]。

-- *fill*: none auto color gradient tiling

单元格的填充覆盖。默认值:#rtext()[auto]。

-- *stroke*: none length color gradient stroke tiling dictionary<table_cell-stroke>

单元格笔画覆盖。默认值:(:)。

-- *breakable*: auto bool<table_breakable>

该单元格所跨的行是否可以分布在不同页面。当取值为auto时,仅跨固定高度行的单元格不可分页,而至少跨一行自动高度行的单元格支持分页。默认值:#rtext()[auto]。

- *hline*<table_hline>
表格中的水平线。

它会覆盖所有单元格描边,包括通过表格描边字段设置的描边。该线条可以穿过由#link(<table_column-gutter>)[表格列间距]选项产生的单元格间隙。

如果你需要在单个表格内的指定位置手动添加水平线,请使用该功能,而不是表格描边字段。如果需要添加的线条属于所有表格统一的设计样式,则建议改用#link(<table_stroke>)[表格描边]字段或#link(<table_cell-stroke>)[单元格描边字段]。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set table.hline(stroke: .6pt)

#table(

  stroke: none,

  columns: (auto, 1fr),
  [09:00], [Badge pick up],
  [09:45], [Opening Keynote],
  [10:30], [Talk: Typst's Future],
  [11:15], [Session: Good PRs],
  table.hline(start: 1),
  [Noon], [_Lunch break_],
  table.hline(start: 1),
  [14:00], [Talk: Tracked Layout],
  [15:00], [Talk: Automations],
  [16:00], [Workshop: Tables],
  table.hline(),
  [19:00], [Day 1 Attendee Mixer],
)
```
  ],[
    #set align(horizon)
    #image("images/3109.png",width: auto)
    ]
)
```typc
table.hline(
    y: autoint,
    start: int,
    end: none int,
    stroke: none length color gradient stroke tiling dictionary,
    position: alignment,
) → content
```
-- *y*: auto int

放置水平线的上方行(从零开始索引)。功能与 grid.hline 中的 y 字段完全相同。默认值:#rtext()[auto]。

-- *start*: int

水平线起始所在的列(从零开始索引,包含该列)。默认值:#rtext()[0]。

-- *end*: none int

水平线终止位置之前的列(从零开始索引,不包含该列)。默认值:#rtext()[none]。

-- *stroke*: none length color gradient stroke tiling dictionary

线条的描边。默认值:#rtext()[1pt+]black。

指定为无,会移除此前在该线条范围内绘制的所有线条,包括水平线或单元格下方的描边。

-- *position*: alignment

给定线条所在行(y轴),可设置线条的放置位置:选择顶部,线条绘制在该行上方;选择底部,线条绘制在该行下方。默认值:top。

该设置仅在启用行间距时生效(其他场景下不建议使用,可直接将y值加1来实现需求)。因为启用行间距后,某一行下方的位置与下一行上方的位置会因两者间的间隔而不再相同。
- *vline*<table_vline>
表格中的竖线。有关如何使用该元素字段的更多信息,请参阅 #link(<grid_vline>)[grid.vline] 的文档。

它会覆盖任何单元格描边,包括通过表格的描边字段设置的描边。该竖线可以穿过由表格#link(<table_row-gutter>)[行间距]选项产生的单元格间隙。

该功能与 #link(<table_hline>)[table.hline] 类似。如果你需要在单个表格的指定位置手动放置竖线,请使用此函数;如果想要添加的线条是所有表格设计的通用部分,则改用#link(<table_stroke>)[表格描边字段]或#link(<table_cell-stroke>)[单元格描边字段]。
```typc
table.vline(
    x: auto int,
    start: int,
    end: none int,
    stroke: none length color gradient stroke tiling dictionary,
    position: alignment,
) → content
```
-- *x*: auto int

放置竖线之前的列(从零开始索引)。功能与 #link(<grid_vline>)[grid.vline] 中的 x 字段完全相同。默认值:#rtext()[auto]。

-- *start*: int

竖线起始所在行(从零开始索引,包含该行)。默认值:#rtext()[0]。

-- *end*: none int

垂直线结束的顶部行(从零开始索引,不包含该行)默认值:#rtext()[none]。

-- *stroke*: none length color gradient stroke tiling dictionary

线条的描边。默认值:#rtext()[1pt+]black。

指定为无,会清除此前在该线条范围内绘制的所有线条,包括垂直线条或其下方按单元格设置的描边。

-- *position*: alignment

线条的放置位置,由其所在列(x)决定:start表示在该列之前绘制线条,end表示在该列之后绘制线条。默认值:start。

也可使用left和right作为取值,但不推荐,因为会导致文档在从左到右和从右到左的排版模式下表单样式不一致。

该设置仅在启用列间距时生效(其他场景不建议使用,优先选择直接将x字段加1)。因为启用列间距后,某一列的结束位置和下一列的起始位置会因中间间隔而不同。

- *header*<table_header>
可重复的表格表头。

即使你不打算将表格分页,也应该用该函数包裹表格的标题行,因为 Typst 会通过此函数为表格附加无障碍元数据,保障文档的通用可访问性。

你可以使用 #link(<repeat>)[repeat] 参数控制表格表头是否在多页上重复显示。

目前,该函数不适合用于创建首列表头或独立的表头单元格。你可以使用普通单元格;如果导出PDF,也可以使用 pdf.header-cell 函数将单元格标记为表头单元格。同样,你可以使用 pdf.data-cell 将此函数内的单元格标记为数据单元格。请注意:这些函数尚不稳定,仅在开启 a11y-extras 特性后可用(详情参见PDF模块文档)。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set page(height: 11.5em)
#set table(
  fill: (x, y) =>
    if x == 0 or y == 0 {
      gray.lighten(40%)
    },
  align: right,
)

#show table.cell.where(x: 0): strong
#show table.cell.where(y: 0): strong

#table(

  columns: 4,

  table.header(

    [], [Blue chip],

    [Fresh IPO], [Penny st'k],

  ),
  table.cell(
    rowspan: 6,
    align: horizon,
    rotate(-90deg, reflow: true)[
      *USD / day*
    ],
  ),
  [0.20], [104], [5],
  [3.17], [108], [4],
  [1.59], [84],  [1],
  [0.26], [98],  [15],
  [0.01], [195], [4],
  [7.34], [57],  [2],
)

```
  ],[
    #set align(horizon)
    #image("images/3110.png",width: auto)\
    #image("images/3111.png",width: auto)
    ]
)
```typc
table.header(
    repeat: bool,
    level: int,
    children:..content,
) → content
```
-- *repeat*: bool

此表头是否需要在各页面重复显示。默认值:#rtext()[true]。

-- *level*: int

标题的层级,不能为0。默认值:#rtext()[1]。

该设置支持一次性重复多个标题。不同层级的标题可以一同重复,前提是层级按升序排列。

值得注意的是,当一个较低层级的标题开始重复时,所有更高层级或同等层级的标题将停止重复(它们会被新标题“替换”)。

-- *children*: content

表头内的单元格和线条。

- *footer*<table_footer>
可重复的表格页脚。

与 table.header 元素类似,页脚可以在表格的每一页重复显示。在大型表格的表头和页脚同时添加列标签、汇总数据或其他需要在每页都可见的信息,能够提升可读性,该特性在此类场景下十分有用。

页脚之后不能放置任何其他表格单元格。
```typc
table.footer(
    repeat: bool,
    children:..content,
) → content
```
-- *repeat*: bool

此页脚是否需要在所有页面重复显示。默认值:#rtext()[true]。

-- *children*: content

页脚内的单元格与线条。

== 术语表(terms)<terms>
术语及其说明的列表。

以垂直方式展示一系列术语及其说明。当说明文字跨多行时,会使用悬挂缩进,以此体现视觉层级。
=== 示例(Example)
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
/ Ligature: A merged glyph.
/ Kerning: A spacing adjustment
  between two adjacent letters.

```
  ],[
    #set align(horizon)
    #image("images/3112.png",width: auto)
    ]
)
=== 语法(Syntax)
该功能还有专用语法:以斜杠开头,后面依次接术语、冒号和描述,即可创建术语列表项。
=== 参数(Parameters)
```typc
terms(
    tight: bool,
    separator: content,
    indent: length,
    hanging-indent: length,
    spacing: auto length,
    children:..content array,
) → content
```
- *tight*: bool<terms_tight>
定义术语列表的默认#link(<terms_spacing>)[间距]。若为 #rtext()[false],条目之间使用段落间距分隔。若为 #rtext()[true],则改用#link(<Paragraph_spacing>)[段落行间距]。这会让列表更加紧凑,当条目内容较短时视觉效果更好。默认值:#rtext()[true]。

在标记模式下,该参数的值由条目之间是否存在空行决定。条目直接相连时,该参数设为 #rtext()[true];条目之间用空行分隔时,该参数设为 #rtext()[false]。标记所定义的紧凑设置无法通过集合规则覆盖。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
/ Fact: If a term list has a lot
  of text, and maybe other inline
  content, it should not be tight
  anymore.

/ Tip: To make it wide, simply
  insert a blank line between the
  items.

```
  ],[
    #set align(horizon)
    #image("images/3113.png",width: auto)
    ]
)
- *separator*: content
项目与描述之间的分隔符。默认值:```typc h(amount: 0.6em, weak: true)```。

如果你只想用一定宽度的空白进行分隔,可以使用 ```typc h(2cm, weak: true)``` 作为分隔符,并将 #rtext()[2cm] 替换为你想要的空白宽度。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set terms(separator: [: ])

/ Colon: A nice separator symbol.

```
  ],[
    #set align(horizon)
    #image("images/3114.png",width: auto)
    ]
)
- *indent*: length
每一项的缩进。默认值:#rtext()[0pt]。
- *hanging-indent*: length<terms_hanging-indent>
描述文本的悬挂缩进。默认值:#rtext()[2em]。

这是在整个项目缩进之外额外设置的。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#set terms(hanging-indent: 0pt)
/ Term: This term list does not
  make use of hanging indents.
```
  ],[
    #set align(horizon)
    #image("images/3115.png",width: auto)
    ]
)
- *spacing*: auto length<terms_spacing>
术语列表各项之间的间距。默认值:#rtext()[auto]。

若设置为自动,紧凑术语列表将使用#link(<Paragraph_leading>)[段落行距],宽松(非紧凑)术语列表则使用#link(<Paragraph_spacing>)[段落间距]。
- *children*: content array
术语列表的子项。

使用术语列表语法时,相邻的条目会自动归入术语列表,即便是通过for循环这类结构生成的条目也一样。
#table(

  columns: (1fr,1fr),
  align: (left,left),
  stroke: none,
  fill: (rgb(250, 250, 250),luma(86.27%)),
  [
    ```typst
#for (year, product) in (
  "1978": "TeX",
  "1984": "LaTeX",
  "2019": "Typst",
) [/ #product: Born in #year.]

```
  ],[
    #set align(horizon)
    #image("images/3116.png",width: auto)
    ]
)
=== 定义(Definitions)
- *item*<terms_item>
术语列表项。
```typc
terms.item(
    term: content,
    description: content,
) → content
```
-- *term*: content

列表项所描述的术语。

-- *description*: content

该术语的描述。

== 题名(title)<title>
文档题名。

该部分用于展示整篇文档的主标题,一篇文档中仅可出现一次。与之不同,一级#link(<heading>)[标题]用于文档的顶层章节。

请注意,与标题一同展示的额外前置元信息(例如作者列表)不属于题名正文内容。

导出为HTML格式时,该主标题会渲染为h1元素,而一级标题则渲染为h2元素。

=== 示例(Example)
#table(

  columns: 1fr,

  align: left,

  stroke: none,

  [

    ```typst

#set document(

  title: [Interstellar Mail Delivery]

)

#title()

= Introduction
In recent years, ...
    ```
  ],
  [
    #set quote(block: true)
    #show quote: set align(center)
    #rect(

      fill: luma(240),
      width: 100%,
      height: auto,
      quote[
      #image("images/3119.png",width: 80%)
    ]
    )
  ]
)
=== 参数(Parameters)
```typc
title(body: auto content) → content
```
- *body*: auto content
标题的内容。默认值:#rtext()[auto]。

当该项省略(或设为#rtext()[auto])时,默认使用#link(<document_title>)[document.title]。这种情况下,必须预先通过```typc set document(title: [..])```设置文档标题。

#table(

  columns: 1fr,

  align: left,

  stroke: none,

  [

    ```typst

#set document(title: [Course ABC, Homework 1])
#title[Homework 1]

...
    ```
  ],
  [
    #set quote(block: true)
    #show quote: set align(center)
    #rect(

      fill: luma(240),
      width: 100%,
      height: auto,
      quote[
      #image("images/3117.png",width: 80%)
    ]
    )
  ]
)