Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

not a duplicate of this question because I want to keep the equation numbering, so a tabular won't do (I think).

I am using flalign to typeset philosophical arguments. I also want to use hyperref to be able to hotlink back to the individual lines of the argument later in the document. This works fine until I have a sentence that needs to be wrapped to the next line.

MWE:

\documentclass[11pt]{amsart}
\usepackage{hyperref}
\begin{document}

\begin{flalign}
&& \text{This is premise 1.} && \text{(Premise)} \label{premise1} \\
&& \text{This is premise 2. What happens when the text goes over the line though? } && \text{(From \autoref{premise1})}\label{premise2}
\end{flalign}

Obviously \autoref{premise2} follows from \autoref{premise1}.

\end{document}
share|improve this question
    
why use flalign at all??? it seems very strange to use a math alignment and then force it to be text in every cell, why not use a text alignment (or a list, which looks more suitable)? –  David Carlisle Apr 6 at 20:32
    
Because I'll end up with 50 or 60 different lines and I want to be able to autoref them. –  shane Apr 6 at 20:36
    
yes I you want automatic numbering/references but why the math? I couldn't tell from the example where the "long" text is in your real case or whether both fields need to allow long text. –  David Carlisle Apr 6 at 20:40
    
I think a theorem-like structure would be better from a conceptual point point of view, and it allows for numbering and referencing. –  Bernard Apr 6 at 20:40
    
Oh, sometimes the lines will need modal logic symbols, sometimes they need to just be plain text where the symbolism is overkill. ideally both fields would have to allow long text. –  shane Apr 6 at 20:42

3 Answers 3

up vote 2 down vote accepted

I develop my suggestion of using a theorem-like structure, using ntheorem and cleveref:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{hyperref}

\usepackage[thref, hyperref]{ntheorem}
\usepackage{cleveref}
\theoremstyle{plain}
\theoremheaderfont{\bfseries}
\theorembodyfont{\upshape}
\theoremseparator{:}
\newtheorem{prem}{Premise}
\begin{document}

\begin{prem}\label{prem1}
  This is the text of premise 1. A very promising premise
\end{prem}

\begin{prem}\label{prem2}
  This is premise 2. What happens when the text goes over the line though? \\
  \footnotesize(from \cref{prem1}).
\end{prem}
Obviously \cref{prem2} follows from \cref{prem1}.

\end{document} 

enter image description here

share|improve this answer

You can use a \parbox:

enter image description here

Notes:

  • As others have stated, this is not a recommended approach. You may want to post a new question asking for suggestions on exactly the desired out along with the constraints that you have. I am sure there are many better ways to do this.

Code:

\documentclass[11pt]{amsart}
\usepackage{hyperref}
\begin{document}

\begin{flalign}
&& \text{This is premise 1.} && \text{(Premise)} \label{premise1} \\
&& \parbox[t]{0.6\linewidth}{This is premise 2. What happens when the text goes over the line though? } && \text{(From \autoref{premise1})}\label{premise2}
\end{flalign}

Obviously \autoref{premise2} follows from \autoref{premise1}.

\end{document}
share|improve this answer
    
I like this a lot, but now the first line of (2) isn't aligned with the equation tag. Is there a way to fix that? –  shane Apr 6 at 20:41
    
You can, but I wouldn't:-) using fleqn is pretty odd anyway, but putting a fixed size parbox in it is doubly weird as you don't need to align fixed size boxes (they are fixed width anyway) and you don't need them to be in math:-) (It is though the answer to the question asked, of how to wrap text in a flalign) –  David Carlisle Apr 6 at 20:42
    
@shane: See updated solution. –  Peter Grill Apr 6 at 20:46
    
@shane -- from your comment, it sounds like you have the equation numbers on the right. (amsart default is on the left, but you didn't specify [reqno].) where do you want them -- left or right? –  barbara beeton Apr 6 at 21:01
    
Adding to @barbarabeeton's remark, this is very depending on the fact that amsart uses leqno and will dramatically break if the journal where the paper is submitted prefers reqno. –  egreg Apr 6 at 21:09

I don't think you want math at all.

enter image description here

\documentclass[11pt]{amsart}
\usepackage{longtable,array,hyperref}


\makeatletter
\newcounter{premise}
\newcommand\premiseautorefname{premise}

\makeatother


\begin{document}

\noindent X\dotfill X

\begin{longtable}{@{\stepcounter{premise}(\thepremise) }
                 >{\raggedright\arraybackslash}p{9cm}
                 >{\addtocounter{premise}{-1}\refstepcounter{premise}\raggedleft\arraybackslash}p{2.5cm}}
This is premise 1. &(Premise) \label{premise1} \\
This is premise 2. What happens when the text goes over the line though? &
From \autoref{premise1}\label{premise2}
\end{longtable}

Obviously \autoref{premise2} follows from \autoref{premise1}.

\end{document}
share|improve this answer
    
This is a text alignment but as I noted in the initial comment a list structure (as used by theorems) is more suitable really, so the I'm glad to see you accepted Bernards answer (even though it dropped the three column layout that flalign was using) –  David Carlisle Apr 6 at 21:24
    
Ah, this is very nice. This looks more like what I pictured in my head, but I accepted Bernard's answer because probably the right answer here is to use amsthm to define a new environment. Thanks for your help though! –  shane Apr 7 at 11:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.