Author Topic: LaTeX discussion  (Read 3303 times)

0 Members and 1 Guest are viewing this topic.

Offline timw4mail

  • Thread Starter
  • Posts: 1329
    • https://timshomepage.net
LaTeX discussion
« on: Tue, 28 July 2009, 13:29:28 »
This is mainly to split this off from the images thread...

I was looking into LaTeX for taking notes in my classes, since its difficult to incorporate Lewis dot structures into text in a regular Word Processor.

I've also wondered if there's an easy way to draw graphs in LaTeX.
Buckling Springs IBM Model F AT, New Model F 77, Unicomp New Model M
Clicky iOne Scorpius M10, OCN-branded Ducky DK-9008-C, Blackmore Nocturna, Redragon Kumara K552-1, Qtronix Scorpius Keypad, Chicony KB-5181(Monterey)
Tactile Apple AEKII (Cream damped ALPS), Filco FKBN91M/JB (Japanese Tenkeyless), Cherry G84-5200, Cherry G84-4100LPAUS, Datalux Spacesaver(Cherry ML), Redragon Devarajas K556 RGB, Newmen GM711, Poker II (Cherry MX Clear), Logitech G910 Orion Spark, Logitech K840
Linear Lenovo Y (Gateron Red), Aluminum kiosk keyboard (Cherry MX Black)

Offline talis

  • Posts: 195
LaTeX discussion
« Reply #1 on: Tue, 28 July 2009, 13:51:16 »
Quote
Now if I could only figure out how to do Chemistry and Graphs with LaTeX...

Its usually easier to graphs in an external package, and just add them to the document as images.  Matlab works quite well for this as you can export directly to .eps.

Chemistry typesetting should be fairly easy.  I can't see it being much more then a mixture of super and sub-scrips around a few basic symbols.:

Code: [Select]
\begin{equation}
Fe_2O_3 + 2 Al \rightarrow 2 Fe + Al_2O_3
\end{equation}



For structural stuff take a look at chemtex and xymtex.

