Check out my first novel, midnight's simulacra!

Eveline and LaTeX: Difference between pages

From dankwiki
(Difference between pages)
Jump to navigation Jump to search
Created page with "<b>from James Joyce’s <i>Dubliners</i> (1914)</b> She sat at the window watching the evening invade the avenue. Her head was leaned against the window curtains and in her nostrils was the odour of dusty cretonne. She was tired. Few people passed. The man out of the last house passed on his way home; she heard his footsteps clacking along the concrete pavement and afterwards crunching on the cinder path before the new red houses. One time there used to be a field ther..."
 
 
Line 1: Line 1:
<b>from James Joyce’s <i>Dubliners</i> (1914)</b>
These days, I always use [https://tug.org/xetex/ XeTeX] (as opposed to e.g. pdflatex), usually in conjunction with the [https://ctan.org/pkg/memoir?lang=en Memoir class] and [https://www.ctan.org/pkg/polyglossia polyglossia package] (as opposed to e.g. babel), though I might use LuaTeX instead. Code can generally run through both and result in similar output. XeTeX is significantly slower than pdflatex, and cannot use the full capabilities of the microtype package (as of 2023-09, anyway). Nonetheless, it's a far better way to deal with [[Unicode]] and modern fonts. LuaTeX seems another valid option, and might perhaps be more actively developed. It's currently about as slow as XeTeX.


She sat at the window watching the evening invade the avenue. Her head was leaned
Note that Amazon's createspace package cannot be used with XeTeX, at least as of 2023-08.
against the window curtains and in her nostrils was the odour of dusty cretonne. She
was tired.


Few people passed. The man out of the last house passed on his way home; she heard
I have a [[Latex_joy_of_man%27s_desiring|blog post from 2023-09-24]] about LaTeX in 2023.
his footsteps clacking along the concrete pavement and afterwards crunching on the
cinder path before the new red houses. One time there used to be a field there in which
they used to play every evening with other people’s children. Then a man from Belfast
bought the field and built houses in it—not like their little brown houses but bright brick
houses with shining roofs. The children of the avenue used to play together in that
field—the Devines, the Waters, the Dunns, little Keogh the cripple, she and her brothers
and sisters. Ernest, however, never played: he was too grown up. Her father used often
to hunt them in out of the field with his blackthorn stick; but usually little Keogh used
to keep nix and call out when he saw her father coming. Still they seemed to have been
rather happy then. Her father was not so bad then; and besides, her mother was alive.
That was a long time ago; she and her brothers and sisters were all grown up; her mother
was dead. Tizzie Dunn was dead, too, and the Waters had gone back to England.
Everything changes. Now she was going to go away like the others, to leave her home.


Home! She looked round the room, reviewing all its familiar objects which she had
==General==
dusted once a week for so many years, wondering where on earth all the dust came
* Use the [https://ctan.org/pkg/microtype microtype] package for most documents. It improves typography via several means.
from. Perhaps she would never see again those familiar objects from which she had
** It is only partially supported outside of pdflatex; LuaTex supports it better than XeTeX as of 2023-10 (see the table in the documentation, page 6).
never dreamed of being divided. And yet during all those years she had never found out
* Use the [https://ctan.org/pkg/realscripts realscripts] package for most documents. It improves sub- and superscripts when using OpenType fonts with appropriate features (normally the glyphs are simply drawn at a smaller size). It doesn't work well in certain environments or in certain cases, in which case use a '*' suffix to revert to the previous definitions. It's best to use this from the beginning of a document so that you check each placement.
the name of the priest whose yellowing photograph hung on the wall above the broken
** As of late 2023, it does not work well with [https://ctan.org/pkg/siunitx?lang=en siunitx] in my experience. You'll want to define <tt>text-subscript-command</tt> and <tt>text-superscript-command</tt> to be commands which use <tt>\textsuperscript*</tt> etc., though this does seem to work.
harmonium beside the coloured print of the promises made to Blessed Margaret Mary
* 72.27 points equals 1 inch equals 25.4 millimeter
Alacoque. He had been a school friend of her father. Whenever he showed the
* Invoke with <tt>-halt-on-error</tt> for better life quality
photograph to a visitor her father used to pass it with a casual word:
** You probably want <tt>-shell-escape</tt> as well. I've never found a situation where it's bad.


“He is in Melbourne now.”
===LuaLaTeX/XeTeX notes===


She had consented to go away, to leave her home. Was that wise? She tried to weigh
* LuaLaTeX needs the Harfbuzz renderer to handle complex languages, and it's superior in any case.
each side of the question. In her home anyway she had shelter and food; she had those
** I think this is the default as of 2020 ("LuaHBTex")
whom she had known all her life about her. Of course she had to work hard, both in the
house and at business. What would they say of her in the Stores when they found out
that she had run away with a fellow? Say she was a fool, perhaps; and her place would
be filled up by advertisement. Miss Gavan would be glad. She had always had an edge
on her, especially whenever there were people listening.


“Miss Hill, don’t you see these ladies are waiting?”
==Punctuation==
===Quotation Marks===
* Use <tt>``</tt> for the left mark, and two apostrophes for the right.
* If you're nesting single quotes within double quotes (e.g. for a quote within a quote), you might run into problems when the interior quote ends or begins with the exterior one, e.g. <nowiki>'''</nowiki> (which is rendered as a double right quote followed by a single right quote). To properly nest, use e.g. <nowiki>'\thinspace''</nowiki>.
* If you want an actual old-skool quotation mark (for emulating old terminals, perhaps), try <tt>\textquotedbl</tt>.
** For an old-skool apostrophe, <tt>\textquotesingle</tt>.


“Look lively, Miss Hill, please.
===Hyphens/Dashes===
* Hyphens separate the parts of a compound word. Use a single '-', without spaces.
* En dashes separate the bounds of a range, usually numerics. Use two '-' characters, without spaces.
* Em dashes separate distinct thoughts. Use three '-' characters, without spaces.
* Minus signs are a mathematical entity. Use a single '-' in math mode.
* To get two actual hyphens, try <tt>-{}-</tt>.


She would not cry many tears at leaving the Stores.
===Periods===
To get correct spacing:
* Use ".\ " if the period does not end the sentence.
* Use "\@. " if the period ends the sentence, and follows a capital letter.
====Ellipses====
Use <tt>\ldots</tt> (or <tt>\cdots</tt> for line-centered dots).
* Don't use three periods (bad spacing) or the [[Unicode]] character '…' (HORIZONTAL ELLIPSIS, U+2026).
* What about <tt>\dots</tt>? '''fixme'''
===Tildes===
Generally, <tt>\textasciitilde{}</tt> is the way to go. In math mode, use <tt>\sim</tt>.
* When typesetting a url, the <tt>url</tt> and <tt>hyperref</tt> packages handle tildes properly.
===Backslashes===
Use <tt>\textbackslash{}</tt> to render a backslash in text.


But in her new home, in a distant unknown country, it would not be like that. Then
==Lists==
she would be married—she, Eveline. People would treat her with respect then. She
Enclose bulleted lists within a <tt>\begin{itemize}</tt> and <tt>\end{itemize}</tt> block. Each element is preceded by <tt>\item</tt>.
would not be treated as her mother had been. Even now, though she was over nineteen,
* <tt>enumerate</tt> will give numbers instead of bullets
she sometimes felt herself in danger of her father’s violence. She knew it was that that
* <tt>description</tt> generates labeled items. Provide each label in square brackets: <tt>\item[label]</tt>
had given her the palpitations. When they were growing up he had never gone for her
==Tables==
like he used to go for Harry and Ernest, because she was a girl; but latterly he had begun
* Use [https://ctan.org/pkg/tabularray tabularray]!
to threaten her and say what he would do to her only for her dead mother’s sake. And
now she had nobody to protect her. Ernest was dead and Harry, who was in the church
decorating business, was nearly always down somewhere in the country. Besides, the
invariable squabble for money on Saturday nights had begun to weary her unspeakably.
She always gave her entire wages—seven shillings—and Harry always sent up what he
could but the trouble was to get any money from her father. He said she used to squander
the money, that she had no head, that he wasn’t going to give her his hard-earned money
to throw about the streets, and much more, for he was usually fairly bad of a Saturday
night. In the end he would give her the money and ask her had she any intention of
buying Sunday’s dinner. Then she had to rush out as quickly as she could and do her
marketing, holding her black leather purse tightly in her hand as she elbowed her way
through the crowds and returning home late under her load of provisions. She had hard
work to keep the house together and to see that the two young children who had been
left to her charge went to school regularly and got their meals regularly. It was hard
work—a hard life—but now that she was about to leave it she did not find it a wholly
undesirable life.


She was about to explore another life with Frank. Frank was very kind, manly, openhearted. She was to go away with him by the night-boat to be his wife and to live with him in Buenos Ayres where he had a home waiting for her. How well she remembered the first time she had seen him; he was lodging in a house on the main road where she used to visit. It seemed a few weeks ago. He was standing at the gate, his peaked cap pushed back on his head and his hair tumbled forward over a face of bronze. Then they had come to know each other. He used to meet her outside the Stores every evening and see her home. He took her to see The Bohemian Girl and she felt elated as she sat in an unaccustomed part of the theatre with him. He was awfully fond of music and sang a little. People knew that they were courting and, when he sang about the lass that loves a sailor, she always felt pleasantly confused. He used to call her Poppens out of fun.
==Appearance==
===Fonts===
* Bold: <tt>\textbf{boldfaced text}</tt>
* Italics: <tt>\textit{italicized text}</tt> (it is advised to end most italicized sequences with "\/")
* Monospace: <tt>\texttt{typewriter-stylized text}</tt>


First of all it had been an excitement for her to have a fellow and then she had begun to like him. He had tales of distant countries. He had started as a deck boy at a pound a month on a ship of the Allan Line going out to Canada. He told her the names of the ships he had been on and the names of the different services. He had sailed through the Straits of Magellan and he told her stories of the terrible Patagonians. He had fallen on his feet in Buenos Ayres, he said, and had come over to the old country just for a holiday. Of course, her father had found out the affair and had forbidden her to have anything to say to him.
LuaTeX and XeTeX support modern (TTF, OTF, etc.) fonts naturally. Use <tt>-otf</tt> versions of packages with these engines if they're available (e.g. [https://ctan.org/pkg/kpfonts-otf?lang=en kpfonts-otf] rather than kpfonts).


“I know these sailor chaps,” he said.
===Spacing===
* The default margins are generally 1.5" or more, more suitable for books than other documents. For 1" margins, add <tt>\usepackage{fullpage}</tt>.
* Double-spacing can be achieved (in the main body) via <tt>\usepackage{doublespace}</tt>
** Return to single-spacing via <tt>\begin{singlespace}</tt> and <tt>\end{singlespace}</tt> blocks.
* <tt>\vfill</tt>, <tt>\vspace{amount}</tt> and <tt>\pagebreak</tt>
==Special Forms==
To include monospaced documents (code, emails, etc) use <tt>\VerbatimInput</tt> on a filename argument. This requires the <tt>moreverb</tt> package.
* Important attributes include ''fontsize'', ''frame'', ''framerule'', ''label'', and ''numbers''


One day he had quarrelled with Frank and after that she had to meet her lover secretly.
To do a background color/image with text, to set a block of text away from the main body, to do anything funky like that, [https://ctan.org/pkg/tcolorbox?lang=en tcolorbox] is the way. For instance, to stretch an image semitransparently behind text without any extra whitespace or background color:
The evening deepened in the avenue. The white of two letters in her lap grew
indistinct. One was to Harry; the other was to her father. Ernest had been her favourite
but she liked Harry too. Her father was becoming old lately, she noticed; he would miss
her. Sometimes he could be very nice. Not long before, when she had been laid up for
a day, he had read her out a ghost story and made toast for her at the fire. Another day,
when their mother was alive, they had all gone for a picnic to the Hill of Howth. She
remembered her father putting on her mother’s bonnet to make the children laugh.


Her time was running out but she continued to sit by the window, leaning her head
<pre>
against the window curtain, inhaling the odour of dusty cretonne. Down far in the
\begin{tcolorbox}[enhanced,
avenue she could hear a street organ playing. She knew the air. Strange that it should
                  size=minimal,
come that very night to remind her of the promise to her mother, her promise to keep
                  interior style={fill overzoom image=IMAGEFILE,fill image opacity=0.25},
the home together as long as she could. She remembered the last night of her mother’s
                  opacityback=0,
illness; she was again in the close dark room at the other side of the hall and outside she
                  beforeafter skip=0pt]
heard a melancholy air of Italy. The organ-player had been ordered to go away and
...text goes here...
given sixpence. She remembered her father strutting back into the sickroom saying:
\end{tcolorbox}
</pre>


“Damned Italians! coming over here!”
==[[Unicode]]==
Basic LaTeX doesn't support UTF-8 beyond expanding macros based on lexical sequences. If this is intended, use the <tt>utf8</tt> parameter to the <tt>inputenc</tt> package.


As she mused the pitiful vision of her mother’s life laid its spell on the very quick of
You should just use XeTeX or LuaTeX. Both aim to be a fully Unicode-aware TeX engines. You shouldn't need to specify any utf8-specific stuff in your preamble.
her being—that life of commonplace sacrifices closing in final craziness. She trembled
as she heard again her mother’s voice saying constantly with foolish insistence:


“Derevaun Seraun! Derevaun Seraun!”
==BibTeX==
* Style [http://www.cs.stir.ac.uk/~kjt/software/latex/showbst.html examples]
* Protect anything like capitalization, accented characters etc with curly braces
* A good list of [http://www.math.uiuc.edu/~hildebr/tex/bibliographies.html BibTeX tips]
* My [[BibTeX|BibTeX repository]]


She stood up in a sudden impulse of terror. Escape! She must escape! Frank would
==Checkers==
save her. He would give her life, perhaps love, too. But she wanted to live. Why should
Of these, ChkTeX seems more fully-featured than lacheck. Neither is actively maintained.
she be unhappy? She had a right to happiness. Frank would take her in his arms, fold
* [http://baruch.ev-en.org/proj/chktex/ ChkTeX]
her in his arms. He would save her.
** Watch out for some idiosyncrasies of ChkTeX. In particular, its error #38 is a false positive using the standard rules of American English.
** Rule emission can be controlled with command-line options or <tt>~/.chktexrc</tt>
*** I use <tt>-n 38</tt>
*** This has the (more descriptive) .chktexrc equivalent <code>QuoteStyle = Traditional</code> (default: Logical)
* [http://www.ctan.org/tex-archive/help/Catalogue/entries/lacheck.html lacheck]


She stood among the swaying crowd in the station at the North Wall. He held her
==See Also==
hand and she knew that he was speaking to her, saying something about the passage
* StackOverflow post, "[http://stackoverflow.com/questions/219853/entering-unicode-characters-in-latex Entering Unicode characters in LaTeX]"
over and over again. The station was full of soldiers with brown baggages. Through the
* Martin J. Osborne's "[http://www.economics.utoronto.ca/osborne/latex/LTXERR.HTM Common (La)TeX errors]"
wide doors of the sheds she caught a glimpse of the black mass of the boat, lying in
* MIT's "[http://web.mit.edu/olh/Latex/ess-toc.html Essential LaTeX on Athena (AC-50)]"
beside the quay wall, with illumined portholes. She answered nothing. She felt her
cheek pale and cold and, out of a maze of distress, she prayed to God to direct her, to
show her what was her duty. The boat blew a long mournful whistle into the mist. If
she went, tomorrow she would be on the sea with Frank, steaming towards Buenos
Ayres. Their passage had been booked. Could she still draw back after all he had done
for her? Her distress awoke a nausea in her body and she kept moving her lips in silent
fervent prayer.
 
A bell clanged upon her heart. She felt him seize her hand:
 
“Come!”
 
All the seas of the world tumbled about her heart. He was drawing her into them: he
would drown her. She gripped with both hands at the iron railing.
 
“Come!”
 
No! No! No! It was impossible. Her hands clutched the iron in frenzy. Amid the seas
she sent a cry of anguish!
 
“Eveline! Evvy!”
 
He rushed beyond the barrier and called to her to follow. He was shouted at to go on
but he still called to her. She set her white face to him, passive, like a helpless animal.
Her eyes gave him no sign of love or farewell or recognition.

Latest revision as of 21:08, 17 November 2023

These days, I always use XeTeX (as opposed to e.g. pdflatex), usually in conjunction with the Memoir class and polyglossia package (as opposed to e.g. babel), though I might use LuaTeX instead. Code can generally run through both and result in similar output. XeTeX is significantly slower than pdflatex, and cannot use the full capabilities of the microtype package (as of 2023-09, anyway). Nonetheless, it's a far better way to deal with Unicode and modern fonts. LuaTeX seems another valid option, and might perhaps be more actively developed. It's currently about as slow as XeTeX.

Note that Amazon's createspace package cannot be used with XeTeX, at least as of 2023-08.

I have a blog post from 2023-09-24 about LaTeX in 2023.

General

  • Use the microtype package for most documents. It improves typography via several means.
    • It is only partially supported outside of pdflatex; LuaTex supports it better than XeTeX as of 2023-10 (see the table in the documentation, page 6).
  • Use the realscripts package for most documents. It improves sub- and superscripts when using OpenType fonts with appropriate features (normally the glyphs are simply drawn at a smaller size). It doesn't work well in certain environments or in certain cases, in which case use a '*' suffix to revert to the previous definitions. It's best to use this from the beginning of a document so that you check each placement.
    • As of late 2023, it does not work well with siunitx in my experience. You'll want to define text-subscript-command and text-superscript-command to be commands which use \textsuperscript* etc., though this does seem to work.
  • 72.27 points equals 1 inch equals 25.4 millimeter
  • Invoke with -halt-on-error for better life quality
    • You probably want -shell-escape as well. I've never found a situation where it's bad.

LuaLaTeX/XeTeX notes

  • LuaLaTeX needs the Harfbuzz renderer to handle complex languages, and it's superior in any case.
    • I think this is the default as of 2020 ("LuaHBTex")

Punctuation

Quotation Marks

  • Use `` for the left mark, and two apostrophes for the right.
  • If you're nesting single quotes within double quotes (e.g. for a quote within a quote), you might run into problems when the interior quote ends or begins with the exterior one, e.g. ''' (which is rendered as a double right quote followed by a single right quote). To properly nest, use e.g. '\thinspace''.
  • If you want an actual old-skool quotation mark (for emulating old terminals, perhaps), try \textquotedbl.
    • For an old-skool apostrophe, \textquotesingle.

Hyphens/Dashes

  • Hyphens separate the parts of a compound word. Use a single '-', without spaces.
  • En dashes separate the bounds of a range, usually numerics. Use two '-' characters, without spaces.
  • Em dashes separate distinct thoughts. Use three '-' characters, without spaces.
  • Minus signs are a mathematical entity. Use a single '-' in math mode.
  • To get two actual hyphens, try -{}-.

Periods

To get correct spacing:

  • Use ".\ " if the period does not end the sentence.
  • Use "\@. " if the period ends the sentence, and follows a capital letter.

Ellipses

Use \ldots (or \cdots for line-centered dots).

  • Don't use three periods (bad spacing) or the Unicode character '…' (HORIZONTAL ELLIPSIS, U+2026).
  • What about \dots? fixme

Tildes

Generally, \textasciitilde{} is the way to go. In math mode, use \sim.

  • When typesetting a url, the url and hyperref packages handle tildes properly.

Backslashes

Use \textbackslash{} to render a backslash in text.

Lists

Enclose bulleted lists within a \begin{itemize} and \end{itemize} block. Each element is preceded by \item.

  • enumerate will give numbers instead of bullets
  • description generates labeled items. Provide each label in square brackets: \item[label]

Tables

Appearance

Fonts

  • Bold: \textbf{boldfaced text}
  • Italics: \textit{italicized text} (it is advised to end most italicized sequences with "\/")
  • Monospace: \texttt{typewriter-stylized text}

LuaTeX and XeTeX support modern (TTF, OTF, etc.) fonts naturally. Use -otf versions of packages with these engines if they're available (e.g. kpfonts-otf rather than kpfonts).

Spacing

  • The default margins are generally 1.5" or more, more suitable for books than other documents. For 1" margins, add \usepackage{fullpage}.
  • Double-spacing can be achieved (in the main body) via \usepackage{doublespace}
    • Return to single-spacing via \begin{singlespace} and \end{singlespace} blocks.
  • \vfill, \vspace{amount} and \pagebreak

Special Forms

To include monospaced documents (code, emails, etc) use \VerbatimInput on a filename argument. This requires the moreverb package.

  • Important attributes include fontsize, frame, framerule, label, and numbers

To do a background color/image with text, to set a block of text away from the main body, to do anything funky like that, tcolorbox is the way. For instance, to stretch an image semitransparently behind text without any extra whitespace or background color:

\begin{tcolorbox}[enhanced,
                  size=minimal,
                  interior style={fill overzoom image=IMAGEFILE,fill image opacity=0.25},
                  opacityback=0,
                  beforeafter skip=0pt]
 ...text goes here...
\end{tcolorbox}

Unicode

Basic LaTeX doesn't support UTF-8 beyond expanding macros based on lexical sequences. If this is intended, use the utf8 parameter to the inputenc package.

You should just use XeTeX or LuaTeX. Both aim to be a fully Unicode-aware TeX engines. You shouldn't need to specify any utf8-specific stuff in your preamble.

BibTeX

Checkers

Of these, ChkTeX seems more fully-featured than lacheck. Neither is actively maintained.

  • ChkTeX
    • Watch out for some idiosyncrasies of ChkTeX. In particular, its error #38 is a false positive using the standard rules of American English.
    • Rule emission can be controlled with command-line options or ~/.chktexrc
      • I use -n 38
      • This has the (more descriptive) .chktexrc equivalent QuoteStyle = Traditional (default: Logical)
  • lacheck

See Also