Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

LaTeX encoder#183

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Quintus wants to merge1 commit intorubychan:master
base:master
Choose a base branch
Loading
fromQuintus:latex-encoder
Open

Conversation

@Quintus
Copy link

Hi,

I was wondering why CodeRay has no LaTeX encoder, so I made one :-). I did a few tests with it, and it seemed ok, but I’ve not yet thrown really obfuscated code on it.

The large string in the file is a LaTeX preamble snippet that needs to be included (e.g. by\include). This preamble snippet allows you to customize the coloring of the result code. Currently, it uses mostly plain black (thus the highlighting isn’t that detailed), but it allows for nearly the same amount of customisation as CodeRay’s CSS classes for the HTML highlighter do.

The highlighter supports line numbers and whitespace visualisation.

I recommend to use this with LuaLaTeX. I’ve tested it with PDFLaTeX though, and as long as you have plain old ASCII sourcecode files (including comments!), it works with it. Theshow_whitespace option definitely requires a Unicode-aware TeX engine such as Luatex as it uses Unicode characters for replacement.

This probably implements#50. I’ve written this completely from scratch, though.

Vale,
Quintus

@Quintus
Copy link
Author

Yay, this breaks GitHub’s highlighter completely. A shame they aren’t using CodeRay! 🐸

Vale,
Quintus

@kornykorny added this to the1.2 milestoneApr 21, 2015
@kornykorny self-assigned thisApr 21, 2015
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we actually need this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Emacs adds this line automatically when it discovers UTF-8 characters in the source file (even if they’re in the comments). The line is not “needed” in that sense thus.

Vale,
Quintus

@korny
Copy link
Member

Wow, this is awesome! I'm not using LaTeX anymore, so I would need a bit of time to test it. Can we add some tests? Preferrably even one that actually runs the output through tex…

@kornykorny mentioned this pull requestApr 21, 2015
@Quintus
Copy link
Author

I think I should be able to add some tests, yes. It will take me some time, though, because I’m busy with different things right now.

Vale,
Quintus

@Quintus
Copy link
Author

@korny is that correct that you invited me to@rubychan? I’m just doing PRs on CodeRay occasionally, but I can’t maintain it as such.https://github.com/Secretchronicles/TSC eats up most of my free time.

Vale,
Quintus

@korny
Copy link
Member

Yes I did :-) You earned it. You don't have to use it, but it feels right to me that you have a commit bit, too.

On 22.04.2015, at 09:30, Marvin Gülkernotifications@github.com wrote:

@korny is that correct that you invited me to@rubychan?

@Quintus
Copy link
Author

Ok thank you! I feel honoured.

Vale,
Quintus

@sieversMartin
Copy link

Why hasn't this been merged? Are there other ways to display LaTeX code within Coderay?

@Quintus
Copy link
Author

I suppose it hasn't been merged because neither me nor korny are actively working on CodeRay...

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

@kornykorny

Labels

Projects

None yet

Milestone

1.2

Development

Successfully merging this pull request may close these issues.

3 participants

@Quintus@korny@sieversMartin

[8]ページ先頭

©2009-2025 Movatter.jp