Text FormattingBegriffsschrift

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
junket
Posts: 10
Joined: Sat Jan 22, 2011 10:34 pm

Begriffsschrift

Post by junket »

Hello, I hope this is an appropriate place to post.

I'm using the begriff package for Frege.
I have one tiny snag with it, that I was hoping someone might have a solution to.
Now, it is a small problem, so it's not the end of the world if I can't solve it, but if someone happens to have an answer to hand, I would be very grateful.
I am trying to recreate this statement from Function and Concept.

\setlength{\BGafterlen}{10 mm}
\hspace{30 mm}$$\BGassert 2 + 3 = 5$$

The slight problem with this is that the assert line is below the following numbers. That is, it is looks like this: _2 rather than like this -2, which I would prefer.
I mean, I would like the assert line to point to the middle of the characters.

Does anyone know a solution to this using begriff or a simple tweak of the package that might help?

Thanks so much,

Junket
Last edited by junket on Thu Feb 03, 2011 12:48 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

junket
Posts: 10
Joined: Sat Jan 22, 2011 10:34 pm

Re: Begriffsschrift

Post by junket »

Also, a second question, is it possible to use the begriff notation without automatically going onto a new line - namely, can we have <text><begriff><text> rather than
<text>
<begriff>
<text>
?
Thanks for the help!
junket
Posts: 10
Joined: Sat Jan 22, 2011 10:34 pm

Re: Begriffsschrift

Post by junket »

Hi,
I've figured out the answer to my second question - it was pretty obvious actually! Still stuck on question number one though.
Thanks!
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Begriffsschrift

Post by frabjous »

I'll start with your second question... (EDIT: oops, didn't see you had figured it out... still, read on...)
Also, a second question, is it possible to use the begriff notation without automatically going onto a new line - namely, can we have <text><begriff><text> rather than
The Begriffsschrift figures just need to be in math mode, so you just need to use inline math mode rather than displayed math mode if you want it on the same line as the text. So put the commands for the figure inside \(...\) rather than inside \[...\]. The plain TeX equivalent of \( ... \) is the single dollar signs, $...$, and you can use that too. The plain TeX equivalent of \[ ... \] is what you were using $$ ... $$, but it's best not to use that any more, for reasons explained in l2tabu.

junket wrote: The slight problem with this is that the assert line is below the following numbers. That is, it is looks like this: _2 rather than like this -2, which I would prefer.
I mean, I would like the assert line to point to the middle of the characters.
I know exactly what you mean, and this is the really the only thing I don't like about the begriff package. Suggestion below...
Does anyone know a solution to this using begriff or a simple tweak of the package that might help?
My solution has been to use a \raisebox from the graphicx package at the end of each line. This takes its contents out of math mode, so you can put them back in with \ensuremath{...}. In your case, for example, you might use (change 0.3em to whatever looks good to you).

Code: Select all

