Added Code Block adornment and a more versatile acronym and glossary handling for LaTeX#116
Open
rmrnc wants to merge 2 commits intofletcher:masterfrom
rmrnc:master
Open
Added Code Block adornment and a more versatile acronym and glossary handling for LaTeX#116rmrnc wants to merge 2 commits intofletcher:masterfrom rmrnc:master
rmrnc wants to merge 2 commits intofletcher:masterfrom
rmrnc:master
Conversation
added 2 commits
May 4, 2015 16:51
>>> \newacro{RFC}[RFC]{Request for Comment}
can be use in a text as
>>> See RFC 1234 for more information. Multiple RFCs are covering security protocols.
resulting in
>>> See \ac{RFC} for more information. Multiple \acp{RFC} are covering security protocols
In order to achieve this, find_abbreviations() [in writer.c] had to "partially" match an abbreviation and pass a detected plural along the corresponding node->key. Thus, a new node key type ABBRPLURAL has been introduced [in libMultiMarkdown.h] and propagated in all print_*_node() functions.
As the partial abbreviation lookup necessitated frequent calls of strlen() performance optimization dictated to extend the node structure by adding length element instead. Visible repercussions are: a strdup() replacement strdup_ext(), modifications of the trim_*() functions, and alteration of all node creations and node copies.
================================================================================================================
Added support for the LaTeX glossaries package by Nicola Talbot (see http://www.ctan.org/pkg/glossaries).
For serious documents this package allows a better acronym and glossary management. Due to its preferred workflow which requires a separate makeidx call, it seems not possible to circumvent the introduced code changes by using TeX's "\renewcommand" for MMD's supported "\ac" and "\newacro" commands. By specifying the metadata key
>>> LaTeX Acronym Package: [acronym | glossaries ]
the preferred acronym package can be selected. Omitting the "LaTeX Acronym Package" key selects, of course, MMD's default behavior, i.e., "acronym package" support.
For this feature the METAKEY, ABBREVIATION, and ABBR switch-cases in print_latex_node() [in latex.c] and the scratch_pad struct [in parser.h] have been modified. An additional enum (latex_acronym_package) has been introduced. The additional scratch_pad element latex_acronym_config is stored in a compact way.
================================================================================================================
Added support for configuring an acronym's label creation
MMD current preference in creating labels is to avoid duplicate acronym keys by concatenating the key with the acronym's text. This makes manual referencing of acronym labels very difficult. Unfortunately, manual acronym referencing in unavoidable, when longer documents are written, e.g., intentionally selecting the full acronym text after its first mentioning, using acronyms in "HTML comment escaped" LaTeX blocks like abstracts, etc.
By specifying the metadata key
>>> LaTeX Acronym Label Style: [Abbreviation | Full]
the preferred acronym label creation style can be selected. Omitting the "LaTeX Acronym Label style" key selects, of course, MMD's default behavior, i.e., "full" label creation.
For this feature the METAKEY, ABBREVIATION, and ABBR switch-cases in print_latex_node() [in latex.c] and the scratch_pad struct [in parser.h] have been modified. An additional enum (latex_acronym_label_style) has been introduced. The additional scratch_pad element latex_acronym_config is stored in a compact way.
…and/environment provided by the LaTeX `relsize` package (cf. <http://www.ctan.org/tex-archive/macros/latex/contrib/relsize>). Only the `CODE` and `VERBATIM*` cases in `latex.c` have been altered. The respective output is now preceded by `\\ifx\\smaller\\undefined \\relax \\else <applied relsize macro> \\fi`. By embedding the `relsize` commands in a conditional TeX block, the availability of the `relsize` commands is reassured.
Owner
|
I'll need more information about what you're trying to accomplish and why before I consider pulling this into the main code base. Acronyms aren't a real high priority, and I don't particularly want to make them any more complex. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
The pull-request consists of two separate commits. Annotations are provided as part of the respective commits.
Cheers
Remo