(note, I'm not a chemist, so I have no idea what this means)
Code: [Select]
\usepackage{xymtex}
.
.
.
\pyridinev{4==Cl}

produces an output like :




There is a lewis package specifically for that, tho it doesn't seem to be overly elegant.

Code: [Select]
\usepackage{lewis}
.
.
.
\lewis{F}{.}{.}{.}{.}{}{}{.}{.}--\lewis{F}{}{}{.}{.}{.}{.}{.}{.}

produces :


Offline timw4mail

  • Thread Starter
  • Posts: 1329
    • https://timshomepage.net
LaTeX discussion
« Reply #2 on: Tue, 28 July 2009, 14:03:28 »
Quote from: talis;105088
Its usually easier to graphs in an external package, and just add them to the document as images.  Matlab works quite well for this as you can export directly to .eps.
How do you actually add images?
I don't have, or know how to use Matlab, do you know if Maple can do anything similar?

Quote
Chemistry typesetting should be fairly easy.  I can't see it being much more then a mixture of super and sub-scrips around a few basic symbols.:

Code: [Select]
\begin{equation}
Fe_2O_3 + 2 Al \rightarrow 2 Fe + Al_2O_3
\end{equation}
Show Image


For structural stuff take a look at chemtex and xymtex.

(note, I'm not a chemist, so I have no idea what this means)
Code: [Select]
\usepackage{xymtex}
.
.
.
\pyridinev{4==Cl}
produces an output like :

Show Image



There is a lewis package specifically for that, tho it doesn't seem to be overly elegant.

Code: [Select]
\usepackage{lewis}
.
.
.
\lewis{F}{.}{.}{.}{.}{}{}{.}{.}--\lewis{F}{}{}{.}{.}{.}{.}{.}{.}
produces :

Show Image

That package is perfect...I just don't want to have to leave things out of my class notes because I can't type them in.
Buckling Springs IBM Model F AT, New Model F 77, Unicomp New Model M
Clicky iOne Scorpius M10, OCN-branded Ducky DK-9008-C, Blackmore Nocturna, Redragon Kumara K552-1, Qtronix Scorpius Keypad, Chicony KB-5181(Monterey)
Tactile Apple AEKII (Cream damped ALPS), Filco FKBN91M/JB (Japanese Tenkeyless), Cherry G84-5200, Cherry G84-4100LPAUS, Datalux Spacesaver(Cherry ML), Redragon Devarajas K556 RGB, Newmen GM711, Poker II (Cherry MX Clear), Logitech G910 Orion Spark, Logitech K840
Linear Lenovo Y (Gateron Red), Aluminum kiosk keyboard (Cherry MX Black)

Offline talis

  • Posts: 195
LaTeX discussion
« Reply #3 on: Tue, 28 July 2009, 14:12:57 »
Anything that can export will work, .eps isn't necicary, you can use .jpg or pretty much any image format for that matter (eps are just vectorized images, so they scale nicely).  You just need to include the images.  Maple may be able to, there's probably a right click context menu export of a figure (its been a while since I used Maple).

I know there's a few ways to graph directly in LaTeX, but they've always seemed overly complicated, and are one of those things you have to look up every time you need them.

Graphics are easy to include, in its  simplest form :

Code: [Select]
\usepackage{graphicx}
.
.
.
\begin{figure}
\includegraphics[]{img/dc-dc-l-graph}
\end{figure}

Tho you can also scale, rotate, center, and annotate:

Code: [Select]
\begin{figure}
    \begin{center}
        \includegraphics[scale=.4]{img/dc-dc-l-graph}
    \end{center}
    \caption[Inductor selection guide]{DC-DC converter inductor selection guide.}
    \label{dc-dc-inductor-selection-graph}
\end{figure}

You can also scale relative to the width of the text field in the layout you are using:

Code: [Select]
\includegraphics[width=.8\textwidth, height=.45\textwidth]{res/car_res/pascar4_simple}\\
« Last Edit: Tue, 28 July 2009, 14:19:24 by talis »

Offline huha

  • Posts: 388
LaTeX discussion
« Reply #4 on: Tue, 28 July 2009, 14:15:05 »
For chemistry stuff, there's always mhchem, which does it right--non-italic element names and slightly different sub- and superscript positions.

-huha
Unicomp Endurapro 105 (blank keycaps, BS) // Cherry G80-3000LSCDE-2 (blues, modded to green MX) // Cherry G80-3000LAMDE-0 (blacks, 2x) // Cherry G80-11900LTMDE-0 (blacks, 2x) // Compaq G80-11801 (browns) // Epson Q203A (Fujitsu Peerless) // IBM Model M2 (BS) // Boscom AS400 Terminal Emulator (OEM\'d Unicomp, BS, 2x) // Dell AT102DW (black Alps) // Mechanical Touch (chinese BS) Acer 6312-KW (Acer mechanics on membrane) // Cherry G84-4100 (ML) // Cherry G80-1000HAD (NKRO, blacks)

Offline keyb_gr

  • Posts: 1384
  • Location: Germany
  • Cherrified user
    • My keyboard page (German)
LaTeX discussion
« Reply #5 on: Tue, 28 July 2009, 14:29:07 »
For drawing I'll be using Inkscape for now. Gnuplot graphs can be included easily, as the latter has an "epslatex" output terminal these days.
Hardware in signatures clutters Google search results. There should be a field in the profile for that (again).

This message was probably typed on a vintage G80-3000 with blues. Double-shots, baby. :D

Offline timw4mail

  • Thread Starter
  • Posts: 1329
    • https://timshomepage.net
LaTeX discussion
« Reply #6 on: Tue, 28 July 2009, 14:49:31 »
Quote from: keyb_gr;105097
For drawing I'll be using Inkscape for now. Gnuplot graphs can be included easily, as the latter has an "epslatex" output terminal these days.

Inkscape does graphing?
Buckling Springs IBM Model F AT, New Model F 77, Unicomp New Model M
Clicky iOne Scorpius M10, OCN-branded Ducky DK-9008-C, Blackmore Nocturna, Redragon Kumara K552-1, Qtronix Scorpius Keypad, Chicony KB-5181(Monterey)
Tactile Apple AEKII (Cream damped ALPS), Filco FKBN91M/JB (Japanese Tenkeyless), Cherry G84-5200, Cherry G84-4100LPAUS, Datalux Spacesaver(Cherry ML), Redragon Devarajas K556 RGB, Newmen GM711, Poker II (Cherry MX Clear), Logitech G910 Orion Spark, Logitech K840
Linear Lenovo Y (Gateron Red), Aluminum kiosk keyboard (Cherry MX Black)

Offline talis

  • Posts: 195
LaTeX discussion
« Reply #7 on: Tue, 28 July 2009, 15:38:06 »
You can try Gnuplot (there's cross platform releases), or take a look at Octave, which is an open source Matlab clone (without all the toolkit/simulink components).

Offline DrunkenDonut

  • Posts: 94
LaTeX discussion
« Reply #8 on: Tue, 28 July 2009, 19:43:50 »
Looks like you're covered with the formulas and chemistry stuff ...

I'll just add, if you're going to be producing PDFs out of all of this, pdflatex or pdftex (and probably some other package I can't recall) can import PNGs directly. PNG are also vector based so they scale nicely as well. You can also add pages from other PDF files easily too.
*Hang on to your wallet!*
BTC E5X5R5BTC-5339R-0 (\'90), MS Natural Keyboard Pro (\'99), Sun Type 5c, 2x 1391401, DASK3ULT (\'08), ABS M1, Dell AT101W, M4-1
FKBN87M/EB (\'09), FKBN87ML/EB (\'09), FKBN87Z/EB (\'09), FKBN87MC/NPEC (\'09), G80-3000LQCDE-2 (\'11)

Offline huha

  • Posts: 388
LaTeX discussion
« Reply #9 on: Tue, 28 July 2009, 20:19:32 »
Quote from: DrunkenDonut;105176
PNG are also vector based so they scale nicely as well. You can also add pages from other PDF files easily too.


PNG aren't vector graphics I'm afraid. Still, nothing's hindering you from exporting your vector graphics as PDF--almost any graphics program has that option.

-huha
Unicomp Endurapro 105 (blank keycaps, BS) // Cherry G80-3000LSCDE-2 (blues, modded to green MX) // Cherry G80-3000LAMDE-0 (blacks, 2x) // Cherry G80-11900LTMDE-0 (blacks, 2x) // Compaq G80-11801 (browns) // Epson Q203A (Fujitsu Peerless) // IBM Model M2 (BS) // Boscom AS400 Terminal Emulator (OEM\'d Unicomp, BS, 2x) // Dell AT102DW (black Alps) // Mechanical Touch (chinese BS) Acer 6312-KW (Acer mechanics on membrane) // Cherry G84-4100 (ML) // Cherry G80-1000HAD (NKRO, blacks)

Offline timw4mail

  • Thread Starter
  • Posts: 1329
    • https://timshomepage.net
LaTeX discussion
« Reply #10 on: Tue, 28 July 2009, 20:51:36 »
Quote from: huha;105179
PNG aren't vector graphics I'm afraid. Still, nothing's hindering you from exporting your vector graphics as PDF--almost any graphics program has that option.

-huha

Although, it seems easier to just incorporate it as an EPS...

It's a shame that PDF is the defacto standard for vector text...its such a bloated, poorly-aged format.
Buckling Springs IBM Model F AT, New Model F 77, Unicomp New Model M
Clicky iOne Scorpius M10, OCN-branded Ducky DK-9008-C, Blackmore Nocturna, Redragon Kumara K552-1, Qtronix Scorpius Keypad, Chicony KB-5181(Monterey)
Tactile Apple AEKII (Cream damped ALPS), Filco FKBN91M/JB (Japanese Tenkeyless), Cherry G84-5200, Cherry G84-4100LPAUS, Datalux Spacesaver(Cherry ML), Redragon Devarajas K556 RGB, Newmen GM711, Poker II (Cherry MX Clear), Logitech G910 Orion Spark, Logitech K840
Linear Lenovo Y (Gateron Red), Aluminum kiosk keyboard (Cherry MX Black)

Offline timw4mail

  • Thread Starter
  • Posts: 1329
    • https://timshomepage.net
LaTeX discussion
« Reply #11 on: Wed, 29 July 2009, 13:56:19 »
Oh, does anyone know of a LaTeX package for logic gates?
Buckling Springs IBM Model F AT, New Model F 77, Unicomp New Model M
Clicky iOne Scorpius M10, OCN-branded Ducky DK-9008-C, Blackmore Nocturna, Redragon Kumara K552-1, Qtronix Scorpius Keypad, Chicony KB-5181(Monterey)
Tactile Apple AEKII (Cream damped ALPS), Filco FKBN91M/JB (Japanese Tenkeyless), Cherry G84-5200, Cherry G84-4100LPAUS, Datalux Spacesaver(Cherry ML), Redragon Devarajas K556 RGB, Newmen GM711, Poker II (Cherry MX Clear), Logitech G910 Orion Spark, Logitech K840
Linear Lenovo Y (Gateron Red), Aluminum kiosk keyboard (Cherry MX Black)

Offline keyb_gr

  • Posts: 1384
  • Location: Germany
  • Cherrified user
    • My keyboard page (German)
LaTeX discussion
« Reply #12 on: Wed, 29 July 2009, 14:10:17 »
Quote from: timw4mail;105284
Oh, does anyone know of a LaTeX package for logic gates?

"pgf" seems to be useable. These m4 macros may also be useful.

I might prefer an external drawing app here.
Hardware in signatures clutters Google search results. There should be a field in the profile for that (again).

This message was probably typed on a vintage G80-3000 with blues. Double-shots, baby. :D

Offline talis

  • Posts: 195
LaTeX discussion
« Reply #13 on: Wed, 29 July 2009, 15:02:30 »
Quote from: keyb_gr;105294
"pgf" seems to be useable. These m4 macros may also be useful.

I might prefer an external drawing app here.

Eagle cad may work as an external editor.  


Quote
Oh, does anyone know of a LaTeX package for logic gates?
If you're just trying to get the ideas across it may be better to stick with Boolean notation, much quicker to type out and captures all the same information:

Code: [Select]
\begin{equation}
\lnot ( A \land B )\lor C
\end{equation}
« Last Edit: Wed, 29 July 2009, 15:16:48 by talis »

Offline DrunkenDonut

  • Posts: 94
LaTeX discussion
« Reply #14 on: Wed, 29 July 2009, 15:35:14 »
Quote from: huha;105179
PNG aren't vector graphics I'm afraid. Still, nothing's hindering you from exporting your vector graphics as PDF


Oooops, my bad. You're right, but I got it stuck in my head that it's vector somehow. I remember doing the PDF export for various images either through built-in exporting or print-to-PDF functionality.

Quote from: timw4mail;105181
Although, it seems easier to just incorporate it as an EPS...


I've had trouble with EPS in the past, especially with programs that don't output EPS quite the way you want. You'd have to go into each image and manually change the window boundaries and such. That's why PDF + PDF/PNG images was such a great combo. Less issues with the file formats and still got your work done, especially if many platforms came into play - Solaris, Windows, etc... Sometimes it's easier with EPS/PS, sometimes it's easier with PNG/PDF.
*Hang on to your wallet!*
BTC E5X5R5BTC-5339R-0 (\'90), MS Natural Keyboard Pro (\'99), Sun Type 5c, 2x 1391401, DASK3ULT (\'08), ABS M1, Dell AT101W, M4-1
FKBN87M/EB (\'09), FKBN87ML/EB (\'09), FKBN87Z/EB (\'09), FKBN87MC/NPEC (\'09), G80-3000LQCDE-2 (\'11)