\( \BGassert\raisebox{-0.3em}{\ensuremath{2+3=5}} \)
There are two problems with this, however. One is that the horizontal line (what Frege calls the "content stroke" is too short; the other is that it's annoying to have to manually insert the raisebox all the time. The solution to both these problems is to make use of the \BGterm command that the package already defines, which is used for the last part of a begriffsschrift branch. However, I like to redefine that command so that it includes the raisebox at the end. So I put this in my preamble:

Code: Select all

\renewcommand{\BGterm}[1]{\unskip%
\setbox0=\hbox{%
\setlength{\BGlinewidth}{0pt}%
\vrule height \baselineskip depth 0pt width 0pt% strut
\vrule height \BGthickness width \BGafterlen depth 0pt%
\ensuremath{\hskip\BGspace \raisebox{-0.3em}{\ensuremath{#1}}}%
}
\vrule height \BGthickness width \BGlinewidth depth 0pt%
\box0%
\setlength{\BGlinewidth}{0pt}%
}%
To make use of the BGterm command you also have to set the length \BGlinewidth to represent the width of the entire construction. So, for your example, I might do (--the raisebox is now built in above so doesn't need to be specifically added--):

Code: Select all

\(\setlength{\BGlinewidth}{0.8em}\BGassert\BGterm{2+3=5}\)
Change 0.8em to whatever looks good to you -- the larger to make this, the longer the horizontal will be.

Finally, you might consider defining a command that will set this length along with putting you in math-mode. You might also throw in another raisebox correction for putting the text part back inline with the surrounding text. So this would look like:

Code: Select all

\newcommand{\inlinebegriff}[2]{%
    \raisebox{0.3em}{\(\setlength{\BGlinewidth}{#1}#2\)}%
}
And then your example would be simply:

Code: Select all

\inlinebegriff{0.8em}{\BGassert\BGterm{2+3=5}}

Here's a complete document that throws some of these ideas together:

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage{begriff}

\renewcommand{\BGterm}[1]{\unskip%
\setbox0=\hbox{%
\setlength{\BGlinewidth}{0pt}%
\vrule height \baselineskip depth 0pt width 0pt% strut
\vrule height \BGthickness width \BGafterlen depth 0pt%
\ensuremath{\hskip\BGspace \raisebox{-0.3em}{\ensuremath{#1}}}%
}
\vrule height \BGthickness width \BGlinewidth depth 0pt%
\box0%
\setlength{\BGlinewidth}{0pt}%
}%

\newcommand{\inlinebegriff}[2]{%
    \raisebox{0.3em}{\(\setlength{\BGlinewidth}{#1}#2\)}%
}
\newcommand{\displaybegriff}[2]{%
    \[ \raisebox{0.3em}{\ensuremath{\setlength{\BGlinewidth}{#1}#2}} \]%
}

\begin{document}
From \inlinebegriff{0.8em}{\BGassert\BGterm{2+3=5}} and \inlinebegriff{1.0em}{\BGassert\BGifb{2+3=5}{3+4=7}} one may infer \inlinebegriff{0.8em}{\BGassert\BGterm{3+4=7}}.  

\displaybegriff{1.5em}{\BGassert\BGif{\BGifb{A}{B}}{\BGif{\BGnot\BGterm{B}}{\BGnot\BGterm{A}}}}

\end{document}

Here's its output:
bgs.png
bgs.png (2.19 KiB) Viewed 3947 times
What are you working on, out of curiousity? There aren't a lot of people who write on Frege. I might be interested professionally in what you're writing.
junket
Posts: 10
Joined: Sat Jan 22, 2011 10:34 pm

Re: Begriffsschrift

Post by junket »

Hello Frabjous,

Thank you for your brilliantly detailed post. I have been out of action for a few days and am deeply sorry I have not been here to thank you sooner. I should have made sure to check sooner. :oops:

Your solution looks excellent, and I really look forward to attempting to employ it!

In terms of what I am working on, I am just a Computer Science student with a little background in philosophy. I have been asked to help to gather some primary-source based material for a course on Discrete Structures and provide a few comments etc, so I am including some Frege, Russell, Cantor, Hilbert and so on. I think it's a nice idea to expose students to this material (or is it vice versa?). The work has been great fun, and has inspired in me something of an interest in the philosophy of mathematics, which I never really explored before.

I also want to leave behind a template that others can change or build upon later, or use for their own work, so your help with the Begriffsschrift is invaluable in this regard.

I am afraid that my knowledge of Frege is rather limited, and I have little or no German.

I think Frege's relationship to Computer Science is quite interesting. I gather he fell afoul of paradox due to his Basic Law V, re: Werthverlauf. However in Computer Science it is best practice to consider a function as a relation.

I am not sure whether that would greatly console him.

Thank you again for all your help! :)

Best,

Junket
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Begriffsschrift

Post by localghost »

If the problem is solved, please mark the topic accordingly as written in Section 3 of the Board Rules. Otherwise please tell us what is missing.


Thorsten
Post Reply