0

I am writing a long exact sequence like this 2 and this 1

in a latex document. But it is going beyond the rest of the text's width. I have written these in math mode. How can I make it small enough so that it fits in the same width as the rest of the text on the same page?

Thank you.

Edit- Here's the code (for a different long exact sequence than the one above):

\documentclass[12pt,a4paper]{report}
\makeatletter
% these two slashes-commands for continuous chapter numbering in parts of the document
\makeatother
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\huge}{\thechapter.}{20pt}{\huge\bf} %for chapter headings
\RequirePackage{etoolbox}
\usepackage{tikz-cd} % and in the above line to use commutative diagrams
\usepackage{amsfonts}
\usepackage[utf8]{inputenc}
\usepackage{amsthm}
% below four lines to just one or two cyrillic letter
\DeclareFontFamily{U}{wncy}{}
\DeclareFontShape{U}{wncy}{m}{n}{<->wncyr10}{}
\DeclareSymbolFont{mcy}{U}{wncy}{m}{n}
\DeclareMathSymbol{\Sh}{\mathord}{mcy}{"58} 
 %Cyrillic letter command over
\usepackage{sagetex}
\usepackage[toc]{appendix} % to make appendi appear in the table of contents
 \usepackage{amssymb}  %to use direct sum symbol
 \usepackage{graphicx} %toinsert images
 \usepackage{amsmath} %to use matrices
 \usepackage{hyperref}
 \usepackage{bm} % to use bold font in math mode use \bm{ insert math mode text}
 \usepackage{mathrsfs} %for scripted english characters
 \usepackage{mathtools}
 \usepackage{tikz-cd} % to draw commutative diagrams
 \usepackage{enumitem}

Then there is a long exact sequence of cohomological groups
\[
0 \longrightarrow H^0(G_K,P) \longrightarrow H^0(G_K,M) \longrightarrow H^0(G_K,N) \\
H^1(G_K,P) \longrightarrow H^1(G_K,M) \longrightarrow H^1(G_K,N),
\]

\[
\begin{tikzcd}
  0 \arrow{r} & 
\frac{E'(K)}{\phi(E(K))} \arrow{r}{\delta} \arrow{d} &
H^{1}(G_K, E[\phi]) \arrow{r} \arrow{d}{Res_v} &
WC(E/K)[\phi] \arrow{r} \arrow{d} & 0 \\
0 \arrow{r} &
\frac{E'(K_v)}{\phi(E(K_v))} \arrow{r}{\delta_{v}} \arrow{d} &
H^{1}(G_{v}, E[\phi]) \arrow{r} \arrow{d} & 
WC(E/K_{v})[\phi] \arrow{r} \arrow{d} & 0 \\
0 \arrow{r} & 
\prod\limits_{v \in M_K} \frac{E'(K_v)}{\phi(E(K_v))} \arrow{r}{\prod\limits_{v \in M_K}\delta_{v}} &
\prod\limits_{v \in M_K} H^{1}(G_{v}, E[\phi]) \arrow{r} &
\prod\limits_{v \in M_K} WC(E/K_{v})[\phi] \arrow{r} & 0 
\tag{$**$} 
\label{starstar}
\end{tikzcd}  
\]
\end{document}
7
  • would you like to share your code
    – js bibra
    Apr 18, 2020 at 2:55
  • Please provide a MWE. If math expression is to long to be in one line, break it into two (or more) lines.
    – Zarko
    Apr 18, 2020 at 2:55
  • @Zarko: how do I do that? Just by giving spaces? or using align environment?
    – Shreya
    Apr 18, 2020 at 2:57
  • Please show your code (in form of small complete document, i.e. MWE) that we can show you haw to do this.
    – Zarko
    Apr 18, 2020 at 3:00
  • I don't know how to write code here and the main tex file contains a lot of text before and after these particular lines. Enclosing the code in backlashes or tilde does nothing as suggested.
    – Shreya
    Apr 18, 2020 at 3:00

1 Answer 1

1

You need to use one of amsmath (mathtools) package math formats, which enables to write multi lines equations . For example, in your case is handy multline environment:

\documentclass[12pt,a4paper]{report}
\usepackage{mathtools}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
Then there is a long exact sequence of cohomological groups
    \begin{multline*}
0 \longrightarrow H^0(G_K,P) \longrightarrow H^0(G_K,M) \longrightarrow H^0(G_K,N) \\
\longrightarrow H^1(G_K,P) \longrightarrow H^1(G_K,M) \longrightarrow H^1(G_K,N),
    \end{multline*}
or
    \[
\begin{multlined}[0.8\linewidth]
0 \longrightarrow H^0(G_K,P) \longrightarrow H^0(G_K,M) \longrightarrow H^0(G_K,N) \\
\longrightarrow H^1(G_K,P) \longrightarrow H^1(G_K,M) \longrightarrow H^1(G_K,N),
\end{multlined}
    \]    
\end{document}

gives

enter image description here

(red lines indicate text border)

Note, equation or \[ ...\] enable break of (long) equations into more lines only if in them are nested amsmath or mathtools math environments like multlined (see second example), etc.

4
  • Thanks, it works perfectly. Do you know how to fix the second example I have provided the code of?(its a commutative diagram in tikz environment)
    – Shreya
    Apr 18, 2020 at 3:42
  • @Shreya, oh, this is new question ... Please one problem per question!
    – Zarko
    Apr 18, 2020 at 3:43
  • Thank so much! I asked two more questions on a similar theme.
    – Shreya
    Apr 18, 2020 at 4:05
  • You can use \allowbreak for your second example
    – user94293
    Apr 18, 2020 at 4:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .