方程式を整理するのに助けてもらえますか?

方程式を整理するのに助けてもらえますか?

こんにちは。私は LaTeX 初心者で、方程式を整理するのに助けが必要です。これが私の持っているものです。

ここに画像の説明を入力してください

  • 式(3)を数値(3)と揃える必要がある。
  • 式(5)と式(6)は、中心に配置され、互いにのみ整列される。

こちらがmweです。https://www.overleaf.com/latex/templates/icml-2019-submission-template/vkqjjvzjvhdc

%%%%%%%% ICML 2019 EXAMPLE LATEX SUBMISSION FILE %%%%%%%%%%%%%%%%%

\documentclass{article}

% Recommended, but optional, packages for figures and better typesetting:
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{booktabs} % for professional tables
\usepackage{amsmath}

% hyperref makes hyperlinks in the resulting PDF.
% If your build breaks (sometimes temporarily if a hyperlink spans a page)
% please comment out the following usepackage line and replace
% \usepackage{icml2019} with \usepackage[nohyperref]{icml2019} above.
\usepackage{hyperref}

% Attempt to make hyperref and algorithmic work together better:
\newcommand{\theHalgorithm}{\arabic{algorithm}}

% Use the following line for the initial blind version submitted for review:
\usepackage{icml2019}

% If accepted, instead use the following line for the camera-ready submission:
%\usepackage[accepted]{icml2019}

% The \icmltitle you define below is probably too long as a header.
% Therefore, a short form for the running title is supplied here:
\icmltitlerunning{Submission and Formatting Instructions for ICML 2019}

\begin{document}

\twocolumn[
\icmltitle{Submission and Formatting Instructions for \\
           International Conference on Machine Learning (ICML 2019)}

% It is OKAY to include author information, even for blind
% submissions: the style file will automatically remove it for you
% unless you've provided the [accepted] option to the icml2019
% package.

% List of affiliations: The first argument should be a (short)
% identifier you will use later to specify author affiliations
% Academic affiliations should list Department, University, City, Region, Country
% Industry affiliations should list Company, City, Region, Country

% You can specify symbols, otherwise they are numbered in order.
% Ideally, you should not use this facility. Affiliations will be numbered
% in order of appearance and this is the preferred way.
\icmlsetsymbol{equal}{*}

\begin{icmlauthorlist}
\icmlauthor{Aeiau Zzzz}{equal,to}
\icmlauthor{Bauiu C.~Yyyy}{equal,to,goo}
\icmlauthor{Cieua Vvvvv}{goo}
\icmlauthor{Iaesut Saoeu}{ed}
\icmlauthor{Fiuea Rrrr}{to}
\icmlauthor{Tateu H.~Yasehe}{ed,to,goo}
\icmlauthor{Aaoeu Iasoh}{goo}
\icmlauthor{Buiui Eueu}{ed}
\icmlauthor{Aeuia Zzzz}{ed}
\icmlauthor{Bieea C.~Yyyy}{to,goo}
\icmlauthor{Teoau Xxxx}{ed}
\icmlauthor{Eee Pppp}{ed}
\end{icmlauthorlist}

\icmlaffiliation{to}{Department of Computation, University of Torontoland, Torontoland, Canada}
\icmlaffiliation{goo}{Googol ShallowMind, New London, Michigan, USA}
\icmlaffiliation{ed}{School of Computation, University of Edenborrow, Edenborrow, United Kingdom}

\icmlcorrespondingauthor{Cieua Vvvvv}{[email protected]}
\icmlcorrespondingauthor{Eee Pppp}{[email protected]}

% You may provide any keywords that you
% find helpful for describing your paper; these are used to populate
% the "keywords" metadata in the PDF but will not be shown in the document
\icmlkeywords{Machine Learning, ICML}

\vskip 0.3in
]

