Live data from Hacker News

Designing a Business Card in LaTeX

olivierpieters.be

201–210 of 223 posts

Re: Designing a Business Card in LaTeX

#202
post #4

Serious question: Is LaTeX used outside academia these days?

I'm finishing up a 350+ page family history book that I wrote in LaTeX; I've got two or three more to go, and I wouldn't consider using anything else. It's got its quirks, but it was so easy to work with page formatting, footnotes/endnotes, and sections that it made up for all the fiddly issues I ran into with images. I have also been using the genealogytree[0] package (which relies on TikZ, coincidentally used by OP…

I've also published multiple books for myself and my friends and family using LaTeX, use LaTeX whenever I want to print out and post or distribute an article that looks crappy in the original, and I've long written my resumes in LaTeX.

Re: Designing a Business Card in LaTeX

#203
post #71

Earlier quoted context omitted.

I'm finishing up a 350+ page family history book that I wrote in LaTeX; I've got two or three more to go, and I wouldn't consider using anything else. It's got its quirks, but it was so easy to work with page formatting, footnotes/endnotes, and sections that it made up for all the fiddly issues I ran into with images. I have also been using the genealogytree[0] package (which relies on TikZ, coincidentally used by OP…

For longer documents in TeX, I wrote a collection of TeX macros for to make cross referencing easy. The collection was a little tricky to write but is fairly easy to use and works great. The package is based on some logical names that serve as, say, pointers ; then in one place define such a name and in other places refer to it and get the page number, etc. inserted where the reference is made. Given some simple exam…

Your cross-referencing macros sound interesting. Are they publicly available anywhere?

Re: Designing a Business Card in LaTeX

#204
post #189

Earlier quoted context omitted.

My comment was in response to the assertion that CM is somehow "overused". Compared to the fonts I listed, Computer Modern is pretty obscure. Maybe I just wasn't clear enough on that part, in which case I sincerely apologize for my poor communication skills.

Ok, I got this, but honestly i thought you meant the opposite

No worries; you apparently weren't the only one ;)

I thought I was pretty clear, but I guess not. Makes me really wish HN had a more forgiving window for editing comments, but oh well.

Re: Designing a Business Card in LaTeX

#205
post #194

Mine is a PCB (Printed Circuit Board). I designed it with KiCAD. Open source CC-BY-NC-SA. https://github.com/bdc0/businesscard

I took graphic design in school (so I've seen plenty of business card concepts) and I just wanted to say that's the most creative card I've seen in years! I'd cherish something like that if you gave it to me - no matter how much they cost the impact is definitely worth it. Wow!

You aren't the only one who likes it; it definitely gets noticed. They cost ~$1 (US) in quantity.

The most common question I get is "If I install the chips, what do I get?" Unfortunately, the answer is nothing. There are people who have done that.

Re: Designing a Business Card in LaTeX

#206
post #169

Earlier quoted context omitted.

I suspect his problem is more with Windows and its brain-dead font rendering. Vertical strokes are the ideal case for subpixel anti-aliasing on a typical LCD: you get 3x the horizontal resolution. On a typical 100dpi screen this gives you 300dpi horizontal resolution, which is around the low-end for print quality. On modern 200dpi "retina" displays, you get 600dpi horizontal resolution which is more than enough to ma…

I'm using a Retina MacBook. The readability problem with Computer Modern is intrinsic to its design, and even a 200 dpi screen just isn't enough to make it look good (IMHO). But it's definitely much worse still on Windows. My question is: why use this particular 1980s font developed to showcase a dead-end stroke rendering technology, when there are much better alternatives around?

Why use it? It's the default, and otherwise you have to find a math font and text font that go together all on your own. At least that's why I use it: laziness.

I agree at 200dpi is not quite enough for Computer Modern. But I claim that, say, 7200dpi is far more than enough, and then it looks great.

Re: Designing a Business Card in LaTeX

#207

Earlier quoted context omitted.

>little boxes of geometric gibberish used as identifiers in which context?

I struggled to understand that as well. Couldn't tell if it was about USPS barcodes (1) or QR codes (or other 2D barcodes) or something else? [1] - https://www.neodynamic.com/Products/Help/BarcodeCF2.0/barcod...

I meant QR codes! I don't really know what they are!

Re: Designing a Business Card in LaTeX

#208
post #71

Earlier quoted context omitted.

For longer documents in TeX, I wrote a collection of TeX macros for to make cross referencing easy. The collection was a little tricky to write but is fairly easy to use and works great. The package is based on some logical names that serve as, say, pointers ; then in one place define such a name and in other places refer to it and get the page number, etc. inserted where the reference is made. Given some simple exam…

Your cross-referencing macros sound interesting. Are they publicly available anywhere?

Available? See the next three posts.

Offered as-is, no warranties. Use at own risk.

They work nicely for me. I haven't looked at the code in years, so there may be some dependencies, likely minor, maybe just in documentation, on some of my other macros.

There may be some subtle bugs, but I haven't found any. If you find a bug and know just what usage encounters the bug, then don't do that usage again! Or fix the bug!

There is enough documentation so that you can see the ideas -- actually they are all quite simple. The macros were a good TeX exercise.

Re: Designing a Business Card in LaTeX

#209

Earlier quoted context omitted.

Your cross-referencing macros sound interesting. Are they publicly available anywhere?

Available? See the next three posts. Offered as-is, no warranties. Use at own risk. They work nicely for me. I haven't looked at the code in years, so there may be some dependencies, likely minor, maybe just in documentation, on some of my other macros. There may be some subtle bugs, but I haven't found any. If you find a bug and know just what usage encounters the bug, then don't do that usage again! Or fix the bug!…

Part I:

      % XREF001.TEX --
      %
      % Created at 02:29:35 on Thursday, April 13th, 2006.
      % ======================================================================
      %
      % Modified at 01:03:52 on Thursday, April 13th, 2006.
      %
      %    Macros for sequential numbering and cross-references
      %
      %    Macros \SNUAdvanceChapter, \SNU#1, \SNT#1, \SNF#1,
      %         \GetSN, \SNC#1, \SNCGetChapter#1, \SNCGetPage#1,
      %         \SNUGetChapter#1, \SNUGetUnit#1, \SNUGetPage#1,
      %         \SNTGetTable#1, \SNTGetPage#1, \SNFGetFigure#1,
      %         \SNFGetPage#1, \SNChapterPrefix
      %
      %    Counters \SNChapter, \SNUnit, \SNTable, \SNFigure,
      %
      %    Here SN abbreviates 'sequential numbering'.
      %
      %    Here we have a start on a fairly general collection of
      %    macros for sequential numbering and cross-referencing.
      %
      %    For example, maybe in some chapter, that at present is
      %    chapter 3, we want to sequentially number definitions,
      %    theorems, remarks, and examples -- call them all 'units'
      %    -- as in:
      %
      %         3.1 Definition:
      %
      %         3.2 Theorem:
      %
      %         3.3 Definition:
      %
      %         3.4 Remark:
      %
      %         3.5 Example:
      %
      %    Then with this package we would select some tags, say,
      %    starting with SNTag, and type
      %
      %         \SNU{\SNTagA} Definition:
      %
      %         \SNU{\SNTagB} Theorem:
      %
      %         \SNU{\SNTagC} Definition:
      %
      %         \SNU{\SNTagD} Remark:
      %
      %         \SNU{\SNTagE} Example:
      %
      %    So, macro \SNU abbreviates 'sequential numbering with
      %    units'.  So, with macro \SNU we get a case of automatic
      %    sequential numbering.
      %
      %    Suppose 3.1 Definition: appeared on page 43.  Then
      %    elsewhere we could write
      %
      %         See \SNUGetChapter\SNTagA.\SNUGetUnit\SNTagA Theorem
      %         on page \SNUGetPage\SNTagA.
      %
      %    and get
      %
      %         See 3.1 Theorem on page 43.
      %
      %    So, we get automatic cross-referencing.
      %
      %    Of course, to do cross-referencing in such a general way,
      %    need to run TeX at least twice, once to find, for each
      %    sequentially numbered 'unit', its page and write this
      %    data to a file, and once to read this file and insert the
      %    sequential numbering and page numbers where desired in
      %    cross-references.
      %
      %    The file is \jobname.XRF.
      %
      %    To use this sequential numbering with units,
      %
      %         o    At each chapter, after the \eject, if there is
      %              one, and just before the \hOne, have
      %
      %                   \SNUAdvanceChapter
      %
      %              to increment by one the counter \SNChapter and
      %              set the counter \SNUnit to 0.
      %
      %         o    Otherwise use macros
      %
      %                   \SNU\SNTagA
      %                   \SNUGetChapter\SNTagA
      %                   \SNUGetUnit\SNTagA
      %                   \SNUGetPage\SNTagA
      %
      %              as illustrated.
      %
      %         o    Then run TeX at least twice, basically until
      %              the file \jobname.XRF quits changing.
      %
      %    So, we get sequential numbering and cross-referencing with
      %    'units'.  The macros and counters particular to 'units'
      %    all begin with \SNU.
      %
      %    We let
      %
      %         \newcount\SNUnit
      %
      %    keep track of the number of the unit.  So, when we use
      %
      %         \def\SNUAdvanceChapter{\advance\SNChapter by1
      %         \SNUnit=0}
      %
      %    to increment
      %
      %         \newcount\SNChapter
      %
      %    we also set \SNUnit=0 for the new chapter.
      %
      %    With the \SNU macros as illustrated, will get file
      %    \jobnane.XRF like
      %
      %         \SNTagA
      %         1 1
      %         1
      %         \SNTagB
      %         1 2
      %         1
      %         \SNTagC
      %         1 3
      %         1
      %         \SNTagD
      %         1 4
      %         1
      %         \SNTagE
      %         1 5
      %         1
      %         \SNTagF
      %         1 6
      %         1
      %         \SNTagG
      %         1 7
      %         1
      %         \SNTagH
      %         1 8
      %         1
      %         \SNTagI
      %         1 9
      %         1
      %
      %    So, get three lines for each invocation of \SNU.  The
      %    first line has the tag.  The second line has data
      %    particular to 'units' macros.  And the third line has the
      %    page number.
      %
      %    For in Appendix I, may want units to go
      %
      %         A.I.1.2
      %
      %    that is, to have a 'prefix' of 'A.I.'.  To this end there
      %    is macro
      %
      %         SNChapterPrefix
      %
      %    which is default empty.  Setting this macro to
      %
      %         \def\SNChapterPrefix{A.I.}
      %
      %    will give the prefix 'A.I.'.  But, such a prefix should
      %    have no blanks else the parsing of the macros that get
      %    cross-referencing information will get confused!
      %
      %    But we may also want sequential numbering and
      %    cross-referencing for tables, figures, equations, etc.
      %
      %    Then the idea is to have more sequential numbering
      %    macros.  But, do not want a proliferation of files.  So,
      %    these other macros should also use the file \jobname.XRF.
      %    For compatibility, each of these other macros should also
      %    write three lines to file \jobname.XRF.  The main freedom
      %    is just in the second line.
      %
      %    Each tag, e.g., \SNTagA, becomes a macro.  So, each tag
      %    should be spelled like a TeX macro and have spelling
      %    different from all other TeX macros in use.
      %
      %    During the first pass of TeX, macros
      %
      %         \SNUGetChapter\SNTagA
      %
      %         \SNUGetUnit\SNTagA
      %
      %         \SNUGetPage\SNTagA
      %
      %    will notice that \SNTagA is not defined and will define
      %    it as the macro \SNUNone from
      %
      %         \def\SNUNone{CH UN PG}
      %
      %    the three tokens of which are intended to abbreviate,
      %    respectively, chapter, unit, and page.
      %
      %    Then each of the three macros
      %
      %         \SNUGetChapter\SNTagA
      %
      %         \SNUGetUnit\SNTagA
      %
      %         \SNUGetPage\SNTagA
      %
      %    will return 'CH', 'UN', and 'PG', respectively, as
      %    temporary place holders and a way to get page breaking
      %    approximately correct before another pass of TeX that
      %    will read and use the XRF file written on the previous
      %    pass.
      %
      %    We also have macros for tables and figures.  For tables,
      %    the names begin with SNT; figures, SNF.
      %
      %    The main challenge was in macro SNU (SNT, SNF) that has
      %    to write both the sequential numbering and the page
      %    number.  The cause of the challenge was how, really,
      %    when, TeX actually does page breaking.  So, once TeX
      %    starts a new page, it keeps adding lines until it clearly
      %    has enough, and maybe too many, lines for that page.
      %    Then TeX decides where to break the page, uses any left
      %    over lines for the next page, and continues.  So, when a
      %    macro in the text executes, TeX does not yet know the
      %    page number but the macro does know the chapter number
      %    and, say, the unit number.
      %
      %    When TeX sees a \write, TeX temporarily puts the \write
      %    in a 'whatsit' until the page breaking and then executes
      %    the \write.  'Whatsits' are discussed starting a line
      %    14,007 of the file of TEXBOOK.TEX.
      %
      %    The trick, then, is to have
      %
      %         \def\JUNKA{\the\SNChapter\space\the\SNUnit}
      %         {\edef\JUNKB{\write\XREFileOut{\JUNKA}}\JUNKB}
      %         \write\XREFileOut{\the\count0}
      %
      %    In the first line we define \JUNKA that has the data to
      %    be written.  The second line has a group with an \edef
      %    (define a macro expanded immediately) of a temporary
      %    macro \JUNKB with the \write and with the data to be
      %    written and, then, with an invocation of \JUNKB.  Due to
      %    the \edef, the whatsit for the \write has only constants
      %    and the right constants.  Those constants are from
      %    counters
      %
      %         \SNChapter
      %         \SNUnit
      %
      %    which might well change by the time the \write is
      %    executed; but, the constants will still have the values
      %    we need to have written.
      %
      %    On the third line, we use \write to write the page
      %    number, and the page number in \count0 is expanded at the
      %    time of the page breaking and, thus, has the correct page
      %    number.
      %
      %    Another challenge is how to handle the data read from
      %    file \jobname.XRF:  As each line is read, it has a
      %    trailing blank.  So, have to use and/or parse the blank.
      %

Re: Designing a Business Card in LaTeX

#210

Earlier quoted context omitted.

Your cross-referencing macros sound interesting. Are they publicly available anywhere?

Available? See the next three posts. Offered as-is, no warranties. Use at own risk. They work nicely for me. I haven't looked at the code in years, so there may be some dependencies, likely minor, maybe just in documentation, on some of my other macros. There may be some subtle bugs, but I haven't found any. If you find a bug and know just what usage encounters the bug, then don't do that usage again! Or fix the bug!…

Part II

     \newread\XREFileIn
      % \message{\string\XREFileIn = \the\XREFileIn}
      \newwrite\XREFileOut
      %
      \newcount\SNChapter
      \newcount\SNUnit
      \newcount\SNTable
      \newcount\SNFigure
      %
      \SNChapter=0
      \SNTable=0
      \SNFigure=0
      %
      \def\SNChapterPrefix{}
      %
      \def\TrimTag#1 {#1}          % For trimming trailing blanks.
      \def\First#1 #2 #3 {#1}      % Parsing first token.
      \def\Second#1 #2 #3 {#2}     %   "     second "
      \def\Third#1 #2 #3 {#3}      %   "     third  "
      \def\SNUNone{CH UN PG}       % Value for tags before there is an XRF file.
      \def\SNTNone{TB JUNK PG}     % Value for tags before there is an XRF file.
      \def\SNFNone{FG JUNK PG}     % Value for tags before there is an XRF file.
      \def\SNPNone{PT JUNK PG}     % Value for tags before there is an XRF file.
      %
      \def\SNUAdvanceChapter{\advance\SNChapter by1
      \SNUnit=0}
      %
      % Define a 'chapter' tag:
      %
      % Need a \global on \advance because might have the \SNC from
      % within a group, e.g., {\bf \SNC ...}.
      %
      \def\SNC#1{{\global\SNUnit=0
      \write\XREFileOut{\string#1}%
      \def\JUNKA{\SNChapterPrefix\the\SNChapter\space JUNK}%
      {\edef\JUNKB{\write\XREFileOut{\JUNKA}}\JUNKB}%
      \write\XREFileOut{\the\count0}}}%
      %
      % Define a 'unit' tag:
      %
      % To be more sure page number is correct, add text to list
      % BEFORE writing page number to XRF file.  In principle could
      % do the same for \SNT and \SNF but from how these are used in
      % practice a page number error would be nearly impossible.
      %
      \def\SNU#1{{\global\advance\SNUnit by1
      \write\XREFileOut{\string#1}%
      \SNChapterPrefix\the\SNChapter.\the\SNUnit
      \def\JUNKA{\SNChapterPrefix\the\SNChapter\space\the\SNUnit}%
      {\edef\JUNKB{\write\XREFileOut{\JUNKA}}\JUNKB}%
      \write\XREFileOut{\the\count0}}}%
      %
      % BEGIN Modified at 04:16:31 on Tuesday, December 29th, 2015.
      %
      %    In this collection, we now have a new
      %    macro
      %
      %         \SNP -- Sequentially Number Pointer
      %
      %    This macro intended for cross
      %    referencing to a place in text, that
      %    is not specifically to a 'unit'
      %    (definition, theorem), table, or
      %    figure.
      %
      %    In short, can have
      %
      %         Note\SNP{\SNTagCU}
      %         that, for $a, b \in R$ and
      %
      %    which will define tag \SNTagCU but
      %    insert nothing into the document.
      %
      %    Then elsewhere can have
      %
      %         Since as on page
      %         \SNCGetPage{\SNTagCU}
      %         an inner product is bilinear,
      %
      %    which will insert into the document
      %    the page number of the page where the
      %    macro \SNTagCU was defined.  Many
      %    more details below:
      %
      %    The macro \SNP is part of this
      %    package of cross referencing and
      %    sequential numbering but does not
      %    actually 'number' or 'sequentially
      %    number' anything.  We start the name
      %    of \SNP with 'SN' just to regard
      %    macro names of the form SNx as
      %    'reserved' in own TeX usage.
      %
      %    Then elsewhere in the document, can
      %    refer to that place by its page
      %    number, chapter number (apparently
      %    with its chapter prefix), etc.
      %
      %    E.g., if give a little discussion of,
      %    say, bilinear, can type, say,
      %
      %         Note\SNP{\SNTagCU}
      %         that, for $a, b \in R$ and
      %
      %    and that will just 'define' tag
      %    SNTagCU.  Of course the tag SNTagCU
      %    was likely from running own KEdit
      %    macro isntag to find the new tag name
      %    SNTagCU and insert it in the argument
      %    of the macro \SPP. That is, in KEdit
      %    we would have line
      %
      %         Note\SNP{}
      %
      %    current, run KEdit macro isntag, and
      %    get a new tag found an inserted to
      %    have something like
      %
      %         Note\SNP{\SNTagCU}
      %
      %    Then elsewhere in the document can
      %    write, say,
      %
      %         Since as on page
      %         \SNCGetPage{\SNTagCU}
      %         an inner product is bilinear,
      %
      %    and get the page number of the page
      %    in the document with
      %
      %         Note\SNP{\SNTagCU}
      %
      %    that is, where tag \SNTagCU was
      %    defined.
      %
      %    So, the lines
      %
      %         Note\SNP{\SNTagCU}
      %         that, for $a, b \in R$ and
      %
      %    write to the XRF file the standard
      %    three lines that would be written by,
      %    say, macro \SNU. With those three
      %    lines, the first has the tag
      %
      %         \SNTagCU
      %
      %    the next line has chapter and unit
      %    and the third line has the page
      %    number, all for what was the case for
      %    that part of that page when the macro
      %    \SNP was run.
      %
      %    Then, macros
      %
      %         \SNUGetChapter\SNTagCU
      %         \SNUGetUnit\SNTagCU
      %         \SNUGetPage\SNTagCU
      %
      %    will all work fine to extract the
      %    data on, respectively, chapter, unit,
      %    and page and insert it into the
      %    document.  That is, there is no
      %    reason to have separate macros to
      %    extract and for macro \SNP.
      %
      %    Really the macro \SNP is just like
      %    macro \SNU except does not add 1 to
      %    SNUnit and does not insert into the
      %    document the chapter prefix, chapter
      %    number, and unit number.  So, where
      %    macro \SNP is used, nothing is
      %    inserted into the document; this is
      %    in contrast with, say, macro \SNU and
      %    is why need the new macro \SNT
      %
Post reply on HN