Zenn
Open14

Latexメモ

fogfog

1行の文字数・1ページの行数の設定方法

https://rion778.hatenablog.com/entry/20091002/1254482262

% 文字数制限の設定
\makeatletter
  \def\maxcharsperline#1{
    \newcounter{mpl}
    \setcounter{mpl}{#1}
    \@tempdima=\linewidth
    \advance\@tempdima by-\value{mpl}zw
    \addtocounter{mpl}{-1}
    \divide\@tempdima by \value{mpl}
    \advance\kanjiskip by\@tempdima
    \advance\parindent by\@tempdima
  }
\makeatother
    
% 行数制限の設定
\def\maxlinesperpage#1{
  \baselineskip=\textheight
  \divide\baselineskip by #1
}
% 1行の文字数
\maxcharsperline{30}

% 1ページ当たりの行数指定 
\maxlinesperpage{35}
fogfog

特殊記号をそのまま出力する方法

特殊記号

$ % & _ { } \ ^ ~ < > |
\verb|&|

\_
fogfog

目次のページ番号と本文のページ番号を分ける方法

% 目次の出力
\pagenumbering{roman}  % ページ番号をローマ数字に設定
\setcounter{tocdepth}{2} %subsectionまで表示する
\tableofcontents
\clearpage

\pagenumbering{arabic} % ページ番号をアラビア数字に設定
% 本文

https://munibus.hatenablog.com/entry/2021/01/07/090515

fogfog

文字の大きさの変え方

\tiny - 非常に小さいサイズ
\scriptsize - スクリプトサイズ(小さい)
\footnotesize - 脚注に使われるサイズ
\small - 小さいサイズ
\normalsize - 標準のサイズ
\large - 大きいサイズ
\Large (Lは大文字) - より大きいサイズ
\LARGE - さらに大きいサイズ
\huge - 非常に大きいサイズ
\Huge - 最大のサイズ
fogfog

章の文字列の余白を調整する

上部の余白を-50pt
下部の余白を20pt

\usepackage{titlesec}
\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries}{\chaptertitlename\thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{-50pt}{20pt}

最初の段落を字下げする

\usepackage{indentfirst}

https://yo.eki.do/notes/indentfirst/

fogfog

引用

Kademlia\cite{maymounkov2002kademlia}

\bibliographystyle{junsrt}
\bibliography{references}

references.bib

@inproceedings{maymounkov2002kademlia,
  title={Kademlia: A peer-to-peer information system based on the xor metric},
  author={Maymounkov, Petar and Mazieres, David},
  booktitle={International workshop on peer-to-peer systems},
  pages={53--65},
  year={2002},
  organization={Springer}
}
作成者以外のコメントは許可されていません