Coder Social home page Coder Social logo

Comments (15)

jxxcarlson avatar jxxcarlson commented on July 30, 2024

Thanks! Will be able to look at it in about an hour. Keep those bug reports coming!!

On Jun 24, 2015, at 10:27 AM, Eduardo de Santana Medeiros Alexandre [email protected] wrote:

I'm having a problem with monospace. I'm not a latex expect, but when I try to compile a document with monospace I end up with an error.

Let's see how it is implemented:

$ echo "monospace italic bold" | asciidoctor-latex -a header=no -
The result was:

{\tt monospace} \emph{italic} \textbf{bold}
I propose to change {\tt monospace} to \texttt{monospace} (works for me).

The \texttt is documented at https://en.wikibooks.org/wiki/LaTeX/Fonts https://en.wikibooks.org/wiki/LaTeX/Fonts

Reply to this email directly or view it on GitHub #36.

from asciidoctor-latex.

jxxcarlson avatar jxxcarlson commented on July 30, 2024

Hi there!

I think that your difficulty has to do with the backlashes, not
with \tt or \textt per se. The following works:

monospace italic bold => {\tt monospace} \emph{italic} \textbf{bold}

but this (for example)

\monospace italic bold =>{\tt \monospace} \emph{italic} \textbf{bold}

won’t work because for TeX, backslash has a special meaning. That is
why you are getting errors.

If you have things
like \foo \bar in your source text, then you can do something like this:


\monospace is a macro

Use four dashes above and below. This will be translated into valid tex.
Here we are using what is called a verbatim macro package for TeX.
Asciidoctor-LaTeX knows how to translate the above into valid TeX.

If you need it in-line, I will need to do a little work to add this feature.

Best regards,

Jim

http://noteshare.io http://noteshare.io/
http://home.noteshareblog.io http://home.noteshareblog.io/

On Jun 24, 2015, at 10:27 AM, Eduardo de Santana Medeiros Alexandre [email protected] wrote:

I'm having a problem with monospace. I'm not a latex expect, but when I try to compile a document with monospace I end up with an error.

Let's see how it is implemented:

$ echo "monospace italic bold" | asciidoctor-latex -a header=no -
The result was:

{\tt monospace} \emph{italic} \textbf{bold}
I propose to change {\tt monospace} to \texttt{monospace} (works for me).

The \texttt is documented at https://en.wikibooks.org/wiki/LaTeX/Fonts https://en.wikibooks.org/wiki/LaTeX/Fonts

Reply to this email directly or view it on GitHub #36.

from asciidoctor-latex.

edusantana avatar edusantana commented on July 30, 2024

No, I put the backlash in the echo command because if I leave the ` it will be interpreted as a bash command:

$ echo "`monospace`"
monospace: command not found

from asciidoctor-latex.

jxxcarlson avatar jxxcarlson commented on July 30, 2024

OK, I agree that this works as stated - no errors. What is it that is giving you errors?

When I run {\tt whatever} and compare it to \texttt{whatever}, the outputs look the same to me.

On Jun 25, 2015, at 8:40 AM, Eduardo de Santana Medeiros Alexandre [email protected] wrote:

No, I put the backlash in the echo command because if I leave the ` it will be interpreted as a bash command:

$ echo "monospace"
monospace: command not found

Reply to this email directly or view it on GitHub #36 (comment).

from asciidoctor-latex.

edusantana avatar edusantana commented on July 30, 2024
$ cat rascunho.adoc
== my Chapter

`monospace`

$ cat rascunho.adoc | asciidoctor-latex -b latex -d book -a header=no -a numbered -
\hypertarget{_my_chapter}{\chapter{my Chapter}}
{\tt monospace}

So I copy this text, and put inside an template with this packages:

\usepackage{lmodern}            % Usa a fonte Latin Modern
\usepackage[T1]{fontenc}        % Selecao de codigos de fonte.
\usepackage[utf8]{inputenc}     % Codificacao do documento (conversão automática dos acentos)
\usepackage{lastpage}           % Usado pela Ficha catalográfica
\usepackage{indentfirst}        % Indenta o primeiro parágrafo de cada seção.
\usepackage{color}              % Controle das cores
\usepackage{graphicx}           % Inclusão de gráficos
\usepackage{microtype}          % para melhorias de justificação

When I compile it with pdflatex:

! Class memoir Error: Font command \tt is not supported.

I see now that asciidoc-latex was made to work with xelatex:

