LoginSignup
0
0

More than 3 years have passed since last update.

Latexチュートリアル

Last updated at Posted at 2021-04-18

イントロ

Latexはよくstandard of パブリケーション of scientific documentsとして使われます。
通常のWord, excelとかの「What you see is what you get!」のルールに沿っていないドキュメントの編集ツールです。 Plain textで編集してコンパイルしてファイルを生成するようなイメージとなります。Latexはソース・ファイルをtex engineでrenderするようなイメージとなります。
公式サイトドキュメントはこちらです。

メリット

  • Latexはプロフェッショナルなツール、科学誌とか論文のスタンダードになることが多い
  • 編集する機能が豊富
  • 数学公式やそのた多種多様な操作に対応
  • 拡張パッケージによって様々な機能を実現可能
  • texファイルはコード形式で、例えばgitによるヴァージョンコントロールがしやすい

インストール

image.png
ここへアクセスしてください。

image.png
画面中央のハイパーリンクをクリック

image.png
continueをクリックし続けて、インストールしてください。

image.png
TeXShopを開いて

syntaxの例1(チュートリアル例1)(そのままチュートリアル通りに打ってみたがちんぷんかんぷんですね)

/documentclass[a4paper, 12pt]{book}
comment: namee[optional arguments]{required arguments}

image.png
image.png

\documentclass[a4paper, 12pt, twocolumn]{book}

\renewcommand{\familydefault}{\sfdefault}

\usepackage[a4paper, inner=1.7cm, outer=2.7cm, top=2cm, bottom=2cm, bindingoffset=1.2cm]{geometry}

\usepackage[english]{babel}

\usepackage{blindtext}


\begin{document}
\title{\Large{\textbf{LaTeX Tutorial}}}
\author{By Derek Banas}
\date{December 21, 2018}


\maketitle

\blindtext[5]

\end{document}

上記の結果は以下のとおりです。
image.png

Editor

Texmakerはマルチプラットフォーム対応なので、おすすめです。texstudioも使いやすいそうです。

onlineで使う方法(チュートリアル例2)

色々なサイトはLatexをサポートしていますが、今回はその中でShareTexを使用。アカウントを作ってすぐに編集可能な状態になるので便利です。

syntax説明

\documentclass[11pt]{article}
% input codeしてutf8にする
\usepackage[utf8]{inputenc}

% basic info about the thesis
\title{sample}
\author{xiaoming}
\date{\today}

% import packages
% 引用論文の際に使うパッケージ
\usepackage{natbib}
% 図を入れるためのpackage
\usepackage{graphicx}

\begin{document}
% generate a title unless you do not add this
\maketitle

\begin{abstract}
    This is the abstract of this paper. 
\end{abstract}

\section{Introduction}
There is a theory which states that if ever anyone discovers exactly what the Univer is for .

\section{Others}
Plain text, Plain-text, or Plaintext is any text, text file, or document containing only text. Unlike a rich-text document, a plain text file cannot have bold text, fonts, larger font sizes, or any other special text formatting. The picture is a visual example of plain text vs. formatted text.

Most associate plain text files with the file extension .txt on Microsoft Windows computers, however, can be any non-formatted file. To view a plaintext file, a text editor, such as Microsoft Notepad is used. However, all text editors including Microsoft WordPad and Word can also be used to view plaintext files because they have no special formatting.\\  however, can be any non-formatted file. To view a plaintext file, a text editor, such as Microsoft Notepad is used. However, all text editors including Microsoft WordPad and Word can also be used to view plaintext files because they have no special formatting.
    % subsection is available
    \subsection{Something}
    fasdgwetwtreltjjrklejfawert

\section{The Universe}

\begin{flushleft}
    fasdfsadfasdfasdfasdf
    sadfsadfasdfsad
    fasdfsadfasdf
    asdfsadf
    % inline 公式を作成
    asdfsghsdfhgrsgwre. $y=2x^2+3$
    freterwfghsdfg
    % 改行して作る公式
    $$ y=2x^2+3$$

    $x^{4y+3}+y^{23}=100$

    $$ x_1 + y_1 = z_1, x{ij}$$
    $$ \frac{3x^2}{2\pi}$$

    $$ \sqrt[4]{3x^2+4}$$
    \begin{center}
    \begin{tabular}{c|c|c}
         a & b & c \\ \hline % line break and horizontal line
         c & d & f
    \end{tabular}
    \end{center}
\end{flushleft}

% 左辺へ
\begin{flushleft}
% \\改行
werowijfsadfnglasdkfjaklsdhflkhkjasf...\\
fasdtwetewkltjaksdf

\end{flushleft}
% 右辺へ
\begin{flushright}
2020/4/15
\end{flushright}
% 図を入れる !h=here, !t=top, !b=bottom
% angleは回転する、widthは横幅
\begin{figure}[h!]
    \centering
    \includegraphics[width=5cm,angle=45]{markdown1.png}
    \caption{Caption}
    \label{fig:my_label}
\end{figure}

% unordered list
\begin{itemize}
    \item 1 item
    \item 2 item
    \item 3 item
\end{itemize}
% order list
\begin{enumerate}
    \item A
    \item B
    \item C
    \item C\#
    \item Python
\end{enumerate}


\begin{center}
    this is a center text
\end{center}


\section{Conclusion}
"I always thought something was wrong with the universe"

\citep{adams1995hitchhiker}
\bibliographystyle{plain}
\bibliography{references}

\end{document}

コンパイルの結果:
image.png
image.png
image.png

今回使った参考資料はこちら
参考資料1
資料→日本語化しないとエラーがでますよ

0
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
0
0