4

It's kind of hard to describe my problem with words so let me start with a code sample :

 \documentclass[10pt]{amsart}
 \begin{document}

    \[
    \begin{array}{cccc}
    Y(N)_{\mathbf Z[\frac 1 N]} : & \mathbf Z[\frac 1 N]- Sch & \longrightarrow & Ens \\
                                  & T                         & \longmapsto       & \left\{ \begin{split}\text{Classes d'isomorphismes de paires $(E,\varphi)$ o\`u}\\ \text{ $E$ est une courbe elliptique sur $T$ et} \\ \text{ $\varphi : (\mathbf Z/N\mathbf Z)_T \to E[N]$ est}\\ \text{ un isomorphisme de sch\'emas en groupes sur $T$} \end{split}  \right \}
    \end{array}
    \]
    \end{document}

Basically i'm trying to fit a paragraph of text in an equation. I can do it using split but then I have to choose where to split itby hand + it looks very bad (cf above code). I would like a solution which splits everything nicely and automatically.

J. Doe
  • 205
  • 2
    try setting a \parbox within \text. then all you should have to do is decide how wide the \parbox is to be. oh -- probably a good idea to set that text \raggedright. – barbara beeton Sep 15 '15 at 19:38
  • Ah that's really exactly what I was looking for thank you very much ! – J. Doe Sep 15 '15 at 19:48
  • Do you know it has been possible for more than twenty years to typeset letters with accents normally? It suffices to add \usepackage[utf8]{inputenc} and \usepackage[T1]{fontenc} to your preamble. – Bernard Sep 15 '15 at 21:40
  • @barbarabeeton No, a \parbox won't do, particularly if you set it \raggedright, unless you're particularly lucky that all lines are nearly full. – egreg Sep 15 '15 at 22:25
  • Yes I know about accents (although it might not look like i've actually type up a bit of latex). I just didn't want anyone to have problem with them so I used something that works with any encoding. – J. Doe Sep 16 '15 at 05:22
  • @egreg -- of course using varwidth is better, but why won't a \parbox work? (and of course anything of the sort will look awful with wildly varying line lengths; \raggedright is usually the "least worst" alternative, and i see you've used it too.) – barbara beeton Sep 16 '15 at 13:18
  • @barbarabeeton The closing brace will be as far from the opening brace as the width of the parbox, notwithstanding whether lines end short of it. – egreg Sep 16 '15 at 13:26
  • @egreg -- thanks. well, i'm determined enough that if i were doing it, i'd just keep adjusting the width to look good with the longest line; that was kind of implied in my comment. – barbara beeton Sep 16 '15 at 13:29

2 Answers2

5

I'd suggest you not to do that. Instead, use some name (convention) for the image of the morphism and then explain the meaning (I chose Y(N)_{T}, but change to the a name that suits you better):

 \documentclass[10pt]{amsart}
 \begin{document}

\begin{align*}
Y(N)_{\mathbf{Z}[\frac{1}{N}]} \colon 
  \mathbf Z\Bigl[\frac{1}{N}\Bigr]\textrm{-Sch} &\longrightarrow \textrm{Ens} 
\\
T &\longmapsto  Y(N)_{T},
\end{align*}
where $Y(N)_{T}$ is the set of classes d'isomorphismes de paires $(E,\varphi)$ o\`u $E$ est une courbe elliptique sur $T$ et $\varphi \colon (\mathbf Z/N\mathbf Z)_T \to E[N]$ est un isomorphisme de sch\'emas en groupes sur $T$.

\end{document}

The result:

enter image description here

I did some other modifications:

  • To get the proper spacing for the colon when defining morphisms, you should use \colon instead of just :.

  • I changed to an align* environment using the arrows as alignment points.

  • I used \textrm for "Sch" and "Ens".

If you load inputenc with the appropriate encoding: utf8 option, for example:

\usepackage[utf8]{inputenc}

you can enter French accents and special letters directly from the kwyboard.

Gonzalo Medina
  • 505,128
  • 2
    Hi, thank you very much for your answer. I think i'm gonna go with Barbar's suggestion above just because i'm kind of stuborn and I had my mind set on doing it this way. But I admit your solution is probably what would be best in the end. Thanks again. – J. Doe Sep 15 '15 at 19:49
  • 1
    @J.Doe This is what I'd do, personally. – egreg Sep 15 '15 at 22:26
5

You could use varwidth in order to have automatic line breaking and no excess spacing of the closing brace. Of course this assumes you really want to have a long textual description in the display, which I can't recommend.

Play with the relative width: the first has a very big pack of words, but at least the other symbols don't disappear with respect to it.

\documentclass[10pt]{amsart}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}

\usepackage{array,varwidth}

\newcommand{\numberset}[1]{\mathbf{#1}}
\newcommand{\Z}{\numberset{Z}}

\begin{document}

\begin{align*}
Y(N)_{\Z[\frac{1}{N}]}\colon 
  \Z\Bigl[\frac{1}{N}\Bigr]\textup{-Sch} & \to \textup{Ens} \\
  T                                 & \mapsto
\left\{
  \begin{varwidth}{.4\displaywidth}
  \raggedright
  Classes d'isomorphismes de paires $(E,\varphi)$ o\`u $E$ est une courbe 
  elliptique sur $T$ et $\varphi\colon (\Z/N\Z)_T \to E[N]$ est un
  isomorphisme de sch\'emas en groupes sur $T$
  \end{varwidth}
\right \}
\end{align*}

\begin{align*}
Y(N)_{\Z[\frac{1}{N}]}\colon 
  \Z\Bigl[\frac{1}{N}\Bigr]\textup{-Sch} & \to \textup{Ens} \\
  T                                 & \mapsto
\left\{
  \begin{varwidth}{.5\displaywidth}
  \raggedright
  Classes d'isomorphismes de paires $(E,\varphi)$ o\`u $E$ est une courbe 
  elliptique sur $T$ et $\varphi\colon (\Z/N\Z)_T \to E[N]$ est un
  isomorphisme de sch\'emas en groupes sur $T$
  \end{varwidth}
\right \}
\end{align*}

\begin{align*}
Y(N)_{\Z[\frac{1}{N}]}\colon 
  \Z\Bigl[\frac{1}{N}\Bigr]\textup{-Sch} & \to \textup{Ens} \\
  T                                 & \mapsto
\left\{
  \begin{varwidth}{.6\displaywidth}
  \raggedright
  Classes d'isomorphismes de paires $(E,\varphi)$ o\`u $E$ est une courbe 
  elliptique sur $T$ et $\varphi\colon (\Z/N\Z)_T \to E[N]$ est un
  isomorphisme de sch\'emas en groupes sur $T$
  \end{varwidth}
\right \}
\end{align*}

\end{document}

enter image description here

Centering the variable under the domain of the map is out of the question: it would appear to hang from nowhere. Also avoid \longrightarrow and \longmapsto: they are too long and add nothing other than occupying valuable space.

egreg
  • 1,121,712