1.怎么显示页码?

To display page numbers in a LaTeX document, you can use the \pagestyle and \pagenumbering commands along with the \thepage command to insert the page number where you want it to appear. Here are the basic steps:

  1. Add
    \pagestyle{plain} or \pagestyle{headings} to your document’s preamble:
\pagestyle{plain}
\pagestyle{headings}

For example:

\documentclass{article}
\pagestyle{plain} % or \pagestyle{headings}
  1. Use
    \pagenumbering{arabic} to specify the page numbering style. You can use other styles like Roman numerals or alphabetic characters as well. Place this command just before the page where you want to start numbering.
    For example, to start numbering with Arabic numerals (1, 2, 3…), use \pagenumbering{arabic}.

  2. To insert the page number in your document, use the
    \thepage command where you want it to appear. This will automatically insert the current page number.
    Here’s an example of how to set up page numbering in a LaTeX document:
    latexCopy code\documentclass{article}

\pagestyle{plain} % or \pagestyle{headings}

\begin{document}

This is page \thepage.

\newpage % Start a new page

This is page \thepage.

\end{document}

在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你可以使用 Angular Material 提供的 `MatPaginator` 组件来实现分页。具体实现步骤如下: 1. 在组件的 HTML 模板中,添加 `MatPaginator` 组件。例如: ```html <mat-paginator [length]="auditingApprovalRecords.length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" (page)="onAuditingPageChange($event)"> </mat-paginator> ``` 其中,`length` 表示数据总数,`pageSize` 表示每页显示的数据条数,`pageSizeOptions` 表示用户可选的每页数据条数选项,`page` 事件表示当用户点击页码时的回调函数。 2. 在组件的 TypeScript 文件中,定义相应的属性和方法。例如: ```typescript import { Component, OnInit, ViewChild } from '@angular/core'; import { MatPaginator } from '@angular/material/paginator'; import { IApprovalRecord } from 'app/shared/model/approval-record.model'; import { ApprovalRecordService } from 'app/entities/approval-record/approval-record.service'; @Component({ selector: 'jhi-approval-record', templateUrl: './approval-record.component.html', }) export class ApprovalRecordComponent implements OnInit { @ViewChild(MatPaginator) paginator!: MatPaginator; auditingApprovalRecords: IApprovalRecord[] = []; createdApprovalRecords: IApprovalRecord[] = []; auditedApprovalRecords: IApprovalRecord[] = []; pageSize = 10; pageSizeOptions: number[] = [5, 10, 20]; constructor(private approvalRecordService: ApprovalRecordService) {} ngOnInit(): void { this.loadAll(); } loadAll(): void { this.approvalRecordService.queryAuditing().subscribe((res: HttpResponse<IApprovalRecord[]>) => { this.auditingApprovalRecords = res.body ?? []; this.auditingApprovalRecords.paginator = this.paginator; // 绑定分页组件 }); this.approvalRecordService.queryCreated().subscribe((res: HttpResponse<IApprovalRecord[]>) => { this.createdApprovalRecords = res.body ?? []; this.createdApprovalRecords.paginator = this.paginator; // 绑定分页组件 }); this.approvalRecordService.queryAudited().subscribe((res: HttpResponse<IApprovalRecord[]>) => { this.auditedApprovalRecords = res.body ?? []; this.auditedApprovalRecords.paginator = this.paginator; // 绑定分页组件 }); } onAuditingPageChange(event: any): void { this.auditingApprovalRecords.paginator = this.paginator; } onCreatedPageChange(event: any): void { this.createdApprovalRecords.paginator = this.paginator; } onAuditedPageChange(event: any): void { this.auditedApprovalRecords.paginator = this.paginator; } } ``` 其中,`@ViewChild(MatPaginator) paginator!: MatPaginator` 表示获取 `MatPaginator` 组件的实例。在 `loadAll()` 方法中,将获取到的数据绑定到 `MatPaginator` 组件上。分别定义了三个回调函数 `onAuditingPageChange`、`onCreatedPageChange` 和 `onAuditedPageChange`,用来处理分页变化事件。 注意:在绑定分页组件时,需要先将获取到的数据赋值给对应的属性,再将属性绑定到分页组件上。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值