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

Write id for code block to label attr in latex when listing is used #961

Merged
merged 1 commit into from Aug 26, 2013

Conversation

Projects
None yet
2 participants
@nougad
Copy link
Contributor

nougad commented Aug 22, 2013

The code:

~~~{#test}
asdf
~~~

gets compiled to html:

<pre id="test">
asdf
</pre>

So it is possible to link to the identifier test

But this doesn't happen on latex

When using the listings package (--listings) it is possible to set the
identifier using the label=test property:

\begin{lstlisting}[label=id]
hi
\end{lstlisting}

And this is exactly what this patch is doing.

Modified LaTeX Reader/Writer and added tests for this.

Florian Eitel
Write id for code block to label attr in latex when listing is used
The code:

    ~~~{#test}
    asdf
    ~~~

gets compiled to html:

    <pre id="test">
    asdf
    </pre>

So it is possible to link to the identifier `test`

But this doesn't happen on latex

When using the listings package (`--listings`) it is possible to set the
identifier using the `label=test` property:

    \begin{lstlisting}[label=id]
    hi
    \end{lstlisting}

And this is exactly what this patch is doing.

Modified LaTeX Reader/Writer and added tests for this.
@jgm

This comment has been minimized.

Copy link

jgm commented on 5f09cf7 Aug 26, 2013

Nice patch, tests much appreciated!

jgm added a commit that referenced this pull request Aug 26, 2013

Merge pull request #961 from nougad/add_latex_listings_label
Write id for code block to label attr in latex when listing is used

@jgm jgm merged commit e7a4bcc into jgm:master Aug 26, 2013

1 check passed

default The Travis CI build passed
Details

@nougad nougad deleted the nougad:add_latex_listings_label branch Aug 26, 2013

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