% this must go after the closing bracket ] following \twocolumn[ ...

% This command actually creates the footnote in the first column
% listing the affiliations and the copyright notice.
% The command takes one argument, which is text to display at the start of the footnote.
% The \icmlEqualContribution command is standard text for equal contribution.
% Remove it (just {}) if you do not need this facility.

%\printAffiliationsAndNotice{}  % leave blank if no need to mention equal contribution
\printAffiliationsAndNotice{\icmlEqualContribution} % otherwise use the standard text.

\begin{abstract}
This document provides a basic paper template and submission guidelines.
Abstracts must be a single paragraph, ideally between 4--6 sentences long.
Gross violations will trigger corrections at the camera-ready phase.
\end{abstract}

\section{Electronic Submission}
\label{submission}

\small
\begin{align}
  \hspace*{-0.2cm} i_t &= \sigma(W_{\!\textit{xi}} * X_t + W_{\textit{hi}} * H_{t-1} + W_{\!\textit{ci}} \circ C_{t-1} + b_i)\\
  \hspace*{-0.2cm} f_t &= \sigma(W_{\!\textit{xf}} * X_t + W_{\textit{hf}} * H_{t-1} + W_{\!\textit{cf}} \circ C_{t-1} + b_f)\\
  \hspace*{-0.2cm} C_t &= f_t \circ C_{t-1} + i_t \circ \tanh(W_{\!\textit{xc}} * X_t + W_{\!\textit{hc}} * H_{t-1} + b_c)\\
  \hspace*{-0.2cm} o_t &= \sigma(W_{\!\textit{xo}} * X_t + W_{\!\textit{ho}} * H_{t-1} + W_{\!\textit{co}} \circ C_{t} + b_o)\\
  S_t &= o_t \circ \textnormal{tanh}(C_t)\\
  H_{t,ij} &= \frac{||S_{t,ij}^2||}{1 + ||S_{t,ij}^2||} \frac{S_{t,ij}}{||S_{t,ij}||}
\end{align}

\end{document}

編集: leandriisさん、回答ありがとうございます。でも、なぜOverleafはエラーのようにすべてをハイライトするのでしょうか? これは、alignをgatherの中にネストすると発生します。

ここに画像の説明を入力してください

ここに画像の説明を入力してください

答え1

これまでの3つの質問に対するコメントと回答を組み合わせると、次のMWEが完成します。その中で、私は環境align内で2つの環境を使用していますgather先ほどお勧めしたように\small最初の例では、フォントサイズとコマンドをそのままにしました\hspace*が、2番目の例では、数式番号が下に移動しないように3番目の数式を2行に分割しました。これはMicoがすでに推奨

ここに画像の説明を入力してください

\documentclass{article}
\usepackage{amsmath}
\usepackage{icml2019}

\begin{document}

\section{Electronic Submission}
\label{submission}

\small
\begin{gather}
  \begin{align}
    \hspace*{-0.2cm} i_t &= \sigma(W_{\!\textit{xi}} * X_t + W_{\textit{hi}} * H_{t-1} + W_{\!\textit{ci}} \circ C_{t-1} + b_i)\\
    \hspace*{-0.2cm} f_t &= \sigma(W_{\!\textit{xf}} * X_t + W_{\textit{hf}} * H_{t-1} + W_{\!\textit{cf}} \circ C_{t-1} + b_f)\\
    \hspace*{-0.2cm} C_t &= f_t \circ C_{t-1} + i_t \circ \tanh(W_{\!\textit{xc}} * X_t + W_{\!\textit{hc}} * H_{t-1} + b_c)\\
    \hspace*{-0.2cm} o_t &= \sigma(W_{\!\textit{xo}} * X_t + W_{\!\textit{ho}} * H_{t-1} + W_{\!\textit{co}} \circ C_{t} + b_o)
  \end{align}\\
  \begin{align}
    S_t &= o_t \circ \tanh(C_t)\\
    H_{t,ij} &= \frac{||S_{t,ij}^2||}{1 + ||S_{t,ij}^2||} \frac{S_{t,ij}}{||S_{t,ij}||}
  \end{align}
\end{gather}
\normalsize

\begin{gather}
  \begin{align}
     i_t &= \sigma(W_{\!\textit{xi}} * X_t + W_{\textit{hi}} * H_{t-1} + W_{\!\textit{ci}} \circ C_{t-1} + b_i)\\
     f_t &= \sigma(W_{\!\textit{xf}} * X_t + W_{\textit{hf}} * H_{t-1} + W_{\!\textit{cf}} \circ C_{t-1} + b_f)\\
     C_t &= f_t \circ C_{t-1} \notag\\
         &+ i_t \circ \tanh(W_{\!\textit{xc}} * X_t + W_{\!\textit{hc}} * H_{t-1} + b_c)\\
     o_t &= \sigma(W_{\!\textit{xo}} * X_t + W_{\!\textit{ho}} * H_{t-1} + W_{\!\textit{co}} \circ C_{t} + b_o)
  \end{align}\\
  \begin{align}
    S_t &= o_t \circ \tanh(C_t)\\
    H_{t,ij} &= \frac{||S_{t,ij}^2||}{1 + ||S_{t,ij}^2||} \frac{S_{t,ij}}{||S_{t,ij}||}
  \end{align}
\end{gather}

\end{document}

答え2

alignまた、環境の中に環境のペアを使うこともありますgatherないただし、を使用してください。6 つの方程式すべてを適合させるには、 、、\hspace*{-0.2cm}の値をリセットします。これらのパラメーターは、数学演算子の各側に挿入される空白の量を制御します。thinmuskip\medmuskip\thickmuskip

ああ、そして私は||、つまり、連続する 2 つの|シンボルを記述して「ノルム」区切り文字を作成しません。代わりに、 と\lVertのいずれかを使用する\rVertか、よりエレガントに、パッケージをロードして、可変サイズのフェンスでmathtoolsというマクロを作成します。\norm

ここに画像の説明を入力してください

\documentclass{article}
\usepackage{microtype}
\usepackage{graphicx}
%\usepackage{subfigure} % this package is deprecated
\usepackage{booktabs}

\usepackage{mathtools} % superset of 'amsmath' package
\DeclarePairedDelimiter\norm\lVert\rVert

\newcommand\vn[1]{\textit{#1}} % how to typeset variable names

\usepackage[colorlinks]{hyperref}
\newcommand{\theHalgorithm}{\arabic{algorithm}}

\usepackage{icml2019}

\begin{document}

\section{Electronic Submission}
\label{submission}

\begingroup  %localize the scope of the following instructions
\small
\thickmuskip=2.5mu % choose values half as large as the defaults
\medmuskip=2mu
\thinmuskip=1.5mu
\begin{gather}
\begin{align}
  i_t &= \sigma(W_{\!\vn{xi}} * X_t + 
                W_{\vn{hi}} * H_{t-1} + 
                W_{\!\vn{ci}} \circ C_{t-1} + b_i)\\
  f_t &= \sigma(W_{\!\vn{xf}} * X_t + 
                W_{\vn{hf}} * H_{t-1} + 
                W_{\!\vn{cf}} \circ C_{t-1} + b_{\vn{f}})\\
  C_t &= f_t \circ C_{t-1} + i_t \circ 
         \tanh(W_{\!\vn{xc}} * X_t + 
         W_{\!\vn{hc}} * H_{t-1} + b_c)\\
  o_t &= \sigma(W_{\!\vn{xo}} * X_t + 
                W_{\!\vn{ho}} * H_{t-1} + 
                W_{\!\vn{co}} \circ C_{t} + b_o)
\end{align}\\
\begin{align}
  S_t      &= o_t \circ \tanh(C_t)\\
  H_{t,ij} &= \frac{\norm{S_{t,ij}^2}}{1+\norm{S_{t,ij}^2}} 
              \frac{S_{t,ij}}{\norm{S_{t,ij}}}
\end{align}
\end{gather}
\endgroup

\end{document}

関連情報