* First steps exporting to tex @ 2021-04-03 9:31 Ypo 2021-04-03 10:15 ` Martin Steffen ` (3 more replies) 0 siblings, 4 replies; 13+ messages in thread From: Ypo @ 2021-04-03 9:31 UTC (permalink / raw) To: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 2187 bytes --] Good morning After reading your interesting advices, I've decided to start my path through LaTeX. I have been some hours trying to start, with little result, but I hope that once established a *workflow* the results will come and the new invested time will be directed just to get better and better results. My doubts: a. As first step for my workflow, it seems convenient to use a "template" with the LaTeX preambles. So maybe the many existing LaTeX templates can be used quickly with orgmode. I found several options and opinions. Which one is the best way? 1. #+SETUPFILE: template.setup -> doesn't seem the ideal way, because the template.setup file must be modified adding #+latex_class to each of the lines. 2. template.tex -> this could be added to the SETUPFILE: #+LATEX_HEADER: \input{template.tex}. But it seems to have no effect on the PDF output. BTW, I can't use emacs HOME path (~/) in the input header, like \input{~//export//template.tex}. This is my template.tex file content: \usepackage{fancyhdr} \thispagestyle{fancy} \lhead{\includegraphics[width=4cm]{jpg.jpg}} \rhead{Student Name: Name\\ Student ID: 1234\\ Course: IDB 601 (Fall 2020)} 3. Another friend told me that .sty templates were the best way. 4. I see some people that create customized LaTeX classes and add the desired class to the orgmode buffer. 5. Also we can see this intricate transformation of a LaTeX template into orgmode. How to Migrate LaTeX Template into org-mode <https://github.com/Literate-DevOps/literate-programming-tutorials/blob/master/how-to/00-convert-latex-template-into-org-mode-template/how-to-migrate-latex-template-into-org-mode.org#how-to-migrate-latex-template-into-org-mode> 6. ... b. I think that in a good integration, every character shown on orgmode should be exported into the PDF output. For example "CENTRE LINE SYMBOL": ℄ How can this integration be done? I have more doubts, but I will keep reading and trying to solve them Best regards [-- Attachment #2: Type: text/html, Size: 3541 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-03 9:31 First steps exporting to tex Ypo @ 2021-04-03 10:15 ` Martin Steffen 2021-04-04 11:04 ` Ypo 2021-04-03 10:43 ` Dr. Arne Babenhauserheide ` (2 subsequent siblings) 3 siblings, 1 reply; 13+ messages in thread From: Martin Steffen @ 2021-04-03 10:15 UTC (permalink / raw) To: Ypo; +Cc: emacs-orgmode >>>>> "Ypo" == Ypo <ypuntot@gmail.com> writes: Ypo> Good morning Ypo> After reading your interesting advices, I've decided to start Ypo> my path through LaTeX. I have been some hours trying to start, Ypo> with little result, but I hope that once established a Ypo> *workflow* the results will come and the new invested time will Ypo> be directed just to get better and better results. Ypo> My doubts: Ypo> a. As first step for my workflow, it seems convenient to use a Ypo> "template" with the LaTeX preambles. So maybe the many existing Ypo> LaTeX templates can be used quickly with orgmode. I found Ypo> several options and opinions. Which one is the best way? I say my advice as a "LaTeX-first" person (i.e., I was familiar with LaTeX before org was around. When I discovered org, which I found useful in many ways, so I tried to familiarize myself also to find out how I could make it useful in tandem with latex. So, for me, stuff that works well in LaTeX, I did not port for myself to org, things where org helps me to make better use of latex, I tried to figure out. For you, being familiar with org, but not (yet) with latex, you may follow different patterns. For the "preamble" of a latex document, the general setup that comes _before_ \begin{document} and before any output is generated, I use native latex using instructions like #+latex_header: \input{switches} #+latex_header: \input{preamble} #+latex_header: \input{style/style-common} #+latex_header: \input{macros} I often separate the preamble from macros. preamble.tex is (for me) the file which contains loading of packages and classes (usepackage etc, and corresponding adapations or settings for that package). macros.tex is things I define using \newcommand (or \def or \newenvironment or similar) As far controlling input is concerned, I also rely on latex-specific setting (outside org, also outside emacs), things like environment settings like $TEXINPUT, a path-specification, where one can control where LaTeX finds (additional) stylefiles, outside of the standard ``load-path''. Thus, I often try to avoid to use hardcoded things, like >>> \input{~//export//template.tex} I would use \input{template} (".tex" is not needed) and I make sure, the templatex.tex file is included in the $TEXINPUTS-path. Typically, the current directory "./" should be included by default (and stuff from the latex-installation is also routinely found) BTW: also when working with pics (with includegraphs), there is a variable (inside latex) that controls where to find figures. So, what I typically would to is things like \usepackage{graphicx} \graphicspath{{./figures/}} That specifies that the pics for \includegrapic are found in a direcory figures, and then I would use \includegraphics[width=4cm]{jpgfigure} not jpgfigure.jpg; \includegraphics can figure it out, if it's a PDF or a jpg; it would also chose ps, if you don't use pdflatex, but latex (I still prefer the xdvi-viewer as faster and more fluent to navigate, I never like any PDF viewer when doing latex, only at the end, I generate the PDF). One can of course ``inline'' all that inside org (like doing a \newcommand inside ``org'', it's just I prefer to keep all the stuff in one (or more) latex files; for those parts I rely on latex (since org does not bring much additional value to the table for the premable stuff, at least for me) Martin Ypo> 1 #+SETUPFILE: template.setup -> doesn't seem the ideal way, Ypo> because the template.setup file must be modified adding Ypo> #+latex_class to each of the lines. 2 template.tex -> this Ypo> could be added to the SETUPFILE: #+LATEX_HEADER: Ypo> \input{template.tex}. But it seems to have no effect on the PDF Ypo> output. BTW, I can't use emacs HOME path (~/) in the input Ypo> header, like \input{~//export//template.tex}. This is my Ypo> template.tex file content: \usepackage{fancyhdr} Ypo> \thispagestyle{fancy} Ypo> \lhead{\includegraphics[width=4cm]{jpg.jpg}} \rhead{Student Ypo> Name: Name\\ Student ID: 1234\\ Course: IDB 601 (Fall 2020)} 3 Ypo> Another friend told me that .sty templates were the best way. Ypo> 4 I see some people that create customized LaTeX classes and Ypo> add the desired class to the orgmode buffer. 5 Also we can see Ypo> this intricate transformation of a LaTeX template into Ypo> orgmode. How to Migrate LaTeX Template into org-mode 6 ... Ypo> b. I think that in a good integration, every character shown Ypo> on orgmode should be exported into the PDF output. For example Ypo> "CENTRE LINE SYMBOL": ℄ How can this integration be done? Ypo> I have more doubts, but I will keep reading and trying to Ypo> solve them Ypo> Best regards ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-03 10:15 ` Martin Steffen @ 2021-04-04 11:04 ` Ypo 2021-04-04 11:36 ` Juan Manuel Macías 2021-04-05 5:05 ` Tim Cross 0 siblings, 2 replies; 13+ messages in thread From: Ypo @ 2021-04-04 11:04 UTC (permalink / raw) To: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 8063 bytes --] >>>>>>> El 03/04/2021 a las 18:00, emacs-orgmode-request@gnu.org escribió: > Message: 34 > Date: Sun, 04 Apr 2021 00:31:24 +1100 > To:emacs-orgmode@gnu.org > Subject: Re: First steps exporting to tex > Message-ID:<871rbr7ag1.fsf@gmail.com> > Content-Type: text/plain; charset=utf-8 > > > Why do you think you need any of this for your 'first steps'. Start by > just writing your org file and exporting it to LaTeX or pdf. Then, once > you have your first document, see what you think needs changing and come > back and ask advice on what you need to do to make the changes you want. > In your first document, don't use any LaTeX commands, header options or > anything else - just write your document using standard org mode. > > Org already sets up a reasonable starting default. Once you know what > the default is, then we can discuss what you may need to change. For > many documents, you may not need to change much at all and you may not > need any templates - for example, you will likely want to change the > margin sizes (this is a common request) or you may want to see what some > of the other 'standard' LaTeX document classes are like. All of this can > be achieved with just minor configuration of org mode. > > The org export to LaTeX only needs to be as complicated as you need it > to be. Org has variables which can be used to add/remove things from the > preamble and once you have those configured, you don't have to put > anything in the org file itself. Start simple and add as you find a need > rather than try to start with something complex which might not be > necessary. > > -- Tim Cross Hi Tim I have been exporting from orgmode to PDF time ago, but very basic PDFs, playing with some basic options of orgmode. When I tried to produce a meeting minute with a logo in the heading, I decided that I should learn better a way of exporting, because the minute meeting was a first challenge, but many more would come. For example, for that task I started with this code, which I think it goes far beyond what the "LaTeX Defaults" can offer (I must yet "play around" a lot with it): #+BEGIN_SRC #+options: toc:nil #+options: num:1 #+options: d:nil #+export_file_name: BORRAR #+options: broken-links:mark #+LaTeX_header_extra: \usepackage{fancyhdr} #+begin_export LaTeX \thispagestyle{fancy} \lhead{\includegraphics[width=4cm]{//192.168.1.2/f/LOGO-IMAGEN CORPORATIVA/IMAGEN CORPORATIVA 2018/DEFINITIVO ANAGRAMAS/SELLO1_grueso.png}} \rhead{Student Name: John Doe\\ Student ID: 1234\\ Course: IDB 601 (Fall 2020)} #+end_export #+END_SRC The buffer I exported my meeting notes from has much more information which is not related with meetings nor with the logo. So I foresaw 3 things: 1. A fast cluttering of the buffers with LaTeX headings would happen, as I will learn more about LaTeX and I will want to add more and more packages. 2. A need for flexibility to be able to export different kinds of documents from the same buffer, ideally achieved just by changing a line (or few lines) in the buffer. Although, from my example, it seems that ~#+begin_export...~ contents can't be added in that way. 3. A great potential if it were possible to use already existing, and well curated, LaTeX templates frictionless through orgmode. I find quite useful to analyse the default generated TeX file though. Best regards >>>>>>> El 03/04/2021 a las 12:15, Martin Steffen escribió: Good morning, Martin > For the "preamble" of a latex document, the general setup that comes > _before_ \begin{document} and before any output is generated, I use > native latex using instructions like > > #+BEGIN_SRC > #+latex_header: \input{switches} > #+latex_header: \input{preamble} > #+latex_header: \input{style/style-common} > #+latex_header: \input{macros} > #+END_SRC Thanks for your input. I'll keep with that. > As far controlling input is concerned, I also rely on latex-specific > setting (outside org, also outside emacs), things like environment > settings like $TEXINPUT, a path-specification, where one can control > where LaTeX finds (additional) stylefiles, outside of the standard > ``load-path''. > > Thus, I often try to avoid to use hardcoded things, like > > >>> \input{~//export//template.tex} > > I would use \input{template} (".tex" is not needed) and I make sure, the > templatex.tex file is included in the $TEXINPUTS-path. Typically, the > current directory "./" should be included by default (and stuff from > the latex-installation is also routinely found) Thanks. But I can read in this post: https://tex.stackexchange.com/questions/93712/definition-of-the-texinputs-variable that ~$TEXINPUT~ could give some problems with LuaLaTeX, could it be? It seems important, since LuaLaTeX is the safe recommendation of our mailing list pal Juan Manuel Macías [maciaschain@...]. >>>>>>> El 03/04/2021 a las 12:43, Dr. Arne Babenhauserheide escribió: A pleasure, Arne. > Alternatively you can use #+INCLUDE: template.org > to grab more than just the org-setup. And there you show me a different way: ~#+INCLUDE,~ "competing" with ~\input{}~. What would be the difference? > Have a look at \DeclareUnicodeCharacter: > https://www.draketo.de/light/english/emacs/char-not-setup-latex Does that mean that some symbols must be declared one by one in order to be exported using LaTeX? >>>>>>> El 03/04/2021 a las 14:10, Juan Manuel Macías escribió: Hi, Juan Manuel :-) > The correct way is \input{~/export/template.tex} I've already tried that. But it doesn't seem to understand the HOME directory ~~/~. At least at Windows. > A *.sty file is what is known in LaTeX jargon as a "package", and it > would come to be the equivalent of what is a *.el file in Emacs, > /mutatis mutandis/. In a sty file you can put whatever you want, but a > different syntax must be used and these files are subject to a series of > good practices. Therefore, a sty file is more indicated to introduce > 'heavy' code that you want reuse in other documents (defined commands > and macros, etc.). In short, what comes to be a package ;-) At the user > level, and unless you want to write your own package (see: > https://www.overleaf.com/learn/latex/Writing_your_own_package), it is > almost never necessary. So I will keep myself far away from .sty by now. > Great care must be taken here. One thing is a LaTeX class, which is > something laborious and complex to write, and another thing what Org > understands for a LaTeX class :-) Classen and the class concept are a > essential component for LaTeX, as a class is the first thing you must > declare in a preamble with the command \documentclass{}. There are the > standard classes (article, book and others) and other ones, more > specialized. A class changes globally the behavior of the document and > all LaTeX commands as \section, \subsection and many more, and add its > own commands. > > A 'LaTeX class' for Org is a light translation of the above. It is > actually "what type of LaTeX document you want to get". > > You can easily define your own LaTeX 'classes' for Org documents. For > example: I have an 'empty class', to be able to add the entire preamble, > without Org charging me anything before the \begin{document} > (add-to-list 'org-latex-classes > '("empty" > "[NO-DEFAULT-PACKAGES] > [PACKAGES] > [EXTRA]" > ("\\section{%s}" . "\\section*{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\subsubsection{%s}" . "\\subsubsection*{%s}") > ("\\paragraph{%s}" . "\\paragraph*{%s}") > ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) > > And I have in my ~/.emacs: > > (setq org-latex-default-class "empty") > (setq org-latex-default-packages-alist nil) > (setq org-latex-packages-alist nil) > (setq org-latex-hyperref-template nil) Thanks for your class. I suppose that "nulls" the orgmode LaTeX export defaults, so you can control it completely. Thank you all [-- Attachment #2: Type: text/html, Size: 12095 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-04 11:04 ` Ypo @ 2021-04-04 11:36 ` Juan Manuel Macías 2021-04-05 5:05 ` Tim Cross 1 sibling, 0 replies; 13+ messages in thread From: Juan Manuel Macías @ 2021-04-04 11:36 UTC (permalink / raw) To: Ypo; +Cc: orgmode Ypo writes: > I've already tried that. But it doesn't seem to understand the HOME > directory ~~/~. At least at Windows. I haven't touched Windows for a thousand years :-), but maybe this thread can help you: https://stackoverflow.com/questions/13584118/how-to-write-a-path-with-latex best regards, Juan Manuel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-04 11:04 ` Ypo 2021-04-04 11:36 ` Juan Manuel Macías @ 2021-04-05 5:05 ` Tim Cross 1 sibling, 0 replies; 13+ messages in thread From: Tim Cross @ 2021-04-05 5:05 UTC (permalink / raw) To: emacs-orgmode > Hi Tim > I have been exporting from orgmode to PDF time ago, but very basic PDFs, playing with some basic options of orgmode. When I tried to produce a > meeting minute with a logo in the heading, I decided that I should learn better a way of exporting, because the minute meeting was a first > challenge, but many more would come. For example, for that task I started with this code, which I think it goes far beyond what the "LaTeX > Defaults" can offer (I must yet "play around" a lot with it): > #+BEGIN_SRC > #+options: toc:nil > #+options: num:1 > #+options: d:nil > #+export_file_name: BORRAR > #+options: broken-links:mark > #+LaTeX_header_extra: \usepackage{fancyhdr} > #+begin_export LaTeX > \thispagestyle{fancy} > \lhead{\includegraphics[width=4cm]{//192.168.1.2/f/LOGO-IMAGEN CORPORATIVA/IMAGEN CORPORATIVA 2018/DEFINITIVO > ANAGRAMAS/SELLO1_grueso.png}} > \rhead{Student Name: John Doe\\ > Student ID: 1234\\ > Course: IDB 601 (Fall 2020)} > #+end_export > #+END_SRC > The buffer I exported my meeting notes from has much more information which is not related with meetings nor with the logo. So I foresaw 3 things: > 1 A fast cluttering of the buffers with LaTeX headings would happen, as I will learn more about LaTeX and I will want to add more and more > packages. > 2 A need for flexibility to be able to export different kinds of documents from the same buffer, ideally achieved just by changing a line (or few lines) > in the buffer. Although, from my example, it seems that ~#+begin_export...~ contents can't be added in that way. > 3 A great potential if it were possible to use already existing, and well curated, LaTeX templates frictionless through orgmode. > I find quite useful to analyse the default generated TeX file though. > Best regards OK, now I understand your objectives a bit more there are a couple of things I would recommend. Org is already fully setup to provide a clean and consistent way to do much of what you are currently achieving with export latex blocks and which can avoid much of the clutter in your org files. The way you are customizing the latex etc is OK for 'one off' type hacks, but isn't the best solution for crating a standard format. Have a look at the documentation for org-latex-classes. In this variable, you can define your own 'pseudo' classes, which you can then use in your org file with a simple #+LATEX_CLASS: line. This will take care of all the preamble stuff, plus more (it uses other org variables, such as ones for listing default 'usepackage' lines and other preamble lines, so read the documentation carefully). So, you could add a 'meeting' class to that variable and when you need to do an org file for meetings, just add #+LATEX_CLASS; meeting at the top of your org file and your ready to go. This is what I did for my 'work' class, which produces documents that included my employers logo, branding colours, fonts, font sizes, heading formats etc. Now when I need to produce a work document, I just add the #+LATEX_CLASS: header and then just write a normal org file. I actually had a number of these custom 'class' definitions. Really nice thing is that if I find something needs to be tweaked or changed, I just have to fix the org-latex-classes and related definitions and know that if I re-export any of my org files that use them, they will all get the fix (no need to edit each individual org file to apply the fix). -- Tim Cross ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-03 9:31 First steps exporting to tex Ypo 2021-04-03 10:15 ` Martin Steffen @ 2021-04-03 10:43 ` Dr. Arne Babenhauserheide 2021-04-03 12:10 ` Juan Manuel Macías 2021-04-03 13:31 ` Tim Cross 3 siblings, 0 replies; 13+ messages in thread From: Dr. Arne Babenhauserheide @ 2021-04-03 10:43 UTC (permalink / raw) To: Ypo; +Cc: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 3373 bytes --] Hi Ypo, Ypo <ypuntot@gmail.com> writes: > After reading your interesting advices, I've decided to start my path > through LaTeX. I have been some hours trying to start, with little > result, but I hope that once established a *workflow* the results will > come and the new invested time will be directed just to get better and > better results. > > My doubts: > > a. As first step for my workflow, it seems convenient to use a > "template" with the LaTeX preambles. So maybe the many existing > LaTeX templates can be used quickly with orgmode. I found several > options and opinions. Which one is the best way? > > > 1. #+SETUPFILE: template.setup -> doesn't seem the ideal way, > because the template.setup file must be modified adding > #+latex_class to each of the lines. > 2. template.tex -> this could be added to the SETUPFILE: > #+LATEX_HEADER: \input{template.tex}. But it seems to have no I use #+LATEX_HEADER: \input{ews30setup} % pointing to ews30setup.tex in the org-file, I export, not a setupfile. Alternatively you can use #+INCLUDE: template.org to grab more than just the org-setup. For an example, see https://hg.sr.ht/~arnebab/draketo/browse/software/wisp.org?rev=31bb4a1fb49c#L1 #+INCLUDE: ../org-templates/level-1.org This pulls the actual content of the file: https://hg.sr.ht/~arnebab/draketo/browse/org-templates/level-1.org?rev=31bb4a1fb49c There is also a setupfile at the bottom: https://hg.sr.ht/~arnebab/draketo/browse/software/wisp.org?rev=31bb4a1fb49c#L1632 #+setupfile: ../org-templates/level-1-software.org This only pulls the changed org-mode settings: https://hg.sr.ht/~arnebab/draketo/browse/org-templates/level-1-software.org?rev=31bb4a1fb49c #+HTML_HEAD_EXTRA: <style type="text/css">.tab-software {background-color: #fffbf8 !important; opacity: 1.0; box-shadow: 0px -5px 7px -2px gray;}</style> #+HTML_LINK_UP: ../software.html > 3. Another friend told me that .sty templates were the best way. I don’t yet have sufficient hold of that. To date I’m using the memoir-class to get the styling I need — where I use styling (that’s not the draketo site, but the ews document). > 5. Also we can see this intricate transformation of a LaTeX > template into orgmode. How to Migrate LaTeX Template into > org-mode > <https://github.com/Literate-DevOps/literate-programming-tutorials/blob/master/how-to/00-convert-latex-template-into-org-mode-template/how-to-migrate-latex-template-into-org-mode.org#how-to-migrate-latex-template-into-org-mode> > 6. ... > > > b. I think that in a good integration, every character shown on > orgmode should be exported into the PDF output. For example "CENTRE > LINE SYMBOL": ℄ > How can this integration be done? Have a look at \DeclareUnicodeCharacter: https://www.draketo.de/light/english/emacs/char-not-setup-latex #+latex_header: \usepackage{uniinput} See https://git.neo-layout.org/neo/neo-layout/src/commit/705fac448a0d0562e4e1bc16bf0b6cadbe235771/latex/Standard-LaTeX/uniinput.ins https://git.neo-layout.org/neo/neo-layout/src/commit/705fac448a0d0562e4e1bc16bf0b6cadbe235771/latex/Standard-LaTeX/uniinput.dtx Best wishes, Arne -- Unpolitisch sein heißt politisch sein ohne es zu merken [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-03 9:31 First steps exporting to tex Ypo 2021-04-03 10:15 ` Martin Steffen 2021-04-03 10:43 ` Dr. Arne Babenhauserheide @ 2021-04-03 12:10 ` Juan Manuel Macías 2021-04-03 13:31 ` Tim Cross 3 siblings, 0 replies; 13+ messages in thread From: Juan Manuel Macías @ 2021-04-03 12:10 UTC (permalink / raw) To: Ypo; +Cc: orgmode Hi Ypo, I think that, as a starting point, the concepts that belong to Org and those that belong to LaTeX should be separated. Ypo writes: > [...] > 2 template.tex -> this could be added to the SETUPFILE: > #+LATEX_HEADER: \input{template.tex}. But it seems to have no effect > on the PDF output. BTW, I can't use emacs HOME path (~/) in the > input header, like \input{~//export//template.tex}. The keyword #+LaTeX_Header pass literal LaTeX commands in a single line to thepreamble. The LaTeX \input{...} command should follow the path of the file you want include, but I see that you are indicating the path with a double //. The correct way is \input{~/export/template.tex} > 3 Another friend told me that .sty templates were the best way. A *.sty file is what is known in LaTeX jargon as a "package", and it would come to be the equivalent of what is a *.el file in Emacs, /mutatis mutandis/. In a sty file you can put whatever you want, but a different syntax must be used and these files are subject to a series of good practices. Therefore, a sty file is more indicated to introduce 'heavy' code that you want reuse in other documents (defined commands and macros, etc.). In short, what comes to be a package ;-) At the user level, and unless you want to write your own package (see: https://www.overleaf.com/learn/latex/Writing_your_own_package), it is almost never necessary. > 4 I see some people that create customized LaTeX classes and add the > desired class to the orgmode buffer. Great care must be taken here. One thing is a LaTeX class, which is something laborious and complex to write, and another thing what Org understands for a LaTeX class :-) Classen and the class concept are a essential component for LaTeX, as a class is the first thing you must declare in a preamble with the command \documentclass{}. There are the standard classes (article, book and others) and other ones, more specialized. A class changes globally the behavior of the document and all LaTeX commands as \section, \subsection and many more, and add its own commands. A 'LaTeX class' for Org is a light translation of the above. It is actually "what type of LaTeX document you want to get". You can easily define your own LaTeX 'classes' for Org documents. For example: I have an 'empty class', to be able to add the entire preamble, without Org charging me anything before the \begin{document} (add-to-list 'org-latex-classes '("empty" "[NO-DEFAULT-PACKAGES] [PACKAGES] [EXTRA]" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) And I have in my ~/.emacs: (setq org-latex-default-class "empty") (setq org-latex-default-packages-alist nil) (setq org-latex-packages-alist nil) (setq org-latex-hyperref-template nil) My advice, as has already been commented here, is that you get familiar with LaTeX for a while, and then see how you can fit LaTeX in your Org workflow, if that's more productive for you. Best regards, Juan Manuel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-03 9:31 First steps exporting to tex Ypo ` (2 preceding siblings ...) 2021-04-03 12:10 ` Juan Manuel Macías @ 2021-04-03 13:31 ` Tim Cross 2021-04-03 16:55 ` Diego Zamboni 3 siblings, 1 reply; 13+ messages in thread From: Tim Cross @ 2021-04-03 13:31 UTC (permalink / raw) To: emacs-orgmode Ypo <ypuntot@gmail.com> writes: > Good morning > > After reading your interesting advices, I've decided to start my path through LaTeX. I have been some hours trying to start, with little result, but I > hope that once established a *workflow* the results will come and the new invested time will be directed just to get better and better results. > > My doubts: > > a. As first step for my workflow, it seems convenient to use a "template" with the LaTeX preambles. So maybe the many existing LaTeX > templates can be used quickly with orgmode. I found several options and opinions. Which one is the best way? > > 1 #+SETUPFILE: template.setup -> doesn't seem the ideal way, because the template.setup file must be modified adding #+latex_class to each of > the lines. > 2 template.tex -> this could be added to the SETUPFILE: #+LATEX_HEADER: \input{template.tex}. But it seems to have no effect on the PDF > output. BTW, I can't use emacs HOME path (~/) in the input header, like \input{~//export//template.tex}. This is my template.tex file content: > \usepackage{fancyhdr} > \thispagestyle{fancy} > \lhead{\includegraphics[width=4cm]{jpg.jpg}} > \rhead{Student Name: Name\\ > Student ID: 1234\\ > Course: IDB 601 (Fall 2020)} > 3 Another friend told me that .sty templates were the best way. > 4 I see some people that create customized LaTeX classes and add the desired class to the orgmode buffer. > 5 Also we can see this intricate transformation of a LaTeX template into orgmode. How to Migrate LaTeX Template into org-mode > 6 ... > > b. I think that in a good integration, every character shown on orgmode should be exported into the PDF output. For example "CENTRE LINE > SYMBOL": ℄ > How can this integration be done? > > I have more doubts, but I will keep reading and trying to solve them > > Best regards Why do you think you need any of this for your 'first steps'. Start by just writing your org file and exporting it to latex or pdf. Then, once you have your first document, see what you think needs changing and come back and ask advice on what you need to do to make the changes you want. In your first document, don't use any latex commands, header options or anything else - just write your document using standard org mode. Org already sets up a reasonable starting default. Once you know what the default is, then we can discuss what you may need to change. For many documents, you may not need to change much at all and you may not need any templates - for example, you will likely want to change the margin sizes (this is a common request) or you may want to see what some of the other 'standard' latex document classes are like. All of this can be achieved with just minor configuration of org mode. The org export to latex only needs to be as complicated as you need it to be. Org has variables which can be used to add/remove things from the preamble and once you have those configured, you don't have to put anything in the org file itself. Start simple and add as you find a need rather than try to start with something complex which might not be necessary. -- Tim Cross ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-03 13:31 ` Tim Cross @ 2021-04-03 16:55 ` Diego Zamboni 2021-04-03 17:07 ` William Denton 0 siblings, 1 reply; 13+ messages in thread From: Diego Zamboni @ 2021-04-03 16:55 UTC (permalink / raw) To: Tim Cross; +Cc: Org-mode [-- Attachment #1: Type: text/plain, Size: 1083 bytes --] > > > The org export to latex only needs to be as complicated as you need it > to be. Org has variables which can be used to add/remove things from the > preamble and once you have those configured, you don't have to put > anything in the org file itself. Start simple and add as you find a need > rather than try to start with something complex which might not be > necessary. > I fully agree with Tim here - don't make things more complicated than necessary! Start with standard Org and the standard export, see how it works and adjust from there. At the far end you can end up with a custom exporter based on ox-latex, but which gives special meanings to certain elements - this is what I ended up with for my CV in ox-awesomecv ( https://gitlab.com/zzamboni/org-cv/-/tree/awesomecv), but this was after a lot of experimentation and playing with the default Org exporters. Ultimately it depends on what type of document you are producing, so there can be no single all-encompassing solution. But really, start simple. Org and LaTeX are both complex enough as they are. --Diego [-- Attachment #2: Type: text/html, Size: 1446 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-03 16:55 ` Diego Zamboni @ 2021-04-03 17:07 ` William Denton 2021-04-03 17:49 ` Juan Manuel Macías 0 siblings, 1 reply; 13+ messages in thread From: William Denton @ 2021-04-03 17:07 UTC (permalink / raw) To: Org-mode [-- Attachment #1: Type: text/plain, Size: 1107 bytes --] On 3 April 2021, Diego Zamboni wrote: > I fully agree with Tim here - don't make things more complicated than > necessary! Start with standard Org and the standard export, see how it > works and adjust from there. It's amazing what the combination of Org and LaTeX can do without any extra customization. Now, it takes a good deal of skill to get them installed and know how to use them. You can't just point a Google Drive user to a link and say, "Install this, it's easy." But once you have them, you can make a simple Org document with a TITLE, a NAME, a couple of headings, a few subheadings, some paragraphs—all just plain text, nothing fancy—and then you export it to PDF and it looks like a published book or journal article! When I first started doing that it amazed me. I suppose I'm used to it now, but it is wonderful. Bill -- William Denton :: Toronto, Canada --- Listening to Art: https://listeningtoart.org/ https://www.miskatonic.org/ --- GHG.EARTH: https://ghg.earth/ Caveat lector. --- STAPLR: https://staplr.org/ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-03 17:07 ` William Denton @ 2021-04-03 17:49 ` Juan Manuel Macías 2021-04-03 18:36 ` Jean Louis 0 siblings, 1 reply; 13+ messages in thread From: Juan Manuel Macías @ 2021-04-03 17:49 UTC (permalink / raw) To: William Denton; +Cc: orgmode William Denton writes: > [...] and it looks like a published book or journal article! Something similar I thought, in my student days, when at the early '90 I saw a document printed in word perfect, just because it had a book typeface (Times Roman), footnotes and many more fancy stuff. It looked /almost/ like a book. With LaTeX something similar happens for the user who is not trained in professional typesetting. TeX as a typographic engine makes an excellent work at the 'physical' level, but as we say in Spain, the trees do not let us see the forest. A LaTeX document produced from standard way will need (likely) a lot of fine tuning, and a solid typographic culture acquired by those who check it out. On the other hand, I think that if an Org user is going to export often to LaTeX, he should know LaTeX reasonably well. I do not say that he become a LaTeXpert, but at least the user should have clear which concepts are from Org and which concepts are from LaTeX. The LaTeX packages you may need as you want to do more complex things, and how to use those packages. Etc. On the Org side there are many and excellent resources to control the export process. But in any translation process you have to know the source language (Org) and what can be expressed in the final language (LaTeX) and how. And the the same happens if the output is HTML, Epub or whatever. I think Org is an excellent tool, full of possibilities (maybe a lot of them don't explored yet) and wonderful things, but it is not magic, although its logo is an unicorn ;-) Best regards, Juan Manuel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-03 17:49 ` Juan Manuel Macías @ 2021-04-03 18:36 ` Jean Louis 2021-04-03 20:46 ` Juan Manuel Macías 0 siblings, 1 reply; 13+ messages in thread From: Jean Louis @ 2021-04-03 18:36 UTC (permalink / raw) To: Juan Manuel Macías; +Cc: William Denton, orgmode * Juan Manuel Macías <maciaschain@posteo.net> [2021-04-03 20:51]: > William Denton writes: > > > [...] and it looks like a published book or journal article! > > Something similar I thought, in my student days, when at the early '90 I > saw a document printed in word perfect, just because it had a book > typeface (Times Roman), footnotes and many more fancy stuff. It looked > /almost/ like a book. > > With LaTeX something similar happens for the user who is not trained in > professional typesetting. TeX as a typographic engine makes an excellent > work at the 'physical' level, but as we say in Spain, the trees do > not let us see the forest. A LaTeX document produced from standard way > will need (likely) a lot of fine tuning, and a solid typographic culture > acquired by those who check it out. TeX and LaTeX must be prime chose who need professional typesetting. Org mode offers limited insight into powers of LaTeX. Org offers quick document creation by using LaTeX and LaTeX may be used to extend Org. It cannot satisfy all people by default. Each person may need customization. Do you have a specific remark on what would be major wrong with the default LaTeX export from your viewpoint? For me, I like larger letters and more space on paper. I find it narrow and not enough legible. But that is not typographically technical comment. > On the other hand, I think that if an Org user is going to export often > to LaTeX, he should know LaTeX reasonably well. Opposite may be said as well. Exporting to LaTeX may be just a side effect in order to create a PDF file. Org user may not need nothing about LaTeX. Even if exporting is often, Org user need not know nothing about LaTeX. Other converter like `pandoc' also offer conversion to LaTeX and user need not know nothing about it. That is the beauty. It does not help the professional though, as professional must know all the specific details. > I do not say that he > become a LaTeXpert, but at least the user should have clear which > concepts are from Org and which concepts are from LaTeX. The LaTeX > packages you may need as you want to do more complex things, and how to > use those packages. Etc. On the Org side there are many and excellent > resources to control the export process. But in any translation process > you have to know the source language (Org) and what can be expressed in > the final language (LaTeX) and how. What you describe relates to advanced LaTeX users who need good quality or who have special needs. Average Org user who knows that Org can export to LaTeX will rather use it as side effect in order to get PDF file. > And the the same happens if the > output is HTML, Epub or whatever. I think Org is an excellent tool, full > of possibilities (maybe a lot of them don't explored yet) and wonderful > things, but it is not magic, although its logo is an unicorn ;-) It is not magic. Yet integration provided by developers brought it to point that simple Org file, text file, can be quickly converted into nice PDF documents. It does not matter if files are edited remotely on mobile devices by using any kind of editor, once file is processed by Emacs and exported it becomes universally accepted. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns Sign an open letter in support of Richard M. Stallman https://rms-support-letter.github.io/ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: First steps exporting to tex 2021-04-03 18:36 ` Jean Louis @ 2021-04-03 20:46 ` Juan Manuel Macías 0 siblings, 0 replies; 13+ messages in thread From: Juan Manuel Macías @ 2021-04-03 20:46 UTC (permalink / raw) To: Jean Louis; +Cc: orgmode Hi Jean Louis, Jean Louis writes: > Do you have a specific remark on what would be major wrong with the > default LaTeX export from your viewpoint? > > For me, I like larger letters and more space on paper. I find it > narrow and not enough legible. But that is not typographically > technical comment. It would be too long to comment here... The flaws of a typical LaTeX ouput could be divided into formal defects and orthotypographic defects. It's not LaTeX's fault (actually TeX and LaTeX represent the greatest advance in typography since Gutenberg); the problem is that a book needs a lot of fixes before reaching the printing press. And everything also depends on each type of book and each book in particular: typography is the science of exceptions. Luckily, TeX offers a lot of resources and packages for fine tuning, and LuaTeX even more. I invite you to read the documentation of these two packages: impnattypo (https://www.ctan.org/pkg/impnattypo) and lua-typo (https://www.ctan.org/pkg/lua-typo) where a part of these issues is discussed. Anyway, I am not saying that all average users should become experts in typesetting. I just wanted emphasize that LaTeX is /just/ the tool (like linotypes and monotypes were in his time) but LaTeX does not do everything, although his standard output is of very good quality compared to other systems. But that is so because TeX works very well, it justifies very well the paragraphs, etc. > [...] > Org user may not need nothing about LaTeX. Even if exporting is often, > Org user need not know nothing about LaTeX. Other converter like > `pandoc' also offer conversion to LaTeX and user need not know nothing > about it. An average Org user does not need to know almost anything about LaTeX if what he wants is just to produce /simple/ PDF documents. I agree. But when he wants to do more complex things, he will need to know how to do them in LaTeX and how to do them also from Org (in case he wants to continue working in Org: even I work in Org when I do professional typesetting, because for me Org is, among other things, the /almost/ perfect interface for LaTeX). If Org users get covered eyes with LaTeX and LaTeX processes, then they will end up filling the Org forums with questions that should rather be asked in the LaTeX forums (I am not saying that it should not be asked here, but if no one knows anything about LaTeX, no one could give answers to problems that are related to LaTeX and not to Org). Let's imagine this hypothetical case: User X enters the Org forum Z and asks: "How can I export to PDF with a two colums layout?" The correct answer is on the LaTeX side: "you have to use the multicol package (and read the package documentation, if fine-tuning is required)", Once the LaTeX oracle has given its answer, the Org oracle will declare that a multicols environment can be created in Org with a special block: #+begin_src org ,#+ATTR_LaTeX: :options {2} ,#+begin_multicols ............. ,#+end_multicols #+end_src Best regards, Juan Manuel ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2021-04-05 5:27 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2021-04-03 9:31 First steps exporting to tex Ypo 2021-04-03 10:15 ` Martin Steffen 2021-04-04 11:04 ` Ypo 2021-04-04 11:36 ` Juan Manuel Macías 2021-04-05 5:05 ` Tim Cross 2021-04-03 10:43 ` Dr. Arne Babenhauserheide 2021-04-03 12:10 ` Juan Manuel Macías 2021-04-03 13:31 ` Tim Cross 2021-04-03 16:55 ` Diego Zamboni 2021-04-03 17:07 ` William Denton 2021-04-03 17:49 ` Juan Manuel Macías 2021-04-03 18:36 ` Jean Louis 2021-04-03 20:46 ` Juan Manuel Macías
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).