New hot document: Tips & Tricks

In txt2tags, you ever wondered how to:

  • Make strike, subscript or superscript text?
  • Insert the ALT text for images?
  • Create a custom DIV or SPAN?
  • Make a line break <BR>?
  • Load extra LaTeX packages?
  • Make colored code snippets?

Fear don’t. Txt2tags Tips & Tricks!

Leave a comment to share your own tip or suggest a new!

11 Responses to “New hot document: Tips & Tricks”

  1. eljunior Says:

    very useful! :-)

    typo found: section “8. Config Overview” you wrote “thier” meaning “tier”… ;-)

  2. Aurélio Jargas Says:

    Ouch! Fixed, thanks :)

  3. bobuse Says:

    Hi Aurélio,

    I prefer to use pgf to incude pictures in my latex documents, so these q&d achieve the conversion :
    %!postproc(tex): ‘(\usepackage{amsfonts,graphicx,url})’ ‘\1\n\usepackage{pgf}’
    %!postproc(tex): ‘includegraphics{(.*).png}’ ‘pgfimage[width=\linewidth]{\1}’

    PS: I don’t forgot you, I will soonly publish my ktxt2tags app. But I’m a bit busy currently :-)

  4. Aurélio Jargas Says:

    Hi bobuse,

    The first postproc you can change by a single:

    %!style(tex): pgf

    Ok, tell me any news on the K world :)

  5. bobuse Says:

    Thank you for this tip ;-)

  6. Ruben.pt Says:

    I have been trying very hard to do something like

    %!preproc: ‘DEF(.*)DEF’ [\1 http://www.google.com/search?q=define:\1]

    But it just doesn’t work and I don’t know why.
    Could you explain why? It break the web or don’t add the \1 on the link (I tried many things).
    Why I can do on preproc ?

    Finally I got success on this way:
    %!postproc(html): ‘–([^ ].*?)–’ <a HREF=”http://www.google.com/search?q=define:1″ rel=”nofollow”>\1</a>

    So –css– is converted to a link to google define css
    I think is useful.

    Cumprimentos.

  7. Aurélio Jargas Says:

    Hello Ruben,

    The problem is that the “:” char is not recognized by txt2tags as valid for URLs, inside the form data (after the “?”). If you just change from PreProc to PostProc on your first rule, it will work:

    %!postproc(html): 'DEF(.*?)DEF' '<a href="\1">\1</a>'

    But your second filter is fine.

  8. Alex Says:

    Thank You

  9. Claude Hiebel Says:

    Hello Aurelio !
    no need for new translation ?

    I suggest a tip for html generation pages.
    I worked in iso8859-1 (in use in France) for my website.
    Now installing Debian Etch : all is in UTF8. This is fully incompatible for my website.
    People working with 2 different codes depending of their OS
    So now I generate ´ ù aso with a translation table :
    a line for each character :
    %!preproc(html) : “è” “&egrave”
    I already need another command
    %!postproc(html) : “&” “&”
    because I got &egrave; without it.
    And I put these commands in the RC file.

    Seems to work

    Bye
    Claude

  10. Aurélio Jargas Says:

    Hello Claude!

    In this case, you must use the %!encoding setting on every document, reflecting the source file encoding (ISO or UTF).

    Nice to see you here

  11. G. Grothendieck Says:

    Remove latex title and title page.

    –no-header removes the title but then its not a valid self
    contained latex file any more. Leaving the first line of your
    input file blank and putting this on the second line does it:

    %!postproc(tex): \\maketitle %\maketitle

    Given the minimalist philosophy of txt2tags I think this should
    be easier to do, e.g. maybe: txt2tags –no-title -t tex input.t2t

Leave a Reply