2

Bear with me, I've only been learning LaTeX a week now. I've included pictures to give a better idea of what I'm talking about. As the title says, I'm trying to write a set of equations such that the first line has 1, second line has 2, third line has 1. The equations on the first and third lines I want to be aligned at the equals sign – that I can do. What I can't do, is align the equals signs on the first and third lines with the centre of the spacing between the 2 equations on line 2. Please help !!!

\documentclass[12pt]{article}
\usepackage{times}
\usepackage{mathptmx}
\usepackage[ignoreall,a4paper,margin=1cm]{geometry}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{undertilde}
\linespread{1.3}

\begin{document}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\large
%% Remember the & for alignment...
\begin{align*}
\mathbf{a}-2\mathbf{b}+\mathbf{c}&=\mathbf{0} \\
\mathbf{a} &= 4\mathbf{i} - \mathbf{j} + \mathbf{k} & \mathbf{b} &= \mathbf{i} - 2\mathbf{k} \\
\mathbf{a}&=
    \begin{pmatrix}
    4 \\
    -1 \\
    1 \\
    \end{pmatrix} &
\mathbf{b}&=
    \begin{pmatrix}
    1 \\
    0 \\
    -2 \\
    \end{pmatrix}
\end{align*}
\end{document}

Ideal outcome, mockup made in Figma

Current Outcome, screenshot from texmaker preview

3
  • 2
    Welcome to TeX.SX! Commented Mar 12 at 16:50
  • 1
    You're describing something different from the code you show: you seem to have one equation in line 1 and two equations on lines 2 and 3, while you say you have just one in line 3. In the first image I see four lines. Commented Mar 12 at 18:29
  • undertilde.sty is not included in tex live. where is the source or can you remove it, if it is not needed for the example? Commented Mar 12 at 23:49

1 Answer 1

1

Your question isn't very clear as the code has 3 lines, but the target image has 4.

Assuming the image is what you want, possibly something like this:

% Source - https://tex.stackexchange.com/q/760764
% Posted by user436553
% Retrieved 2026-03-12, License - CC BY-SA 4.0

\documentclass[12pt]{article}
\usepackage[ignoreall,a4paper,margin=1cm]{geometry}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{newtx}
\usepackage{setspace}
\setstretch{1.3}
\pagestyle{empty}

\begin{document}
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\large
%% Remember the & for alignment...
\begin{align*}
  \mathbf{a}-2\mathbf{b}+\mathbf{c}&=\mathbf{0} \\
  \begin{aligned}
    \mathbf{a} &= 4\mathbf{i} - \mathbf{j} + \mathbf{k} \\
    \mathbf{a}&=
    \begin{pmatrix*}[r]
      4 \\
      -1 \\
      1 \\
    \end{pmatrix*}
  \end{aligned}
  \qquad &\phantom{=} \qquad
  \begin{aligned}
    \mathbf{b} &= \mathbf{i} - 2\mathbf{k} \\
    \mathbf{b}&=
    \begin{pmatrix*}[r]
      1 \\
      0 \\
      -2 \\
    \end{pmatrix*}
  \end{aligned}\\
  \mathbf{a}-2\mathbf{b}+\mathbf{c}&=\mathbf{0}
\end{align*}
\end{document}

adjusted equations

Off-topic notes:

  • times is obsolete and ought not be used; ditto mathptmx

    • I substituted newtx, which should be loaded after amssymb, if the latter is also required.
  • mathtools loads amsmath.

  • Use setspace and \setstretch rather than \linespread.

  • Generally, bold should be used in maths when it carries semantic meaning. Generally, it is better in that case to create an appropriately named macro for yourself, rather than writing \mathbf everywhere. Then it is easy to change if you end up needing something different.

    • \NewDocumentCommand \something {m} {\mathbf{#1}} where something describes what the markup means mathematically, as opposed to what it looks like.
  • Your current layout is not consistent with the plain page style. You should modify one or other or both.

    • Here's the layout visually:

    layout

    You can see that you have no space here for a header or footer (or marginal notes). So page numbers etc. simply get cut-off and, indeed, geometry warns you

Package geometry Warning: The marginal notes overrun the paper.
     Add 25.54726pt and more to the right margin.

*geometry* verbose mode - [ preamble ] result:
* driver: pdftex
* paper: a4paper
* layout: <same size as paper>
* layoutoffset:(h,v)=(0.0pt,0.0pt)
* modes: showframe 
* h-part:(L,W,R)=(28.45274pt, 540.60239pt, 28.45274pt)
* v-part:(T,H,B)=(28.45274pt, 788.14136pt, 28.45274pt)
* \paperwidth=597.50787pt
* \paperheight=845.04684pt
* \textwidth=540.60239pt
* \textheight=788.14136pt
* \oddsidemargin=-43.81725pt
* \evensidemargin=-43.81725pt
* \topmargin=-80.81725pt
* \headheight=12.0pt
* \headsep=25.0pt
* \topskip=12.0pt
* \footskip=30.0pt
* \marginparwidth=44.0pt
* \marginparsep=10.0pt
* \columnsep=10.0pt
* \skip\footins=10.8pt plus 4.0pt minus 2.0pt
* \hoffset=0.0pt
* \voffset=0.0pt
* \mag=1000
* \@twocolumnfalse
* \@twosidefalse
* \@mparswitchfalse
* \@reversemarginfalse
* (1in=72.27pt=25.4mm, 1cm=28.453pt)
  • 1cm margins and zeroed skips make for fairly ugly results.

    not very pretty

    This is justifiable if

    1. it is an institutional requirement - institutions are known for demanding aesthetically abhorrent typography, especially, for some reason, North American graduate schools;
    2. this is a crib sheet for a 1-page-cheat-sheet-allowed exam, with a requirement for 1.3 line-spacing, 12pt and 1cm margins, but no requirement for acceptable typography;
    3. it is only for the draft, which only you will read and you don't care/like it.

    If none of these apply, you should reconsider the layout and skips. This is especially true if you are doing this to get your submission into the permitted page count, because making your paper difficult for the reviewers to read isn't usually the best way of achieving that.

    If you really need these settings, you should not use ignoreall, but should configure the layout settings so that things fit on the page. If you don't need marginal notes, for example, marginparwidth=0pt,marginparsep=0pt might be suitable. And similarly for the header and footer areas.

\usepackage[marginparwidth=0pt,marginparsep=0pt,headheight=0pt,headsep=0pt,footskip=0pt,a4paper,margin=1cm]{geometry}

This says you have no header or footer and no marginal notes. This sanitises the settings, so eliminating inconsistencies. It obviously does not ameliorate the typographic mischief.

1
  • This works !! Thank you so much !! Commented Mar 14 at 11:57

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.