1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

latex チートシート(自分用)

Last updated at Posted at 2022-07-14

cloud latexで作業中に自分で見る用のチートシートを作りました.

画像貼り付け

1枚の画像を貼り付ける

\begin{figure}
\centering
\includegraphics[width=12cm]{}
\caption{画像の説明}
\label{fig:}
\end{figure}

2枚の画像を横並びに貼り付ける

\begin{figure}[htbp]
  \begin{minipage}[b]{0.45\linewidth}
    \centering
    \includegraphics[width=6cm]{}
    \caption{}
    \label{fig:}
  \end{minipage}
  \begin{minipage}[b]{0.45\linewidth}
    \centering
    \includegraphics[width=6cm]{}
    \caption{}
    \label{fig:}
  \end{minipage}
\end{figure}

複数の画像(例:7枚)を貼り付ける

まずは,これをdocmentclassの下におまじない.

\newlength{\subfigwidth}
\newlength{\subfigcolsep}
\setlength{\subfigcolsep}{2\tabcolsep}
\setkeys{Gin}{width=\subfigwidth}
\usepackage{subfigure}
\begin{figure}[tbh]
  \setlength{\subfigwidth}{.34\linewidth}
  \addtolength{\subfigwidth}{-.5\subfigcolsep}
  \begin{minipage}[b]{\subfigwidth}
    \subfigure[]{\includegraphics[width=4cm]{}}
  \end{minipage}
  \begin{minipage}[b]{\subfigwidth}
    \subfigure[]{\includegraphics[width=4cm]{}}
  \end{minipage}
  \begin{minipage}[b]{\subfigwidth}
    \subfigure[]{\includegraphics[width=4cm]{}}
  \end{minipage}
  \begin{minipage}[b]{\subfigwidth}
    \subfigure[]{\includegraphics[width=4cm]{}}
  \end{minipage}
  \begin{minipage}[b]{\subfigwidth}
    \subfigure[]{\includegraphics[width=4cm]{}}
  \end{minipage}
  \begin{minipage}[b]{\subfigwidth}
    \subfigure[]{\includegraphics[width=4cm]{}}
  \end{minipage}
  \begin{minipage}[b]{\subfigwidth}
    \subfigure[]{\includegraphics[width=4cm]{}}
  \end{minipage}
  \caption{}
  \label{fig:}
\end{figure}

ソースコードを貼り付ける場合

documentclassの下におまじないをして,

\usepackage{listings,jvlisting}
\lstset{
  basicstyle={\ttfamily},
  identifierstyle={\small},
  commentstyle={\smallitshape},
  keywordstyle={\small\bfseries},
  ndkeywordstyle={\small},
  stringstyle={\small\ttfamily},
  frame={tb},
  breaklines=true,
  columns=[l]{fullflexible},
  numbers=left,
  xrightmargin=0zw,
  xleftmargin=3zw,
  numberstyle={\scriptsize},
  stepnumber=1,
  numbersep=1zw,
  lineskip=-0.5ex
}
\begin{lstlisting}[caption=,label=]
#include<stdio.h>
int main(){
   printf("Hello world!");
}
\end{lstlisting}

参考文献リスト

\begin{thebibliography}{99}
\bibitem{}
\bibitem{}\url{}
\bibitem{}
\end{thebibliography}

参照する際は\cite{}コマンド
一部こちらの記事を参考にさせていただきました.
https://qiita.com/ta_b0_/items/2619d5927492edbb5b03

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?