Math & Science ⇒ How to have textual sentences numbered as formulas?
How to have textual sentences numbered as formulas?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
How to have textual sentences numbered as formulas?
Code: Select all
\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext} % for auto-generating text
\usepackage{amsmath} % for \text command
\begin{document}
\blindtext
\begin{equation}
\text{\parbox{.85\textwidth}{\blindtext}}
\end{equation}
\blindtext
\end{document}
I can think of other solutions involving \refstepcounter and minipages, which might be more suitable, especially if you wanted a distinct counter from the equation counter.
Re: How to have textual sentences numbered as formulas?
Suppose someone has arrived in the first three chapters of his book at a result that he summarizes as follows:
All AIDS patients have HIV infection. Antony
Perkins has AIDS. But he is not HIV infected. These
two sentences are inconsistent. \label{aids}
He now wants to have the above set of three lines justified (indented left and right) and numbered in order to be able to refer to them in later contexts by citing that number. In addition, formulas and such textual blocks should share one and the same consecutive number sequence.
Re: How to have textual sentences numbered as formulas?
I have tested it in the meantime. However, without \blindtext because for any reason my LaTeX does not cooperate with. But even without \blindtext the program functions, say 50%. Text set by myself is well justified (left and right) AND numbered. Alas, the number goes in the next paragrpah, whereas the numbering itself is integrated into that of formulas to the effect that its consecutivity is retained.
How to have textual sentences numbered as formulas?
Do you get the problem even with this:
Code: Select all
\documentclass{article}
\usepackage{amsmath} % for \text command
\begin{document}
Here is your example. I've corrected it to be standard English. I'm putting this paragraph here mainly so you can see how it looks relative to the rest of the page.
\begin{equation}
\text{\parbox{.85\textwidth}{All AIDS patients are infected with HIV. Antony
Perkins has AIDS. But he is not infected with HIV. These
two sentences are inconsistent.}}
\end{equation}
Here is another paragraph that I put in just to show that the number is not going in the wrong place. Do you like my paragraph?
\end{document}
(Can I also point out that even with my grammatical fixes, those sentences are not logically inconsistent, since you have AIDS without being an AIDS patient? Or is that being too pedantic?)
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: How to have textual sentences numbered as formulas?
How to have textual sentences numbered as formulas?
"(Can I also point out that even with my grammatical fixes, those sentences are not logically inconsistent, since you have AIDS without being an AIDS patient? Or is that being too pedantic?)"
What I meant was people who have AIDS. Disregard the word "patient". So my example turns:
For all x: If x has AIDS, then x is infected with HIV;
Anthony Perkins has AIDS. But he is not infected with HIV. These
two sentences are inconsistent.
Proof: The premise "For all x: If x is P then x is Q; a is P; a is not Q" implies contradictions and thus it implies everything.
By the way: I have unsuccessfully tried to construct a handy \newenvironment on the basis of the program we have agreed upon recently. The textual output I obtain and the number allocated to it by the \begin{equation}-based newenvironment are misplaced.
How to have textual sentences numbered as formulas?
My code isn't really well-suited for defining a new environment, since the text goes inside brackets, and you can't match the brackets in the environment definition. http://www.latex-community.org/forum/vi ... f=5&t=7757
The easiest thing to do would be to define a command rather than an environment. But there may be a way to do an environment with minipage, but I'm too busy right now to test.
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\newcommand{\texteq}[1]{\begin{equation}\text{\parbox{0.85\textwidth}{#1}}\end{equation}}
\begin{document}
Here is an example of a statement, and a bad proof of that statement. The reason the proof is bad is that ``inconsistent'' and ``implies contradictions'' mean the same thing, and hence, it is circular to presuppose the latter in trying to establish the former.
\texteq{For all $x$: If $x$ has AIDS, then $x$ is infected with HIV;
Anthony Perkins has AIDS. But he is not infected with HIV. These
two sentences are inconsistent.}
\begin{proof}
The premise ``For all $x$: If $x$ is $P$ then $x$ is $Q$; $a$ is $P$; $a$ is not $Q$'' implies contradictions and thus it implies everything.
\end{proof}
\end{document}
Re: How to have textual sentences numbered as formulas?
Your definition is elegant and functions well. Only referencing poduces the following error: Not the number of the textual item but the section number where it stands is displayed.
BTW: Inconsistency IS in fact defined as implying a contradiction because from a contradiction you can derive every sentence, be it true, false, non-sensical, etc. Use simply the rule "Ex contradictione quodlibet". That is: "A and not-A /- B" where "/-" stands for "implies" and B is any sentence you like.