$ asciidoctor-latex -b latex rascunho.adoc 
$ pdflatex rascunho.tex 
(....)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Fatal fontspec error: "cannot-use-pdftex"
! 
! The fontspec package requires either XeTeX or LuaTeX to function.
! 
! You must change your typesetting engine to, e.g., "xelatex" or "lualatex"
! instead of plain "latex" or "pdflatex".
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................

$ xelatex rascunho.tex 
(...)
Output written on rascunho.pdf (1 page).

Since I was using with header=no, the produced code was made for xelatex', not working withpdflatex`.

I think that the {\tt} command is not inside of these packages.

When I change to use with texttt my tex compiles with pdflatex,

from asciidoctor-latex.

edusantana avatar edusantana commented on July 30, 2024

Here's the complete file:
https://gist.github.com/edusantana/341c947dcffa9da4c27d

The error:

! Class memoir Error: Font command \tt is not supported.

See the memoir class documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.445 Testing {\tt
                   monospace}.
? 
! Emergency stop.
 ...                                              

l.445 Testing {\tt
                   monospace}.
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on document.log.

When I change the \tt to \texttt it works.

from asciidoctor-latex.

edusantana avatar edusantana commented on July 30, 2024

The microfile that you wrote with the class article ( at #37 ) , worked. It compiled with tt and texttt, both became monospace. I will test with memoir class.

from asciidoctor-latex.

edusantana avatar edusantana commented on July 30, 2024

Yes, the problem is with the memoir class:

\documentclass[11pt, oneside]{memoir} 
\begin{document}

{\tt monospace with tt}

\texttt{monospace with texttt}
\end{document}

This one doesn't compile.

from asciidoctor-latex.

edusantana avatar edusantana commented on July 30, 2024

I have tested how pandoc does it, it uses \texttt:

$ cat pandoc.md 
`monospace with pandoc` *italic* **bold**
$ pandoc pandoc.md -t latex
\texttt{monospace with pandoc} \emph{italic} \textbf{bold}

from asciidoctor-latex.

jxxcarlson avatar jxxcarlson commented on July 30, 2024

Thanks, I’ll change to \textt later today

On Jun 26, 2015, at 7:34 AM, Eduardo de Santana Medeiros Alexandre [email protected] wrote:

I have tested how pandoc http://pandoc.org/getting-started.html does it, it uses \texttt:

$ cat pandoc.md
monospace with pandoc italic bold
$ pandoc pandoc.md -t latex
\texttt{monospace with pandoc} \emph{italic} \textbf{bold}

Reply to this email directly or view it on GitHub #36 (comment).

from asciidoctor-latex.

jxxcarlson avatar jxxcarlson commented on July 30, 2024

I’ve changed to \textt — could you
test? I am having some system
problems and can’t be sure that all is OK
until I get them fixed.

On Jun 26, 2015, at 7:34 AM, Eduardo de Santana Medeiros Alexandre [email protected] wrote:

I have tested how pandoc http://pandoc.org/getting-started.html does it, it uses \texttt:

$ cat pandoc.md
monospace with pandoc italic bold
$ pandoc pandoc.md -t latex
\texttt{monospace with pandoc} \emph{italic} \textbf{bold}

Reply to this email directly or view it on GitHub #36 (comment).

from asciidoctor-latex.

edusantana avatar edusantana commented on July 30, 2024
$ echo "\`monospace\` _italic_ *bold*" | asciidoctor-latex -a header=no -

the output was:

\textt{ monospace} \emph{italic} \textbf{bold}

I think there's an extra space: textt{ monospace} it should be -> textt{monospace}

from asciidoctor-latex.

jxxcarlson avatar jxxcarlson commented on July 30, 2024

Should be ok now -- no extra space. Again, could you double check?

Thanks so much for bringing up this problem -- sorry it took so much back and forth.
Please let me know if there are further problems .. the converter is still beta software

from asciidoctor-latex.

edusantana avatar edusantana commented on July 30, 2024

It's okay now. thanks!
May I suggest put the number of the issue in the commit message? This way when can track it more easy...

from asciidoctor-latex.

johnyf avatar johnyf commented on July 30, 2024

For those led here by searching about the memoir package error regarding \tt (mentioned above), the memoir class does not define old font commands (LaTeX 2.09) by default. These commands can be activated by explicitly passing the class option oldfontcommands to memoir, as described in this answer.

from asciidoctor-latex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.