Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of backslash in plain fields #4

Open
tomtom opened this issue Mar 5, 2017 · 1 comment
Open

Handling of backslash in plain fields #4

tomtom opened this issue Mar 5, 2017 · 1 comment

Comments

@tomtom
Copy link

tomtom commented Mar 5, 2017

When I import plain fields, \% gets imported verbatim. I'd have to just use %, which causes problems when typesetting the tex file via latex.

Are users supposed to use (1) \% or (2) % in plain fields? If 1, the import algorthm should remove the backslash. If 2, the manual should give some guidelines how users can typeset the tex file.

It would be nice, if the manual included some sort of template with all environments and commands defined so that the file can be imported and typeset via latex. (Or if the export included definitions for such environments and commands.)

Anyway, many thanks for this great addon.

Regards

@TentativeConvert
Copy link
Owner

To be honest, I'm positively surprised the add-on does anything even half-sensible with % used in a field. And I'm not quite sure what it ideally should do.

My initial impuls would be that users should expect (2), i.e. just %, to be imported as % in plain fields. If I understand correctly, this is indeed how the add-on currently behaves. To get things displayed correctly when running pdf-latex on your file, you could try to (re)define the \xplain fields such that the contents are wrapped in a latex verbatim environment. Something like:

\newcommand{\xplain}[1]{\begin{verbatim}#1\end{verbatim}}

(I haven't tested this.)

If you're mainly interested in importing "plain text", then you're probably better off without this add-on. In that case, it should be easier to type-set notes in a csv-file and use Anki's built-in importer. Anki's internal format is HTML, and type-setting plain text in LaTeX in order to later convert it to HTML seems a very round-about routine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants